/* Conductør Web Dashboard — no-scroll shell with a vertical icon
   sidebar and a scrollable main content area. html/body occupy the
   whole viewport and never scroll; each tab panel is its own scroll
   container so per-tab scroll position is preserved across switches. */

/* KL-113: cascade layering. All rules in this file live in @layer base;
   per-feature CSS in static/features/ uses @layer features for
   predictable override priority without !important. */
@layer reset, base, components, features, overrides;

@layer base {

:root {
    --bg: #0a0a0f;
    --surface: #14141f;
    --surface-2: #1e1e2e;
    --border: #2a2a3e;
    --text: #e0e0e8;
    --text-dim: #8888a0;
    --accent: #b48cff;
    --bass: #ff3c3c;
    --mids: #3cdc3c;
    --highs: #5078ff;
    --danger: #ff3040;
    --flash: #ffdd44;
    --sidebar-w: 180px;
    --sidebar-w-narrow: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Respect the `hidden` attribute even when a component sets an explicit
   `display:` rule (e.g. `display: flex` on banners). Without this, the
   UA-stylesheet `display: none` from [hidden] loses to our component CSS
   and JS toggling `.hidden = true` has no visual effect. */
[hidden] { display: none !important; }

html, body { height: 100%; width: 100%; overflow: hidden; }

body {
    font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
    background: var(--bg);
    color: var(--text);
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: 1fr;
    min-width: 720px;
}

/* KL-171: thin, translucent scrollbars on Windows so the WebView2
   default (a ~17px opaque bar) doesn't sit on top of toast close-X
   buttons or any other right-edge content. WKWebView on Mac already
   uses overlay scrollbars (invisible until scrolling) so these rules
   are visually a no-op there — they only manifest on Chromium-based
   webviews (Windows WebView2, browser-based dev). 8px width matches
   the visual weight of the rest of our chrome and keeps clear of any
   8px right-margin we put on overlay surfaces. */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(180, 140, 255, 0.35) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: rgba(180, 140, 255, 0.35);
    border-radius: 4px;
    /* Inset border creates the visual "padding" around the thumb so it
       doesn't touch the edge of the track — feels lighter than a
       solid bar at the same width. */
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(180, 140, 255, 0.55);
    background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }

/* Sidebar */
.shell-sidebar {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}
.shell-brand {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

/* KL-177: Early Access pill. Sits below the brand wordmark in the
   sidebar header. Magenta because brand purple was too subtle and
   amber felt warning-y. Non-dismissible by design — the whole point
   is to make EA status impossible to ignore. Click jumps to the Help
   tab so the user has a one-tap path to send feedback about whatever
   prompted them to notice the pill. */
.early-access-pill {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.18rem 0.55rem;
    border: none;
    border-radius: 999px;
    background: #ff2d8a;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(255, 45, 138, 0.35);
    transition: filter 0.12s, transform 0.12s;
}
.early-access-pill:hover {
    filter: brightness(1.1);
}
.early-access-pill:active {
    transform: translateY(1px);
}
.early-access-pill:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.shell-tier-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    margin: 0.5rem 0.75rem 0;
    padding: 0.4rem 0.5rem 0.45rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: transparent;
    color: var(--text);
    transition: background 0.15s, color 0.15s;
}
.shell-tier-badge:hover {
    background: var(--accent);
    color: #fff;
}
.shell-tier-badge .tier-badge-label { opacity: 0.75; }
.shell-tier-badge .tier-badge-teaser {
    /* Rotating one-line feature teaser ("DMX fixtures", etc.). Lower
       contrast than the label/CTA, normal-cased so it reads as
       descriptive copy rather than a header. min-height keeps the
       sidebar from jittering during the opacity-fade rotation. */
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--text-dim);
    opacity: 0;
    transition: opacity 0.22s ease-in-out;
    min-height: 0.85rem;
    line-height: 1;
}
.shell-tier-badge .tier-badge-cta { color: var(--accent); }
.shell-tier-badge:hover .tier-badge-label,
.shell-tier-badge:hover .tier-badge-teaser,
.shell-tier-badge:hover .tier-badge-cta { color: #fff; opacity: 1; }
.brand-word {
    display: inline-block;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #a55eea, #ff6b6b);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: brand-hue 6s linear infinite;
}
@keyframes brand-hue {
    from { background-position: 0% 0%; }
    to   { background-position: 200% 0%; }
}

.tab-rail {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    flex: 1;
    gap: 0.15rem;
}
.tab-rail .tab-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: transparent;
    color: var(--text-dim);
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-align: left;
    transition: color 0.15s, background 0.15s, border-left-color 0.15s;
}
.tab-rail .tab-btn:hover { color: var(--text); background: var(--surface-2); }
.tab-rail .tab-btn.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--surface-2);
}
.tab-glyph {
    display: inline-block;
    width: 1.25rem;
    text-align: center;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}
.tab-label { flex: 1; }

.shell-help,
.shell-about {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
}
.shell-help:hover,
.shell-about:hover { color: var(--accent); }

/* App Updates tab (KL-51). Double-tall, two lines: glyph + label on
   top, status on bottom. Cyan-glow treatment when an update is
   actually available so it catches the eye without screaming "error". */
.shell-updates {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    text-align: left;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    border-left: 3px solid transparent;
    width: 100%;
    transition: color 0.15s, background 0.15s, border-left-color 0.15s, box-shadow 0.4s;
}
.shell-updates:hover { color: var(--text); background: var(--surface-2); }
.shell-updates.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--surface-2);
}
.shell-updates-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.shell-updates-status {
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    padding-left: 2rem; /* align under label, past the glyph column */
    line-height: 1.2;
    transition: color 0.3s;
}
.shell-updates[data-update-state="uptodate"] .shell-updates-status {
    color: var(--text-dim);
}
.shell-updates[data-update-state="available"] {
    color: #48dbfb;
    border-left-color: #48dbfb;
    background: rgba(72, 219, 251, 0.06);
    animation: updates-available-pulse 3s ease-in-out infinite;
}
.shell-updates[data-update-state="available"] .shell-updates-status {
    color: #48dbfb;
    font-weight: 700;
}
@keyframes updates-available-pulse {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(72, 219, 251, 0); }
    50%      { box-shadow: inset 4px 0 12px -4px rgba(72, 219, 251, 0.5); }
}
@media (max-width: 880px) {
    .shell-updates .tab-label,
    .shell-updates-status { display: none; }
    .shell-updates-row { justify-content: center; }
    .shell-updates { padding: 0.7rem 0; }
}

/* App Updates panel content. */
.updates-panel { padding: 0; }
.updates-panel h2 {
    margin: 0 0 1rem 0;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}
.updates-card {
    background: var(--surface);
    border-radius: 0.5rem;
    padding: 1rem;
    max-width: 32rem;
    border-left: 3px solid transparent;
    transition: border-color 0.3s;
}
.updates-card[data-state="available"] {
    border-left-color: #48dbfb;
}
.updates-card[data-state="error"] {
    border-left-color: var(--danger);
}
.updates-version-line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.8rem;
}
.updates-version-current {
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 700;
}

.updates-state {
    margin-bottom: 0.8rem;
}
.updates-state-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.updates-state-detail {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}
.updates-state-detail strong {
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.updates-released {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-left: 0.5rem;
}
.updates-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 900;
    line-height: 1;
}
.updates-state-uptodate .updates-glyph {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}
.updates-state-available .updates-glyph {
    background: rgba(72, 219, 251, 0.15);
    color: #48dbfb;
}
.updates-state-error .updates-glyph {
    background: rgba(244, 67, 54, 0.15);
    color: var(--danger);
}
.updates-state-unsupported .updates-glyph {
    background: var(--surface-2);
    color: var(--text-dim);
}

.updates-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}
.updates-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #48dbfb;
    color: #0a1014;
    text-decoration: none;
    padding: 0.7rem 1rem;
    border-radius: 0.4rem;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    align-self: flex-start;
    transition: background 0.15s, transform 0.1s;
}
.updates-download-btn:hover {
    background: #6ee5ff;
    transform: translateY(-1px);
}
.updates-download-btn:active {
    transform: translateY(0);
}
.updates-size {
    font-weight: 500;
    opacity: 0.65;
    font-size: 0.75rem;
}
.updates-alt-link {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-decoration: underline;
    align-self: flex-start;
}
.updates-alt-link:hover { color: var(--accent); }

.updates-footnote {
    font-size: 0.7rem;
    color: var(--text-dim);
    line-height: 1.4;
    padding: 0.5rem 0.6rem;
    border-left: 2px solid var(--border);
    background: var(--bg);
    border-radius: 0 0.2rem 0.2rem 0;
}

.updates-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.8rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border);
}
.updates-recheck {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.35rem 0.7rem;
    border-radius: 0.3rem;
    font-size: 0.7rem;
    cursor: pointer;
    font-family: inherit;
}
.updates-recheck:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.updates-recheck:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.updates-checked-at {
    font-size: 0.65rem;
    color: var(--text-dim);
}

/* Main content — grid of [toolbar, panels]. Panels container is a
   positioning context so each .tab-panel can fill it absolutely and
   keep its own scroll position when you switch away. */
.shell-main {
    grid-column: 2;
    min-width: 0;
    display: grid;
    grid-template-rows: 1fr;
    position: relative;
    overflow: hidden;
}
.shell-panels {
    position: relative;
    overflow: hidden;
    min-height: 0;
}
.tab-panel {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: 1rem 1rem 5rem;
}
.tab-panel[hidden] { display: none; }

/* Floating live-show controls — always reachable regardless of tab */
.show-quick-actions {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 50;
    pointer-events: auto;
}
.show-quick-actions .action-btn {
    flex: 0 0 auto;
    min-width: 5.5rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

@media (max-width: 1200px) {
    body { grid-template-columns: var(--sidebar-w-narrow) 1fr; }
    .brand-word { font-size: 0.8rem; letter-spacing: 0; }
    .tab-label { display: none; }
    .shell-help .tab-label,
    .shell-about .tab-label { display: none; }
    .tab-rail .tab-btn { justify-content: center; padding: 0.7rem 0; gap: 0; }
    .shell-help,
    .shell-about { justify-content: center; padding: 0.7rem 0; gap: 0; }
    .shell-tier-badge {
        flex-direction: column;
        gap: 0.15rem;
        margin: 0.4rem 0.25rem 0;
        padding: 0.3rem 0.2rem;
        font-size: 0.55rem;
        letter-spacing: 0.04em;
    }
    .shell-tier-badge .tier-badge-label,
    .shell-tier-badge .tier-badge-teaser { display: none; }
}
/* Band Meters */
.band-meters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.band {
    flex: 1;
    background: var(--surface);
    border-radius: 0.5rem;
    padding: 0.5rem;
    text-align: center;
}

.band-label {
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

#band-bass .band-label { color: var(--bass); }
#band-mids .band-label { color: var(--mids); }
#band-highs .band-label { color: var(--highs); }

.band-bar {
    height: 2rem;
    background: var(--bg);
    border-radius: 0.25rem;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.band-fill {
    height: 100%;
    width: 0%;
    transition: width 0.05s linear;
    border-radius: 0.25rem;
}

#fill-bass { background: var(--bass); }
#fill-mids { background: var(--mids); }
#fill-highs { background: var(--highs); }

.band-value {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Director hero — KL-58. Bar experience: Lumi is sized larger than
   the panel and positioned so the panel's bottom edge clips her at
   hip/waist level. She appears to be "standing behind a bar" — head
   and torso visible inside the panel, lower body completely hidden
   (no ghost, no bleed) below the panel border. */
.director-panel {
    /* Pure black fill so the MP4s' black backgrounds (KL-61) blend
       seamlessly with the panel under mix-blend-mode: screen — no
       visible seam where the video element sits. The 1px purple
       border + outer glow box-shadow still define the panel's edge
       so it reads as a card, just without the inner purple tint
       that used to clash with the video.

       KL-64: border + outer glow color now driven by --lumi-pulse-
       color / --lumi-border-color CSS variables that show.js sets
       from the current emotion's color (or Lumi's per-decision
       mood_color override). The 800ms transition makes emotion
       shifts feel like a slow color drift rather than a snap. */
    --lumi-pulse-color: rgba(180, 140, 255, 0.28);
    --lumi-border-color: rgba(180, 140, 255, 0.85);
    background: #000;
    border: 1px solid var(--lumi-border-color);
    border-radius: 0.5rem;
    padding: 1rem 1.2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 36px var(--lumi-pulse-color);
    transition: box-shadow 800ms ease-out, border-color 800ms ease-out;
    position: relative;
    min-height: 22rem;
    /* Flex-center text content vertically so the mood word doesn't
       strand at the top of a tall panel. */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* No overflow:hidden — the mood-word glow halo (KL-55) bleeds
       intentionally. The cartoon is clipped via .director-cartoon-clip
       which has its own overflow:hidden. */
}

/* Mood row + note + meta need position:relative + z-index so they
   stack ABOVE the absolute-positioned .director-cartoon-clip. Without
   it, CSS layers positioned siblings on top of non-positioned flex
   children regardless of DOM order — which puts Lumi in front of the
   text. We want her behind. */
.director-mood-row,
.director-note,
.director-meta,
.hud-bands,
.hud-stats {
    position: relative;
    z-index: 1;
}

/* ─── KL-64: HUD widgets inside the director panel ─────────────────
   Band meters (top-right) and stats (bottom-right) consolidate into
   the panel as low-key telemetry overlays. Both are positioned
   absolutely against the panel's right edge so Lumi (anchored to the
   left) keeps the visual center, and the mood word + note + meta
   stay where they are.
   ─────────────────────────────────────────────────────────────────── */
.hud-bands {
    position: absolute;
    top: 0.85rem;
    right: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 2;
}
.hud-band {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.hud-band-glyph {
    font-family: var(--font-mono, monospace);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-muted, rgba(200, 200, 220, 0.55));
    width: 0.7rem;
    text-align: right;
}
.hud-band-bar {
    width: 4.5rem;
    height: 3px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 2px;
    overflow: hidden;
}
.hud-band-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 90ms linear;
}
#fill-bass  { background: linear-gradient(90deg, rgba(255, 80, 80, 0.5),   #ff6060); }
#fill-mids  { background: linear-gradient(90deg, rgba(80, 255, 120, 0.5), #50e070); }
#fill-highs { background: linear-gradient(90deg, rgba(120, 160, 255, 0.5), #7090ff); }

.hud-stats {
    position: absolute;
    bottom: 0.85rem;
    right: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    z-index: 2;
    text-align: right;
}
.hud-stat {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    justify-content: flex-end;
}
.hud-stat-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: rgba(200, 200, 220, 0.4);
    text-transform: uppercase;
}
.hud-stat-value {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(220, 220, 230, 0.7);
    min-width: 2.6rem;
    text-align: right;
}

/* ─── KL-67: hardware-status row ──────────────────────────────────
   Compact "systems" badge row at top-LEFT of the director panel,
   mirroring the band meters' top-right placement. Two badges (DMX +
   GVE), each carrying a label, a count, and a per-device dot strip
   that scales from 2 to 28 lights cleanly. Past 28, the badge falls
   back to a "battery-style" proportion bar (rendered with the same
   dot-color palette) — see show.js updateSystems().
   ─────────────────────────────────────────────────────────────────── */
.hud-systems {
    position: absolute;
    top: 50%;
    right: 0.95rem;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
    z-index: 2;
    pointer-events: auto;
    /* Hide entirely when neither subsystem is configured — Starter
       users with Govee only, or DMX-only users, never see a row of
       dashes. JS adds .visible when any badge has data. */
    visibility: hidden;
}
.hud-systems.visible { visibility: visible; }

.sys-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(200, 200, 220, 0.55);
    line-height: 1;
}
.sys-badge[hidden] { display: none; }
.sys-label {
    /* Tiny prefix glyph — the badge itself, "DMX" / "GVE". Uses the
       same muted color as hud-band-glyph for visual coherence. */
    color: rgba(200, 200, 220, 0.45);
}
.sys-count {
    /* "5/7" style fraction. Slightly brighter than label so it reads
       as the primary number. */
    color: rgba(220, 220, 230, 0.75);
    min-width: 1.5rem;
}
.sys-dots {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 3px;
    max-width: 10rem;          /* wraps to a second row past ~14 dots */
    align-items: center;
}
.sys-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(120, 220, 140, 0.95);   /* default green */
    box-shadow: 0 0 4px rgba(120, 220, 140, 0.45);
    flex-shrink: 0;
    cursor: default;
    transition: background 0.2s, box-shadow 0.2s;
}
.sys-dot[data-state="stale"] {
    background: #ffb830;
    box-shadow: 0 0 4px rgba(255, 184, 48, 0.5);
}
.sys-dot[data-state="dead"] {
    background: #ff3d5a;
    box-shadow: 0 0 4px rgba(255, 61, 90, 0.55);
}
.sys-dot[data-state="never"] {
    background: transparent;
    box-shadow: none;
    border: 1.5px solid rgba(120, 120, 140, 0.6);
    /* Slightly larger so the ring's stroke matches the solid dots'
       perceived size. */
    width: 8px;
    height: 8px;
}
/* Summary stripe variant for >28 device rigs. Replaces the dot strip
   with a thin segmented bar where width-proportions match
   green/amber/red counts. JS adds .as-stripe and renders three child
   divs in order. */
.sys-dots.as-stripe {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0;
    width: 9rem;
    height: 5px;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}
.sys-dots.as-stripe .stripe-segment {
    height: 100%;
}
.sys-dots.as-stripe .stripe-segment[data-state="ok"]    { background: rgba(120, 220, 140, 0.95); }
.sys-dots.as-stripe .stripe-segment[data-state="stale"] { background: #ffb830; }
.sys-dots.as-stripe .stripe-segment[data-state="dead"]  { background: #ff3d5a; }
.sys-dots.as-stripe .stripe-segment[data-state="never"] { background: rgba(120, 120, 140, 0.4); }

/* Meta row pinned to bottom-LEFT under Lumi's silhouette. Override
   the centered text-align inherited from .director-panel. */
.director-meta {
    position: absolute;
    bottom: 0.85rem;
    left: 1.1rem;
    text-align: left;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

/* Beat-pulse glyph — small dot that flashes white on every beat.
   Resting state is a dim purple dot; .beat-pulse-active class fires
   the bright animation. The animation key resets each time the
   class is toggled, so JS strips + reapplies on every beat tick. */
.director-beat-pulse {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: rgba(180, 140, 255, 0.35);
    box-shadow: 0 0 4px rgba(180, 140, 255, 0.4);
    transition: background 90ms ease-out, box-shadow 90ms ease-out;
    flex-shrink: 0;
}
.director-beat-pulse.beat-pulse-active {
    background: #ffffff;
    box-shadow:
        0 0 6px #ffffff,
        0 0 14px var(--accent),
        0 0 24px var(--accent);
}

/* "Thinking" indicator — three dots that fade in sequence while a
   director API call is in flight, plus a cyan shimmer glow on the
   LUMI label. Hidden by default (display: none), revealed when the
   .director-thinking-active class lands on the parent meta row. */
.director-thinking {
    display: none;
    align-items: center;
    gap: 0.18rem;
}
.director-meta.thinking .director-thinking {
    display: inline-flex;
}
.director-thinking .dot {
    width: 0.28rem;
    height: 0.28rem;
    border-radius: 50%;
    background: var(--cyan, #00e5c8);
    box-shadow: 0 0 4px rgba(0, 229, 200, 0.6);
    animation: lumi-thinking-bob 1.3s ease-in-out infinite;
}
.director-thinking .dot:nth-child(2) { animation-delay: 0.18s; }
.director-thinking .dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes lumi-thinking-bob {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40%           { opacity: 1.0;  transform: translateY(-0.08rem); }
}
/* Cyan shimmer on the LUMI label while she's thinking. */
.director-meta.thinking .director-meta-label {
    color: #f3e8ff;
    text-shadow: 0 0 4px rgba(0, 229, 200, 0.85);
    animation: lumi-thinking-shimmer 1.3s ease-in-out infinite;
}
@keyframes lumi-thinking-shimmer {
    0%, 100% { text-shadow: 0 0 4px rgba(0, 229, 200, 0.5); }
    50%      { text-shadow: 0 0 10px rgba(0, 229, 200, 1.0); }
}

/* KL-68: clickable link inside the director note for the off-state
   prompts (Get Pro / Director tab jump). Reuses the dashboard's
   accent color. text-shadow doesn't inherit, so the 8-direction
   stroke is repeated explicitly here so the link stays readable
   over Lumi's silhouette. */
.director-note-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    pointer-events: auto;
    font-style: italic;
    transition: color 200ms ease-out, text-shadow 200ms ease-out;
    text-shadow:
        -1px -1px 0 #000, 0 -1px 0 #000, 1px -1px 0 #000,
        -1px  0   0 #000,                1px  0   0 #000,
        -1px  1px 0 #000, 0  1px 0 #000, 1px  1px 0 #000;
}
.director-note-link:hover {
    color: #f3e8ff;
    text-shadow:
        -1px -1px 0 #000, 0 -1px 0 #000, 1px -1px 0 #000,
        -1px  0   0 #000,                1px  0   0 #000,
        -1px  1px 0 #000, 0  1px 0 #000, 1px  1px 0 #000,
        0 0 6px var(--accent);
}

/* Cycle countdown — hairline progress bar across the panel bottom.
   Fills 0→100% as time elapses since Lumi's last decision (15s
   period). Snaps back to 0 on each new decision and re-fills.
   Pure CSS transition + JS sets the width, no keyframe needed. */
.director-cycle-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: rgba(180, 140, 255, 0.06);
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
    transition: opacity 250ms ease-out;
}
/* KL-68: hide the cycle bar in off-states. Filling toward 100% with
   no decision to follow would be misleading — and a bar pinned at
   0 just adds visual noise. */
.director-panel[data-director-state="tier_locked"] .director-cycle-bar,
.director-panel[data-director-state="disabled"] .director-cycle-bar {
    opacity: 0;
}
.director-cycle-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg,
        rgba(180, 140, 255, 0.2),
        rgba(180, 140, 255, 0.6),
        rgba(0, 229, 200, 0.6));
    transition: width 200ms linear;
}

/* Superbeat full-panel cyan flash overlay. Fully transparent at rest;
   .superbeat-flash-active fires a 350ms cyan-white burst that fades
   out via CSS keyframe. */
.director-superbeat-flash {
    position: absolute;
    inset: 0;
    border-radius: 0.5rem;
    pointer-events: none;
    background: radial-gradient(ellipse at center,
        rgba(255, 255, 255, 0.55),
        rgba(0, 229, 200, 0.35) 40%,
        transparent 75%);
    opacity: 0;
    z-index: 3;
}
.director-superbeat-flash.superbeat-flash-active {
    animation: lumi-superbeat-burst 350ms ease-out;
}
@keyframes lumi-superbeat-burst {
    0%   { opacity: 0; }
    25%  { opacity: 0.9; }
    100% { opacity: 0; }
}

/* Clip container — fills the panel border-box and clips the cartoon
   to the panel's rounded shape. inset:0 pins it to the panel;
   matching border-radius makes the clip invisible. The bar effect:
   anything below the panel bottom is hidden completely. */
.director-cartoon-clip {
    position: absolute;
    inset: 0;
    overflow: hidden;
    /* Inner-corner correction (KL-64 nitpick): the panel's outer
       border-radius is 0.5rem, but the inner edge of its 1px border
       has radius 0.5rem - 1px. Matching that here keeps the video's
       square corners from peeking past the panel's rounded color
       border. */
    border-radius: calc(0.5rem - 1px);
    /* KL-199: force a fresh stacking context so the child <video>'s
       mix-blend-mode: screen is composed INSIDE this clip and the
       rounded-corner mask actually applies. Without it, blend-mode
       layers get hoisted to a compositor surface that respects the
       rectangular overflow:hidden but bleeds past the border-radius —
       which is what made the panel's top-left and bottom-left corners
       read as square instead of rounded. */
    isolation: isolate;
    pointer-events: none;
    z-index: 0;
}

/* Main Lumi — KL-58 / KL-100. The new batch of Lumi assets is
   uniformly waist-up, so the previous per-framing width split
   (full-body vs bust source) is gone — single width applies to all
   23 emotions. */
.director-cartoon {
    position: absolute;
    left: -1rem;
    top: 0;
    width: 24.48rem;
    height: auto;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.55));
    transition: opacity 0.4s ease;
}

/* Video version (KL-61). MP4 sources ship with a pure black background
   (Picsart's bg removal pass leaves matte black). mix-blend-mode: screen
   drops black pixels onto whatever's behind them while keeping Lumi's
   bright chrome, glowing seams, and headphone LEDs vivid against the
   panel's dark purple gradient — the practical equivalent of native
   transparency without WebM-alpha gymnastics. */
video.director-cartoon {
    mix-blend-mode: screen;
}
.director-cartoon[hidden] {
    opacity: 0;
}
/* KL-194: two-video crossfade. Both .director-cartoon-video elements
   stay in DOM (no `hidden` attribute → no display:none → opacity
   transition can run). The .is-active one is fully opaque; the
   other is opacity 0. setCartoon ping-pongs the class on emotion
   change and the existing `transition: opacity 0.4s ease` on
   .director-cartoon does the crossfade. */
.director-cartoon-video {
    opacity: 0;
    pointer-events: none;
}
.director-cartoon-video.is-active {
    opacity: 1;
}

.director-mood {
    font-size: 4.5rem;
    font-weight: 900;
    color: #f3e8ff;
    letter-spacing: 0.3em;
    /* letter-spacing leaves trailing space after the last glyph;
       text-indent pushes the run right by the same amount so the
       visible characters optically center inside the panel. */
    text-indent: 0.3em;
    text-transform: uppercase;
    line-height: 1.0;
    margin: 0.1rem 0 0.3rem;
    white-space: nowrap;
    /* No overflow:hidden (KL-55) — clipping the box clipped the
       text-shadow halo too, leaving the glow visibly boxed in.
       Long moods are size-tiered by JS in show.js.

       Glow tuned to read clearly against Lumi's body when she's
       overlapping (KL-58 follow-up): bigger spread on the inner +
       outer halos, and the outermost halo bumped from 50% to 70%
       opacity so the mood word stays the dominant element. */
    text-shadow:
        0 0 10px #ffffff,
        0 0 22px var(--accent),
        0 0 44px var(--accent),
        0 0 80px rgba(180, 140, 255, 0.7);
}

.director-note {
    font-size: 0.95rem;
    color: var(--text);
    margin-top: 0.2rem;
    font-style: italic;
    opacity: 0.85;
    max-width: 75%;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    /* No line-clamp — show Claude's full reasoning. The prompt asks
       for 1-2 sentences and a 600-char defensive cap in the validator
       prevents runaway output. Panel grows to fit if the note runs
       slightly long. */
    /* 1px black stroke (KL-58 follow-up) so the italic note stays
       readable when it overlaps Lumi's body. 8-direction text-shadow
       outlines the glyphs without depending on -webkit-text-stroke +
       paint-order, which can render unevenly on non-Chromium WebViews. */
    text-shadow:
        -1px -1px 0 #000, 0 -1px 0 #000, 1px -1px 0 #000,
        -1px  0   0 #000,                1px  0   0 #000,
        -1px  1px 0 #000, 0  1px 0 #000, 1px  1px 0 #000;
}

/* Footer line — collapses "AI DIRECTOR" + backend + status onto one
   divider-separated row so the mood word stays the visual anchor.
   KL-198: subtle dark text-shadow halo so the letters stay readable
   when Lumi's bright video moves behind them. Inherits to all the
   child spans (LUMI / backend name / status separators) by default;
   the .thinking variants below override with their own cyan shimmer. */
.director-meta {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 0.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.55rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-shadow:
        0 0 3px rgba(0, 0, 0, 0.85),
        0 1px 2px rgba(0, 0, 0, 0.7);
}
.director-meta-label {
    color: var(--accent);
    opacity: 0.7;
    font-weight: 700;
}
.director-meta-sep {
    opacity: 0.4;
    letter-spacing: 0;
}

@media (min-width: 768px) {
    .director-mood { font-size: 6rem; }
    .director-cartoon { width: 29.92rem; left: -1.5rem; top: 0; }
    .director-panel { min-height: 26rem; }
}

.action-btn {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.action-btn:active { background: var(--surface-2); }
.action-btn.danger { border-color: var(--danger); color: var(--danger); }
.action-btn.danger:active { background: var(--danger); color: white; }
.action-btn.flash { border-color: var(--flash); color: var(--flash); }
.action-btn.flash:active { background: var(--flash); color: black; }

/* Play/Pause + Stop primary engine controls in the floating quick-actions
   bar. Filled (not outlined) so they stand out from the outlined
   secondary trio to their right.

   The unified Play/Pause button switches its label between PLAY and
   PAUSE depending on engine state (data-state attribute toggled by JS
   from the 10Hz state push), and its color hue follows the action you
   can take next: green when paused (you'd Play), amber when playing
   (you'd Pause). Always full-bright; no dimmed/inactive variant.

   Stop is always full-bright red — it's the emergency control, must
   always look ready to be hit hard. */
.action-btn.engine-playpause {
    background: #1f7a3f;
    border-color: #2bb06a;
    color: #eaffec;
    min-width: 6.5rem;
}
.action-btn.engine-playpause:hover { background: #268a4a; }
.action-btn.engine-playpause[data-state="playing"] {
    background: #b88030;
    border-color: #d49a4a;
    color: #fff7e8;
}
.action-btn.engine-playpause[data-state="playing"]:hover { background: #c98e3b; }

.action-btn.engine-stop {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    box-shadow: 0 0 0 1px rgba(255, 48, 64, 0.25), 0 4px 14px rgba(0, 0, 0, 0.45);
}
.action-btn.engine-stop:hover { filter: brightness(1.1); }
.action-btn.engine-stop:active { background: #d4202c; }

/* Divider between engine controls (play/stop) and scene controls
   (blackout/flash/next). Visually separates the two groups so the
   primary emergency controls read as distinct from the routine ones. */
.show-quick-actions .qa-divider {
    width: 1px;
    align-self: stretch;
    margin: 0 0.15rem;
    background: var(--border);
    opacity: 0.6;
}

/* Show tab layout — hero (director + sliders) stacked over telemetry */
/* KL-56: .show-hero grid was removed — director-panel is now full-width
   on its own and controls + telemetry sit underneath as their own blocks. */

.show-telemetry {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}
.show-telemetry .band-meters { margin-bottom: 0; }
.show-telemetry .stats { margin-bottom: 0; }

@media (max-width: 900px) {
    .show-telemetry {
        grid-template-columns: 1fr;
    }
}

/* Controls */
.controls { margin-bottom: 1rem; }
.controls h2 { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--accent); }

/* ─── Lumi Console (KL-65) ───────────────────────────────────────
   Vertical lighting-board faders, grouped into ENGINE / COLOR / WASH
   clusters on a brushed-metal backplate. The native <input type=range>
   stays internally horizontal but is rotated -90deg via transform so
   all the existing JS (slider.value, ghost-touch RAF, stagger order)
   continues to work without changes. Custom thumbs are chunky
   rectangular caps with grip ridges; tracks are recessed slot
   gradients; tick marks live on the wrapper. Ghost-touch state
   replaces resting metallic with a cap-glow halo + cyan inner-
   track lining (carries forward from KL-63).
   ───────────────────────────────────────────────────────────────── */

.lumi-console {
    background:
        /* Faint vertical brushed-metal grain */
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.012) 0,
            rgba(255, 255, 255, 0.012) 1px,
            transparent 1px,
            transparent 2px
        ),
        /* Top-down panel gradient */
        linear-gradient(180deg, #14141a 0%, #1d1d24 50%, #14141a 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.5rem;
    padding: 0.85rem 1.1rem 1.25rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}
.lumi-console h2 {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--accent);
}

/* KL-201: header row pairs the H2 with the LIVE / LUMI'S DRIVING chip
   so the panel reads as automated at a glance. The chip is anchored to
   the right of the H2 (flex justify-content: space-between) and stays
   on one line until the panel narrows below ~440px, at which point it
   wraps under the H2 instead of crushing into it. */
.lumi-console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.lumi-console-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.18rem 0.55rem 0.18rem 0.5rem;
    border: 1px solid rgba(180, 140, 255, 0.35);
    border-radius: 999px;
    background: rgba(180, 140, 255, 0.08);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    user-select: none;
}

.lumi-console-chip-dot {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(180, 140, 255, 0.55);
    animation: lumi-chip-pulse 1.6s ease-in-out infinite;
}

@keyframes lumi-chip-pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(180, 140, 255, 0.55);
    }
    50% {
        opacity: 0.55;
        box-shadow: 0 0 0 4px rgba(180, 140, 255, 0);
    }
}

/* KL-201: close-range explainer. Sits directly under the H2/chip row
   and reads as a friendly nudge rather than a warning sticker. */
.lumi-console-subtitle {
    margin-top: 0.25rem;
    margin-bottom: 0.65rem;
    color: var(--text-dim);
    font-size: 0.75rem;
    font-style: italic;
}

/* Reduce-motion users get a static dot — no pulse. */
@media (prefers-reduced-motion: reduce) {
    .lumi-console-chip-dot {
        animation: none;
    }
}

.console-banks {
    display: flex;
    gap: 0.85rem;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.console-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem 0.7rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0.4rem;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.4);
}
.console-group-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--accent);
    text-align: center;
    opacity: 0.7;
    text-transform: uppercase;
}

.fader-bank {
    display: flex;
    gap: 0.45rem;
    align-items: flex-start;
    justify-content: center;
}

.fader-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    width: 48px;
    transition: filter 250ms ease-out;
}
.fader-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: rgba(220, 220, 230, 0.55);
    text-transform: uppercase;
    transition: color 250ms ease-out, text-shadow 250ms ease-out;
}
.fader-readout {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(220, 220, 230, 0.55);
    transition: color 250ms ease-out, text-shadow 250ms ease-out;
    min-height: 0.85rem;
}

/* Track wrapper — fixed size container for the rotated input.
   Tick marks on left and right edges at 25/50/75% via background
   gradients. Bipolar variants get a center hairline via ::before. */
.fader-track-wrap {
    position: relative;
    width: 36px;
    height: 170px;
    background:
        linear-gradient(to right, rgba(255, 255, 255, 0.18) 5px, transparent 5px) 0   25% / 100% 1px no-repeat,
        linear-gradient(to right, rgba(255, 255, 255, 0.18) 5px, transparent 5px) 0   50% / 100% 1px no-repeat,
        linear-gradient(to right, rgba(255, 255, 255, 0.18) 5px, transparent 5px) 0   75% / 100% 1px no-repeat,
        linear-gradient(to left,  rgba(255, 255, 255, 0.18) 5px, transparent 5px) 100% 25% / 100% 1px no-repeat,
        linear-gradient(to left,  rgba(255, 255, 255, 0.18) 5px, transparent 5px) 100% 50% / 100% 1px no-repeat,
        linear-gradient(to left,  rgba(255, 255, 255, 0.18) 5px, transparent 5px) 100% 75% / 100% 1px no-repeat;
}
/* Bipolar center detent — extra emphasized hairline + soft halo at
   the visual center of the track so the user can see "this fader is
   at neutral" at a glance. Only applied to .fader-bipolar columns
   (the three hue-offset faders). */
.fader-bipolar .fader-track-wrap::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 1px;
    background: rgba(180, 140, 255, 0.55);
    box-shadow: 0 0 4px rgba(180, 140, 255, 0.35);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

/* The native input — rotated -90deg via transform so it visually
   fills the wrapper as a vertical fader. Pre-rotation dimensions
   (170 × 32) become post-rotation (32 × 170). Input height is
   intentionally matched to the thumb's pre-rotation height (32px)
   so after rotation the cap's center lands exactly on the input's
   center → which is the wrap's center → which is the track's
   visual centerline. Asymmetric input/thumb heights cause a visible
   horizontal offset (cap drifts to one side of the slot). */
.lumi-console input[type="range"] {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 170px;
    height: 32px;
    transform: translate(-50%, -50%) rotate(-90deg);
    transform-origin: center;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    cursor: default;
    margin: 0;
    padding: 0;
}

/* Track — visual ~6px wide vertical slot. Recessed via inset shadow.
   Pre-rotation: this is the runnable-track at 6px tall. */
.lumi-console input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.55),
        rgba(255, 255, 255, 0.07),
        rgba(0, 0, 0, 0.55)
    );
    border-radius: 3px;
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.7),
        0 1px 0 rgba(255, 255, 255, 0.04);
    transition: background 250ms ease-out, box-shadow 250ms ease-out;
}
.lumi-console input[type="range"]::-moz-range-track {
    height: 6px;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.55),
        rgba(255, 255, 255, 0.07),
        rgba(0, 0, 0, 0.55)
    );
    border-radius: 3px;
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.7),
        0 1px 0 rgba(255, 255, 255, 0.04);
    transition: background 250ms ease-out, box-shadow 250ms ease-out;
}

/* Cap (thumb) — chunky rectangular fader cap. Pre-rotation it lives
   as 14px wide × 32px tall; post-rotation it's a 32×14 cap that
   slides up and down the visual track. The repeating-linear-gradient
   adds horizontal grip ridges (3 stripes); the linear-gradient
   underneath gives it the metallic curvature. The inset highlight +
   shadow + drop shadow give 3D depth. */
.lumi-console input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 32px;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0, transparent 9px,
            rgba(0, 0, 0, 0.45) 9px, rgba(0, 0, 0, 0.45) 10px
        ),
        linear-gradient(
            to right,
            #1a1a20 0%,
            #353540 28%,
            #4d4d58 50%,
            #353540 72%,
            #1a1a20 100%
        );
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5),
        0 2px 5px rgba(0, 0, 0, 0.6);
    /* Center the cap on the input's vertical axis (= track centerline).
       Input height 32, track height 6 → track top at y=13.
       Thumb height 32; for thumb center at y=16 (input center):
       margin-top = 16 - 32/2 - 13 = -13. */
    margin-top: -13px;
    transition: background 250ms ease-out, box-shadow 250ms ease-out, border-color 250ms ease-out;
}
.lumi-console input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 32px;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0, transparent 9px,
            rgba(0, 0, 0, 0.45) 9px, rgba(0, 0, 0, 0.45) 10px
        ),
        linear-gradient(
            to right,
            #1a1a20 0%,
            #353540 28%,
            #4d4d58 50%,
            #353540 72%,
            #1a1a20 100%
        );
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5),
        0 2px 5px rgba(0, 0, 0, 0.6);
    transition: background 250ms ease-out, box-shadow 250ms ease-out, border-color 250ms ease-out;
}

/* Ghost-touch active state. Cap glows the emotion/mood color (via
   --lumi-pulse-color set by show.js / KL-64); track fills cyan; the
   whole column gets a soft drop-shadow halo so the eye follows. */
.lumi-console .fader-column.ghost-touching {
    filter: drop-shadow(0 0 10px var(--lumi-pulse-color, rgba(201, 70, 255, 0.55)));
}
.lumi-console .fader-column.ghost-touching input[type="range"]::-webkit-slider-runnable-track {
    background: linear-gradient(
        to bottom,
        rgba(0, 229, 200, 0.4),
        rgba(0, 229, 200, 0.75),
        rgba(0, 229, 200, 0.4)
    );
    box-shadow:
        inset 0 0 6px rgba(0, 229, 200, 0.6),
        0 0 8px rgba(0, 229, 200, 0.4);
}
.lumi-console .fader-column.ghost-touching input[type="range"]::-moz-range-track {
    background: linear-gradient(
        to bottom,
        rgba(0, 229, 200, 0.4),
        rgba(0, 229, 200, 0.75),
        rgba(0, 229, 200, 0.4)
    );
    box-shadow:
        inset 0 0 6px rgba(0, 229, 200, 0.6),
        0 0 8px rgba(0, 229, 200, 0.4);
}
.lumi-console .fader-column.ghost-touching input[type="range"]::-webkit-slider-thumb {
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0, transparent 9px,
            rgba(0, 0, 0, 0.4) 9px, rgba(0, 0, 0, 0.4) 10px
        ),
        linear-gradient(
            to right,
            #382850 0%,
            #6b5090 28%,
            #f3e8ff 50%,
            #6b5090 72%,
            #382850 100%
        );
    border-color: var(--cyan, #00e5c8);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4),
        0 0 14px var(--lumi-pulse-color, rgba(201, 70, 255, 0.7)),
        0 0 4px rgba(0, 229, 200, 0.8);
}
.lumi-console .fader-column.ghost-touching input[type="range"]::-moz-range-thumb {
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0, transparent 9px,
            rgba(0, 0, 0, 0.4) 9px, rgba(0, 0, 0, 0.4) 10px
        ),
        linear-gradient(
            to right,
            #382850 0%,
            #6b5090 28%,
            #f3e8ff 50%,
            #6b5090 72%,
            #382850 100%
        );
    border-color: var(--cyan, #00e5c8);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4),
        0 0 14px var(--lumi-pulse-color, rgba(201, 70, 255, 0.7)),
        0 0 4px rgba(0, 229, 200, 0.8);
}
.lumi-console .fader-column.ghost-touching .fader-readout {
    color: #f3e8ff;
    text-shadow: 0 0 6px rgba(0, 229, 200, 0.6);
}
.lumi-console .fader-column.ghost-touching .fader-label {
    color: #f3e8ff;
    text-shadow: 0 0 4px rgba(0, 229, 200, 0.4);
}

/* Stats */
.stats { margin-bottom: 1rem; }
.stats h2 { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--accent); }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.stat {
    background: var(--surface);
    border-radius: 0.3rem;
    padding: 0.5rem;
    text-align: center;
}

.stat-label { font-size: 0.65rem; color: var(--text-dim); }
.stat-value { font-size: 1rem; font-weight: 700; }

/* Settings */
.settings { margin-bottom: 1rem; }
.settings h2 { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--accent); }

.settings-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 0 0.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
}
.settings-footer .brand-word { font-size: 0.7rem; }
.settings-footer-tagline { font-style: italic; }
/* KL-78: small Komar Labs parent-brand wordmark in the settings
   footer. Sits between the tagline and the copyright; inherits
   currentColor so the dim footer text color carries through. */
.settings-footer-kl {
    display: inline-block;
    height: 11px;
    width: auto;
    margin: 0 0.25rem;
    opacity: 0.7;
    vertical-align: middle;
}
.settings-footer-upgrade {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: transform 0.15s, box-shadow 0.2s;
}
.settings-footer-upgrade:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(201, 70, 255, 0.35);
    color: #fff;
}

.setting-row {
    background: var(--surface);
    border-radius: 0.5rem;
    padding: 0.8rem;
    /* KL-90: small gap between stacked cards so they read as discrete
       items instead of merging into a single visual block. Last-child
       reset suppresses the trailing gap so the section ends cleanly. */
    margin-bottom: 0.375rem;
}
.setting-row:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.setting-name {
    font-size: 0.8rem;
    font-weight: 700;
}

.setting-status {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.setting-status.set-env { color: #4caf50; }
.setting-status.set-config { color: #4caf50; }
.setting-status.set-secrets { color: var(--accent); }
.setting-status.unset { color: var(--text-dim); }
.setting-status.ok { color: #4caf50; font-weight: 700; }
.setting-status.warn { color: var(--flash, #f5a623); font-weight: 700; }
.setting-status.error { color: var(--danger); font-weight: 700; }
.setting-status.info { color: var(--text-dim); }
/* KL-142: in-flight + failure status for the catalog refresh row.
   `is-busy` shows accent-color + a soft pulse; `is-error` borrows
   the danger token used elsewhere on the page. */
.setting-status.is-busy {
    color: var(--accent);
    animation: setting-status-pulse 1.4s ease-in-out infinite;
}
.setting-status.is-error { color: var(--danger); }
@keyframes setting-status-pulse { 50% { opacity: 0.55; } }

.setting-controls {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.setting-controls input[type="password"] {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.6rem;
    border-radius: 0.3rem;
    font-family: inherit;
    font-size: 0.75rem;
    min-width: 0;
}

.setting-controls input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
}

.setting-controls .action-btn {
    flex: 0 0 auto;
    padding: 0.5rem 0.8rem;
    font-size: 0.7rem;
}

.setting-hint {
    font-size: 0.65rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* Inline "help" link tucked under a setting-row. macOS audio re-trigger
   lives here; future per-setting help links should follow the same style. */
.setting-help-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--accent);
    text-decoration: none;
    opacity: 0.75;
    transition: opacity 0.15s;
}
.setting-help-link:hover {
    opacity: 1;
    text-decoration: underline;
}

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

/* KL-156: padded up so dropdowns align visually with the action-btn
   family they sit next to in setting-rows (action-btn is 0.8rem padding,
   0.8rem font, 0.5rem radius). The select used to be noticeably tighter
   than its sibling controls, which read as untreated.

   `appearance: none` is REQUIRED — without it, WebKit/Chrome on macOS
   render <select> with the native control which ignores CSS padding,
   font-size, and border-radius. The custom SVG chevron replaces the
   native disclosure arrow we just opted out of; padding-right reserves
   space for it. */
.setting-select {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 2rem 0.6rem 0.75rem;
    border-radius: 0.4rem;
    font-family: inherit;
    font-size: 0.8rem;
    min-width: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%238a8699' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    cursor: pointer;
}
.setting-select:focus {
    outline: none;
    border-color: var(--accent);
}
/* Disabled selects keep the visual weight (intentional lock, not
   broken). Lighten cursor to telegraph state. */
.setting-select:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* KL-156: signal meter sized as a real diagnostic — 2.7rem reads at
   a glance from across the room during a live setup, the colored fill
   actually feels like a meter rather than a hairline indicator. */
.signal-meter {
    position: relative;
    height: 2.7rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    overflow: hidden;
    margin-bottom: 0.6rem;
}
.signal-meter-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: linear-gradient(90deg, #4caf50 0%, #a8d84a 60%, var(--flash) 85%, var(--danger) 100%);
    transition: width 0.08s linear;
}
.signal-meter-fill.silent {
    background: var(--surface-2);
}
.signal-meter-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    /* KL-156: bumped from 0.6rem to read at a glance against the
       2.7rem-tall meter container. */
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

.setting-name {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.icon-btn {
    flex: 0 0 auto;
    padding: 0 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.3rem;
    color: var(--text-dim);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn.active { color: var(--accent); border-color: var(--accent); }

.setting-warning,
.setting-result {
    font-size: 0.65rem;
    line-height: 1.4;
    margin-bottom: 0.4rem;
}
.setting-warning { color: var(--flash); }
.setting-result.ok { color: #4caf50; }
.setting-result.err { color: var(--danger); }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}
.modal-overlay[hidden] { display: none; }

.modal-dialog {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 1.2rem 1.2rem 1rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.modal-dialog h3 {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 0.8rem;
    padding-right: 1.5rem;
}
.modal-close {
    position: absolute;
    top: 0.4rem;
    right: 0.6rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}
.modal-close:hover { color: var(--text); }

.modal-steps {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text);
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}
.modal-steps li { margin-bottom: 0.3rem; }
.modal-steps code {
    background: var(--surface-2);
    padding: 0.05rem 0.3rem;
    border-radius: 0.2rem;
    font-size: 0.85em;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.modal-actions .action-btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.8rem;
    text-decoration: none;
    text-align: center;
}
.modal-primary {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

.modal-wide { max-width: 560px; }

.modal-intro {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.8rem;
    line-height: 1.5;
}
.modal-intro strong { color: var(--text); }
.modal-intro-muted {
    font-size: 0.78rem;
    font-style: italic;
    color: var(--text-dim);
    opacity: 0.85;
    margin-bottom: 1rem;
}

/* OS-contextual helper line under the audio picker (Settings tab and
   the wizard share this style). Quieter than a regular .setting-hint
   so it reads as a footnote. */
.os-helper {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.4rem;
}
.os-helper a { color: var(--accent, #8ab4ff); }

/* KL-97: tag exactly one option per OS as the recommended pick so
   first-run users have a visual anchor in the audio dropdown. Native
   <option> styling is limited (browsers ignore most rules), but
   color + weight reliably stick in WKWebView and Chrome/Edge. */
.setting-select option.option-recommended {
    font-weight: 600;
    color: var(--success, #7aeba1);
}

/* Log tab — free-wrapping entries, newest on top. The panel itself is
   already a scroll container (absolute .tab-panel), so the entries
   list just flows naturally. */
.log-panel {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    height: 100%;
}
.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.log-header h2 { font-size: 0.9rem; color: var(--accent); letter-spacing: 0.05em; }
.log-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    flex: 0 0 auto;
    max-width: 7rem;
    padding: 0.45rem 0.8rem;
}
.log-copy-icon { font-size: 1rem; line-height: 1; }

.log-entries {
    background: var(--surface);
    border-radius: 0.3rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.78rem;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.log-entry {
    padding: 0.2rem 0;
    border-bottom: 1px solid var(--bg);
    word-break: break-word;
    white-space: pre-wrap;
}
.log-entry:last-child { border-bottom: none; }
/* Director AI config tab */
.director-config {
    background: var(--surface);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.director-config > h2 {
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
}

/* Lumi attribution under the AI Director feature heading. Subtler
   than body copy — sets up the persona without competing with the
   technical settings underneath. */
.director-config .director-subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1.1rem;
    line-height: 1.5;
}
.director-config .director-subtitle strong {
    color: var(--accent);
    font-weight: 700;
}

.director-config .setting-row {
    margin-bottom: 1rem;
}

.director-config .toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text);
    cursor: pointer;
}

.director-config .toggle input[type="checkbox"] {
    accent-color: var(--accent);
    width: 1rem;
    height: 1rem;
}

/* --- Director status banner (KL-48) --- */
.director-status-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    border-radius: 0.4rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.director-status-banner .director-status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--text-muted, #5a5670);
    flex-shrink: 0;
}
.director-status-banner[data-state="relay"] .director-status-dot,
.director-status-banner[data-state="byok"] .director-status-dot {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
}
.director-status-banner[data-state="off"] .director-status-dot {
    background: var(--text-muted, #5a5670);
}
.director-status-banner[data-state="warn"] .director-status-dot {
    background: #f5a623;
}
.director-status-banner[data-state="err"] .director-status-dot {
    background: #ef4444;
}
.director-status-banner[data-state="loading"] .director-status-dot {
    background: var(--accent);
    animation: director-status-pulse 1.1s ease-in-out infinite;
}
@keyframes director-status-pulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1.0; }
}

/* --- Director cards (KL-48) --- */
.director-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}
.director-cards-heading {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 0 0 0.25rem;
}
.director-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    align-items: flex-start;
}
.director-card:hover {
    border-color: var(--accent);
}
.director-card input[type="radio"] {
    accent-color: var(--accent);
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.director-card:has(input[type="radio"]:checked) {
    border-color: var(--accent);
    background: rgba(201, 70, 255, 0.06);
}
.director-card-body {
    flex: 1;
    min-width: 0;
}
.director-card-head {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    margin-bottom: 0.2rem;
}
.director-card-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}
.director-card-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: rgba(201, 70, 255, 0.14);
    padding: 0.1rem 0.45rem;
    border-radius: 0.2rem;
}
.director-card-desc {
    color: var(--text-dim);
    font-size: 0.82rem;
    line-height: 1.5;
    margin: 0;
}

/* BYOK card body — only visible when its radio is selected. */
.director-byok-fields {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.director-byok-current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}
.director-byok-current code {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    padding: 0.15rem 0.4rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--text);
}
.director-byok-input-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.director-byok-input-row input {
    flex: 1;
    min-width: 0;
}
.director-byok-status {
    font-size: 0.78rem;
    min-height: 1.05rem;
    color: var(--text-dim);
}
.director-byok-status.checking { color: var(--text-dim); font-style: italic; }
.director-byok-status.pending  { color: var(--text-dim); }
.director-byok-status.ok       { color: #22c55e; }
.director-byok-status.err      { color: #ef4444; }
.director-byok-hint {
    font-size: 0.75rem;
    color: var(--text-muted, var(--text-dim));
    line-height: 1.5;
}
.director-byok-hint a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent);
}
.director-byok-hint code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85em;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.2rem;
    padding: 0 0.3rem;
}

/* Advanced disclosure inside the BYOK card — surfaces the model
   override input. Default Haiku; type whatever Anthropic accepts
   (Sonnet, Opus, custom IDs). Auto-saves on debounce. */
.director-byok-advanced {
    margin-top: 0.4rem;
}
.director-byok-advanced > summary {
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--text-dim);
    padding: 0.3rem 0;
    user-select: none;
    list-style: none;
}
.director-byok-advanced > summary::-webkit-details-marker { display: none; }
.director-byok-advanced > summary::before {
    content: "▸ ";
    color: var(--accent);
    margin-right: 0.2rem;
    display: inline-block;
}
.director-byok-advanced[open] > summary::before { content: "▾ "; }
.director-byok-advanced > summary:hover { color: var(--text); }
.director-byok-advanced-body {
    margin-top: 0.4rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.director-byok-model-status {
    font-size: 0.78rem;
    min-width: 5rem;
    color: var(--text-dim);
    align-self: center;
}
.director-byok-model-status.checking { font-style: italic; }
.director-byok-model-status.ok       { color: #22c55e; }
.director-byok-model-status.err      { color: #ef4444; }

/* Help tab — hero card with the Send Feedback button. */
.help-hero {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 1.4rem 1.6rem;
    margin: 0.4rem 0 1.5rem;
    max-width: 760px;
}
.help-hero h1 {
    margin: 0 0 0.6rem;
    font-size: 1.4rem;
    color: var(--accent);
}
.help-hero p {
    margin: 0 0 1rem;
    color: var(--text);
    line-height: 1.5;
    font-size: 0.95rem;
}
.help-hero .help-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}
.help-hero .feedback-btn {
    background: var(--accent);
    color: #14111c;
    border: 0;
    border-radius: 0.4rem;
    padding: 0.7rem 1.2rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
}
.help-hero .feedback-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.help-hero .secondary-line {
    color: var(--text-dim);
    font-size: 0.8rem;
}
.help-hero .secondary-line strong { color: var(--text); }

/* --- Help tab: diagnostics card (KL-34) --- */
.help-diagnostics .diagnostics-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.4rem;
}
.diagnostics-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}
.diagnostics-label {
    color: var(--text-dim);
    font-size: 0.85rem;
    min-width: 7.5rem;
}
.diagnostics-value {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 0.3rem;
    padding: 0.25rem 0.55rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    color: var(--text);
    user-select: all;
    word-break: break-all;
}
.diagnostics-copy {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 0.3rem;
    padding: 0.2rem 0.6rem;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s;
}
.diagnostics-copy:hover:not(:disabled) {
    color: var(--accent);
    border-color: var(--accent);
}
.diagnostics-copy:disabled { opacity: 0.5; cursor: not-allowed; }
.diagnostics-copy.copied {
    color: var(--accent);
    border-color: var(--accent);
}

/* Help + About tab buttons get the same accent treatment when active
   as the main tab-rail buttons (they live outside .tab-rail in the DOM). */
.shell-help.tab-btn,
.shell-about.tab-btn {
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    border-left: 3px solid transparent;
    width: 100%;
    text-align: left;
}
.shell-help.tab-btn.active,
.shell-about.tab-btn.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--surface-2);
}

/* --- About tab (KL-42) --- */
.about-hero .about-tagline {
    background: linear-gradient(90deg,
        #ff5d5d 0%, #ffa05d 16%, #ffd75d 33%,
        #5dff8c 50%, #5dd9ff 66%, #b25dff 83%, #ff5db8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.05rem;
    font-weight: 600;
    margin: -0.2rem 0 0.9rem;
}
.about-link-line {
    margin-top: 0.4rem;
    font-size: 0.85rem;
}
.about-link-line a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent);
}
.about-link-line a:hover { filter: brightness(1.15); }
.about-section-title {
    margin: 0.2rem 0 0.5rem;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.about-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}
.about-list li {
    padding: 0.3rem 0;
    color: var(--text);
    font-size: 0.95rem;
}
.about-list li strong { color: var(--text); }
.about-supporters-cta {
    margin: 0.2rem 0 0;
    color: var(--text-dim);
    font-size: 0.85rem;
}
.about-link-btn {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--accent);
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    text-decoration: underline dashed;
    text-underline-offset: 2px;
}
.about-link-btn:hover { filter: brightness(1.15); }
.about-acks-body {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.55;
    margin: 0 0 0.9rem;
}
/* KL-177: About-panel early-access strip. Sits above the copyright,
   uses the same magenta as the sidebar pill so the visual link to
   "you're testing" reads at a glance. */
.about-early-access {
    color: var(--text-dim);
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.75rem;
    border-left: 3px solid #ff2d8a;
    background: rgba(255, 45, 138, 0.08);
    border-radius: 0 4px 4px 0;
}
.about-ea-tag {
    display: inline-block;
    margin-right: 0.4rem;
    padding: 0.05rem 0.4rem;
    background: #ff2d8a;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 999px;
    vertical-align: 0.05rem;
}
.about-copyright {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin: 0;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.about-kl-wordmark {
    height: 13px;
    width: auto;
}
/* KL-101: idle / quota paused-pill + marathon countdown. The pill sits
   inline next to the director on/off toggle so users can see the
   distinction between "off" (their choice) and "paused" (our choice). */
.director-paused-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 180, 100, 0.12);
    border: 1px solid rgba(255, 180, 100, 0.4);
    font-size: 0.8rem;
    color: #f0c890;
}
.director-paused-pill .director-paused-label { letter-spacing: 0.02em; }
.director-paused-pill .action-btn {
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
}
.director-marathon-active {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent, #b48cff);
    font-size: 0.85rem;
}
.director-extras {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Tablet+ — fill the window edge-to-edge; desktop-app feel, not a centered web page. */
@media (min-width: 768px) {
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .brand { font-size: 2.4rem; }
}

} /* end @layer base */
