/* ==========================================================================
   Design system — converges the web app on the PDF report's visual language.

   Tokens mirror app/services/pdf_generator.py BASE_CSS (slate text scale,
   tinted status colors, section-header grammar). Brand colors are NOT
   hardcoded here: base.html emits --brand / --accent from the brand seam,
   and --primary derives from them. No external fonts (white-label).
   ========================================================================== */

/* Self-hosted Poppins — geometric stand-in for SmartStart's Nexa.
   Served from our static dir: no CDN, no tracking (white-label rule). */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/poppins-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/poppins-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/poppins-700.woff2') format('woff2');
}

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
    --bg: #ffffff;
    --bg-subtle: #f8fafc;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Brand seam: base.html sets --brand/--accent; fall back to PDF palette */
    --primary: var(--brand, #3b82f6);
    --cta: var(--accent, var(--brand, #3b82f6));
    --cta-ink: #191e24;
    --primary-soft: color-mix(in srgb, var(--brand, #3b82f6) 10%, white);

    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #06b6d4;
    --info-bg: #ecfeff;

    --radius: 10px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 4px 16px rgba(15, 23, 42, 0.08), 0 8px 32px rgba(15, 23, 42, 0.06);

    /* System stack, Inter preferred when installed — no font downloads */
    --font: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
            'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-subtle);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    color: var(--text);
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0 0 12px;
}

h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }

p { margin: 0 0 12px; }

a { color: var(--primary); }

small { font-size: 13px; color: var(--text-secondary); }

main {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 24px 48px;
}

/* --------------------------------------------------------------------------
   3. Top nav
   -------------------------------------------------------------------------- */
.navbar {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.nav-brand {
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 999px;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
    background: var(--bg-subtle);
    color: var(--text);
}

.nav-link.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   4. Footer
   -------------------------------------------------------------------------- */
footer {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
    background: var(--cta);
    color: var(--cta-ink);
    font-weight: 600;
}

.btn-primary:hover {
    background: color-mix(in srgb, var(--cta), #0f172a 12%);
}

.btn-outline {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn-full { width: 100%; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   6. Forms
   -------------------------------------------------------------------------- */
.form-group { margin-bottom: 18px; }

.form-group label,
label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.form-group label {
    display: block;
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input:not([type]),
textarea {
    width: 100%;
    padding: 9px 12px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
    line-height: 1.5;
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

input[type="checkbox"] {
    width: auto;
    accent-color: var(--primary);
}

.field-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.field-error {
    font-size: 13px;
    color: var(--danger);
}

/* Bare buttons (no class) pick up the outline treatment so legacy forms
   don't render unstyled browser chrome. */
button:not([class]) {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

button:not([class]):hover {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
}

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.card > p:last-child { margin-bottom: 0; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.card-grid .card { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   8. Section header (PDF grammar: title + hairline, actions right-aligned)
   -------------------------------------------------------------------------- */
.section { margin-bottom: 28px; }

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.section-header .section-actions { margin-left: auto; }

/* Page-level header variant: a full-size h1 with right-aligned actions */
.section-header h1 { margin: 0; }

/* --------------------------------------------------------------------------
   9. Badges + status badges
   -------------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    border-radius: 999px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    white-space: nowrap;
}

.status-badge { text-transform: capitalize; }

.status-queued,
.status-analyzing,
.status-generating_pdf,
.status-sending_email {
    background: var(--info-bg);
    color: #0e7490;
}

.status-complete {
    background: var(--success-bg);
    color: #047857;
}

.status-failed {
    background: var(--danger-bg);
    color: #b91c1c;
}

/* --------------------------------------------------------------------------
   10. Stat cards
   -------------------------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

/* Compact stat pair — scenario cards and other in-card summaries */
.stat-pair {
    display: flex;
    gap: 28px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid var(--border);
}

.stat-pair .stat-value { font-size: 18px; }

/* --------------------------------------------------------------------------
   11. Flash messages
   -------------------------------------------------------------------------- */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

.flash-success {
    background: var(--success-bg);
    border-color: color-mix(in srgb, var(--success) 30%, white);
    color: #047857;
}

.flash-error {
    background: var(--danger-bg);
    border-color: color-mix(in srgb, var(--danger) 30%, white);
    color: #b91c1c;
}

.flash-warning {
    background: var(--warning-bg);
    border-color: color-mix(in srgb, var(--warning) 35%, white);
    color: #92400e;
}

.flash-info {
    background: var(--info-bg);
    border-color: color-mix(in srgb, var(--info) 30%, white);
    color: #0e7490;
}

/* --------------------------------------------------------------------------
   12. Empty states
   -------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--bg);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 12px;
}

.empty-state h3 {
    margin-bottom: 6px;
    color: var(--text);
}

.empty-state p {
    max-width: 460px;
    margin: 0 auto 16px;
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   13. Auth (login)
   -------------------------------------------------------------------------- */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 55vh;
}

.auth-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    max-width: 420px;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-wordmark {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.auth-header .subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 6px 0 0;
}

.success-state {
    text-align: center;
    color: var(--text-secondary);
}

.success-state .success-icon {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   14. Tables
   -------------------------------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

th, td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

th {
    background: var(--bg-subtle);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

tbody tr:hover { background: var(--bg-subtle); }

/* --------------------------------------------------------------------------
   15. Misc content
   -------------------------------------------------------------------------- */
pre {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* Error pages (404/500) */
.error-page {
    text-align: center;
    padding: 72px 24px;
}

.error-page .error-code {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.error-page h1 { margin-bottom: 8px; }

.error-page p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   16. Report — breadcrumb, score card, breakdown, grade colors
   -------------------------------------------------------------------------- */
.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.score-card-main {
    display: flex;
    align-items: center;
    gap: 20px;
}

.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
    color: #fff;
    font-size: 30px;
    font-weight: 800;
    background: var(--text-muted); /* unknown-grade fallback */
}

.overall-score {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.score-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.score-row:first-child { padding-top: 0; }
.score-row:last-child { border-bottom: none; padding-bottom: 0; }

.score-row-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}

.criterion-name { font-weight: 600; }

.criterion-weight {
    font-size: 12px;
    color: var(--text-muted);
}

.criterion-score {
    margin-left: auto;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.score-bar {
    height: 8px;
    border-radius: 999px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--text-muted);
}

.criterion-justification {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 6px 0 0;
}

.takeaway-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.takeaway { border-left: 3px solid var(--border-strong); }
.takeaway-grid .takeaway { margin-bottom: 0; }
.takeaway-strength { border-left-color: var(--success); }
.takeaway-improvement { border-left-color: var(--warning); }

.report-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Grade colors mirror pdf_generator.GRADE_COLORS. Declared after
   .grade-badge / .score-bar-fill so the grade wins at equal specificity. */
.grade-a { background: #22c55e; } /* green  — >=90 */
.grade-b { background: #3b82f6; } /* blue   — >=80 */
.grade-c { background: #f59e0b; } /* amber  — >=70 */
.grade-d { background: #f97316; } /* orange — >=60 */
.grade-f { background: #ef4444; } /* red    — below */

/* --------------------------------------------------------------------------
   16b. Transcript — segments, speaker pills, inline annotations
   -------------------------------------------------------------------------- */
.transcript-segment {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 10px;
}

.segment-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.speaker-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.speaker-agent {
    background: var(--primary-soft);
    color: var(--primary);
}

.speaker-user {
    background: var(--success-bg);
    color: var(--success);
}

.segment-time {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.segment-head .segment-add-note { margin-left: auto; }

.segment-text { margin: 8px 0 0; }

/* Inline note (annotation) — server-rendered and JS-built share this shape */
.annotation {
    background: var(--warning-bg);
    border-left: 3px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-top: 10px;
}

.annotation-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.annotation-author {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.annotation-actions { margin-left: auto; }

.annotation-note {
    margin: 6px 0 0;
    white-space: pre-line;
}

.annotation-empty { margin: 0; }
.annotation-list .annotation:first-child { margin-top: 0; }

/* Inline-expand note form (no modal) */
.annotation-form { margin-top: 10px; }

.annotation-form textarea {
    width: 100%;
    font: inherit;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    resize: vertical;
}

.annotation-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.annotation-form-error { margin: 0; }

/* Small text-button used by transcript note actions */
.link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
}

.link-btn:hover { color: var(--text); }
.link-btn-danger { color: var(--danger); }
.link-btn:disabled { opacity: 0.6; cursor: default; }

/* --------------------------------------------------------------------------
   17. Utilities
   -------------------------------------------------------------------------- */
.muted { color: var(--text-muted); }

.pre-line { white-space: pre-line; }

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   18. Responsive (target >=768px; below: collapse, never overflow)
   -------------------------------------------------------------------------- */
img, svg, video { max-width: 100%; }

@media (max-width: 767px) {
    main { padding: 20px 14px 36px; }

    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 14px;
    }

    .stats-grid { grid-template-columns: 1fr; }

    .auth-card { padding: 28px 20px; }

    table { display: block; overflow-x: auto; }
}

/* --------------------------------------------------------------------------
   18. Scenario cards
   -------------------------------------------------------------------------- */
.scenario-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow .15s ease, transform .15s ease;
}

.scenario-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.scenario-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scenario-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .5px;
    flex-shrink: 0;
    /* SmartStart yellow ring around the deep-blue medallion */
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cta) 60%, white);
}

.scenario-id {
    min-width: 0;
}

.scenario-name {
    display: block;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.35;
    color: var(--text);
    text-decoration: none;
}

.scenario-name:hover {
    color: var(--primary);
}

.scenario-phone {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
}

a.scenario-phone:hover {
    color: var(--primary);
}

.scenario-desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
    flex-grow: 1;
}

.scenario-stats {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.scenario-chip {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12.5px;
    color: var(--text-secondary);
    background: var(--bg-subtle);
}

.scenario-chip strong {
    color: var(--text);
    font-weight: 600;
}

/* Tags: brand-tinted pills, distinct from the neutral stat chips. Rendered
   as links — clicking one filters the Scenarios list. */
.scenario-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tag-chip {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, white);
    border: 1px solid color-mix(in srgb, var(--primary) 25%, white);
}

.tag-chip:hover {
    background: color-mix(in srgb, var(--primary) 16%, white);
    text-decoration: none;
}

.tag-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

/* ---------------------------------------------------------------------------
   19. Rubric library
   --------------------------------------------------------------------------*/
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.data-table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    padding: 10px 14px;
}

.data-table td {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    vertical-align: top;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.inline-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------------------------------------------------------------------------
   20. Admin portal — usage bar chart
   --------------------------------------------------------------------------*/
.usage-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 120px;
}

.usage-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.usage-bar {
    width: 100%;
    min-height: 2px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    transition: height .2s ease;
}

.usage-bar-label {
    margin-top: 4px;
    font-size: 10px;
    color: var(--text-secondary);
}

/* ---------------------------------------------------------------------------
   21. ElevenLabs native-analysis panel
   --------------------------------------------------------------------------*/
.el-criteria {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.el-criterion-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.el-result {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.el-result-success { background: #dcfce7; color: #166534; }
.el-result-failure { background: #fee2e2; color: #991b1b; }
.el-result-unknown { background: var(--bg-subtle); color: var(--text-secondary); }

/* ---------------------------------------------------------------------------
   22. Report: benchmark, key moments, structured coaching
   --------------------------------------------------------------------------*/
.benchmark-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 8px;
}

.benchmark-value {
    font-size: 30px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.benchmark-pct-suffix { font-size: 15px; font-weight: 600; }

.benchmark-label {
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.key-moments {
    margin: 0;
    padding-left: 18px;
}

.key-moments li { margin-bottom: 6px; }

.coaching-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.coaching-col ul { margin: 0; padding-left: 18px; }
.coaching-col li { margin-bottom: 6px; }
.coaching-done { border-left: 3px solid #16a34a; }
.coaching-improve { border-left: 3px solid #d97706; }

.coaching-focus {
    margin-top: 16px;
    border-left: 3px solid var(--primary);
}
