/* =====================================================
   DeepFilterNet2 Audio Noise Remover — Stylesheet
   ===================================================== */

:root {
    /* Color System */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(18, 18, 30, 0.85);
    --bg-card-hover: rgba(24, 24, 40, 0.9);
    --bg-elevated: rgba(30, 30, 50, 0.6);

    --text-primary: #f0f0f5;
    --text-secondary: #9898b0;
    --text-muted: #5a5a78;

    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.3);

    --success: #00cec9;
    --success-glow: rgba(0, 206, 201, 0.25);

    --warning: #fdcb6e;
    --danger: #ff6b6b;
    --danger-glow: rgba(255, 107, 107, 0.2);

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px var(--accent-glow);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Animated Background Orbs ---- */
.bg-orbs {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px; height: 600px;
    background: var(--accent);
    top: -200px; left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px; height: 500px;
    background: var(--success);
    bottom: -150px; right: -100px;
    animation-delay: -7s;
    animation-duration: 25s;
}

.orb-3 {
    width: 400px; height: 400px;
    background: #fd79a8;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    animation-duration: 30s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -80px) scale(1.1); }
    50% { transform: translate(-30px, 60px) scale(0.95); }
    75% { transform: translate(80px, 30px) scale(1.05); }
}

/* ---- App Container ---- */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Header ---- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon svg {
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 4px 12px var(--accent-glow));
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.logo-text .accent {
    color: var(--accent-light);
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 2px;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    backdrop-filter: blur(12px);
}

.badge-dot {
    width: 7px; height: 7px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    border-color: var(--border-hover);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.card-icon {
    width: 42px; height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.card-icon svg {
    width: 20px; height: 20px;
    color: white;
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ---- Drop Zone ---- */
.drop-zone {
    border: 2px dashed rgba(108, 92, 231, 0.25);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--accent-glow), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.05);
}

.drop-zone:hover::before,
.drop-zone.drag-over::before {
    opacity: 1;
}

.drop-zone-content {
    position: relative;
    z-index: 1;
}

.upload-icon-wrapper {
    margin-bottom: 16px;
}

.upload-icon {
    width: 64px; height: 64px;
    color: var(--accent-light);
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.3s;
}

.drop-zone:hover .upload-icon {
    opacity: 1;
    transform: translateY(-4px);
}

.drop-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.drop-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1;
}

.btn svg {
    width: 18px; height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #7c6cf0);
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(108, 92, 231, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.btn-accent {
    background: linear-gradient(135deg, var(--success), #00b894);
    color: #0a0a0f;
    box-shadow: 0 4px 16px var(--success-glow);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 206, 201, 0.4);
}

.btn-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon svg {
    width: 16px; height: 16px;
}

.btn-icon:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

/* ---- File Info ---- */
.file-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.file-info-icon {
    width: 40px; height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.file-info-icon svg {
    width: 20px; height: 20px;
    color: white;
}

.file-info-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---- Process Button ---- */
#process-btn {
    margin-top: 20px;
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
    font-size: 1rem;
}

/* ---- Processing Card ---- */
.processing-card {
    text-align: center;
    padding: 48px 28px;
}

.processing-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.processing-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 28px;
}

/* Spinner */
.processing-spinner {
    position: relative;
    width: 80px; height: 80px;
    margin: 0 auto 28px;
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.spinner-ring-2 {
    inset: 8px;
    border-top-color: var(--accent-light);
    animation-direction: reverse;
    animation-duration: 0.9s;
}

.spinner-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-icon svg {
    width: 24px; height: 24px;
    color: var(--accent-light);
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-icon {
    0%, 100% { opacity: 0.5; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 28px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--success));
    border-radius: 100px;
    transition: width 0.5s ease;
    animation: progress-shimmer 2s linear infinite;
    background-size: 200% 100%;
}

@keyframes progress-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Processing Steps */
.processing-steps {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    transition: color 0.3s;
}

.step.active {
    color: var(--accent-light);
}

.step.done {
    color: var(--success);
}

.step-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: currentColor;
    transition: all 0.3s;
}

.step.active .step-dot {
    box-shadow: 0 0 8px var(--accent-glow);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.step.done .step-dot {
    box-shadow: 0 0 8px var(--success-glow);
}

/* ---- Stats Bar ---- */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    backdrop-filter: blur(12px);
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 6px;
}

.stat-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* ---- Comparison Grid (3-column) ---- */
.comparison-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.player-card {
    padding: 20px;
}

.enhanced-card {
    border-color: rgba(0, 206, 201, 0.15);
}

.enhanced-card:hover {
    border-color: rgba(0, 206, 201, 0.3);
}

.player-header {
    margin-bottom: 16px;
}

.player-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.player-badge svg {
    width: 14px; height: 14px;
}

.before-badge {
    background: var(--danger-glow);
    color: var(--danger);
}

.denoised-badge {
    background: rgba(253, 203, 110, 0.2);
    color: var(--warning);
}

.denoised-card {
    border-color: rgba(253, 203, 110, 0.15);
}

.denoised-card:hover {
    border-color: rgba(253, 203, 110, 0.3);
}

.after-badge {
    background: var(--success-glow);
    color: var(--success);
}

/* Waveform Container */
.waveform-container {
    height: 80px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    overflow: hidden;
    position: relative;
}

.waveform-container canvas {
    width: 100%;
    height: 100%;
}

/* Player Controls */
.player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.play-btn svg {
    width: 16px; height: 16px;
}

.play-btn:hover {
    transform: scale(1.08);
}

.time-display {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.time-sep {
    color: var(--text-muted);
    margin: 0 2px;
}

.seek-bar-wrapper {
    flex: 1;
    min-width: 0;
}

.seek-bar,
.volume-bar {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    outline: none;
    cursor: pointer;
}

.seek-bar::-webkit-slider-thumb,
.volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    background: var(--accent-light);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
    box-shadow: 0 0 6px var(--accent-glow);
}

.seek-bar::-webkit-slider-thumb:hover,
.volume-bar::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.volume-control svg {
    width: 16px; height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.volume-bar {
    width: 60px;
}

/* ---- Action Bar ---- */
.action-bar {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---- Footer ---- */
.app-footer {
    margin-top: auto;
    padding-top: 40px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.app-footer strong {
    color: var(--text-secondary);
}

/* ---- Utilities ---- */
.hidden {
    display: none !important;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .app-container {
        padding: 20px 16px;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .comparison-3col {
        grid-template-columns: 1fr;
    }

    .processing-steps {
        flex-wrap: wrap;
        gap: 16px;
    }

    .player-controls {
        flex-wrap: wrap;
    }

    .volume-control {
        display: none;
    }

    .action-bar {
        flex-direction: column;
    }

    .action-bar .btn {
        width: 100%;
        justify-content: center;
    }

    .pipeline-info {
        flex-direction: column;
        gap: 8px;
    }

    .pipeline-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 480px) {
    .logo-text h1 {
        font-size: 1.2rem;
    }

    .header-badge {
        display: none;
    }

    .drop-zone {
        padding: 32px 16px;
    }
}

/* ---- Animation for results appearing ---- */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-animate {
    animation: slide-up 0.5s ease-out forwards;
}

.stats-bar { animation: slide-up 0.4s ease-out forwards; }
.comparison-3col { animation: slide-up 0.5s ease-out 0.1s forwards; opacity: 0; }
.action-bar { animation: slide-up 0.5s ease-out 0.2s forwards; opacity: 0; }

/* ---- Pipeline Info ---- */
.pipeline-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.pipeline-step {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pipeline-step div:last-child {
    display: flex;
    flex-direction: column;
}

.pipeline-step strong {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pipeline-step span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.pipeline-num {
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.pipeline-num.accent-bg {
    background: linear-gradient(135deg, var(--success), #00b894);
}

.pipeline-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 300;
}

/* ---- OR Divider ---- */
.or-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
}

.or-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.or-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

/* ---- Live Recording ---- */
.record-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: border-color 0.3s;
}

.record-section.recording {
    border-color: var(--danger);
    box-shadow: 0 0 20px var(--danger-glow);
}

.record-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.record-btn {
    position: relative;
    width: 56px; height: 56px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.record-btn-inner {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--danger), #e55039);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 1;
    position: relative;
}

.record-btn-inner svg {
    width: 22px; height: 22px;
    color: white;
}

.record-btn:hover .record-btn-inner {
    transform: scale(1.08);
    box-shadow: 0 4px 16px var(--danger-glow);
}

.record-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--danger);
    opacity: 0;
    animation: none;
}

.record-section.recording .record-pulse {
    animation: record-pulse-anim 1.5s ease-out infinite;
}

@keyframes record-pulse-anim {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

.record-info {
    flex: 1;
}

.record-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.record-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--danger);
}

.rec-dot {
    width: 10px; height: 10px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse-dot 1s ease-in-out infinite;
}

.live-waveform {
    width: 100%;
    height: 60px;
    margin-top: 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

/* ========== Call Analysis Section ========== */
#analysis-section { margin-top: 32px; display: flex; flex-direction: column; gap: 20px; }

.analysis-loading-card {
    padding: 48px 32px;
    text-align: center;
}
.analysis-loading-card h2 { margin: 24px 0 8px; font-size: 1.5rem; }

.analysis-header {
    display: flex;
    gap: 28px;
    align-items: center;
    padding: 28px;
}
.score-gauge {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}
.score-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 10; }
.gauge-fg {
    fill: none;
    stroke: #6C5CE7;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease, stroke 0.4s;
}
.gauge-label {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge-value { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.gauge-suffix { font-size: 0.85rem; opacity: 0.5; margin-top: 2px; }

.analysis-summary { flex: 1; min-width: 0; }
.analysis-summary h2 { margin: 0 0 8px; font-size: 1.4rem; }
.analysis-summary p { margin: 0 0 12px; color: rgba(255,255,255,0.75); line-height: 1.5; }

.flag-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.flag-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.flag-miss { background: rgba(255,107,107,0.15); color: #ff8a8a; border: 1px solid rgba(255,107,107,0.3); }
.flag-warn { background: rgba(253,203,110,0.15); color: #fdcb6e; border: 1px solid rgba(253,203,110,0.3); }

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: rgba(255,255,255,0.95);
}

.funnel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.funnel-cell {
    padding: 16px;
    border-radius: var(--radius-md, 12px);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    display: flex; flex-direction: column; gap: 6px;
}
.funnel-label { font-size: 0.78rem; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.05em; }
.funnel-value { font-size: 1.4rem; font-weight: 700; }
.funnel-yes { border-color: rgba(0,206,201,0.4); background: rgba(0,206,201,0.08); }
.funnel-yes .funnel-value { color: #00cec9; }
.funnel-no  { border-color: rgba(255,107,107,0.3); background: rgba(255,107,107,0.05); }
.funnel-no  .funnel-value { color: #ff8a8a; }

.evidence-block { display: flex; flex-direction: column; gap: 8px; }
.evidence-quote {
    padding: 10px 14px;
    background: rgba(108,92,231,0.08);
    border-left: 3px solid #6C5CE7;
    border-radius: 6px;
    font-style: italic;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.8);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.metric-card {
    padding: 18px;
    border-radius: var(--radius-md, 12px);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}
.metric-header {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 10px;
}
.metric-name { font-weight: 600; font-size: 0.95rem; }
.metric-score { font-size: 1.1rem; font-weight: 700; color: #a29bfe; }
.metric-bar {
    width: 100%; height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}
.metric-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #6C5CE7, #a29bfe);
    border-radius: 3px;
    transition: width 0.7s ease;
}
.metric-notes { margin: 0; font-size: 0.82rem; color: rgba(255,255,255,0.6); line-height: 1.45; }
.metric-missed { border-color: rgba(255,107,107,0.35); }
.metric-missed .metric-score { color: #ff8a8a; }
.metric-missed .metric-bar-fill { background: linear-gradient(90deg, #ff6b6b, #ff8a8a); }

.moments-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.moment-card { padding: 20px; }
.moment-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
    font-weight: 600;
}
.moment-header svg { width: 18px; height: 18px; }
.moment-best .moment-header svg { color: #00cec9; }
.moment-low .moment-header svg { color: #ff8a8a; }
.moment-ts {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(108,92,231,0.15);
    color: #a29bfe;
    cursor: pointer;
    transition: background 0.2s;
}
.moment-ts:hover { background: rgba(108,92,231,0.3); }
.moment-card p { margin: 0; color: rgba(255,255,255,0.7); line-height: 1.5; }

.transcript-card { padding: 20px; }
.transcript-card summary {
    cursor: pointer;
    font-weight: 600;
    padding: 4px 0;
    list-style: none;
}
.transcript-card summary::-webkit-details-marker { display: none; }
.transcript-card summary::before { content: "▸ "; color: #a29bfe; }
.transcript-card[open] summary::before { content: "▾ "; }
.transcript-body {
    margin-top: 16px;
    max-height: 380px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px;
}
.utt-row {
    display: grid;
    grid-template-columns: 50px 90px 1fr;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.88rem;
    line-height: 1.5;
}
.utt-row:hover { background: rgba(255,255,255,0.03); }
.utt-ts {
    font-family: 'JetBrains Mono', monospace;
    color: #a29bfe;
    cursor: pointer;
    font-size: 0.78rem;
}
.utt-ts:hover { text-decoration: underline; }
.utt-spk { font-weight: 600; color: #fdcb6e; font-size: 0.8rem; }
.utt-text { color: rgba(255,255,255,0.85); }

@media (max-width: 768px) {
    .analysis-header { flex-direction: column; text-align: center; }
    .funnel-grid, .metric-grid, .moments-grid { grid-template-columns: 1fr; }
    .utt-row { grid-template-columns: 1fr; gap: 2px; }
}

/* ========== Timestamped Issues ========== */
.issues-card .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.issue-count {
    background: rgba(255,107,107,0.18);
    color: #ff8a8a;
    border: 1px solid rgba(255,107,107,0.4);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    min-width: 24px;
    text-align: center;
}

.issues-timeline {
    position: relative;
    height: 36px;
    margin: 8px 0 20px;
}
.timeline-track {
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    transform: translateY(-50%);
}
.timeline-markers {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.tl-marker {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    border: 2px solid #1a1a2e;
    transition: transform 0.15s, box-shadow 0.15s;
}
.tl-marker:hover {
    transform: translate(-50%, -50%) scale(1.4);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.1);
}
.tl-marker.sev-high   { background: #ff6b6b; }
.tl-marker.sev-medium { background: #fdcb6e; }
.tl-marker.sev-low    { background: #74b9ff; }

.issues-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.no-issues {
    padding: 24px;
    text-align: center;
    color: rgba(255,255,255,0.6);
    background: rgba(0,206,201,0.06);
    border: 1px solid rgba(0,206,201,0.2);
    border-radius: 10px;
}

.issue-item {
    padding: 14px 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    border-left: 4px solid #fdcb6e;
}
.issue-item.sev-high   { border-left-color: #ff6b6b; background: rgba(255,107,107,0.05); }
.issue-item.sev-medium { border-left-color: #fdcb6e; }
.issue-item.sev-low    { border-left-color: #74b9ff; }

.issue-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.issue-ts {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: #a29bfe;
    background: rgba(108,92,231,0.15);
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.issue-ts:hover { background: rgba(108,92,231,0.3); }
.issue-cat {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.7);
    padding: 3px 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
}
.issue-sev {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 6px;
    margin-left: auto;
}
.issue-sev.sev-high   { background: rgba(255,107,107,0.2); color: #ff8a8a; }
.issue-sev.sev-medium { background: rgba(253,203,110,0.2); color: #fdcb6e; }
.issue-sev.sev-low    { background: rgba(116,185,255,0.2); color: #74b9ff; }
.issue-desc {
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
    font-size: 0.9rem;
}
.issue-quote {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.25);
    border-left: 2px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    font-style: italic;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

/* ========== Markers on enhanced player ========== */
.waveform-container { position: relative; }
.waveform-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}
.wf-marker {
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: 3px;
    transform: translateX(-50%);
    border-radius: 2px;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 0 8px currentColor;
    opacity: 0.85;
    transition: opacity 0.15s, width 0.15s;
}
.wf-marker:hover { opacity: 1; width: 5px; }
.wf-marker.sev-high   { background: #ff6b6b; color: #ff6b6b; }
.wf-marker.sev-medium { background: #fdcb6e; color: #fdcb6e; }
.wf-marker.sev-low    { background: #74b9ff; color: #74b9ff; }

.seek-bar-wrapper { position: relative; }
.seek-markers {
    position: absolute;
    left: 0; right: 0;
    bottom: -10px;
    height: 10px;
    pointer-events: none;
}
.seek-marker {
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translateX(-50%);
    border: 2px solid #1a1a2e;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.15s;
}
.seek-marker:hover { transform: translateX(-50%) scale(1.4); }
.seek-marker.sev-high   { background: #ff6b6b; }
.seek-marker.sev-medium { background: #fdcb6e; }
.seek-marker.sev-low    { background: #74b9ff; }

.issues-hint {
    margin: 0 0 14px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    font-style: italic;
}

/* ========== Analysis Player (full-width dedicated) ========== */
.analysis-player-card {
    padding: 22px 24px;
    background: linear-gradient(135deg, rgba(108,92,231,0.08), rgba(0,206,201,0.06));
    border: 1px solid rgba(108,92,231,0.25);
    margin-bottom: 20px;
}
.ap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.ap-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
}
.ap-title svg { color: #a29bfe; }
.ap-legend {
    display: flex;
    gap: 14px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.7);
}
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
}
.lg-dot.sev-high { background: #ff6b6b; }
.lg-dot.sev-medium { background: #fdcb6e; }
.lg-dot.sev-low { background: #74b9ff; }

.ap-waveform {
    position: relative;
    height: 100px;
    background: rgba(0,0,0,0.25);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}
.ap-markers { position: absolute; inset: 0; pointer-events: none; }
.ap-markers .wf-marker {
    position: absolute;
    top: 6px; bottom: 6px;
    width: 3px;
    transform: translateX(-50%);
    border-radius: 2px;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 0 10px currentColor;
    transition: width 0.15s;
}
.ap-markers .wf-marker:hover { width: 6px; }
.ap-markers .wf-marker.sev-high   { background: #ff6b6b; color: #ff6b6b; }
.ap-markers .wf-marker.sev-medium { background: #fdcb6e; color: #fdcb6e; }
.ap-markers .wf-marker.sev-low    { background: #74b9ff; color: #74b9ff; }

.ap-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}
.ap-play-btn {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(108,92,231,0.4);
    transition: transform 0.15s;
    flex-shrink: 0;
}
.ap-play-btn:hover { transform: scale(1.05); }
.ap-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    min-width: 100px;
}
.ap-seek-wrap {
    position: relative;
    flex: 1;
}
.ap-seek {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.ap-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #a29bfe;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(108,92,231,0.5);
}
.ap-seek-markers {
    position: absolute;
    left: 0; right: 0;
    top: -8px;
    height: 22px;
    pointer-events: none;
}
.ap-seek-markers .seek-marker {
    position: absolute;
    top: 0;
    width: 14px; height: 14px;
    border-radius: 50%;
    transform: translateX(-50%);
    border: 2px solid #1a1a2e;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.15s;
}
.ap-seek-markers .seek-marker:hover { transform: translateX(-50%) scale(1.4); }
.ap-seek-markers .seek-marker.sev-high { background: #ff6b6b; }
.ap-seek-markers .seek-marker.sev-medium { background: #fdcb6e; }
.ap-seek-markers .seek-marker.sev-low { background: #74b9ff; }

/* ========== Analysis Player: Zoom + Ranges ========== */
.ap-zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 4px;
}
.ap-zoom-btn {
    width: 28px; height: 28px;
    border: none;
    background: rgba(255,255,255,0.04);
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.15s;
}
.ap-zoom-btn:hover { background: rgba(108,92,231,0.4); }
.ap-zoom-btn:active { background: rgba(108,92,231,0.7); }
.ap-zoom-level {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.8);
    min-width: 36px;
    text-align: center;
}

.ap-waveform-scroll {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    height: 100px;
    background: rgba(0,0,0,0.25);
    border-radius: 10px;
    margin-bottom: 4px;
    border: 1px solid rgba(255,255,255,0.05);
    scrollbar-width: thin;
    scrollbar-color: rgba(108,92,231,0.6) rgba(0,0,0,0.2);
}
.ap-waveform-scroll::-webkit-scrollbar { height: 8px; }
.ap-waveform-scroll::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.ap-waveform-scroll::-webkit-scrollbar-thumb {
    background: rgba(108,92,231,0.6);
    border-radius: 4px;
}

/* Inside the scroll container, .ap-waveform becomes inner wide content */
.ap-waveform-scroll .ap-waveform {
    position: relative;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
    overflow: visible;
    /* width set dynamically via JS as zoom changes */
}

.ap-ranges { position: absolute; inset: 0; pointer-events: none; }
.range-band {
    position: absolute;
    top: 0; bottom: 0;
    cursor: pointer;
    pointer-events: auto;
    border-left: 2px solid;
    border-right: 2px solid;
    transition: filter 0.15s;
}
.range-band:hover { filter: brightness(1.4); }
.range-band.sev-high   { background: rgba(255,107,107,0.18); border-color: #ff6b6b; }
.range-band.sev-medium { background: rgba(253,203,110,0.18); border-color: #fdcb6e; }
.range-band.sev-low    { background: rgba(116,185,255,0.18); border-color: #74b9ff; }
.range-label {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    background: rgba(0,0,0,0.7);
    border-radius: 3px;
    white-space: nowrap;
    color: #fff;
    pointer-events: none;
}

.ap-playhead {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: #fff;
    box-shadow: 0 0 8px rgba(255,255,255,0.6);
    pointer-events: none;
    left: 0;
    transition: left 0.05s linear;
    z-index: 10;
}

.ap-time-ruler {
    position: relative;
    height: 18px;
    margin-bottom: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.45);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.ap-time-ruler::-webkit-scrollbar { display: none; }
.ap-time-ruler-inner { position: relative; height: 100%; }
.ruler-tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    padding-top: 3px;
}
.ruler-tick::before {
    content: "";
    position: absolute;
    top: 0; left: 50%;
    width: 1px; height: 4px;
    background: rgba(255,255,255,0.3);
}

/* ========== Skip Denoise Toggle ========== */
.skip-denoise-toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    margin-top: 14px;
    background: rgba(0,206,201,0.05);
    border: 1px solid rgba(0,206,201,0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.skip-denoise-toggle:hover { background: rgba(0,206,201,0.1); }
.skip-denoise-toggle input[type="checkbox"] { display: none; }
.toggle-slider {
    width: 40px; height: 22px;
    background: rgba(255,255,255,0.15);
    border-radius: 11px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s;
}
.toggle-slider::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.skip-denoise-toggle input:checked + .toggle-slider {
    background: #00cec9;
}
.skip-denoise-toggle input:checked + .toggle-slider::after {
    transform: translateX(18px);
}
.toggle-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.toggle-text strong { font-size: 0.92rem; color: #fff; }
.toggle-text small { font-size: 0.78rem; color: rgba(255,255,255,0.55); }

/* ========== Sessions on Waveform ========== */
.ap-sessions { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.session-band {
    position: absolute;
    top: 0; bottom: 0;
    border-left: 2px dashed rgba(255,255,255,0.25);
    pointer-events: auto;
    cursor: pointer;
    transition: filter 0.15s;
}
.session-band:hover { filter: brightness(1.3); }
.session-band:first-child { border-left: none; }
.session-band .session-label {
    position: absolute;
    top: 2px;
    left: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sessions list panel */
.sessions-card .sessions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.session-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border-left: 4px solid #6c5ce7;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.session-row:hover { background: rgba(108,92,231,0.1); }
.session-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(108,92,231,0.25);
    color: #a29bfe;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.session-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.8);
    min-width: 130px;
}
.session-meta {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.55);
    flex: 1;
}

.src-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}
.src-badge.src-ai { background: rgba(108,92,231,0.25); color: #a29bfe; border: 1px solid rgba(108,92,231,0.5); }
.src-badge.src-algo { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.55); }

.session-row { align-items: flex-start; }
.session-body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.session-head-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.session-row .session-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.8);
    min-width: auto;
}
.session-topic {
    font-size: 0.92rem;
    color: #fff;
    font-weight: 600;
    line-height: 1.35;
}
.session-evidence { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.ev-chip {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 2px 8px;
    border-radius: 4px;
    font-style: italic;
}
.session-embed {
    font-size: 0.72rem;
    color: rgba(253,203,110,0.75);
    margin-top: 2px;
}
.src-badge.conf-high   { background: rgba(85,239,196,0.22); color: #55efc4; border: 1px solid rgba(85,239,196,0.4); }
.src-badge.conf-medium { background: rgba(253,203,110,0.22); color: #fdcb6e; border: 1px solid rgba(253,203,110,0.4); }
.src-badge.conf-low    { background: rgba(255,107,107,0.22); color: #ff8a8a; border: 1px solid rgba(255,107,107,0.4); }

/* Session badges in issues & transcript */
.issue-session {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(108,92,231,0.22);
    color: #a29bfe;
    border: 1px solid rgba(108,92,231,0.5);
    cursor: help;
}
.utt-row.has-session {
    padding-left: 10px;
    background: rgba(255,255,255,0.02);
}
.utt-sess {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(108,92,231,0.15);
    color: #a29bfe;
    margin-right: 4px;
}

/* ========== Live Caption ========== */
.ap-live-caption {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(90deg, rgba(108,92,231,0.08), rgba(0,206,201,0.06));
    border: 1px solid rgba(108,92,231,0.2);
    border-radius: 8px;
    margin-top: 12px;
    min-height: 36px;
}
.ap-caption-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255,107,107,0.2);
    color: #ff8a8a;
    border: 1px solid rgba(255,107,107,0.4);
    flex-shrink: 0;
    position: relative;
}
.ap-caption-label::before {
    content: "";
    position: absolute;
    top: 50%; left: -5px;
    transform: translateY(-50%);
    width: 6px; height: 6px;
    background: #ff6b6b;
    border-radius: 50%;
    box-shadow: 0 0 6px #ff6b6b;
    animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.4; transform: translateY(-50%) scale(0.7); }
}
.ap-caption-text {
    font-size: 0.95rem;
    line-height: 1.4;
    color: rgba(255,255,255,0.55);
    font-style: italic;
    flex: 1;
    min-width: 0;
    transition: color 0.2s;
}
.ap-caption-text.live-active {
    color: #fff;
    font-style: normal;
    font-weight: 500;
}

/* ========== Transcript live-row highlight ========== */
.utt-row.live-active {
    background: linear-gradient(90deg, rgba(108,92,231,0.18), rgba(108,92,231,0.04)) !important;
    box-shadow: inset 3px 0 0 #a29bfe;
    transition: background 0.2s;
}
.utt-row.live-active .utt-text {
    color: #fff;
    font-weight: 500;
}

/* Session-start vertical marker (no filled band) */
.session-start-marker {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    transform: translateX(-1px);
    border-left: 2px solid;
    pointer-events: auto;
    cursor: pointer;
    z-index: 2;
}
.session-start-marker .session-label {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #000;
    padding: 1px 6px;
    border-radius: 3px;
    text-shadow: none;
    pointer-events: none;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}
/* Disable the old filled session-band */
.session-band { display: none; }

/* Staff internal chat blocks — faint gray bands behind session markers */
.staff-block-band {
    position: absolute;
    top: 0; bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.04),
        rgba(255,255,255,0.04) 6px,
        rgba(255,255,255,0.08) 6px,
        rgba(255,255,255,0.08) 12px
    );
    border-top: 1px dashed rgba(255,255,255,0.15);
    border-bottom: 1px dashed rgba(255,255,255,0.15);
    pointer-events: auto;
    cursor: help;
    z-index: 1;
}
.staff-block-band:hover {
    background: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.08),
        rgba(255,255,255,0.08) 6px,
        rgba(255,255,255,0.14) 6px,
        rgba(255,255,255,0.14) 12px
    );
}

/* Session transcript dropdown */
.session-toggle {
    margin-left: auto;
    background: rgba(108,92,231,0.15);
    color: #a29bfe;
    border: 1px solid rgba(108,92,231,0.35);
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}
.session-toggle:hover {
    background: rgba(108,92,231,0.35);
    color: #fff;
}
.session-transcript {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(108,92,231,0.4) transparent;
}
.session-transcript::-webkit-scrollbar { width: 6px; }
.session-transcript::-webkit-scrollbar-thumb {
    background: rgba(108,92,231,0.4);
    border-radius: 3px;
}
.sess-utt {
    display: grid;
    grid-template-columns: 48px 60px 1fr;
    gap: 10px;
    padding: 4px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.sess-utt:last-child { border-bottom: none; }
.sess-utt-ts {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #a29bfe;
    cursor: pointer;
    text-decoration: underline dotted rgba(162,155,254,0.4);
}
.sess-utt-ts:hover { color: #fff; }
.sess-utt-spk {
    font-weight: 600;
    color: #fdcb6e;
    font-size: 0.78rem;
}
.sess-utt-text { color: rgba(255,255,255,0.85); line-height: 1.4; }
.sess-empty {
    padding: 12px;
    color: rgba(255,255,255,0.5);
    text-align: center;
    font-style: italic;
}
