/* ════════════════════════════════════════════════════════════════════
   AUDIOBoxx — Audio Fingerprinting Studio stylesheet
   AUDIOBoxx-inspired glass-morphism on top of TailwindCSS.
   Tailwind utilities handle layout/spacing; this file themes bespoke
   classes used throughout index.html + app.js.
   ════════════════════════════════════════════════════════════════════ */

:root {
    --bg: #0a0a0f;
    --panel: rgba(255, 255, 255, 0.05);
    --panel-2: rgba(255, 255, 255, 0.04);
    --text: #e5e7eb;
    --muted: #9ca3af;
    --accent: #818cf8;          /* indigo-400 */
    --accent-2: #c4b5fd;        /* violet-300 */
    --success: #4ade80;         /* green-400 */
    --warn: #fbbf24;            /* amber-400 */
    --danger: #f87171;          /* red-400 */
    --border: rgba(255, 255, 255, 0.1);
    --border-2: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

/* Reserve the vertical scrollbar gutter on every tab so the tab bar and
   main content never shift horizontally when switching panels. */
html { scrollbar-gutter: stable; overflow-y: scroll; }

html, body {
    margin: 0;
    padding: 0;
    background: #0a0a0f;
    color: var(--text);
    font: 14px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Background glow orbs (fixed, behind content) */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 9999px;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}
body::before { width: 600px; height: 600px; background: rgba(99, 102, 241, 0.15); top: -200px; left: -200px; }
body::after  { width: 500px; height: 500px; background: rgba(168, 85, 247, 0.12); bottom: -150px; right: -150px; }

a { color: var(--accent); }
code { background: rgba(255, 255, 255, 0.08); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* ── Glass surfaces ────────────────────────────────────────────────── */
.glass {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
}
.glass-light {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-2);
}

/* ── Top bar / brand ───────────────────────────────────────────────── */
.topbar h1 { margin: 0; }
.topbar p { margin: 0; }
/* Default header inner width matches Tailwind's max-w-7xl (1280px). */
.topbar-inner { max-width: 80rem; width: 100%; }
/* When a wide panel is active, main expands to 1400px — match it here
   so the brand/logo and stats align with the sticky tab bar below. */
body:has(.panel.panel-wide.active) .topbar-inner { max-width: 1400px; }

.brand-text-block { min-width: 0; line-height: 1.35; }

/* Dot-matrix LED scroll display (header) */
.header-led {
    margin-top: 2px;
    max-width: min(36vw, 240px);
    min-width: 120px;
}
.header-led-bezel {
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}
.header-led-canvas {
    display: block;
    width: 100%;
    height: auto;
    background: transparent;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .header-led-canvas { opacity: 0.95; }
}

/* ── Animated brand mark (Cursor Glass–style shimmer + live EQ) ───── */
.abx-logo-shell {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #6366f1 100%);
    background-size: 220% 220%;
    animation: abx-logo-gradient 7s ease infinite, abx-logo-glow 3.5s ease-in-out infinite;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.abx-logo-shell::after {
    content: '';
    position: absolute;
    inset: -60%;
    background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.42) 50%, transparent 58%);
    animation: abx-logo-shimmer 3.4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
.abx-logo-shell .abx-logo-svg {
    position: relative;
    z-index: 1;
    display: block;
}
.abx-logo-shell--header { width: 40px; height: 40px; border-radius: 12px; }
.abx-logo-shell--header .abx-logo-svg { width: 30px; height: 30px; }
.abx-logo-shell--sm { width: 34px; height: 34px; border-radius: 9px; }
.abx-logo-shell--sm .abx-logo-svg { width: 22px; height: 22px; }
.abx-logo-shell--md { width: 60px; height: 60px; border-radius: 14px; }
.abx-logo-shell--md .abx-logo-svg { width: 38px; height: 38px; }
.abx-logo-shell--lg { width: 72px; height: 72px; border-radius: 18px; }
.abx-logo-shell--lg .abx-logo-svg { width: 52px; height: 52px; }

.abx-logo-wave--1 { animation: abx-logo-wave-pulse 2.6s ease-in-out infinite; }
.abx-logo-wave--2 { animation: abx-logo-wave-pulse 2.6s ease-in-out infinite 0.22s; }
.abx-logo-wave--3 { animation: abx-logo-wave-pulse 2.6s ease-in-out infinite 0.44s; }
.abx-logo-bar {
    transform-box: fill-box;
    transform-origin: center bottom;
}
.abx-logo-bar--1 { animation: abx-logo-eq 0.95s ease-in-out infinite; }
.abx-logo-bar--2 { animation: abx-logo-eq 0.95s ease-in-out infinite 0.14s; }
.abx-logo-bar--3 { animation: abx-logo-eq 0.95s ease-in-out infinite 0.28s; }
.abx-logo-core {
    transform-box: fill-box;
    transform-origin: center;
    animation: abx-logo-core-pulse 2.2s ease-in-out infinite;
}

@keyframes abx-logo-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes abx-logo-shimmer {
    0% { transform: translateX(-65%) rotate(14deg); opacity: 0; }
    18% { opacity: 1; }
    52% { transform: translateX(65%) rotate(14deg); opacity: 1; }
    82% { opacity: 0; }
    100% { transform: translateX(120%) rotate(14deg); opacity: 0; }
}
@keyframes abx-logo-glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.08); }
}
@keyframes abx-logo-wave-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}
@keyframes abx-logo-eq {
    0%, 100% { transform: scaleY(0.5); opacity: 0.72; }
    50% { transform: scaleY(1); opacity: 1; }
}
@keyframes abx-logo-core-pulse {
    0%, 100% { transform: scale(1); opacity: 0.88; }
    50% { transform: scale(1.2); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .abx-logo-shell,
    .abx-logo-shell::after,
    .abx-logo-wave--1,
    .abx-logo-wave--2,
    .abx-logo-wave--3,
    .abx-logo-bar--1,
    .abx-logo-bar--2,
    .abx-logo-bar--3,
    .abx-logo-core {
        animation: none !important;
    }
}

/* ── Tabs (pill style like AUDIOBoxx) ──────────────────────────────── */
.tabs { border: none; }

/* Static, non-reflowing tab bar — identical layout on every tab,
   sticky below the top header so it stays visible while scrolling. */
.tabs-static {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 6px;
    margin: 0 0 32px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    position: sticky;
    top: 72px;
    z-index: 40;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}
.tabs-static::-webkit-scrollbar { height: 6px; }
.tabs-static::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.tabs-static .tab {
    flex: 1 1 0;
    min-width: max-content;
    white-space: nowrap;
    text-align: center;
    position: relative;
    transition:
        background 0.28s ease,
        color 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease,
        transform 0.22s ease;
}
.tab.tab-active,
.tab.active {
    background: linear-gradient(
        180deg,
        rgba(99, 102, 241, 0.32) 0%,
        rgba(99, 102, 241, 0.14) 100%
    );
    color: #e0e7ff !important;
    border-color: rgba(129, 140, 248, 0.55) !important;
    box-shadow:
        0 4px 18px rgba(99, 102, 241, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}
.tab.tab-active::after,
.tab.active::after {
    content: '';
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: 5px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #c7d2fe, transparent);
    animation: tabActiveLine 2.6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes tabActiveLine {
    0%, 100% { opacity: 0.45; transform: scaleX(0.85); }
    50% { opacity: 1; transform: scaleX(1); }
}
.tab.tab-inactive {
    color: rgba(255, 255, 255, 0.52);
    border-color: transparent;
}
.tab.tab-inactive:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-0.5px);
}

/* Active-tab icons: one calm motion + light semantic tint (no spin/bounce) */
@keyframes tabIconFloat {
    0%, 100% { transform: translateY(0); opacity: 0.88; }
    50% { transform: translateY(-2px); opacity: 1; }
}
.tab.tab-active i[class*="tab-icon-"],
.tab.active i[class*="tab-icon-"] {
    display: inline-block;
    animation: tabIconFloat 2.8s ease-in-out infinite;
}
.tab.tab-active .tab-icon-ov  { color: #a5b4fc; }
.tab.tab-active .tab-icon-fp  { color: #c4b5fd; }
.tab.tab-active .tab-icon-id  { color: #93c5fd; }
.tab.tab-active .tab-icon-db  { color: #a5b4fc; }
.tab.tab-active .tab-icon-link { color: #67e8f9; }
.tab.tab-active .tab-icon-mon { color: #86efac; }
.tab.tab-active .tab-icon-rec { color: #fca5a5; }
.tab.tab-active .tab-icon-map { color: #fcd34d; }
.tab.tab-active .tab-icon-rpt { color: #c4b5fd; }
.tab.tab-active .tab-icon-about { color: #e9d5ff; }

/* ── Panels (tab content) ──────────────────────────────────────────── */
.panel { display: none; position: relative; z-index: 1; }
.panel.active {
    display: block;
    animation: panelEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes panelEnter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .tabs-static .tab,
    .tab.tab-active,
    .tab.active,
    .tab.tab-active::after,
    .tab.active::after,
    .tab.tab-active i[class*="tab-icon-"],
    .tab.active i[class*="tab-icon-"],
    .panel.active {
        animation: none;
        transition: none;
    }
    .tab.tab-active,
    .tab.active { transform: none; }
}

/* ── Status pulse: header server dot + active monitors/recordings ─── */
#stat-server, #mon-sse {
    display: inline-block;
    animation: statusPulse 1.6s ease-in-out infinite;
    transform-origin: center;
}
.stat-card.is-active .ic-pill {
    animation: statusPulse 1.4s ease-in-out infinite;
    transform-origin: center;
}
@keyframes statusPulse {
    0%, 100% { transform: scale(1);    text-shadow: 0 0 0   currentColor; filter: drop-shadow(0 0 0   currentColor); opacity: 1; }
    50%      { transform: scale(1.18); text-shadow: 0 0 10px currentColor; filter: drop-shadow(0 0 8px currentColor); opacity: .75; }
}

h2 { font-size: 22px; font-weight: 700; margin: 0 0 6px; color: #fff; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 600; color: rgba(255,255,255,.8); letter-spacing: .2px; }
.hint { color: var(--muted); margin: 0 0 18px; font-size: 13px; }

/* ── Forms and inputs ──────────────────────────────────────────────── */
.form {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.grid .span-2 { grid-column: span 2; }

label {
    display: flex; flex-direction: column; gap: 6px;
    font-size: 11px; color: var(--muted);
    text-transform: uppercase; letter-spacing: .6px; font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.6rem;
    padding: 0.55rem 0.9rem;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    box-sizing: border-box;
    min-height: 38px;
}
/* Selects placed in inline control bars (filters, pickers) should size to
   content, not stretch like form-field selects do. */
.monitor-controls select,
.inline-check select { width: auto; min-height: 0; }
input:focus, select:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
select option { background: #1a1a2e; color: var(--text); }
input[type="date"] { color-scheme: dark; }

/* ── Buttons ───────────────────────────────────────────────────────── */
button.primary,
button.secondary,
button.success,
button.danger,
a.secondary,
a.primary {
    border: 1px solid transparent;
    cursor: pointer;
    border-radius: 0.65rem;
    padding: 0.55rem 1.1rem;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: opacity .2s, transform .1s, background .2s;
    text-decoration: none;
    display: inline-block;
}
button.primary, a.primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}
button.primary:hover, a.primary:hover { opacity: .88; transform: translateY(-1px); }
button.primary:active { transform: translateY(0); }
button.primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
button.secondary, a.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
button.secondary:hover, a.secondary:hover { background: rgba(255, 255, 255, 0.14); }
button.success, a.success {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
button.success:hover { background: rgba(34, 197, 94, 0.25); }

.status { margin-top: 12px; font-size: 13px; color: var(--muted); min-height: 18px; }
.status.ok  { color: var(--success); }
.status.err { color: var(--danger); }
.stat-match { color: var(--success); font-weight: 600; }
.stat-nomatch { color: var(--warn); font-weight: 600; }
.stat-error { color: var(--danger); font-weight: 600; }
.progress-label .stat-match,
.progress-label .stat-nomatch,
.progress-label .stat-error { font-weight: 600; }

/* ── Drop zones ────────────────────────────────────────────────────── */
.drop {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    margin-bottom: 16px;
}
.drop:hover, .drop.dragover {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.05);
}
.drop-inner { display: flex; flex-direction: column; gap: 6px; }
.drop strong { color: #fff; font-size: 14px; }
.drop span { color: var(--muted); font-size: 12px; }
.drop .filename { color: var(--accent); font-weight: 600; margin-top: 4px; }

/* ── Result cards ──────────────────────────────────────────────────── */
.results { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.result {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-2);
    border-radius: 0.9rem;
    padding: 14px 18px;
    display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
    transition: border-color .2s;
}
.result:hover { border-color: rgba(99, 102, 241, 0.3); }
.result.top { border-color: rgba(34, 197, 94, 0.5); box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12); }
.result .title { font-weight: 700; color: #fff; }
.result .artist { color: var(--muted); font-size: 12px; }
.result .badge { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.result .conf { text-align: right; }
.result .conf .val { font-size: 20px; font-weight: 700; color: var(--accent); }
.result .conf .sub { font-size: 11px; color: var(--muted); }
.result .meta {
    font-size: 12px; color: var(--muted); grid-column: 1 / -1;
    border-top: 1px solid var(--border-2); padding-top: 8px;
    display: flex; gap: 16px; flex-wrap: wrap;
}
.result.empty { justify-content: center; color: var(--muted); }

/* ── Library toolbar (Refresh / Search / Export) ─────────────────────
 * Sits above the reference-library table. Wraps cleanly on narrow
 * viewports. The clear-search × button overlays the right edge of the
 * search input; the count chip on the far right tells the user how
 * many tracks are showing vs. the unfiltered total. */
.library-toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 6px 0 0;
}
.library-toolbar > button { flex: 0 0 auto; }
.library-search {
    position: relative; flex: 1 1 240px; min-width: 200px; max-width: 460px;
}
.library-search input {
    width: 100%;
    padding: 7px 28px 7px 12px;
    background: rgba(255,255,255,.05); color: #fff;
    border: 1px solid var(--border-2); border-radius: 8px;
    font-size: 13px;
}
.library-search input:focus {
    outline: none; border-color: rgba(129,140,248,.55);
    box-shadow: 0 0 0 2px rgba(129,140,248,.20);
}
.library-search .library-search-clear {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: transparent; border: 0; color: var(--muted);
    width: 22px; height: 22px; border-radius: 50%;
    font-size: 14px; line-height: 1; cursor: pointer;
}
.library-search .library-search-clear:hover {
    background: rgba(255,255,255,.08); color: #fff;
}
.library-count { margin-left: auto; font-size: 11px; }

/* ── Tables ────────────────────────────────────────────────────────── */
.library {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.8rem;
    overflow: hidden;
    border: 1px solid var(--border-2);
}
.library th, .library td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-2);
    font-size: 13px;
}
.library th {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: .8px;
    background: rgba(255, 255, 255, 0.05);
}
.library tbody tr { transition: background .15s; }
.library tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
.library tbody tr:last-child td { border-bottom: none; }
.library td.empty { text-align: center; color: var(--muted); padding: 24px; }
.library button.delete {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 12px;
}
.library button.delete:hover { background: rgba(239, 68, 68, 0.25); }

/* ── Toast ─────────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 15, 30, 0.95);
    backdrop-filter: blur(12px);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 10px 16px;
    font-size: 13px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity .2s, transform .2s;
    pointer-events: none;
    z-index: 9999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast.ok { border-color: rgba(34, 197, 94, 0.4); }
.toast.err { border-color: rgba(239, 68, 68, 0.4); }

/* ── License server notification popup ─────────────────────────────── */
.license-notif-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(6px);
}
.license-notif-overlay.is-hidden { display: none; }
.license-notif-card {
    width: min(520px, 100%);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
    padding: 24px;
}
.license-notif-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}
.license-notif-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    font-size: 22px;
    flex-shrink: 0;
}
.license-notif-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}
.license-notif-meta {
    margin: 4px 0 0;
    font-size: 12px;
    color: #64748b;
}
.license-notif-message {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.65;
    color: #334155;
    white-space: pre-line;
}
.license-notif-ok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.license-notif-ok:hover { filter: brightness(1.05); }
.license-notif-card--success { border-color: rgba(34, 197, 94, 0.45); }
.license-notif-card--warn { border-color: rgba(245, 158, 11, 0.55); }

/* ── Progress (bulk scans) ─────────────────────────────────────────── */
.progress-wrap { margin-top: 12px; }

/* Header-attached compact progress pill (folder scans / bulk fingerprint).
   Sits inline in the top bar between the brand block and the stats block. */
.header-progress {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(99,102,241,0.18), rgba(139,92,246,0.18));
    border: 1px solid var(--border-2);
    font-size: 12px;
    color: #e5e7eb;
    max-width: min(46%, 520px);
    min-width: 0;
    overflow: hidden;
    flex: 0 1 auto;
}
.header-progress[hidden] { display: none; }
.header-progress-label {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
    min-width: 0;
    flex: 0 1 auto;
}
.header-progress-counts {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    min-width: 0;
    flex: 0 1 auto;
}
.header-progress-bar {
    flex: 1 1 80px;
    min-width: 48px;
    max-width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border-2);
}
.header-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width .3s;
}

@media (max-width: 900px) {
    .header-progress { display: none !important; }
}
.progress {
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border-2);
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width .3s;
}
.progress-label { font-size: 11px; color: var(--muted); margin-top: 6px; }
.folder-log {
    margin-top: 12px;
    max-height: 260px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-2);
    border-radius: 0.6rem;
    padding: 8px 12px;
    font: 11px/1.55 ui-monospace, Menlo, Consolas, monospace;
    color: var(--muted);
}
.folder-log .line { padding: 2px 0; }
.folder-log .line.ok  { color: var(--success); }
.folder-log .line.err { color: var(--danger); }
.folder-log .line.warn { color: var(--warn); }

/* Bulk scan / identify status rows (inside folder-log) */
.folder-log .row,
.folder-log .folder-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 6px;
    border-left: 3px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;
}
.folder-log .row .tag,
.folder-log .folder-row .tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
}
.folder-log .row .path,
.folder-log .folder-row .path { color: var(--text); flex: 1; word-break: break-all; }
.folder-log .row .err { color: var(--danger); }
.folder-log .row .match {
    display: block; width: 100%;
    margin-top: 4px; padding-left: 18px;
    color: var(--accent); font-size: 11px;
}
.folder-log .row .match strong { color: var(--accent-2); }

/* Added / matched (green) */
.folder-log .row.added,
.folder-log .row.matched,
.folder-log .folder-row.added {
    border-left-color: var(--success);
    background: rgba(34, 197, 94, 0.07);
}
.folder-log .row.added .tag,
.folder-log .row.matched .tag,
.folder-log .folder-row.added .tag {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.35);
}

/* Skipped / unmatched (amber/grey warn) */
.folder-log .row.skipped,
.folder-log .row.unmatched,
.folder-log .folder-row.skipped {
    border-left-color: var(--warn);
    background: rgba(251, 191, 36, 0.05);
}
.folder-log .row.skipped .tag,
.folder-log .row.unmatched .tag,
.folder-log .folder-row.skipped .tag {
    background: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
    border-color: rgba(251, 191, 36, 0.35);
}

/* Failed (red) */
.folder-log .row.failed,
.folder-log .folder-row.failed {
    border-left-color: var(--danger);
    background: rgba(239, 68, 68, 0.06);
}
.folder-log .row.failed .tag,
.folder-log .folder-row.failed .tag {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.35);
}

/* ── Tags / badges ─────────────────────────────────────────────────── */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: .3px;
    font-weight: 500;
}
.tag-added   { background: rgba(34, 197, 94, 0.15); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); }
.tag-failed  { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.tag-skipped { background: rgba(255, 255, 255, 0.08); color: #d1d5db; border: 1px solid var(--border); }

/* ── Live Monitor specifics ────────────────────────────────────────── */
.monitor-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.monitor-stats > div {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-2);
    border-radius: 0.75rem;
    padding: 14px 12px;
    text-align: center;
}
.monitor-stats .value { display: block; font-size: 22px; font-weight: 700; color: var(--accent); }
.monitor-stats .label { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-top: 4px; }

.monitor-controls { display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.monitor-controls label { flex-direction: row; align-items: center; }
.monitor-controls select { padding: 6px 10px; }

.jiotv-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 14px 18px;
    margin-bottom: 14px;
}
.jiotv-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.jiotv-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ── Card scaffolding (used on recording / results / report tabs) ──── */
.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 16px 18px;
}
.card h3 {
    font-size: 12px; text-transform: uppercase; letter-spacing: .8px;
    color: rgba(255, 255, 255, 0.7); margin: 0 0 12px;
    display: flex; align-items: center; gap: 8px; font-weight: 600;
}
.card h3 .ic { color: var(--accent); font-size: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-head h3 { margin: 0; }

/* Overview — LAN access card expand / collapse */
#ov-auth-card .ov-auth-head { cursor: pointer; user-select: none; }
#ov-auth-card .ov-auth-collapse-btn {
    min-width: 28px;
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}
#ov-auth-card.collapsed .ov-auth-body { display: none; }
#ov-auth-card.collapsed .ov-auth-head { margin-bottom: 0; }
#ov-auth-card:not(.collapsed) .ov-auth-body { margin-top: 12px; }
/* Host / admin: never hide LAN user management when the card is collapsed */
#ov-auth-card.host-manage-lan .ov-lan-users-panel,
#ov-lan-users-wrap.ov-lan-users-panel.is-visible { display: block !important; }
#ov-lan-users-wrap.ov-lan-users-panel:not(.is-visible):not(.host-force-show) { display: none !important; }
#ov-lan-users-wrap.ov-lan-users-panel input,
#ov-lan-users-wrap.ov-lan-users-panel select,
#ov-lan-users-wrap.ov-lan-users-panel button {
    pointer-events: auto;
}
#ov-auth-card .ov-auth-head-summary {
    font-size: 11px;
    max-width: min(520px, 55vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#ov-auth-card:not(.collapsed) .ov-auth-head-summary { display: none; }
.muted-tag { font-size: 11px; color: var(--muted); }

/* Data entry — Report + Results panels only (tab nav shows allowed tabs) */
body.abx-role-data-entry .panel[data-panel]:not([data-panel="results"]):not([data-panel="report"]),
body.abx-role-data-entry .panel.active[data-panel]:not([data-panel="results"]):not([data-panel="report"]) {
    display: none !important;
    visibility: hidden !important;
}
body.abx-role-data-entry .panel[data-panel="results"].active,
body.abx-role-data-entry .panel[data-panel="report"].active {
    display: block !important;
}

/* Panels that use a sidebar + main layout need wider max-width */
.panel.panel-wide { width: 100%; }
body:has(.panel.panel-wide.active) main { max-width: 1400px; }

/* ── Report tab ────────────────────────────────────────────────────── */
.report-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .report-layout { grid-template-columns: 1fr; } }
.report-sidebar { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 140px; }
.report-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.report-sidebar .card label,
.map-sidebar .card label,
.rec-sidebar .card label {
    display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px;
}
.report-sidebar .card select,
.report-sidebar .card input,
.map-sidebar .card select,
.map-sidebar .card input,
.rec-sidebar .card select,
.rec-sidebar .card input {
    width: 100%;
}
.report-sidebar button.full,
.map-sidebar button.full,
.rec-sidebar button.full { width: 100%; margin-top: 6px; }
.report-sidebar .preset-stack { display: flex; flex-direction: column; gap: 6px; }
.report-sidebar .preset-stack button { width: 100%; padding: 7px 10px; font-size: 12px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px)  { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-2);
    border-radius: 0.75rem;
    padding: 14px 10px;
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.stat-card-wide {
    min-width: 0;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.12);
}
.stat-card .ic-pill {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    font-size: 14px; background: rgba(99, 102, 241, 0.18); color: #a5b4fc;
}
.stat-card .ic-pill.success { background: rgba(34, 197, 94, 0.18); color: var(--success); }
.stat-card .ic-pill.warn    { background: rgba(251, 191, 36, 0.18); color: var(--warn); }
.stat-card .ic-pill.accent2 { background: rgba(168, 85, 247, 0.18); color: #c4b5fd; }
.stat-card .lbl {
    font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stat-card .val {
    font-size: clamp(12px, 1.4vw, 20px);
    font-weight: 700; color: #fff;
    max-width: 100%; width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    line-height: 1.2;
}
.stat-card .val.val-sm { font-size: clamp(11px, 1.1vw, 15px); }
.stat-card .val.v-success { color: var(--success); }
.stat-card .val.v-warn    { color: var(--warn); }
.stat-card .val.v-accent2 { color: #c4b5fd; }

.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .chart-row { grid-template-columns: 1fr; } }
.chart-row .card { min-width: 0; overflow: hidden; }
/* Wrap each chart canvas in a fixed-height box so Chart.js responsive resize
   doesn't feed back into its parent and grow on every tick. */
.chart-box { position: relative; height: 260px; width: 100%; }
.chart-box > canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
/* Secondary subheader used when a card stacks a second chart below the first. */
.sub-head {
    display: flex; align-items: center; gap: 6px;
    margin: 12px 0 6px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
    color: var(--muted); text-transform: uppercase;
    border-top: 1px dashed var(--border-2); padding-top: 10px;
}
.sub-head .ic { font-size: 14px; opacity: 0.85; }

/* Hour × Day-of-week heatmap */
.heatmap-wrap { overflow-x: auto; padding: 6px 2px; }
.heatmap-wrap .empty { color: var(--muted); text-align: center; padding: 30px 0; }
.heatmap {
    display: grid;
    grid-template-columns: 42px repeat(24, minmax(22px, 1fr));
    gap: 3px;
    min-width: 620px;
    font-size: 10px;
    color: var(--muted);
}
.heatmap .hm-corner { grid-column: 1; grid-row: 1; }
.heatmap .hm-hour-lbl {
    text-align: center; font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.heatmap .hm-day-lbl {
    text-align: right; padding-right: 6px; line-height: 22px; font-weight: 600; color: var(--text);
}
.heatmap .hm-cell {
    height: 22px; border-radius: 3px;
    background: rgba(52, 199, 89, 0.08);
    position: relative; cursor: default;
    transition: transform 0.1s ease, outline 0.1s ease;
}
.heatmap .hm-cell:hover { transform: scale(1.15); outline: 1px solid rgba(255, 255, 255, 0.4); z-index: 2; }
.heatmap .hm-cell[data-v="0"] { background: rgba(148, 163, 184, 0.08); }
.hm-legend { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.hm-legend .hm-scale {
    flex: 0 0 160px; height: 10px; border-radius: 3px;
    background: linear-gradient(90deg, rgba(52,199,89,0.12), rgba(52,199,89,0.4), rgba(52,199,89,0.7), rgba(52,199,89,1));
}

.leaderboard { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.leaderboard .empty { color: var(--muted); text-align: center; padding: 26px 0; }
.lb-row {
    display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-2);
    border-radius: 0.65rem;
    padding: 8px 12px;
}
.lb-row .rank {
    width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 700; font-size: 12px;
    background: rgba(99, 102, 241, 0.2); color: #a5b4fc;
}
.lb-row.gold   .rank { background: rgba(251, 191, 36, 0.2); color: var(--warn); }
.lb-row.silver .rank { background: rgba(203, 213, 225, 0.18); color: #e2e8f0; }
.lb-row.bronze .rank { background: rgba(205, 127, 50, 0.2); color: #fdba74; }
.lb-row .title  { font-size: 13px; font-weight: 600; color: #fff; }
.lb-row .artist { font-size: 11px; color: var(--muted); }
.lb-row .stats  { text-align: right; display: flex; flex-direction: column; }
.lb-row .stats .count { font-size: 15px; font-weight: 700; color: var(--accent); }
.lb-row .stats .conf  { font-size: 10px; color: var(--muted); text-transform: uppercase; }

/* Top 10 songs — styled ranked list with gradient progress bars. Used on
   the Reports tab as a cleaner alternative to a Chart.js horizontal bar
   chart (which cramped long "Title — Artist" labels). */
.top10-list { display: flex; flex-direction: column; gap: 6px; }
.top10-list .empty { color: var(--muted); text-align: center; padding: 26px 0; }
.t10-row {
    display: grid;
    grid-template-columns: 32px minmax(180px, 1.6fr) minmax(120px, 2fr) 72px;
    gap: 12px;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-2);
    border-radius: 0.65rem;
    padding: 8px 12px;
}
.t10-row .t10-rank {
    width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700; font-size: 12px;
    background: rgba(99, 102, 241, 0.18); color: #a5b4fc;
}
.t10-row.gold   .t10-rank { background: rgba(251, 191, 36, 0.22); color: var(--warn); }
.t10-row.silver .t10-rank { background: rgba(203, 213, 225, 0.20); color: #e2e8f0; }
.t10-row.bronze .t10-rank { background: rgba(205, 127, 50, 0.22); color: #fdba74; }
.t10-row .t10-info { min-width: 0; }
.t10-row .t10-title  {
    font-size: 13px; font-weight: 600; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.t10-row .t10-artist {
    font-size: 11px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.t10-row .t10-bar-wrap {
    height: 10px; border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}
.t10-row .t10-bar {
    height: 100%; border-radius: 5px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6 55%, #ec4899);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.35) inset;
    transition: width 320ms ease;
}
.t10-row.gold   .t10-bar { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.t10-row.silver .t10-bar { background: linear-gradient(90deg, #cbd5e1, #94a3b8); }
.t10-row.bronze .t10-bar { background: linear-gradient(90deg, #fdba74, #c2410c); }
.t10-row .t10-stats { text-align: right; }
.t10-row .t10-count { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.1; }
.t10-row .t10-conf  { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Compact leaderboard variant used by Top matched songs / Top artists
   on the Report tab. Tighter rows, smaller bar, lighter chrome so two
   lists sit side-by-side without dominating the page. */
.top10-list.compact { gap: 4px; }
.top10-list.compact .t10-row {
    grid-template-columns: 26px minmax(140px, 1.4fr) minmax(80px, 1.6fr) 78px;
    gap: 10px;
    padding: 5px 9px;
    border-radius: 0.5rem;
}
.top10-list.compact .t10-row .t10-rank {
    width: 22px; height: 22px; font-size: 11px;
}
.top10-list.compact .t10-row .t10-title  { font-size: 12px; }
.top10-list.compact .t10-row .t10-artist { font-size: 10px; }
.top10-list.compact .t10-row .t10-bar-wrap { height: 6px; border-radius: 3px; }
.top10-list.compact .t10-row .t10-bar { border-radius: 3px; }
.top10-list.compact .t10-row .t10-count { font-size: 13px; }
.top10-list.compact .t10-row .t10-conf  { font-size: 9px; }

/* Side-by-side leaderboard cards on Report tab. Falls back to one column
   on narrow viewports. */
.rpt-leader-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .rpt-leader-row { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
    .t10-row { grid-template-columns: 28px 1fr 64px; }
    .t10-row .t10-bar-wrap { grid-column: 2 / span 2; order: 4; height: 8px; }
}

.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: stretch; }
.channel-grid .empty { color: var(--muted); text-align: center; padding: 24px 0; }
.ch-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-2);
    border-radius: 0.75rem;
    padding: 12px 14px;
    transition: border-color .2s, transform .15s;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ch-card:hover { border-color: rgba(99, 102, 241, 0.35); transform: translateY(-1px); }
.ch-card .name {
    font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 10px;
    display: flex; justify-content: space-between; align-items: center; gap: 6px;
    min-width: 0;
}
.ch-card .name > span:first-child { min-width: 0; }
.ch-card .name .tag-rate {
    font-size: 10px; padding: 2px 8px; border-radius: 999px;
    background: rgba(34, 197, 94, 0.18); color: var(--success); font-weight: 700;
    flex-shrink: 0;
}
.ch-card .name .tag-rate.low { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.ch-card .kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ch-card .kv > div {
    background: rgba(255, 255, 255, 0.03); border-radius: 6px; padding: 6px 4px; text-align: center;
    min-width: 0;
}
.ch-card .kv span { display: block; font-size: 13px; font-weight: 700; color: var(--accent); }
.ch-card .kv span.s-success { color: var(--success); }
.ch-card .kv span.s-danger  { color: var(--danger); }
.ch-card .kv label { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-top: 2px; }

.airplay-wrap {
    max-height: 520px; overflow-y: auto;
    border: 1px solid var(--border-2);
    border-radius: 0.65rem;
    position: relative;
}
/* .library uses overflow:hidden + border-collapse:collapse — breaks sticky thead */
.airplay-wrap > table.library.airplay-table {
    overflow: visible;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}
.airplay-table { margin-top: 0; border-radius: 0; font-size: 12px; border-collapse: separate; border-spacing: 0; }
.airplay-wrap > table.library.airplay-table thead th,
.airplay-table thead th {
    position: sticky; top: 0; z-index: 5;
    background: #16162a !important;
    box-shadow: inset 0 -1px 0 var(--border-2);
    border-bottom: none;
}
.airplay-table th.r, .airplay-table td.r { text-align: right; }
.airplay-table th.c, .airplay-table td.c { text-align: center; }

/* ── Recording tab ─────────────────────────────────────────────────── */
.rec-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .rec-layout { grid-template-columns: 1fr; } }
.rec-sidebar { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 140px; }
.rec-main    { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.kv-lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.kv-lines > div { display: flex; justify-content: space-between; font-size: 13px; }
.kv-lines span   { color: var(--muted); }
.kv-lines strong { color: #fff; font-weight: 700; }
.kv-lines strong.v-success { color: var(--success); }
.kv-lines strong.v-warn    { color: var(--warn); }

.row-buttons { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.row-buttons .full { width: 100%; }

.rec-stream-list { display: flex; flex-direction: column; gap: 8px; }
.rec-stream-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-2);
    border-radius: 0.65rem;
    padding: 8px 9px;
}
@keyframes rec-card-breathe {
    0%, 100% {
        border-color: rgba(74, 222, 128, 0.28);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
    50% {
        border-color: rgba(74, 222, 128, 0.9);
        box-shadow: 0 0 14px rgba(74, 222, 128, 0.22);
    }
}
.rec-stream-item.rsi-live {
    border-color: rgba(74, 222, 128, 0.35);
    background: rgba(74, 222, 128, 0.06);
    animation: rec-card-breathe 2.4s ease-in-out infinite;
}
.streams-table .duration-cell {
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: #e2e8f0;
}
@keyframes stream-stop-breathe {
    0%, 100% {
        border-color: rgba(248, 113, 113, 0.42);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        background: rgba(239, 68, 68, 0.12);
    }
    50% {
        border-color: rgba(252, 165, 165, 0.85);
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
        background: rgba(239, 68, 68, 0.22);
    }
}
/* Configured streams: same button chrome as Edit/Delete, subtle stop tint + breathe when live */
.streams-table button.stream-stop-btn {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.42);
    background: rgba(239, 68, 68, 0.12);
    animation: stream-stop-breathe 2.4s ease-in-out infinite;
}
.streams-table button.stream-stop-btn:hover {
    background: rgba(239, 68, 68, 0.28);
    border-color: rgba(252, 165, 165, 0.9);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
    animation: none;
}
/* Live streams card: prominent red stop */
.rsi-record-btn.rsi-record-stop {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.45), rgba(185, 28, 28, 0.55)) !important;
    border: 1px solid rgba(248, 113, 113, 0.75) !important;
    color: #fff !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}
.rsi-record-btn.rsi-record-stop:hover {
    background: linear-gradient(180deg, rgba(248, 113, 113, 0.6), rgba(220, 38, 38, 0.7)) !important;
    border-color: #fecaca !important;
}
.rsi-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}
.rsi-info { flex: 1; min-width: 0; }
.rsi-name {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rsi-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.rsi-pill {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    line-height: 1.2;
}
.rsi-pill-lang {
    text-transform: none;
    letter-spacing: 0;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.15);
}
.rsi-record-btn {
    flex-shrink: 0;
    width: 32px;
    height: 28px;
    padding: 0 !important;
    font-size: 12px !important;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.rsi-quality-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px;
    margin: 0;
    min-width: 0;
}
.rsi-quality-lbl {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    white-space: nowrap;
}

/* Compact quality select — short option labels (Auto, 1080p, …). */
.rec-quality {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.2;
    padding: 4px 20px 4px 6px;
    height: 24px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background-color: rgba(255,255,255,0.06);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 0.45rem;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none' stroke='%23ffffff' stroke-width='1.4'><path d='M1 1l4 4 4-4'/></svg>");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 7px 5px;
    cursor: pointer;
}
.rec-quality:hover { background-color: rgba(255,255,255,0.10); }
.rec-quality:focus { outline: none; border-color: rgba(255,255,255,0.30); }
.rec-quality:disabled { opacity: 0.55; cursor: not-allowed; }
/* Native <option> rendering can't be styled cross-browser; make sure
   the popup uses sane dark colours where the browser honours them. */
.rec-quality option { background: #1f2937; color: #fff; }

.rec-workers { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; }
.rec-worker {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-2);
    border-left: 3px solid var(--success);
    border-radius: 0.65rem; padding: 10px 12px;
}
.rw-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.rw-body { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 10px; font-size: 11px; }
.rw-body label { font-size: 9px; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
.rw-body span  { color: #fff; font-weight: 600; word-break: break-all; }

.live-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--success); box-shadow: 0 0 0 0 rgba(74, 222, 128, .6);
    animation: livepulse 1.2s ease-out infinite;
}
@keyframes livepulse {
    0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); }
    70%  { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.rec-filter-row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.rec-filter-row label { flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }

.rec-files { display: flex; flex-direction: column; gap: 14px; max-height: 620px; overflow-y: auto; }

/* Channel card — wraps all dates+files for one stream */
.rec-channel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-2);
    border-radius: 0.75rem;
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 10px;
}
.rc-head {
    display: flex; align-items: center; gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-2);
    color: #fff; font-size: 14px;
}
.rc-head strong { color: var(--accent); font-size: 15px; letter-spacing: 0.2px; }
.rc-icon { font-size: 18px; line-height: 1; }
.rc-head .muted-tag { margin-left: auto; }

/* Per-day group inside a channel */
.rec-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-2);
    border-radius: 0.6rem; padding: 8px 10px;
}
.rg-head {
    font-size: 12px; margin-bottom: 6px; color: #fff;
    display: flex; align-items: center; gap: 8px;
}
.rg-date { color: var(--accent); font-weight: 600; }
.rg-head .muted-tag { margin-left: auto; }
.rg-files { display: flex; flex-direction: column; gap: 4px; }
.rg-file {
    display: grid;
    grid-template-columns: 90px 90px 1fr auto auto auto;
    gap: 10px; align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-2);
    border-radius: 0.5rem; padding: 6px 10px;
    font-size: 11px;
}
.rg-file .fn-time {
    color: #fff; font-weight: 600;
    font-family: ui-monospace, monospace;
    letter-spacing: 0.3px;
}
.rg-file .fn { color: #fff; font-weight: 600; font-family: ui-monospace, monospace; }
.rg-file .fn-spacer { /* pushes action buttons to the right */ }
.btn-tiny { padding: 3px 8px !important; font-size: 10px !important; border-radius: 6px !important; }

/* ── Play details panel (analyst classification) ───────────────────────
 * Sits between the "Recording player" card-head and the player widget on
 * the View Results tab. Lets the analyst classify what kind of play this
 * detection was (Full Song / Trailer / Promo / Jingle / Snippet / custom).
 * Persisted to monitor_log.play_kind and surfaced in CSV / Excel / PDF. */
@keyframes play-details-breathe {
    0%, 100% {
        border-color: rgba(74, 222, 128, 0.28);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
    50% {
        border-color: rgba(74, 222, 128, 0.9);
        box-shadow: 0 0 14px rgba(74, 222, 128, 0.22);
    }
}
/* Collapse the wrapper when play details are hidden (no empty gap). */
.card-play-details:has(#play-details[hidden]) {
    display: none;
}
.card-play-details {
    padding-top: 10px;
    padding-bottom: 10px;
}
.card-play-details .play-details {
    margin: 0;
}
.play-details {
    margin: 6px 0 12px 0;
    padding: 10px 12px;
    background: rgba(74, 222, 128, 0.06);
    border: 1px solid rgba(74, 222, 128, 0.35);
    border-radius: 10px;
}
.play-details:not([hidden]) {
    animation: play-details-breathe 2.4s ease-in-out infinite;
}
.play-details:focus-within:not([hidden]) {
    animation: none;
    border-color: rgba(74, 222, 128, 0.85);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.25);
}
.play-details[hidden] { display: none !important; }
.play-details .pd-row {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.play-details .pd-label {
    font-size: 12px; font-weight: 600; color: var(--accent, #818cf8);
    letter-spacing: .3px; text-transform: uppercase;
    margin-right: 4px;
}
.play-details .pd-select,
.play-details .pd-custom {
    padding: 5px 9px; font-size: 12px;
    background: rgba(255,255,255,.05); color: #fff;
    border: 1px solid rgba(255,255,255,.10); border-radius: 6px;
    min-width: 160px; max-width: 100%;
}
.play-details .pd-select:focus,
.play-details .pd-custom:focus {
    outline: none; border-color: rgba(129,140,248,.55);
    box-shadow: 0 0 0 2px rgba(129,140,248,.20);
}
.play-details .pd-select option {
    background: #1f1f2e; color: #fff;
}
.play-details .pd-select:disabled,
.play-details .pd-custom:disabled,
.play-details .btn-tiny:disabled {
    opacity: .50; cursor: not-allowed;
}
.play-details .pd-custom[hidden] { display: none !important; }
.play-details .pd-epg-input {
    flex: 1;
    min-width: 200px;
    max-width: 100%;
}
.play-details .pd-status {
    font-size: 11px; color: rgba(255,255,255,.55);
    transition: color .2s ease;
}
.play-details .pd-status.is-ok    { color: #4ade80; }
.play-details .pd-status.is-err   { color: #f87171; }
.play-details .pd-attribution {
    margin: 6px 0 0;
    padding: 6px 10px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--muted);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
}
.play-details .pd-attribution[hidden] { display: none !important; }

.play-details .pd-hint {
    margin-top: 6px; font-size: 11px;
}

/* ── Play details: dropdown-options manager ────────────────────────────
 * Inline editor for the analyst's preset list. Hidden by default; the
 * "✎ Manage list" button toggles it. Options live in localStorage so a
 * user can curate their own classification vocabulary that survives
 * page reloads. */
.play-details .pd-manager {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
}
.play-details .pd-manager[hidden] { display: none !important; }
.play-details .pd-manager-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px; color: #fff; font-size: 12px;
}
.play-details .pd-option-list {
    list-style: none; padding: 0; margin: 0 0 8px 0;
    max-height: 200px; overflow-y: auto;
}
.play-details .pd-option-list li {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 8px; margin-bottom: 4px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 6px;
    color: #fff; font-size: 12px;
}
.play-details .pd-option-list li .pd-opt-name { flex: 1 1 auto; }
.play-details .pd-option-list li .pd-opt-remove {
    background: rgba(248,113,113,.18);
    border: 1px solid rgba(248,113,113,.45);
    color: #fecaca;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 11px;
    cursor: pointer;
}
.play-details .pd-option-list li .pd-opt-remove:hover {
    background: rgba(248,113,113,.35); color: #fff;
}
.play-details .pd-option-list li.pd-opt-empty {
    background: transparent; border: 0;
    color: rgba(255,255,255,.45); font-style: italic;
    justify-content: center;
}
.play-details .pd-manager-add {
    display: flex; gap: 6px; align-items: center; margin-bottom: 8px;
}
.play-details .pd-manager-add .pd-custom { flex: 1 1 auto; }
.play-details .pd-manager-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}

/* ── View Results (mapping) tab ────────────────────────────────────── */
.map-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .map-layout { grid-template-columns: 1fr; } }
.map-sidebar { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 140px; }
.map-main    { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.map-player-wrap {
    position: relative; background: #000;
    border-radius: 0.75rem; overflow: hidden;
    aspect-ratio: 16/9; max-height: 420px;
}
.map-video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.map-audio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ── Custom branded player (AUDIOBoxx) ─────────────────────────────── */
.abx-player {
    color: #fff; font-family: inherit;
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 18px 48px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.03);
}
.abx-player.kind-audio { background: radial-gradient(ellipse at center, #141428 0%, #05050a 70%); }
.abx-click-layer { position: absolute; inset: 0; background: transparent; border: 0; cursor: pointer; z-index: 2; }

.abx-top-overlay {
    position: absolute; inset: 0 0 auto 0; padding: 12px 14px;
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; z-index: 5; pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,.65) 0%, rgba(0,0,0,.25) 60%, rgba(0,0,0,0) 100%);
}
.abx-brand { display: flex; align-items: center; gap: 10px; min-width: 0; pointer-events: auto; }
.abx-logo {
    /* legacy hook — animated shell supplies visuals */
    background: none;
    box-shadow: none;
    padding: 0;
    display: contents;
}
.abx-titleblock { min-width: 0; line-height: 1.2; }
.abx-title { font-size: 13px; font-weight: 700; letter-spacing: .3px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.abx-sub { margin-top: 2px; font-size: 11px; color: rgba(255,255,255,.70); text-shadow: 0 1px 3px rgba(0,0,0,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

.abx-match-card {
    pointer-events: auto; min-width: 200px; max-width: 46%;
    padding: 10px 12px; border-radius: 10px;
    background: rgba(10,10,15,.60); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 8px 22px rgba(0,0,0,.5);
    color: #fff; animation: abx-slide-in .25s ease;
}
@keyframes abx-slide-in { from { opacity:0; transform: translateY(-6px);} to { opacity:1; transform:none;} }
.abx-mc-head { display: flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
.abx-mc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.abx-mc-kind { color: #fff; }
.abx-mc-conf { margin-left: auto; font-weight: 600; letter-spacing: .3px; color: rgba(255,255,255,.78); text-transform: none; }
.abx-match-card.is-match   { border-color: rgba(74,222,128,.55); background: linear-gradient(180deg, rgba(16,185,129,.22), rgba(10,10,15,.55)); }
.abx-match-card.is-match   .abx-mc-dot  { background: var(--success); box-shadow: 0 0 0 4px rgba(74,222,128,.18); animation: abx-pulse 1.6s ease-in-out infinite; }
.abx-match-card.is-match   .abx-mc-kind { color: #d1fae5; }
.abx-match-card.is-nomatch { border-color: rgba(251,191,36,.55); background: linear-gradient(180deg, rgba(245,158,11,.22), rgba(10,10,15,.55)); }
.abx-match-card.is-nomatch .abx-mc-dot  { background: var(--warn); }
.abx-match-card.is-nomatch .abx-mc-kind { color: #fef3c7; }
.abx-match-card.is-error   { border-color: rgba(248,113,113,.55); background: linear-gradient(180deg, rgba(239,68,68,.22), rgba(10,10,15,.55)); }
.abx-match-card.is-error   .abx-mc-dot  { background: var(--danger); }
.abx-match-card.is-error   .abx-mc-kind { color: #fee2e2; }
.abx-mc-title  { margin-top: 6px; font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abx-mc-artist { margin-top: 1px; font-size: 11.5px; color: rgba(255,255,255,.80); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abx-mc-meta   { margin-top: 4px; font-size: 10.5px; color: rgba(255,255,255,.55); letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@keyframes abx-pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(74,222,128,.18);} 50% { box-shadow: 0 0 0 8px rgba(74,222,128,.05);} }

.abx-status-banner {
    position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
    z-index: 4; pointer-events: none; text-align: center;
    padding: 14px 28px; border-radius: 14px;
    background: rgba(10,10,15,.55); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.10); animation: abx-fade-in .35s ease;
    max-width: 80%; box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.abx-status-kind { font-size: clamp(20px, 3.6vw, 34px); font-weight: 800; letter-spacing: 2px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.abx-status-banner.is-match   .abx-status-kind { background: linear-gradient(135deg,#22c55e,#86efac); -webkit-background-clip: text; background-clip: text; color: transparent; }
.abx-status-banner.is-nomatch .abx-status-kind { background: linear-gradient(135deg,#f59e0b,#fde68a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.abx-status-banner.is-error   .abx-status-kind { background: linear-gradient(135deg,#ef4444,#fecaca); -webkit-background-clip: text; background-clip: text; color: transparent; }
.abx-status-title  { margin-top: 6px; font-size: 14px; font-weight: 600; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.7); }
.abx-status-artist { margin-top: 2px; font-size: 12px; color: rgba(255,255,255,.72); }
@keyframes abx-fade-in { from { opacity:0; transform: translate(-50%, -46%) scale(.96);} to { opacity:1; transform: translate(-50%, -50%) scale(1);} }

.abx-audio-art { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(99,102,241,.18), rgba(0,0,0,0) 70%); z-index: 1; }
.abx-eq { display: flex; align-items: flex-end; gap: 6px; height: 90px; }
.abx-eq i { display: block; width: 8px; border-radius: 4px; background: linear-gradient(to top, var(--accent), var(--accent-2)); animation: abx-eq 1.1s ease-in-out infinite; box-shadow: 0 0 12px rgba(129,140,248,.45); }
.abx-eq i:nth-child(1){ animation-delay: -.1s; height: 30%; }
.abx-eq i:nth-child(2){ animation-delay: -.3s; height: 60%; }
.abx-eq i:nth-child(3){ animation-delay: -.5s; height: 90%; }
.abx-eq i:nth-child(4){ animation-delay: -.2s; height: 70%; }
.abx-eq i:nth-child(5){ animation-delay: -.6s; height: 50%; }
.abx-eq i:nth-child(6){ animation-delay: -.4s; height: 80%; }
.abx-eq i:nth-child(7){ animation-delay: -.15s; height: 40%; }
@keyframes abx-eq { 0%,100% { transform: scaleY(.4);} 50% { transform: scaleY(1);} }
.abx-player.is-paused .abx-eq i { animation-play-state: paused; }

.abx-controls {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px 12px;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,0) 100%);
    pointer-events: auto;
}
.abx-btn {
    background: rgba(255,255,255,.08); color: #fff;
    border: 1px solid rgba(255,255,255,.08);
    width: 32px; height: 32px; border-radius: 8px;
    display: grid; place-items: center; cursor: pointer;
    transition: background .15s ease, transform .1s ease, border-color .15s ease, color .15s ease;
    flex: 0 0 auto;
}
.abx-btn:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.18); }
.abx-btn:active { transform: scale(.94); }
.abx-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Normalize icon glyph sizing across every control so the rows look even
 * regardless of what each underlying <svg> declared as width/height.
 * NOTE: do NOT set display here — the play / mute buttons toggle which
 * of their two SVGs is visible via `.abx-ic-pause` / `.abx-ic-mute`
 * `display: none`, and forcing `display: block` here used to override
 * that toggle and show both icons at once. */
.abx-btn > svg { width: 16px; height: 16px; }
/* All player control buttons share the base 32x32 / 8px-radius footprint
 * (.abx-btn). The play / stop / mute / fullscreen / clip variants only
 * recolor — they do NOT redefine width / height / border-radius — so the
 * control row stays visually uniform. */
.abx-btn.abx-play { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; box-shadow: 0 6px 16px rgba(99,102,241,.45), inset 0 0 0 1px rgba(255,255,255,.15); }
.abx-btn.abx-play:hover { filter: brightness(1.08); }
.abx-btn.abx-stop { background: rgba(248,113,113,.14); border-color: rgba(248,113,113,.45); color: #fecaca; }
.abx-btn.abx-stop:hover { background: rgba(248,113,113,.30); color: #fff; border-color: rgba(248,113,113,.7); }
/* Clip download — icon-only player control. Green when active (matches the
 * "save / download" affordance), neutral-grey when disabled (no-match). */
.abx-btn.abx-clip {
    background: rgba(34,197,94,.18);
    border-color: rgba(34,197,94,.55);
    color: #4ade80;
    text-decoration: none;
}
.abx-btn.abx-clip:hover {
    background: rgba(34,197,94,.32);
    border-color: rgba(34,197,94,.80);
    color: #ffffff;
}
.abx-btn.abx-clip.is-disabled,
.abx-btn.abx-clip[aria-disabled="true"] {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.12);
    color: rgba(255,255,255,.40);
    cursor: not-allowed;
}
.abx-btn.abx-clip.is-disabled:hover,
.abx-btn.abx-clip[aria-disabled="true"]:hover {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.12);
    color: rgba(255,255,255,.40);
}
.abx-ic-pause, .abx-ic-mute { display: none; }
.abx-player.is-playing .abx-play .abx-ic-play { display: none; }
.abx-player.is-playing .abx-play .abx-ic-pause { display: block; }
.abx-player.is-muted #abx-mute .abx-ic-vol { display: none; }
.abx-player.is-muted #abx-mute .abx-ic-mute { display: block; }

.abx-time { font-size: 11px; color: rgba(255,255,255,.88); font-variant-numeric: tabular-nums; min-width: 40px; text-align: center; letter-spacing: .3px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.abx-seek { position: relative; flex: 1 1 auto; height: 4px; background: rgba(255,255,255,.16); border-radius: 999px; cursor: pointer; margin: 0 4px; transition: height .15s ease; }
.abx-seek:hover { height: 6px; }
.abx-seek-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; box-shadow: 0 0 10px rgba(129,140,248,.5); }
.abx-seek-knob { position: absolute; left: 0; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 2px 8px rgba(0,0,0,.6), 0 0 0 3px rgba(129,140,248,.25); opacity: 0; transition: opacity .15s ease; }
.abx-seek:hover .abx-seek-knob { opacity: 1; }
.abx-vol { width: 68px; height: 4px; background: rgba(255,255,255,.16); border-radius: 999px; position: relative; cursor: pointer; }
.abx-vol-fill { position: absolute; inset: 0 auto 0 0; width: 80%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; }

.map-player-wrap:fullscreen { max-height: none; aspect-ratio: auto; width: 100vw; height: 100vh; border-radius: 0; }
.map-player-wrap:fullscreen .abx-title { max-width: 40vw; }

@media (max-width: 640px) {
    .abx-vol { display: none; }
    .abx-time-tot { display: none; }
    .abx-title, .abx-sub { max-width: 40vw; }
    .abx-match-card { min-width: 0; max-width: 55%; padding: 8px 10px; }
    .abx-mc-title { font-size: 12px; }
}
.map-placeholder {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--muted); gap: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
}
.map-placeholder .pl-logo {
    /* shell child carries the animated mark */
    background: none;
    box-shadow: none;
    width: auto;
    height: auto;
}
.map-placeholder .pl-logo svg { display: block; }

.map-timeline {
    position: relative; height: 96px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-2);
    border-radius: 0.65rem;
    margin: 24px 0 8px;
    padding: 6px 0 6px 64px;
}
.map-timeline .empty {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    color: var(--muted); font-size: 12px;
}
.map-hours { position: absolute; top: -18px; left: 64px; right: 0; height: 14px; font-size: 9px; color: var(--muted); font-family: ui-monospace, monospace; }
.map-hours span { position: absolute; transform: translateX(-50%); }

/* Three stacked lanes – match / nomatch / error. Each is a thin horizontal
   strip; events render as colored bar segments inside their lane so the
   day's airplay pattern reads at a glance. */
.map-lanes { position: absolute; left: 64px; right: 6px; top: 6px; bottom: 6px; display: flex; flex-direction: column; gap: 4px; }
.map-lane {
    position: relative; flex: 1;
    border-radius: 4px;
    background: linear-gradient(to right, rgba(255,255,255,0.02), rgba(255,255,255,0.04));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.map-lane-label {
    position: absolute; left: -60px; top: 50%;
    transform: translateY(-50%);
    font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); width: 56px; text-align: right;
}
.map-lane.match   .map-lane-label { color: var(--success); }
.map-lane.nomatch .map-lane-label { color: var(--warn); }
.map-lane.error   .map-lane-label { color: var(--danger); }
.map-bar {
    position: absolute; top: 2px; bottom: 2px;
    min-width: 2px;
    border: 0; padding: 0; cursor: pointer;
    border-radius: 3px;
    background: var(--muted);
    box-shadow: 0 1px 2px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.08);
    transition: filter .12s, transform .12s, box-shadow .12s;
}
.map-bar:hover { filter: brightness(1.25); transform: scaleY(1.08); box-shadow: 0 2px 6px rgba(0,0,0,0.45), 0 0 0 2px rgba(255,255,255,0.10); z-index: 2; }
.map-bar.match   { background: linear-gradient(180deg, var(--success), color-mix(in srgb, var(--success) 65%, #000)); }
.map-bar.nomatch { background: linear-gradient(180deg, var(--warn),    color-mix(in srgb, var(--warn) 65%, #000)); }
.map-bar.error   { background: linear-gradient(180deg, var(--danger),  color-mix(in srgb, var(--danger) 65%, #000)); }
.map-bar.active  { outline: 2px solid #fbbf24; outline-offset: 1px; box-shadow: 0 0 0 4px rgba(251,191,36,0.25); z-index: 3; }

.map-legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); }
.map-legend .leg-item { cursor: pointer; user-select: none; padding: 2px 6px; border-radius: 999px; transition: background .15s, color .15s; }
.map-legend .leg-item:hover { background: rgba(255,255,255,0.06); color: #e5e7eb; }
.map-legend .leg-item.selected { background: rgba(99,102,241,0.18); color: #fff; }
.map-legend .leg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; background: var(--muted); }
.map-legend .leg-dot.match   { background: var(--success); }
.map-legend .leg-dot.nomatch { background: var(--warn); }
.map-legend .leg-dot.error   { background: var(--danger); }
.map-legend .leg-dot.active  { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2); }

/* Legend click-to-filter: hide dots that don't match the selected type.
   The host #map-timeline receives a data-filter attribute; each rule below
   hides every dot that isn't the selected kind. Only one filter at a time. */
.map-timeline[data-filter="match"]   .map-dot:not(.match),
.map-timeline[data-filter="nomatch"] .map-dot:not(.nomatch),
.map-timeline[data-filter="error"]   .map-dot:not(.error),
.map-timeline[data-filter="active"]  .map-dot:not(.active) { display: none; }

.map-events { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow-y: auto; }
.map-event {
    display: grid; grid-template-columns: 150px 1fr auto;
    gap: 12px; align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-2);
    border-left: 3px solid var(--border);
    border-radius: 0.65rem; padding: 8px 12px;
    transition: border-color .2s;
    cursor: pointer;
}
.map-event.has-rec { border-left-color: var(--success); }
.map-event.has-rec:hover { border-color: rgba(99, 102, 241, 0.35); }
.map-event.no-rec { opacity: .7; }
.map-event.is-selected {
    border-color: rgba(56, 189, 248, 0.55);
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
}
.map-event .me-time { font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); }
.me-top  { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.me-top strong { font-size: 13px; color: #fff; }
.me-meta { font-size: 11px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 3px; }
/* Play-kind badge on a mapped event row. Subtle accent so the analyst
 * can scan the events list for already-classified plays at a glance. */
.me-playkind {
    color: #4ade80 !important; font-weight: 600;
    background: rgba(34,197,94,.10);
    border: 1px solid rgba(34,197,94,.30);
    padding: 1px 7px; border-radius: 999px;
    font-size: 10px; letter-spacing: .2px;
}

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); }

/* ── Checkboxes ────────────────────────────────────────────────────── */
input[type="checkbox"] { accent-color: #6366f1; }

/* ── Streams tab ───────────────────────────────────────────────────── */
.streams-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .streams-layout { grid-template-columns: 1fr; } }
.streams-sidebar { position: sticky; top: 140px; }
.streams-main { min-width: 0; }

/* Horizontal scroll wrapper used by wide tables (e.g. Configured streams).
   The inner table keeps its normal card look; only overflow scrolls. */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    border-radius: 0.8rem;
}
.table-scroll .library { margin-top: 12px; }

/* Configured-streams table is 9 columns wide — constrain the URL column
   so the whole row fits most viewports without horizontal scroll, and
   truncate long URLs with an ellipsis + title tooltip. */
.streams-table { min-width: 760px; }
.streams-table th:nth-child(2),
.streams-table td:nth-child(2) {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.streams-table td:nth-child(2) code { font-size: 11px; }
.stream-form-stack { display: flex; flex-direction: column; gap: 10px; }
.stream-form-stack label { gap: 4px; }
.stream-form-stack button.full { width: 100%; margin-top: 6px; }

/* ── About tab — glass cards ───────────────────────────────────────── */
@keyframes about-glass-breathe {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.28),
            inset 0 1px 0 rgba(255, 255, 255, 0.07);
    }
    50% {
        border-color: rgba(129, 140, 248, 0.42);
        box-shadow:
            0 14px 44px rgba(99, 102, 241, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.14);
    }
}
@keyframes about-glass-sweep {
    0% { transform: translateX(-130%) skewX(-12deg); opacity: 0; }
    18% { opacity: 0.55; }
    42% { transform: translateX(130%) skewX(-12deg); opacity: 0; }
    100% { transform: translateX(130%) skewX(-12deg); opacity: 0; }
}
[data-panel="about"] .card,
[data-panel="about"] .about-license {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.09) 0%,
        rgba(255, 255, 255, 0.03) 42%,
        rgba(99, 102, 241, 0.07) 100%
    );
    backdrop-filter: blur(22px) saturate(1.35);
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    animation: about-glass-breathe 4.2s ease-in-out infinite;
}
[data-panel="about"] .about-layout .card:nth-child(2) { animation-delay: -0.6s; }
[data-panel="about"] .about-layout .card:nth-child(3) { animation-delay: -1.2s; }
[data-panel="about"] .about-grid .card:nth-child(1) { animation-delay: -0.3s; }
[data-panel="about"] .about-grid .card:nth-child(2) { animation-delay: -0.9s; }
[data-panel="about"] .about-license { animation-delay: -0.15s; }
[data-panel="about"] .card::before,
[data-panel="about"] .about-license::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        105deg,
        transparent 38%,
        rgba(255, 255, 255, 0.14) 50%,
        transparent 62%
    );
    animation: about-glass-sweep 7s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
[data-panel="about"] .card > *,
[data-panel="about"] .about-license > * {
    position: relative;
    z-index: 1;
}
[data-panel="about"] .about-license {
    background: linear-gradient(
        145deg,
        rgba(245, 179, 1, 0.1) 0%,
        rgba(255, 255, 255, 0.04) 45%,
        rgba(99, 102, 241, 0.06) 100%
    );
    border-color: rgba(245, 179, 1, 0.22);
}
[data-panel="about"] .about-hero {
    background: linear-gradient(
        145deg,
        rgba(99, 102, 241, 0.14) 0%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(139, 92, 246, 0.1) 100%
    );
}
@media (prefers-reduced-motion: reduce) {
    [data-panel="about"] .card,
    [data-panel="about"] .about-license,
    [data-panel="about"] .card::before,
    [data-panel="about"] .about-license::before {
        animation: none;
    }
}

.about-layout { display: flex; flex-direction: column; gap: 14px; }
.about-hero { display: flex; gap: 18px; align-items: center; }
.about-logo {
    /* animated shell child */
    background: none;
    box-shadow: none;
    width: auto;
    height: auto;
    padding: 0;
}
.about-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } .about-hero { flex-direction: column; text-align: center; } }
.about-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px) { .about-grid-3 { grid-template-columns: 1fr; } }
.about-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; color: rgba(255, 255, 255, 0.75); font-size: 12px; }
.about-list li { padding-left: 16px; position: relative; }
.about-list li::before { content: '▸'; position: absolute; left: 0; color: var(--accent); }
.about-list.small { font-size: 11px; }
.about-list code { font-size: 10.5px; background: rgba(99, 102, 241, 0.14); color: #c7d2fe; border-radius: 4px; padding: 1px 5px; }
.about-h { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: rgba(255, 255, 255, 0.5); margin: 0 0 8px; font-weight: 600; }

/* ── License card ──────────────────────────────────────────────────── */
.about-license { margin-bottom: 14px; }
.about-license .lic-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.about-license .lic-head h3 { margin: 0; }
.about-license .lic-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.about-license .lic-input-wrap { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 4px; }
.about-license .lic-input-wrap label { font-size: 10.5px; color: rgba(255, 255, 255, 0.45); text-transform: uppercase; letter-spacing: .6px; }
.about-license .lic-input-wrap input { background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.1); color: #e6eaf4; border-radius: 8px; padding: 8px 10px; font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.12em; text-transform: uppercase; }
.about-license .lic-input-wrap input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25); }
.about-license .lic-err { color: #ff6b6b; font-size: 11.5px; margin: 8px 0 0; }
.about-license .lic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 860px) { .about-license .lic-grid { grid-template-columns: repeat(2, 1fr); } }
.about-license .lic-grid > div { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.about-license .lic-grid label { font-size: 10px; color: rgba(255, 255, 255, 0.45); text-transform: uppercase; letter-spacing: .5px; }
.about-license .lic-grid strong { color: #fff; font-size: 13px; }
.about-license .lic-grid .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: #c7d2fe; letter-spacing: .05em; }

/* ── EULA / guideline scroll boxes ─────────────────────────────────── */
.eula-content { max-height: 420px; overflow-y: auto; padding-right: 6px; font-size: 12px; line-height: 1.55; color: rgba(255, 255, 255, 0.72); }
.eula-content p { margin: 0 0 9px; }
.eula-content p strong { color: #fff; }
.eula-content .about-h { margin-top: 4px; }
.eula-summary { background: rgba(99, 102, 241, 0.08); border: 1px solid rgba(99, 102, 241, 0.2); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.eula-summary .lic-grid { gap: 6px; }
.eula-summary .lic-grid > div { background: rgba(0, 0, 0, 0.15); }
.eula-footer { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.06); text-align: center; font-size: 10.5px; color: rgba(255, 255, 255, 0.35); font-style: italic; }
.v-accent2 { color: #fbbf24; }
.v-success { color: var(--success); }
.v-warn { color: var(--warn); }
.v-err { color: var(--err, #ff6b6b); }

/* ── Mini-chart canvas sizing ──────────────────────────────────────── */
.chart-row .ov-chart-wrap {
    position: relative;
    width: 100%;
    height: 200px;
    min-height: 160px;
}
.chart-row .ov-chart-wrap.ov-chart-cpu,
.chart-row .ov-chart-wrap.ov-chart-ram {
    height: 220px;
    min-height: 180px;
}
.chart-row .ov-chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
}

.ov-capacity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
@media (max-width: 760px) {
    .ov-capacity-grid { grid-template-columns: 1fr; }
}
.ov-cap-tile {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.ov-cap-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 6px;
}
.ov-cap-val {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}
.ov-capacity-card.is-stressed .ov-cap-val { color: var(--warn); }
.ov-capacity-card.is-ok .ov-cap-val { color: var(--success); }
.ov-cap-detail {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
}
.ov-cap-note {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.5;
}

.ov-sizing-details {
    margin-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 12px;
}
.ov-sizing-details summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    user-select: none;
}
.ov-sizing-intro {
    margin: 10px 0 8px;
    font-size: 12px;
}
.ov-sizing-legend {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text);
}
.ov-sizing-legend strong {
    color: var(--text);
    font-weight: 600;
}
.ov-sizing-key {
    margin: 0 0 8px;
    font-size: 11px;
    opacity: 0.85;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}
.ov-sizing-mark {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
}
.ov-sizing-mark-tier {
    font-weight: 700;
    font-size: inherit;
}
.ov-sizing-ic {
    display: block;
    flex-shrink: 0;
}
.ov-sizing-ic.system {
    color: #34c759;
}
.ov-sizing-ic.license {
    color: #67e8f9;
}
.ov-sizing-emoji {
    font-size: 13px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
    min-height: 14px;
}
.ov-sizing-stream-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.ov-sizing-badges {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ov-sizing-badge {
    display: inline-flex;
    line-height: 0;
}
.ov-sizing-scroll {
    overflow: auto;
    margin-top: 4px;
    max-height: min(320px, 42vh);
}
.ov-sizing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 1.4;
}
.ov-sizing-table th,
.ov-sizing-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}
.ov-sizing-table th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
}
.ov-sizing-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}
.ov-sizing-table tr.is-system-tier td {
    background: rgba(52, 199, 89, 0.1);
    color: var(--text);
}
.ov-sizing-table tr.is-system-tier td:first-child {
    font-weight: 700;
    color: #34c759;
    box-shadow: inset 4px 0 0 #34c759;
}
.ov-sizing-table tr.is-license-tier:not(.is-system-tier) td {
    background: rgba(103, 232, 249, 0.08);
    color: var(--text);
}
.ov-sizing-table tr.is-license-tier:not(.is-system-tier) td:first-child {
    font-weight: 700;
    color: #67e8f9;
    box-shadow: inset 4px 0 0 #67e8f9;
}
.ov-sizing-table tr.is-system-tier.is-license-tier td:first-child {
    color: #7ee787;
    box-shadow: inset 4px 0 0 #34c759, inset 7px 0 0 #67e8f9;
}
.ov-sizing-table tr.is-beyond-hardware td {
    opacity: 0.42;
}


/* Backup form layout */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.inline-check input[type="checkbox"] { width: 16px; height: 16px; }

/* --- Index-load banner (shown while fingerprint index rehydrates) --- */
.index-loading {
    max-width: 80rem;
    margin: 12px auto 0;
    padding: 0 1.5rem;
}
.index-loading-inner {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    background: linear-gradient(90deg, rgba(99,102,241,0.14), rgba(52,199,89,0.10));
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
    color: #e2e8f0;
}
.index-loading-text { display: flex; flex-direction: column; line-height: 1.35; }
.index-loading-text strong { color: #fff; font-weight: 600; font-size: 0.95rem; }
.index-loading-detail { color: rgba(226, 232, 240, 0.75); font-size: 0.8rem; }
.index-loading .spinner,
.status .spinner,
.header-progress .spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(99, 102, 241, 0.25);
    border-top-color: rgba(99, 102, 241, 1);
    border-radius: 50%;
    animation: idxSpin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: -3px;
}
@keyframes idxSpin { to { transform: rotate(360deg); } }

/* Disabled-by-loading state for primary action buttons */
button[data-requires-index].is-waiting {
    opacity: 0.6; cursor: wait; pointer-events: none;
}

/* Index-load progress bar */
.index-loading-bar {
    margin-top: 8px;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    overflow: hidden;
}
.index-loading-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(99,102,241,1), rgba(52,199,89,1));
    border-radius: 999px;
    transition: width 0.3s ease;
}
#index-loading-pct {
    font-variant-numeric: tabular-nums;
    color: #c7d2fe;
    margin-left: 6px;
    font-weight: 500;
}

/* ── License limit banner on Add Stream form ───────────────────── */
@keyframes license-banner-breathe {
    0%, 100% {
        border-color: rgba(74, 222, 128, 0.28);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
    50% {
        border-color: rgba(74, 222, 128, 0.9);
        box-shadow: 0 0 14px rgba(74, 222, 128, 0.22);
    }
}
@keyframes license-banner-blocked-breathe {
    0%, 100% {
        border-color: rgba(248, 113, 113, 0.42);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
    50% {
        border-color: rgba(252, 165, 165, 0.85);
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
    }
}
.license-limit-banner {
    margin: -4px 0 12px;
    padding: 10px 12px;
    border-radius: 0.55rem;
    font-size: 12px;
    background: rgba(74, 222, 128, 0.06);
    border: 1px solid rgba(74, 222, 128, 0.35);
    color: #bbf7d0;
    line-height: 1.45;
}
.license-limit-banner:not([hidden]) {
    animation: license-banner-breathe 2.4s ease-in-out infinite;
}
.license-limit-banner b { color: #fff; }
.license-limit-banner.is-blocked {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(248, 113, 113, 0.45);
    color: #fecaca;
    animation: license-banner-blocked-breathe 2.4s ease-in-out infinite;
}
.license-limit-banner.is-blocked strong { color: #fff; }

#streams-count.limit-reached { color: #fecaca; background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.4); }
#stat-rec-workers-wrap.limit-reached .value { color: #fecaca; }

/* ── Danger buttons (destructive actions) ──────────────────── */
button.danger,
.btn.danger {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
    color: #fff;
    border: 1px solid rgba(239, 68, 68, 0.7);
    font-weight: 600;
}
button.danger:hover,
.btn.danger:hover {
    background: linear-gradient(180deg, rgba(248, 113, 113, 1), rgba(239, 68, 68, 1));
    border-color: rgba(248, 113, 113, 0.9);
}
button.danger:disabled { opacity: 0.55; cursor: not-allowed; }


/* -- License Gate (full-screen activation overlay) --------------- */
#license-gate {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(8, 11, 22, 0.92);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    color: #e6eaf4; font-family: inherit;
    transition: opacity 280ms ease, visibility 280ms ease;
}
#license-gate.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#license-gate .license-gate-card {
    width: 100%; max-width: 440px; padding: 32px 30px 26px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(245, 179, 1, 0.06), rgba(0, 0, 0, 0) 60%), rgba(20, 24, 38, 0.85);
    border: 1px solid rgba(245, 179, 1, 0.22);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
    text-align: center;
}
#license-gate .license-gate-logo { display: flex; justify-content: center; margin-bottom: 14px; }
#license-gate .license-gate-logo img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 4px 14px rgba(245, 179, 1, 0.35)); }
#license-gate h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: 0.04em; color: #fff; }
#license-gate .license-gate-sub { margin: 0 0 20px; font-size: 13px; color: rgba(255, 255, 255, 0.65); }
#license-gate .license-gate-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
#license-gate .license-gate-form label { font-size: 10.5px; color: rgba(255, 255, 255, 0.55); text-transform: uppercase; letter-spacing: 0.6px; }
#license-gate .license-gate-form input {
    background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e6eaf4; border-radius: 10px; padding: 11px 13px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    letter-spacing: 0.14em; text-transform: uppercase; font-size: 14px;
}
#license-gate .license-gate-form input:focus {
    outline: none; border-color: #f5b301;
    box-shadow: 0 0 0 3px rgba(245, 179, 1, 0.22);
}
#license-gate .license-gate-error { color: #ff6b6b; font-size: 12px; margin: 2px 0 0; }
#license-gate .license-gate-btn {
    margin-top: 6px; padding: 11px 16px; border: 0; border-radius: 10px; cursor: pointer;
    font-weight: 600; font-size: 14px; letter-spacing: 0.02em; color: #1a1408;
    background: linear-gradient(180deg, #ffcd3c, #f5b301);
    box-shadow: 0 8px 22px rgba(245, 179, 1, 0.32);
    transition: transform 80ms ease, filter 120ms ease;
}
#license-gate .license-gate-btn:hover:not(:disabled) { filter: brightness(1.05); }
#license-gate .license-gate-btn:active:not(:disabled) { transform: translateY(1px); }
#license-gate .license-gate-btn:disabled { opacity: 0.6; cursor: progress; }
#license-gate .license-gate-hwid {
    margin: 12px 0 0; font-size: 10.5px; color: rgba(255, 255, 255, 0.4);
    font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all;
}

#license-gate .license-gate-transfer {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 12px; border-radius: 8px;
    background: rgba(245, 179, 1, 0.06); border: 1px solid rgba(245, 179, 1, 0.25);
    font-size: 12px; color: rgba(255, 255, 255, 0.85); line-height: 1.4;
    cursor: pointer;
}
#license-gate .license-gate-transfer input { margin-top: 2px; cursor: pointer; }
#license-gate .license-gate-transfer b { color: #ffcd3c; }

/* -- LAN login gate (full-screen; same family as license gate) -- */
#lan-login-gate {
    position: fixed; inset: 0; z-index: 99998;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(8, 11, 22, 0.92);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    color: #e6eaf4; font-family: inherit;
    transition: opacity 280ms ease, visibility 280ms ease;
}
#lan-login-gate.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#lan-login-gate .lan-login-gate-card {
    width: 100%; max-width: 440px; padding: 32px 30px 26px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08), rgba(0, 0, 0, 0) 60%), rgba(20, 24, 38, 0.85);
    border: 1px solid rgba(129, 140, 248, 0.28);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
    text-align: center;
}
#lan-login-gate .lan-login-gate-logo { display: flex; justify-content: center; margin-bottom: 14px; }
#lan-login-gate h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: 0.04em; color: #fff; }
#lan-login-gate .lan-login-gate-sub { margin: 0 0 20px; font-size: 13px; color: rgba(255, 255, 255, 0.65); }
#lan-login-gate .lan-login-gate-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
#lan-login-gate .lan-login-gate-form label {
    font-size: 10.5px; color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase; letter-spacing: 0.6px;
}
#lan-login-gate .lan-login-gate-form input {
    background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e6eaf4; border-radius: 10px; padding: 11px 13px; font-size: 14px;
}
#lan-login-gate .lan-login-gate-form input:focus {
    outline: none; border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
#lan-login-gate .lan-login-gate-error { color: #ff6b6b; font-size: 12px; margin: 2px 0 0; }
#lan-login-gate .lan-login-gate-btn {
    margin-top: 6px; padding: 11px 16px; border: 0; border-radius: 10px; cursor: pointer;
    font-weight: 600; font-size: 14px; color: #fff;
    background: linear-gradient(180deg, #a5b4fc, #6366f1);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.35);
    transition: transform 80ms ease, filter 120ms ease;
}
#lan-login-gate .lan-login-gate-btn:hover:not(:disabled) { filter: brightness(1.06); }
#lan-login-gate .lan-login-gate-btn:disabled { opacity: 0.6; cursor: progress; }
#lan-login-gate .lan-login-gate-hint {
    margin: 10px 0 0; font-size: 11px; line-height: 1.45;
    color: rgba(255, 255, 255, 0.45); text-align: center;
}

.ov-lan-users-add-form {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}
.ov-lan-users-add-form[hidden] { display: none !important; }
.ov-lan-add-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.ov-lan-add-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
}
.ov-lan-add-grid input,
.ov-lan-add-grid select {
    font-size: 12px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    pointer-events: auto;
}
#ov-lan-users-wrap input,
#ov-lan-users-wrap select,
#ov-lan-users-wrap button {
    pointer-events: auto;
}
#ov-lan-users-table select[data-f="role"] {
    min-width: 200px;
    max-width: 280px;
}

/* -- Masked license key on About page -- */
.lic-key-wrap { display: inline-flex; align-items: center; gap: 6px; }
.lic-key-toggle {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    color: #c7d2fe; border-radius: 6px; padding: 1px 6px; font-size: 11px;
    cursor: pointer; line-height: 1.2;
}
.lic-key-toggle:hover { background: rgba(255,255,255,0.12); }

/* -- Form field block (matches label + input rhythm) -- */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.field.span-2 { grid-column: span 2; }
.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.field-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 500;
}
.format-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.format-summary {
    font-size: 12px;
    color: var(--muted);
    margin-right: 4px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.format-preset {
    background: transparent;
    border: none;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(199, 210, 254, 0.85);
    cursor: pointer;
    border-radius: 0.4rem;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.2;
}
.idf-view-toggle { display: flex; gap: 6px; flex-wrap: wrap; }
.idf-view-toggle .format-preset.active {
    background: rgba(99, 102, 241, 0.35);
    border-color: var(--accent);
    color: #e0e7ff;
}

.idf-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-top: 4px;
    width: 100%;
}

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

.idf-offline-quota {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    padding: 7px 12px;
    border-radius: 0.45rem;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.35);
    color: #c7d2fe;
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .idf-offline-quota {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

.idf-offline-quota.is-blocked {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(248, 113, 113, 0.45);
    color: #fecaca;
}

.idf-offline-quota.is-unlimited {
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.3);
    color: #bbf7d0;
}

/* Saved offline results — button + dropdown aligned with form inputs */
.idf-history-row {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr);
    gap: 12px;
    align-items: end;
    margin: 0 0 14px;
}
.idf-history-load {
    display: flex;
    align-items: flex-end;
}
.idf-history-load button {
    margin: 0;
    white-space: nowrap;
}
.idf-history-scans {
    margin: 0;
    min-width: 0;
}
.idf-history-scans select {
    width: 100%;
    box-sizing: border-box;
}
@media (max-width: 640px) {
    .idf-history-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .idf-history-load button {
        width: 100%;
    }
}

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

.idf-report-scroll {
    max-height: min(520px, 62vh);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.idf-progress-track {
    position: relative;
    min-height: 22px;
}
.idf-progress-track .progress-pct-label {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 700;
    color: #f3f4f6;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
    pointer-events: none;
    z-index: 2;
}

.format-preset:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.format-control {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.6rem;
    padding: 0.5rem 0.65rem;
    min-height: 38px;
    box-sizing: border-box;
}
.format-control:focus-within {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.format-matrix {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-content: flex-start;
    max-height: 4.5rem;
    overflow-y: auto;
    padding: 1px 0;
}
.format-matrix::-webkit-scrollbar { width: 4px; }
.format-matrix::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}
.format-cell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.1rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    user-select: none;
    transition: background .12s, border-color .12s, color .12s;
}
.format-cell input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.format-cell-ext {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 11px;
    color: rgba(229, 231, 235, 0.65);
    letter-spacing: 0;
}
.format-cell:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}
.format-cell:hover .format-cell-ext { color: var(--text); }
.format-cell.is-on {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(129, 140, 248, 0.55);
}
.format-cell.is-on .format-cell-ext {
    color: #eef2ff;
    font-weight: 500;
}
.format-cell:focus-within {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
}

/* Bulk identify / fingerprint run summary */
.run-summary { display: flex; flex-direction: column; gap: 6px; }
.run-summary-lead { color: var(--text); font-weight: 500; }
.run-summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 12px;
}
.run-summary-stats .stat-match,
.run-summary-stats .stat-nomatch,
.run-summary-stats .stat-error {
    font-weight: 500;
}
.progress-label .run-summary-stats { margin-top: 2px; }

/* Help bot character (draggable): help-bot-unit.css */

.help-bot-panel {
    position: absolute;
    right: 0;
    bottom: 104px;
    width: min(400px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    background: rgba(10, 10, 20, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(129, 140, 248, 0.22);
    border-radius: 16px;
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: help-bot-fade-in 0.25s ease-out;
}
.help-bot.help-bot-panel-above .help-bot-panel {
    bottom: auto;
    top: 104px;
}
.help-bot-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-2);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(79, 70, 229, 0.06));
}
.help-bot-head-text { flex: 1; min-width: 0; }
.help-bot-avatar {
    width: 72px;
    height: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
}
.help-bot-avatar--sm { width: 44px; height: 50px; }
.help-bot-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}
.help-bot-status-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
}
.help-bot-status-line::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
    animation: help-bot-pulse-ring 2s ease-out infinite;
}
.help-bot-status-line.is-offline::before { background: var(--warn); box-shadow: none; animation: none; }
.help-bot-status-line.is-busy::before { background: var(--accent); animation: help-bot-think-glow 0.8s infinite; }
.help-bot-close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.help-bot-close:hover { color: #fff; }
.help-bot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-2);
    max-height: 92px;
    overflow-y: auto;
}
.help-bot-chip {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--accent-2);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.help-bot-chip:hover {
    background: rgba(129, 140, 248, 0.18);
    border-color: rgba(129, 140, 248, 0.45);
    transform: translateY(-1px);
}
.help-bot-chip--inline { margin: 2px 4px 2px 0; vertical-align: baseline; }
.help-bot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 12px;
    min-height: 200px;
}
.help-bot-ai-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    margin-right: 6px;
    vertical-align: middle;
}
.help-bot-msg-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 6px;
}
.help-bot-msg--user .help-bot-msg-label { color: #a5b4fc; text-align: right; }
.help-bot-preamble {
    color: var(--accent-2);
    font-size: 13px;
    margin-bottom: 8px !important;
}
.help-bot-page { margin-bottom: 6px !important; }
.help-bot-page-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(129, 140, 248, 0.2);
    border: 1px solid rgba(129, 140, 248, 0.35);
    color: #c7d2fe;
}
.help-bot-msg-inner {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.help-bot-bubble { flex: 1; min-width: 0; }
.help-bot-msg p { margin: 0 0 6px; line-height: 1.5; }
.help-bot-msg p:last-child { margin-bottom: 0; }
.help-bot-title-line { font-weight: 600; color: #fff; margin-bottom: 4px !important; }
.help-bot-lead { color: var(--text); }
.help-bot-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-2); margin: 8px 0 4px !important; }
.help-bot-steps, .help-bot-tips { margin: 0 0 8px; padding-left: 1.2rem; }
.help-bot-steps li, .help-bot-tips li { margin-bottom: 4px; }
.help-bot-meta { font-size: 10px; color: var(--muted); margin-top: 8px !important; }
.help-bot-err { color: #fca5a5; }
.help-bot-fade-in { animation: help-bot-fade-in 0.35s ease-out forwards; }
.help-bot-extra .help-bot-lead { display: none; }
.help-bot-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 2px;
    background: var(--accent);
    vertical-align: text-bottom;
    animation: help-bot-cursor-blink 0.9s step-end infinite;
}
.help-bot-msg--user {
    align-self: flex-end;
    max-width: 88%;
    order: 1;
}
.help-bot-msg--user .help-bot-bubble {
    padding: 8px 12px;
    border-radius: 14px 14px 4px 14px;
    background: rgba(99, 102, 241, 0.4);
    border: 1px solid rgba(129, 140, 248, 0.3);
}
.help-bot-msg--bot {
    align-self: flex-start;
    max-width: 98%;
    order: 2;
}
.help-bot-msg--bot .help-bot-bubble {
    padding: 8px 10px;
    border-radius: 14px 14px 14px 4px;
    background: var(--panel);
    border: 1px solid var(--border-2);
}
.help-bot-msg--typing .help-bot-bubble { padding-top: 4px; }
.help-bot-typing-dots {
    display: flex;
    gap: 5px;
    padding: 6px 0;
}
.help-bot-typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: abox-typing-bounce 1.1s ease-in-out infinite;
}
.help-bot-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.help-bot-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
.help-bot-related { font-size: 11px; color: var(--muted); margin-top: 8px !important; }
.help-bot-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border-2);
}
.help-bot-form input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text);
    font-size: 13px;
}
.help-bot-form input:disabled { opacity: 0.55; }
.help-bot-form button.primary { padding: 8px 14px; min-width: 44px; }

.help-bot-footer {
    padding: 8px 14px 12px;
    border-top: 1px solid var(--border-2);
    background: rgba(0, 0, 0, 0.2);
}
.help-bot-enable-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}
.help-bot-enable-label input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
}
.help-bot-enable-label:hover span { color: var(--text); }

.help-bot.is-bot-disabled .help-bot-fab,
.help-bot.is-bot-disabled .help-bot-panel {
    display: none !important;
}
.help-bot-restore {
    position: fixed;
    right: 20px;
    bottom: 18px;
    z-index: 9989;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(129, 140, 248, 0.45);
    background: rgba(10, 10, 20, 0.94);
    color: #e0e7ff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}
.help-bot-restore:hover {
    border-color: rgba(165, 180, 252, 0.7);
    color: #fff;
}
.help-bot-restore[hidden] {
    display: none !important;
}
.help-bot.is-bot-disabled {
    pointer-events: none;
}
.help-bot.is-bot-disabled .help-bot-restore {
    pointer-events: auto;
}
@media (max-width: 480px) {
    .help-bot { right: 12px; bottom: 16px; }
    .help-bot-panel { width: calc(100vw - 24px); }
}
@media (prefers-reduced-motion: reduce) {
    .help-bot { transition: none !important; }
    .help-bot-fab, .help-bot-fab-pulse, .abox-unit__inner, .abox-unit__eye,
    .abox-unit__lens, .abox-unit__tread, .abox-unit__arm--r,
    .help-bot-status-line::before { animation: none !important; }
}
