/* =====================================================
   the store brand Cashier Analytics — Professional Dashboard
   Clean, full-width enterprise design
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    --bg-body: #f5f6fa;
    --bg-card: #ffffff;
    --bg-hover: #f8f9fb;
    --bg-muted: #f0f1f5;
    --bg-input: #ffffff;

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: rgba(79, 70, 229, 0.08);
    --accent-border: rgba(79, 70, 229, 0.2);

    --success: #059669;
    --success-light: rgba(5, 150, 105, 0.08);
    --warning: #d97706;
    --warning-light: rgba(217, 119, 6, 0.08);
    --danger: #dc2626;
    --danger-light: rgba(220, 38, 38, 0.06);

    --border: #e5e7eb;
    --border-hover: #d1d5db;

    --radius: 8px;
    --radius-lg: 12px;

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

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* ---- Hide legacy elements ---- */
.bg-orbs, .orb, .orb-1, .orb-2, .orb-3 { display: none; }

/* ============================================
   TOP BAR — Full-width dark header + nav
   ============================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 32px;
    flex-shrink: 0;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    color: #fff;
    letter-spacing: -0.02em;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.01em;
}

.brand-sub {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

/* Nav items */
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.nav-item svg {
    opacity: 0.6;
    flex-shrink: 0;
}

.nav-item:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.06);
}

.nav-item:hover svg { opacity: 0.9; }

.nav-item.active {
    color: #ffffff;
    background: rgba(79, 70, 229, 0.3);
}

.nav-item.active svg { opacity: 1; }

/* Right side */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    flex-shrink: 0;
}

.topbar-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
}

.topbar-logout {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: transparent;
    color: #94a3b8;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.topbar-logout:hover {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.08);
}

/* Legacy tab-nav / tab-btn (JS still uses these selectors) */
.tab-nav { display: none; }
.tab-btn { display: none; }

/* ============================================
   LAYOUT
   ============================================ */
.app-layout {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 24px 40px;
    min-height: calc(100vh - 56px);
}

.main-content {
    width: 100%;
}

/* ============================================
   PAGE SECTIONS
   ============================================ */
.page-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.filter-bar.compact {
    padding: 10px 14px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-input {
    padding: 7px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    min-width: 140px;
    transition: border-color 0.15s, box-shadow 0.15s;
    height: 34px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* Status messages */
.status-msg {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 12px;
}

.status-msg.loading {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}

.status-msg.error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(220,38,38,0.15);
}

.status-msg.success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(5,150,105,0.15);
}

.result-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

/* ============================================
   DATA TABLE — Clean corporate style
   ============================================ */
.table-container {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    padding: 10px 14px;
    text-align: left;
    background: #f9fafb;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: var(--text-primary);
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background 0.1s;
}

.data-table tbody tr:hover td {
    background: #f8f9fb;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .fname {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* History date grid */
.history-dates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.date-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.date-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
    transform: translateY(-2px);
}
.date-card-date {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.date-card-day {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.date-card-score {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px; color: #fff;
    align-self: flex-end; margin-top: -40px;
}
.date-card-score.score-high { background: var(--success); }
.date-card-score.score-mid { background: var(--warning, #f59e0b); }
.date-card-score.score-low { background: var(--danger); }
.date-card-stats {
    display: flex; gap: 12px;
    font-size: 12px; color: var(--text-muted);
}
.date-card-stats span { display: flex; align-items: center; gap: 3px; }
.date-card-cashiers {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px;
}
.date-card-cashier-tag {
    font-size: 11px; font-weight: 500;
    padding: 2px 8px; border-radius: 999px;
    background: var(--primary-light, rgba(79,70,229,0.08));
    color: var(--primary);
    text-transform: capitalize;
}
.date-card-cashiers { flex-direction: column; gap: 8px; }
/* Each venue = a small "store card" inside the date card, cashiers within it */
.venue-group {
    display: flex; flex-direction: column; gap: 6px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--bg-subtle, rgba(0,0,0,.02));
}
.venue-group > div:last-child { display: flex; flex-wrap: wrap; gap: 4px; }
.venue-label {
    font-size: 11px; font-weight: 700; letter-spacing: .2px;
    color: var(--text, #374151);
    display: flex; align-items: center; gap: 6px;
}
.venue-label::before { content: "🏬"; font-size: 12px; }
.venue-label .venue-count {
    font-size: 9px; font-weight: 700; color: var(--text-muted, #6b7280);
    background: rgba(0,0,0,.06); border-radius: 999px; padding: 1px 7px; margin-left: auto;
}

/* Day detail view */
.day-detail-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px;
}
.score-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    font-weight: 700; font-size: 13px; color: #fff;
}
.score-badge.score-high { background: var(--success); }
.score-badge.score-mid { background: var(--warning, #f59e0b); }
.score-badge.score-low { background: var(--danger); }
.cashier-name-cell { text-transform: capitalize; font-weight: 600; }

/* History table */
.history-table .td-filename {
    max-width: 400px;
    white-space: normal;
    word-break: break-all;
    line-height: 1.4;
}

.history-table .th-filename { min-width: 250px; }

/* Running analysis row */
.history-running-row {
    background: rgba(79, 70, 229, 0.03);
    border-left: 3px solid var(--accent);
}

.running-indicator {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 6px;
}

.running-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(79,70,229,0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
    white-space: nowrap;
    height: 34px;
}

.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 1px 2px rgba(79,70,229,0.3);
}

.btn-primary:hover { background: var(--accent-hover); }

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

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm { padding: 5px 10px; font-size: 12px; height: 30px; }

.btn-icon {
    width: 32px; height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

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

.btn-icon:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

/* Pull table action buttons */
.pull-actions {
    display: flex;
    gap: 4px;
}

.pull-actions .btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 5px;
    height: 28px;
}

.btn-play { background: var(--success); color: #fff; border: none; cursor: pointer; }
.btn-direct { background: var(--danger); color: #fff; border: none; cursor: pointer; }
.btn-hybrid { background: var(--accent); color: #fff; border: none; cursor: pointer; }
.btn-transcribe { background: #7c3aed; color: #fff; border: none; cursor: pointer; }

.btn-play:hover { background: #047857; }
.btn-play.playing { background: var(--danger); }
.btn-play.playing:hover { background: #b91c1c; }
.btn-direct:hover { background: #b91c1c; }
.btn-hybrid:hover { background: var(--accent-hover); }
.btn-transcribe:hover { background: #6d28d9; }

.pull-actions .btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* User badge in pull table */
.pull-user-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.pull-user-badge[data-user="sahrul"] { background: rgba(5,150,105,0.1); color: var(--success); }
.pull-user-badge[data-user="nunung"] { background: var(--accent-light); color: var(--accent); }
.pull-user-badge[data-user="yogi"]   { background: var(--warning-light); color: var(--warning); }
.pull-user-badge[data-user="nursin"] { background: rgba(5,150,105,0.1); color: var(--success); }

.pull-dur { font-family: var(--font-mono); font-weight: 500; }
.pull-dur.long { color: var(--danger); }

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

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

.card-icon {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: 6px;
    flex-shrink: 0;
}

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

.card-header h2 { font-size: 16px; font-weight: 700; }

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

/* ============================================
   SPINNER
   ============================================ */
@keyframes spin { to { transform: rotate(360deg); } }

.processing-card {
    text-align: center;
    padding: 40px 24px;
}

.processing-content h2 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.processing-text { color: var(--text-secondary); font-size: 13px; margin-bottom: 20px; }

.processing-spinner {
    position: relative;
    width: 48px; height: 48px;
    margin: 0 auto 20px;
}

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

.spinner-ring-2 {
    inset: 6px;
    border-top-color: #818cf8;
    animation-direction: reverse;
    animation-duration: 0.8s;
}

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

.spinner-icon svg { width: 18px; height: 18px; color: var(--accent); }

/* Progress Bar */
.progress-bar {
    height: 3px;
    background: #e5e7eb;
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 100px;
    transition: width 0.5s ease;
}

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

.step {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

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

.step-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

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

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

/* ============================================
   AUDIO PLAYERS & COMPARISON
   ============================================ */
.comparison-3col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.player-card { padding: 14px; }

.enhanced-card { border-color: rgba(5,150,105,0.3); }
.denoised-card { border-color: rgba(217,119,6,0.3); }

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

.player-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

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

.before-badge { background: var(--danger-light); color: var(--danger); }
.denoised-badge { background: var(--warning-light); color: var(--warning); }
.after-badge { background: var(--success-light); color: var(--success); }

.waveform-container {
    height: 72px;
    background: #0f172a;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
}

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

.player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.play-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.play-btn svg { width: 12px; height: 12px; }
.play-btn:hover { background: var(--accent-hover); }

.time-display {
    font-family: var(--font-mono);
    font-size: 12px;
    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; position: relative; }

.seek-bar,
.volume-bar {
    -webkit-appearance: none;
    appearance: none;
    width: 100%; height: 4px;
    background: #e5e7eb;
    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);
    border-radius: 50%;
    cursor: pointer;
}

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

.volume-control svg { width: 16px; height: 16px; color: var(--text-muted); }
.volume-bar { width: 60px; }

/* ============================================
   ACTION BAR
   ============================================ */
.action-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* ============================================
   DROP ZONE
   ============================================ */
.drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: var(--radius);
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
}

.drop-zone::before { display: none; }

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
}

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

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

.upload-icon {
    width: 40px; height: 40px;
    color: var(--accent);
    opacity: 0.4;
}

.drop-zone:hover .upload-icon { opacity: 0.7; }

.drop-text { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.drop-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* ============================================
   FILE INFO
   ============================================ */
.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-top: 10px;
}

.file-info-icon {
    width: 34px; height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: 6px;
}

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

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

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

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

/* Process button */
#process-btn {
    margin-top: 12px;
    width: 100%;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    height: auto;
}

/* ============================================
   OR DIVIDER
   ============================================ */
.or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
}

.or-line { flex: 1; height: 1px; background: var(--border); }
.or-text { font-size: 11px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.1em; }

/* ============================================
   RECORDING
   ============================================ */
.record-section {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    transition: border-color 0.15s;
}

.record-section.recording { border-color: var(--danger); }

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

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

.record-btn-inner {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 1;
    position: relative;
}

.record-btn-inner svg { width: 16px; height: 16px; color: white; }
.record-btn:hover .record-btn-inner { background: #b91c1c; }

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

.record-section.recording .record-pulse { opacity: 0.3; }

.record-info { flex: 1; }
.record-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

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

.rec-dot { width: 8px; height: 8px; background: var(--danger); border-radius: 50%; }

.live-waveform {
    width: 100%; height: 50px;
    margin-top: 10px;
    border-radius: 6px;
    background: #0f172a;
}

/* ============================================
   SKIP DENOISE TOGGLE
   ============================================ */
.skip-denoise-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-top: 10px;
    background: var(--success-light);
    border: 1px solid rgba(5,150,105,0.15);
    border-radius: 6px;
    cursor: pointer;
}

.skip-denoise-toggle input[type="checkbox"] { display: none; }

.toggle-slider {
    width: 36px; height: 20px;
    background: #d1d5db;
    border-radius: 10px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s;
}

.toggle-slider::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.skip-denoise-toggle input:checked + .toggle-slider { background: var(--success); }
.skip-denoise-toggle input:checked + .toggle-slider::after { transform: translateX(16px); }

.toggle-text { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.toggle-text strong { font-size: 13px; color: var(--text-primary); }
.toggle-text small { font-size: 12px; color: var(--text-muted); }

/* ============================================
   PIPELINE INFO
   ============================================ */
.pipeline-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 14px;
    padding: 10px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
}

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

.pipeline-step div:last-child { display: flex; flex-direction: column; }
.pipeline-step strong { font-size: 13px; font-weight: 600; }
.pipeline-step span { font-size: 12px; color: var(--text-muted); }

.pipeline-num {
    width: 24px; height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.pipeline-num.accent-bg { background: var(--success); }
.pipeline-arrow { color: var(--text-muted); }

/* ============================================
   ANALYSIS — Score Gauge, Metrics, etc.
   ============================================ */
#analysis-section {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.analysis-loading-card { padding: 36px 24px; text-align: center; }
.analysis-loading-card h2 { margin: 16px 0 8px; font-size: 16px; }

.analysis-header {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 16px;
}

.score-gauge {
    position: relative;
    width: 110px; height: 110px;
    flex-shrink: 0;
}

.score-gauge svg {
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg { fill: none; stroke: #e5e7eb; stroke-width: 10; }

.gauge-fg {
    fill: none;
    stroke: var(--accent);
    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: 22px;
    font-weight: 800;
    line-height: 1;
}

.gauge-suffix { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.analysis-summary { flex: 1; min-width: 0; }
.analysis-summary h2 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.analysis-summary p { margin: 0 0 8px; color: var(--text-secondary); line-height: 1.5; font-size: 13px; }

/* Analysis meta info (cashier, date, filename) */
.analysis-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 13px;
}

.meta-cashier {
    font-weight: 700;
    font-size: 15px;
    color: var(--accent);
    text-transform: capitalize;
}

.meta-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-muted);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.meta-file {
    font-size: 11px;
    color: var(--text-muted);
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta-sep {
    color: var(--text-muted);
    font-size: 10px;
}

/* Analysis snippets grid (inside analysis view) */
.analysis-snippets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (max-width: 900px) {
    .analysis-snippets-grid { grid-template-columns: 1fr; }
}

/* Snippet session groups */
.snippet-session-group {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.snippet-session-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    user-select: none;
}
.snippet-session-toggle {
    font-size: 11px;
    color: var(--text-muted);
    width: 14px;
    text-align: center;
}
.snippet-session-body {
    padding: 10px;
}

/* Snippet category filter chips */
.snippet-filter-chip {
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    text-transform: capitalize;
}
.snippet-filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.snippet-filter-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Deductions */
.deductions-strip { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }

.deduction-badge {
    font-size: 12px; font-weight: 600;
    padding: 3px 8px; border-radius: 999px;
    background: var(--danger-light); color: var(--danger);
    border: 1px solid rgba(220,38,38,0.2);
}

.deduction-none {
    background: var(--success-light); color: var(--success);
    border: 1px solid rgba(5,150,105,0.2);
}

/* Flags */
.flag-strip { display: flex; flex-wrap: wrap; gap: 5px; }

.flag-badge {
    font-size: 12px; font-weight: 600;
    padding: 3px 8px; border-radius: 999px;
}

.flag-miss { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(220,38,38,0.2); }
.flag-warn { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(217,119,6,0.2); }

.section-title {
    font-size: 15px; font-weight: 700;
    margin: 0 0 12px;
}

/* Funnel Grid */
.funnel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.funnel-cell {
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--bg-muted);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.funnel-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.funnel-value { font-size: 16px; font-weight: 700; }

.funnel-yes { border-color: rgba(5,150,105,0.3); background: var(--success-light); }
.funnel-yes .funnel-value { color: var(--success); }

.funnel-no { border-color: rgba(220,38,38,0.2); background: var(--danger-light); }
.funnel-no .funnel-value { color: var(--danger); }

/* Evidence */
.evidence-block { display: flex; flex-direction: column; gap: 5px; }

.evidence-quote {
    padding: 8px 10px;
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Metric Grid */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.metric-card {
    padding: 14px;
    border-radius: var(--radius);
    background: var(--bg-muted);
    border: 1px solid var(--border);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.metric-name { font-weight: 600; font-size: 13px; }

.metric-score {
    font-size: 14px; font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
}

.metric-bar {
    width: 100%; height: 5px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.metric-bar-fill {
    height: 100%; width: 0;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.7s ease;
}

.metric-notes { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.metric-missed { border-color: rgba(220,38,38,0.2); }
.metric-missed .metric-score { color: var(--danger); }
.metric-missed .metric-bar-fill { background: var(--danger); }

/* Moments */
.moments-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.moment-card { padding: 14px; }

.moment-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
}

.moment-header svg { width: 16px; height: 16px; }
.moment-best .moment-header svg { color: var(--success); }
.moment-low .moment-header svg { color: var(--danger); }

.moment-ts {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent-light);
    color: var(--accent);
    cursor: pointer;
}

.moment-ts:hover { background: rgba(79,70,229,0.15); }

.moment-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.4;
    font-size: 13px;
}

/* Transcript */
.transcript-card { padding: 14px; }

.transcript-card summary {
    cursor: pointer;
    font-weight: 600;
    padding: 4px 0;
    list-style: none;
    font-size: 13px;
}

.transcript-card summary::-webkit-details-marker { display: none; }
.transcript-card summary::before { content: "\25B8 "; color: var(--accent); }
.transcript-card[open] summary::before { content: "\25BE "; }

.transcript-body {
    margin-top: 10px;
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.utt-row {
    display: grid;
    grid-template-columns: 48px 80px 1fr;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 3px;
    font-size: 12px;
    line-height: 1.4;
}

.utt-row:hover { background: #f3f4f6; }

.utt-ts {
    font-family: var(--font-mono);
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
}

.utt-ts:hover { text-decoration: underline; }
.utt-spk { font-weight: 600; color: var(--warning); font-size: 12px; }
.utt-text { color: var(--text-secondary); }

/* ============================================
   ISSUES
   ============================================ */
.issues-card .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.issue-count {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(220,38,38,0.2);
    font-size: 12px; font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 24px;
    text-align: center;
}

.issues-timeline {
    position: relative; height: 32px;
    margin: 6px 0 14px;
}

.timeline-track {
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 3px;
    background: #e5e7eb;
    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: 10px; height: 10px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: transform 0.15s;
}

.tl-marker:hover { transform: translate(-50%, -50%) scale(1.4); }

.tl-marker.sev-high   { background: var(--danger); }
.tl-marker.sev-medium { background: var(--warning); }
.tl-marker.sev-low    { background: var(--accent); }

.issues-list { display: flex; flex-direction: column; gap: 5px; }

.no-issues {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    background: var(--success-light);
    border: 1px solid rgba(5,150,105,0.15);
    border-radius: var(--radius);
}

.issue-item {
    padding: 10px 14px;
    background: var(--bg-muted);
    border-radius: var(--radius);
    border-left: 4px solid var(--warning);
}

.issue-item.sev-high { border-left-color: var(--danger); background: var(--danger-light); }
.issue-item.sev-medium { border-left-color: var(--warning); }
.issue-item.sev-low { border-left-color: var(--accent); }

.issue-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.issue-ts {
    font-family: var(--font-mono);
    font-size: 12px; font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 2px 8px;
    border-radius: 5px;
    cursor: pointer;
}

.issue-ts:hover { background: rgba(79,70,229,0.12); }

.issue-cat {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 2px 6px;
    background: #f3f4f6;
    border-radius: 5px;
}

.issue-sev {
    font-size: 12px; font-weight: 700;
    padding: 2px 6px;
    border-radius: 5px;
    margin-left: auto;
}

.issue-sev.sev-high   { background: var(--danger-light); color: var(--danger); }
.issue-sev.sev-medium { background: var(--warning-light); color: var(--warning); }
.issue-sev.sev-low    { background: var(--accent-light); color: var(--accent); }

.issue-desc { color: var(--text-secondary); line-height: 1.4; font-size: 13px; }

.issue-quote {
    margin-top: 5px;
    padding: 6px 10px;
    background: #f9fafb;
    border-left: 2px solid var(--border);
    border-radius: 3px;
    font-style: italic;
    font-size: 12px;
    color: var(--text-muted);
}

.issues-hint {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   WAVEFORM MARKERS
   ============================================ */
.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;
    opacity: 0.8;
    transition: opacity 0.15s, width 0.15s;
}

.wf-marker:hover { opacity: 1; width: 5px; }
.wf-marker.sev-high   { background: var(--danger); }
.wf-marker.sev-medium { background: var(--warning); }
.wf-marker.sev-low    { background: var(--accent); }

.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 #fff;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.15s;
}

.seek-marker:hover { transform: translateX(-50%) scale(1.4); }
.seek-marker.sev-high   { background: var(--danger); }
.seek-marker.sev-medium { background: var(--warning); }
.seek-marker.sev-low    { background: var(--accent); }

/* ============================================
   ANALYSIS PLAYER
   ============================================ */
.analysis-player-card {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.ap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.ap-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 13px;
}

.ap-title svg { color: var(--accent); }

.ap-legend {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.lg-item { display: inline-flex; align-items: center; gap: 4px; }

.lg-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
}

.lg-dot.sev-high { background: var(--danger); }
.lg-dot.sev-medium { background: var(--warning); }
.lg-dot.sev-low { background: var(--accent); }

.ap-waveform {
    position: relative;
    height: 90px;
    background: #0f172a;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    border: 1px solid #1e293b;
}

.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;
}

.ap-markers .wf-marker:hover { width: 5px; }
.ap-markers .wf-marker.sev-high   { background: var(--danger); }
.ap-markers .wf-marker.sev-medium { background: var(--warning); }
.ap-markers .wf-marker.sev-low    { background: var(--accent); }

.ap-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ap-play-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.ap-play-btn:hover { background: var(--accent-hover); }

.ap-skip-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ap-skip-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.ap-time {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 90px;
}

.ap-seek-wrap { position: relative; flex: 1; }

.ap-seek {
    width: 100%; height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.ap-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.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: 10px; height: 10px;
    border-radius: 50%;
    transform: translateX(-50%);
    border: 2px solid #fff;
    cursor: pointer;
    pointer-events: auto;
}

.ap-seek-markers .seek-marker:hover { transform: translateX(-50%) scale(1.3); }
.ap-seek-markers .seek-marker.sev-high { background: var(--danger); }
.ap-seek-markers .seek-marker.sev-medium { background: var(--warning); }
.ap-seek-markers .seek-marker.sev-low { background: var(--accent); }

/* Zoom controls */
.ap-zoom-controls {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px;
}

.ap-zoom-btn {
    width: 24px; height: 24px;
    border: none;
    background: #fff;
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.ap-zoom-btn:hover { background: var(--accent-light); color: var(--accent); }

.ap-zoom-level {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 30px;
    text-align: center;
}

.ap-waveform-scroll {
    position: relative;
    overflow-x: auto; overflow-y: hidden;
    height: 90px;
    background: #0f172a;
    border-radius: 6px;
    margin-bottom: 4px;
    border: 1px solid #1e293b;
    scrollbar-width: thin;
    scrollbar-color: rgba(79,70,229,0.4) rgba(15,23,42,0.6);
}

.ap-waveform-scroll::-webkit-scrollbar { height: 5px; }
.ap-waveform-scroll::-webkit-scrollbar-track { background: rgba(15,23,42,0.6); }
.ap-waveform-scroll::-webkit-scrollbar-thumb { background: rgba(79,70,229,0.4); border-radius: 3px; }

.ap-waveform-scroll .ap-waveform {
    position: relative; height: 100%;
    background: transparent;
    border: none; border-radius: 0;
    margin: 0; overflow: visible;
}

.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.3); }
.range-band.sev-high   { background: rgba(220,38,38,0.15); border-color: var(--danger); }
.range-band.sev-medium { background: rgba(217,119,6,0.15); border-color: var(--warning); }
.range-band.sev-low    { background: rgba(79,70,229,0.15); border-color: var(--accent); }

.range-label {
    position: absolute; top: 3px; left: 3px;
    font-size: 11px; font-weight: 700;
    padding: 1px 5px;
    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;
    pointer-events: none;
    left: 0;
    transition: left 0.05s linear;
    z-index: 10;
}

.ap-time-ruler {
    position: relative; height: 16px;
    margin-bottom: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    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: 3px;
    background: #d1d5db;
}

/* Live caption */
.ap-live-caption {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-top: 6px;
    min-height: 32px;
}

.ap-caption-label {
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 800;
    letter-spacing: 0.1em;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(220,38,38,0.2);
    flex-shrink: 0;
    position: relative;
}

.ap-caption-label::before {
    content: "";
    position: absolute;
    top: 50%; left: -4px;
    transform: translateY(-50%);
    width: 5px; height: 5px;
    background: var(--danger);
    border-radius: 50%;
}

.ap-caption-text {
    font-size: 13px;
    line-height: 1.3;
    color: var(--text-muted);
    font-style: italic;
    flex: 1; min-width: 0;
}

.ap-caption-text.live-active {
    color: var(--text-primary);
    font-style: normal;
    font-weight: 500;
}

/* Transcript highlight */
.utt-row.live-active {
    background: var(--accent-light) !important;
    box-shadow: inset 3px 0 0 var(--accent);
}

.utt-row.live-active .utt-text {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================
   SESSIONS
   ============================================ */
.ap-sessions { position: absolute; inset: 0; pointer-events: none; z-index: 1; }

.session-band { display: none; }

.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: 3px; left: 3px;
    font-size: 11px; font-weight: 800;
    color: #000;
    padding: 1px 5px;
    border-radius: 3px;
    pointer-events: none;
    white-space: nowrap;
}

.staff-block-band {
    position: absolute; top: 0; bottom: 0;
    background: repeating-linear-gradient(45deg,
        rgba(0,0,0,0.02), rgba(0,0,0,0.02) 6px,
        rgba(0,0,0,0.05), rgba(0,0,0,0.05) 12px);
    border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
    pointer-events: auto;
    cursor: help;
    z-index: 1;
}

.staff-block-band:hover {
    background: repeating-linear-gradient(45deg,
        rgba(0,0,0,0.04), rgba(0,0,0,0.04) 6px,
        rgba(0,0,0,0.08), rgba(0,0,0,0.08) 12px);
}

/* Sessions list */
.sessions-card .sessions-list,
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.session-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.1s;
}

.session-row:hover { background: #f3f4f6; }

.session-num {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.session-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.session-head-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.session-time {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

.session-meta { font-size: 12px; color: var(--text-muted); flex: 1; }

.session-topic {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

.session-evidence {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 2px;
}

.ev-chip {
    font-size: 11px;
    color: var(--text-muted);
    background: #f3f4f6;
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 3px;
    font-style: italic;
}

.session-embed { font-size: 12px; color: var(--warning); margin-top: 2px; }

/* Source badges */
.src-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

.src-badge.src-ai { background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent-border); }
.src-badge.src-algo { background: #f3f4f6; color: var(--text-muted); }

.src-badge.conf-high, .conf-high { background: var(--success-light); color: var(--success); border: 1px solid rgba(5,150,105,0.2); }
.src-badge.conf-medium, .conf-medium { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(217,119,6,0.2); }
.src-badge.conf-low, .conf-low { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(220,38,38,0.2); }

.issue-session {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 12px; font-weight: 700;
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    cursor: help;
}

.utt-row.has-session { padding-left: 10px; background: #fafbfc; }

.utt-sess {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 11px; font-weight: 700;
    background: var(--accent-light);
    color: var(--accent);
    margin-right: 3px;
}

/* Session toggle & transcript dropdown */
.session-toggle {
    margin-left: auto;
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    border-radius: 4px;
    font-size: 12px; font-weight: 600;
    padding: 2px 8px;
    cursor: pointer;
    font-family: inherit;
}

.session-toggle:hover { background: rgba(79,70,229,0.12); }

.session-transcript {
    margin-top: 6px;
    padding: 8px 10px;
    background: #f9fafb;
    border-radius: 5px;
    border: 1px solid var(--border);
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(79,70,229,0.3) transparent;
}

.session-transcript::-webkit-scrollbar { width: 4px; }
.session-transcript::-webkit-scrollbar-thumb { background: rgba(79,70,229,0.3); border-radius: 2px; }

.sess-utt {
    display: grid;
    grid-template-columns: 44px 55px 1fr;
    gap: 6px;
    padding: 3px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}

.sess-utt:last-child { border-bottom: none; }

.sess-utt-ts {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline dotted rgba(79,70,229,0.3);
}

.sess-utt-ts:hover { color: var(--text-primary); }
.sess-utt-spk { font-weight: 600; color: var(--warning); font-size: 12px; }
.sess-utt-text { color: var(--text-secondary); line-height: 1.3; }
.sess-empty { padding: 10px; color: var(--text-muted); text-align: center; font-style: italic; }

/* ============================================
   SNIPPETS
   ============================================ */
.snippet-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

/* Snippet group header per cashier+date */
.snippet-group-header {
    grid-column: 1 / -1;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-muted));
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    margin: 14px 0 6px;
}

.snippet-group-header:first-child { margin-top: 0; }

/* Reserve toggle */
.snippet-reserve-toggle {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4px 0;
}


/* Reserve and edge case card modifiers */
.snippet-card.snippet-reserve {
    opacity: 0.5;
    border-style: dashed;
}
.snippet-card.snippet-reserve:hover { opacity: 0.85; }

.snippet-card.snippet-edge {
    border-left-color: #d4a72c;
    background: linear-gradient(135deg, var(--bg-card), rgba(212,167,44,0.04));
}

.snippet-stat {
    padding: 12px 14px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.snippet-stat-value {
    font-size: 20px;
    font-weight: 800;
    font-family: var(--font-mono);
    line-height: 1.2;
}

.snippet-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: 2px;
}

.snippet-stat-value.stat-total { color: var(--text-primary); }
.snippet-stat-value.stat-pending { color: var(--warning); }
.snippet-stat-value.stat-agreed { color: var(--success); }
.snippet-stat-value.stat-disagreed { color: var(--danger); }

.snippets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.snippets-grid > .snippet-card {
    flex: 1 1 340px;
    max-width: 100%;
}

.snippets-grid > .snippet-group-header,
.snippets-grid > .snippet-reserve-toggle,
.snippets-grid > div[style*="display: none"],
.snippets-grid > div:not(.snippet-card):not(.snippet-group-header):not(.snippet-reserve-toggle) {
    flex: 0 0 100%;
}

.snippet-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s;
    position: relative;
}

.snippet-card:hover { box-shadow: var(--shadow); }

.snippet-card.snippet-reviewed { opacity: 0.65; }
.snippet-card.snippet-reviewed:hover { opacity: 1; }

.snippet-review-status {
    position: absolute; top: 8px; right: 8px;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.snippet-review-status.status-agree {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(5,150,105,0.3);
}

.snippet-review-status.status-disagree {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(220,38,38,0.25);
}

.snippet-good { border-left: 4px solid var(--success); }
.snippet-bad, .snippet-needs_improvement { border-left: 4px solid var(--danger); }

.snippet-badges {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding-right: 26px;
}

.snippet-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-cat { background: var(--accent-light); color: var(--accent); }
.badge-good { background: var(--success-light); color: var(--success); }
.badge-bad { background: var(--danger-light); color: var(--danger); }

.snippet-score {
    margin-left: auto;
    font-weight: 700;
    font-size: 13px;
    font-family: var(--font-mono);
}

.snippet-cashier {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: capitalize;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.snippet-date {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-transform: none;
}

.snippet-player {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 5px 8px;
}

.snippet-audio-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 6px 0 2px;
}

.snippet-player-raw {
    background: transparent;
    border-style: dashed;
}

.info-i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    font-family: Georgia, "Times New Roman", serif;
    cursor: help;
    vertical-align: middle;
    margin-left: 6px;
    user-select: none;
    white-space: pre-line;
}
.info-i:hover { filter: brightness(1.1); }

.sp-play-btn {
    width: 26px; height: 26px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sp-play-btn:hover { background: var(--accent-hover); }

.sp-time {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    min-width: 28px;
    text-align: center;
}

.sp-progress-wrap {
    flex: 1;
    height: 6px;
    cursor: pointer;
    padding: 5px 0;
    display: flex;
    align-items: center;
}

.sp-progress-bar {
    width: 100%; height: 3px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.sp-progress-fill {
    height: 100%; width: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.sp-playing .sp-progress-fill { background: var(--success); }

.sp-speed-group {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.sp-speed-btn {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}

.sp-speed-btn:hover { color: var(--text-primary); border-color: var(--accent); }

.sp-speed-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.snippet-transcript {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    max-height: 64px;
    overflow-y: auto;
    background: var(--bg-muted);
    padding: 6px 8px;
    border-radius: 5px;
    border: 1px solid var(--border);
}

.snippet-explanation {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
    font-style: italic;
}

.snippet-feedback {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.snippet-feedback .fb-cat-head {
    flex: 1 0 100%;
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 2px;
}
.snippet-card[data-multi="1"] .snippet-feedback { margin-top: 4px; }

/* Session card: shared player on top, each snippet listed below */
.session-card .session-snippets { margin-top: 10px; }
.session-card .session-snippet-row {
    border-top: 2px solid var(--border);
    padding-top: 10px;
    margin-top: 10px;
}
.session-card .session-snippet-row:first-child {
    border-top: none;
    margin-top: 0;
}

.fb-btn {
    flex: 1;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.15s;
}

.fb-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-hover);
}

.fb-btn.fb-agree:hover {
    border-color: var(--success);
    color: var(--success);
    background: var(--success-light);
}

.fb-btn.fb-disagree:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-light);
}

.fb-active-agree {
    background: var(--success-light) !important;
    border-color: var(--success) !important;
    color: var(--success) !important;
    font-weight: 700;
}

.fb-active-disagree {
    background: var(--danger-light) !important;
    border-color: var(--danger) !important;
    color: var(--danger) !important;
    font-weight: 700;
}

/* ============================================
   LEADERBOARD
   ============================================ */
.leaderboard-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.lb-summary-card {
    min-width: 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.lb-best { border-left: 3px solid var(--success); }
.lb-attention { border-left: 3px solid var(--danger); }

.lb-sum-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.lb-sum-name { font-size: 14px; font-weight: 700; text-transform: capitalize; }

.lb-sum-score {
    font-size: 20px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--accent);
}

.leaderboard-table th {
    font-size: 12px;
    padding: 8px 12px;
    text-align: left;
    background: #f9fafb;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.leaderboard-table td {
    font-size: 13px;
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.leaderboard-table tr:hover td { background: #f8f9fb; }

.lb-cashier-name { text-transform: capitalize; font-weight: 600; }

.lb-green td { color: var(--success); }
.lb-yellow td { color: var(--warning); }
.lb-red td { color: var(--danger); }

.lb-green td:first-child, .lb-green .lb-cashier-name,
.lb-yellow td:first-child, .lb-yellow .lb-cashier-name,
.lb-red td:first-child, .lb-red .lb-cashier-name {
    color: var(--text-primary);
}

.lb-detail-row td { padding: 0 !important; }

.lb-detail-content {
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 0 0 var(--radius) var(--radius);
}

.lb-detail-content h4 { font-size: 13px; margin-bottom: 6px; text-transform: capitalize; }

.lb-hist-item {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
}

.lb-hist-item:last-child { border-bottom: none; }

.lb-hist-score { font-weight: 700; font-family: var(--font-mono); color: var(--accent); }

.lb-deduction {
    font-size: 11px;
    color: var(--danger);
    background: var(--danger-light);
    padding: 1px 5px;
    border-radius: 3px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--bg-body);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-md);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-form input {
    padding: 9px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.login-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.login-btn:hover { background: var(--accent-hover); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================
   UPLOAD CARD
   ============================================ */
.upload-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

/* ============================================
   LEGACY CLASS MAPPINGS
   ============================================ */
/* Old pull-card maps to page-section */
.pull-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 0;
}

/* Old pull-filters → filter-bar */
.pull-filters {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 14px 16px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.pull-status { /* alias → status-msg */
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
}

.pull-status.loading {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}

.pull-status.error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(220,38,38,0.15);
}

.pull-status.success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(5,150,105,0.15);
}

.pull-count {
    margin: 10px 0 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.pull-table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.pull-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pull-table th {
    padding: 10px 14px;
    text-align: left;
    background: #f9fafb;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.pull-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: var(--text-primary);
    white-space: nowrap;
}

.pull-table tr:hover td { background: #f8f9fb; }
.pull-table tr:last-child td { border-bottom: none; }

.pull-table .fname {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* Old pull-input */
.pull-input {
    padding: 7px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    transition: border-color 0.15s;
    height: 34px;
}

.pull-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.history-filters {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    align-items: center;
    flex-wrap: wrap;
}

.history-filters input[type="date"] { flex: 1; min-width: 120px; }

.snippets-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.snippets-filters .filter-input {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden { display: none !important; }
.results-animate {}

/* ============================================
   FOOTER
   ============================================ */
.app-footer {
    margin-top: auto;
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-bottom: 16px;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .topbar-inner { padding: 0 12px; height: 48px; }

    .brand-sub { display: none; }

    .topbar-nav {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .topbar-nav::-webkit-scrollbar { display: none; }

    .nav-item { padding: 6px 10px; font-size: 12px; }
    .nav-item svg { display: none; }

    .topbar-status { display: none; }

    .topbar-logout span:last-child { display: none; }

    .app-layout { padding: 12px; }

    .page-section { padding: 14px 12px; }

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

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

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

    .analysis-header { flex-direction: column; text-align: center; }
    .funnel-grid, .metric-grid, .moments-grid { grid-template-columns: 1fr; }
    .leaderboard-summary { grid-template-columns: 1fr; }

    .utt-row { grid-template-columns: 1fr; gap: 2px; }

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

    .volume-control { display: none; }
}

@media (max-width: 480px) {
    .brand-icon { display: none; }
    .brand-name { font-size: 13px; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ============================================
   SELECTION
   ============================================ */
::selection { background: rgba(79,70,229,0.2); color: var(--text-primary); }
