/* ============================================================================
   NarraHive Script Editor â€” style.css
   Dark editorial design system for broadcast journalism
   ============================================================================ */

/* â”€â”€ Design Tokens (Dark Mode â€” Default) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
:root {
    --bg-app:        #0a0a0a;
    --bg-panel:      #0d0d0d;
    --bg-surface:    #141414;    /* player bar, modal backgrounds */
    --bg-card-rec:   #0f172a;
    --accent-rec:    #267336;    /* Premiere forest green — SB left border */
    --accent-rec-2:  rgba(38,115,54,0.25);
    --accent-rec-3:  rgba(38,115,54,0.45);
    --accent-vo:     #d946ef;    /* Magenta — TTS-generated VO (visible only when selected) */
    --accent-vo-rec: #14b8a6;    /* Teal — Recorded/approved VO (visible only when selected) */
    --bg-narrative:  rgba(234,51,35,0.04);
    --bg-card:       #1a1a2e;

    --accent-crimson:   #ea3323;
    --accent-crimson-2: rgba(234,51,35,0.2);
    --accent-crimson-3: rgba(234,51,35,0.45);
    --accent-note:      #f59e0b;
    --accent-suggested: rgba(99,102,241,0.15);
    --accent-blue:      #60a5fa;

    --marker-must:     #ea3323;
    --marker-poi:      #ffcc00;
    --marker-broll:    #00ccff;
    --marker-priority: #ff6600;
    --marker-note:     #e5e7eb;

    --text-primary:   #f8fafc;
    --text-secondary: #cbd5e1;    /* Brightened for visibility */
    --text-muted:     #94a3b8;    /* Brightened for visibility */
    --text-placeholder: #64748b;

    --border-subtle: #1a1a1a;
    --border-panel:  #1e1e1e;

    --topbar-h: 40px;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Light mode override */
[data-theme="light"] {
    --bg-app:        #f8f9fa;
    --bg-panel:      #ffffff;
    --bg-surface:    #f1f5f9;    /* player bar in light mode */
    --bg-card-rec:   #eff6ff;
    --accent-rec:    #1a6b2a;
    --accent-rec-2:  rgba(26,107,42,0.15);
    --accent-rec-3:  rgba(26,107,42,0.35);
    --bg-narrative:  rgba(220,38,38,0.04);
    --bg-card:       #f1f5f9;

    --accent-crimson:    #dc2626;
    --accent-crimson-2:  rgba(220,38,38,0.15);
    --marker-poi:        #ca8a04;
    --marker-broll:      #0891b2;
    --marker-priority:   #ea580c;
    --marker-note:       #6b7280;
    --accent-note:       #d97706;

    --text-primary:   #0f172a;
    --text-secondary: #334155;    /* Darkened for visibility on white */
    --text-muted:     #475569;    /* Darkened for visibility on white */
    --text-placeholder: #9ca3af;

    --border-subtle: #e5e7eb;
    --border-panel:  #e2e8f0;
}

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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    background: var(--bg-app);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; font-family: inherit; }
textarea, input, select {
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
}
.hidden { display: none !important; }

/* â”€â”€ App Layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.nh-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-app);
}

/* â”€â”€ TOP BAR â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.nh-topbar {
    display: flex;
    align-items: center;
    height: var(--topbar-h);
    padding: 0 12px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    gap: 8px;
    position: relative;
    z-index: 100;
}

.topbar-logo {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}
.topbar-logo-dot {
    color: var(--accent-crimson);
}

/* Breadcrumb */
.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.bc-segment {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: none;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s;
}
.bc-segment:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--border-panel);
}
.bc-label { font-size: 11px; }
.bc-arrow { opacity: 0.4; flex-shrink: 0; }
.bc-sep {
    color: var(--text-muted);
    font-size: 12px;
    user-select: none;
}
.bc-new-btn {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid var(--border-panel);
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.bc-new-btn:hover {
    background: rgba(234,51,35,0.12);
    border-color: var(--accent-crimson);
    color: var(--accent-crimson);
}

/* ── RM-028 Phase A: recording chip + quick-switch drawer ───────────────── */
.bc-recording .bc-rec-mic { font-size: 11px; line-height: 1; }
.bc-recording .bc-label { font-family: 'JetBrains Mono', monospace; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-recording[aria-expanded="true"] { background: rgba(255,255,255,0.08); border-color: var(--border-panel); }
.bc-recording[aria-expanded="true"] .bc-rec-caret { transform: rotate(180deg); }
.bc-rec-caret { transition: transform 0.15s; }

/* Old file tabs replaced by the breadcrumb chip + drawer */
#tpTabs { display: none !important; }

/* Breadcrumb moved to the panel row — hide the topbar project crumb + New Project
   (project creation lives in the browser / folder-project management). Company stays. */
#bcProject, #bcTopSep, #bcNewBtn { display: none !important; }
/* Company has no switcher yet (single company) — drop the dropdown caret + click affordance */
#bcTeam .bc-arrow { display: none; }
#bcTeam { cursor: default; }

/* Folder/project trail + recording chip live in the transcript panel controls bar */
.nh-crumb-path { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.nh-crumb-seg {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 8px; border: 1px solid transparent; border-radius: 6px;
    background: none; color: var(--text-secondary); font-size: 13px;
    max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: background 0.15s;
}
.nh-crumb-seg.nh-crumb-clickable { cursor: pointer; }
.nh-crumb-seg.nh-crumb-clickable:hover { background: rgba(255,255,255,0.06); }
.nh-crumb-seg.nh-crumb-project { color: var(--accent-crimson); font-weight: 600; }
.nh-crumb-sep { color: var(--text-muted); font-size: 12px; user-select: none; }
.nh-crumb-ellipsis {
    cursor: pointer; color: var(--text-muted); padding: 4px 6px; border-radius: 6px;
    font-size: 13px; line-height: 1;
}
.nh-crumb-ellipsis:hover { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.nh-crumb-pop {
    position: fixed; z-index: 320; min-width: 180px; padding: 6px;
    background: var(--bg-surface); border: 1px solid var(--border-panel);
    border-radius: 10px; box-shadow: 0 16px 40px -14px rgba(0,0,0,0.7);
}
.nh-crumb-pop-item {
    display: flex; align-items: center; gap: 8px; padding: 7px 9px; width: 100%;
    border: none; background: none; border-radius: 6px; cursor: pointer;
    font-size: 13px; color: var(--text-secondary); white-space: nowrap; text-align: left;
}
.nh-crumb-pop-item:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

/* NH-136: folder picker tree + Add/Move mode toggle (modal is always dark) */
.nh-tree { max-height: 280px; overflow-y: auto; border: 1px solid #2a2a3a; border-radius: 8px; padding: 4px; background: #0e0e15; }
.nh-tree-row { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #cbd5e1; white-space: nowrap; }
.nh-tree-row:hover { background: rgba(255,255,255,0.05); }
.nh-tree-row.selected { background: rgba(99,102,241,0.22); color: #fff; }
.nh-tree-tog { width: 14px; flex-shrink: 0; display: inline-flex; justify-content: center; color: #9aa; font-size: 11px; cursor: pointer; }
.nh-tree-lbl { overflow: hidden; text-overflow: ellipsis; }
.nh-mode-btn { flex: 1; padding: 6px; border: 1px solid #33334a; background: #1a1a26; color: #9aa; border-radius: 7px; font-size: 12px; cursor: pointer; }
.nh-mode-btn.active { background: rgba(99,102,241,0.25); color: #fff; border-color: #6366f1; }

/* RM-028 Phase B: narrative brief now lives in the project drawer — hide the
   old main-menu brief block above the script to reclaim space. */
#narrativeBrief { display: none !important; }

/* RM-028 Phase B: project settings drawer */
.nh-proj-drawer {
    position: fixed; z-index: 300; width: clamp(400px, 48vw, 700px); max-width: 94vw; max-height: 84vh;
    overflow-y: auto; padding: 18px 20px;
    background: var(--bg-surface); border: 1px solid var(--border-panel);
    border-radius: 12px; box-shadow: 0 20px 50px -12px rgba(0,0,0,0.7);
}
.nh-pd-sub { font-size: 10.5px; font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.nh-pd-field textarea { min-height: 96px; resize: vertical; }

/* Superuser mode — strong visual indicator (amber accent + badge) */
body.nh-superuser .nh-topbar { border-bottom: 2px solid #fbbf24; box-shadow: inset 0 -2px 0 #fbbf24; }
.nh-su-badge { background: #fbbf24; color: #1a1a1a; font-weight: 800; font-size: 10px; padding: 2px 7px; border-radius: 6px; letter-spacing: .05em; }

/* RM-028: drop the "Toggle transcript panel" button */
#spCollapseTranscriptBtn { display: none !important; }
/* NH-139: script language now lives in Project setup — hide the main-menu selector
   (kept in DOM, mirrored, so the agent still reads its value) */
.sp-lang-label, #scriptLangSelector { display: none !important; }
.nh-pd-info { font-size: 11px; color: var(--text-muted); cursor: help; margin-left: 4px; }
.nh-pd-header { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; }
.nh-pd-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.nh-pd-field > span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-placeholder); }
.nh-pd-field input, .nh-pd-field textarea, .nh-pd-field select {
    width: 100%; box-sizing: border-box; padding: 8px 10px; font-size: 13px;
    background: var(--bg-app); border: 1px solid var(--border-panel); border-radius: 8px;
    color: var(--text-primary); outline: none; resize: vertical; font-family: inherit;
}
.nh-pd-field input:focus, .nh-pd-field textarea:focus { box-shadow: 0 0 0 3px rgba(234,51,35,0.28); }
.nh-pd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.nh-pd-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
    border: 1px solid var(--border-panel); background: none; border-radius: 8px;
    color: var(--text-secondary); font-size: 12.5px; cursor: pointer; transition: background .12s;
}
.nh-pd-btn:hover { background: rgba(255,255,255,0.06); }
.nh-pd-msg { font-size: 11.5px; color: var(--text-muted); min-height: 14px; margin-top: 8px; }
.nh-pd-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.nh-pd-tags:empty { display: none; }
.nh-pd-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.nh-pd-tag button { border: none; background: none; color: inherit; cursor: pointer; opacity: .65; padding: 0; font-size: 13px; line-height: 1; }
.nh-pd-tag button:hover { opacity: 1; }
.nh-pd-tagadd {
    display: block; width: 100%; box-sizing: border-box; padding: 8px 10px;
    border: 1px solid var(--border-panel); border-radius: 8px; background: var(--bg-app);
    color: var(--text-primary); font-size: 13px; outline: none;
}
.nh-pd-tagadd:focus { box-shadow: 0 0 0 3px rgba(234,51,35,0.28); }
.nh-pd-folders { display: flex; flex-direction: column; border: 1px solid var(--border-panel); border-radius: 8px; overflow: hidden; }
.nh-pd-folder { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; }
.nh-pd-folder:hover { background: rgba(255,255,255,0.04); }
.nh-pd-folder input[type="radio"] { width: auto !important; padding: 0 !important; box-shadow: none !important; flex-shrink: 0; margin: 0; }
.nh-pd-folder-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nh-pd-folder .nh-pd-rm { flex-shrink: 0; border: none; background: none; color: var(--text-muted); cursor: pointer; font-size: 14px; line-height: 1; }
.nh-pd-folder .nh-pd-rm:hover { color: #fca5b5; }
.nh-pd-addfolder {
    display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 10px;
    border: none; border-top: 1px solid var(--border-panel); background: none;
    color: #818cf8; font-size: 12.5px; cursor: pointer; text-align: left;
}
.nh-pd-addfolder:hover { background: rgba(255,255,255,0.04); }
[data-theme="light"] .nh-pd-folder:hover, [data-theme="light"] .nh-pd-addfolder:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .nh-pd-btn:hover { background: rgba(0,0,0,0.05); }
/* RM-028: full-width breadcrumb bar above the workspace */
.nh-crumb-bar {
    display: flex; align-items: center; gap: 6px; width: 100%; box-sizing: border-box;
    padding: 6px 14px; background: var(--bg-panel);
    border-bottom: 1px solid var(--border-panel); overflow-x: auto; flex-shrink: 0;
}
.nh-crumb-bar::-webkit-scrollbar { height: 0; }
.nh-crumb-bar .bc-recording { font-size: 13px; padding: 5px 10px; color: #14b8a6; }
.nh-crumb-bar .bc-recording .bc-label { font-size: 13px; max-width: 720px; }

.nh-crumb-drawer {
    position: fixed;           /* top/left set in JS, anchored under the chip */
    z-index: 300;
    width: 440px;
    max-width: 92vw;
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-panel);
    border-radius: 12px;
    box-shadow: 0 20px 50px -12px rgba(0,0,0,0.7);
}
.nh-rec-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    transition: background 0.12s;
}
.nh-rec-row:hover, .nh-rec-row:focus-visible { background: rgba(255,255,255,0.05); }
.nh-rec-row.active { background: rgba(234,51,35,0.10); }
.nh-rec-check { width: 16px; display: flex; justify-content: center; color: var(--accent-crimson); font-size: 13px; }
.nh-rec-name {
    flex: 1; min-width: 0;
    font-family: 'JetBrains Mono', monospace; font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nh-rec-row.active .nh-rec-name { color: var(--text-primary); }
.nh-rec-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* Hover swaps the duration/status for per-row actions (V0 pattern) */
.nh-rec-actions { display: none; margin-left: auto; align-items: center; gap: 2px; flex-shrink: 0; }
.nh-rec-row:hover .nh-rec-meta, .nh-rec-row:focus-within .nh-rec-meta { display: none; }
.nh-rec-row:hover .nh-rec-actions, .nh-rec-row:focus-within .nh-rec-actions { display: flex; }
.nh-rec-act {
    width: 26px; height: 26px; display: grid; place-items: center;
    border: none; background: none; border-radius: 6px; cursor: pointer;
    color: var(--text-muted); font-size: 13px; line-height: 1;
}
.nh-rec-act:hover { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.nh-rec-act-danger:hover { color: #fca5b5; }
[data-theme="light"] .nh-rec-act:hover { background: rgba(0,0,0,0.06); }
.nh-rec-dur { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-placeholder); }
.nh-rec-pill { border-radius: 999px; padding: 2px 8px; font-size: 10px; font-weight: 500; line-height: 1; }
.nh-rec-add {
    display: flex; align-items: center; gap: 10px;
    width: 100%; margin-top: 2px; padding: 8px;
    border: none; background: none; border-radius: 8px;
    color: #818cf8; font-size: 13px; cursor: pointer;
    transition: background 0.12s;
}
.nh-rec-add:hover { background: rgba(255,255,255,0.05); }
.nh-rec-empty { padding: 10px 12px; color: var(--text-muted); font-size: 12px; }
[data-theme="light"] .nh-rec-row:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .nh-rec-row.active { background: rgba(220,38,38,0.10); }

/* Topbar right */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    position: relative;
}
.topbar-version {
    font-size: 10px;
    opacity: 0.35;
    vertical-align: middle;
}
.topbar-dl-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.topbar-dl-win {
    background: rgba(96,165,250,0.1);
    border: 1px solid rgba(96,165,250,0.2);
    color: #60a5fa;
}
.topbar-dl-win:hover { background: rgba(96,165,250,0.2); }
.topbar-dl-mac {
    background: rgba(52,211,153,0.1);
    border: 1px solid rgba(52,211,153,0.2);
    color: #34d399;
}
.topbar-dl-mac:hover { background: rgba(52,211,153,0.2); }

.theme-toggle-group {
    display: flex;
    align-items: center;
    background: rgba(128,128,128,0.1);
    border-radius: 16px;
    padding: 2px;
    gap: 1px;
}
.theme-opt {
    width: 22px;
    height: 22px;
    border-radius: 12px;
    border: none;
    background: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.theme-opt.active, .theme-opt:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-primary);
}

.topbar-bug-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(234,51,35,0.25);
    background: none;
    color: var(--accent-crimson);
    font-size: 11px;
    transition: all 0.15s;
}
.topbar-bug-btn:hover { background: rgba(234,51,35,0.1); }

/* â”€â”€ WORKSPACE â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.nh-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* â”€â”€ PANELS â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.nh-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-panel);
}

.nh-transcript-panel {
    width: 42%;
    min-width: 240px;
    border-right: 1px solid var(--border-subtle);
    flex-shrink: 0;
    transition: width 0.25s ease;
    position: relative; /* containing block for record-modal overlay */
}

.nh-script-panel {
    flex: 1;
    min-width: 200px;
    overflow: hidden;
}

/* â”€â”€ PANEL RESIZE HANDLE â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.nh-panel-resizer {
    width: 6px;
    flex-shrink: 0;
    position: relative;
    background: transparent;
    cursor: col-resize;
    z-index: 10;
}
/* Permanent visible crimson center-line */
.nh-panel-resizer::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0; bottom: 0;
    width: 2px;
    transform: translateX(-50%);
    background: rgba(234,51,35,0.35);
    transition: background 0.15s;
    pointer-events: none;
}
.nh-panel-resizer:hover::before {
    background: rgba(234,51,35,0.85);
}
.nh-panel-resizer:hover .panel-resizer-hit {
    background: rgba(234,51,35,0.08);
}
.panel-resizer-hit {
    position: absolute;
    inset: 0;
    transition: background 0.15s;
}
.panel-collapse-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid var(--border-panel);
    background: var(--bg-panel);
    color: var(--text-secondary);
    font-size: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
    transition: all 0.15s;
}
.panel-collapse-left { left: -9px; }
.panel-collapse-right { left: -9px; }
.nh-panel-resizer:hover .panel-collapse-btn,
.panel-collapse-btn:hover {
    display: flex;
    color: var(--accent-crimson);
    border-color: var(--accent-crimson);
}

.transcript-hidden-strip {
    width: 6px;
    background: var(--accent-crimson);
    cursor: pointer;
    flex-shrink: 0;
    writing-mode: vertical-rl;
    font-size: 9px;
    letter-spacing: 0.1em;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.transcript-hidden-strip:hover { opacity: 1; }

/* ── HORIZONTAL PANEL RESIZE HANDLE (For Agent / Brief) ── */
.nh-panel-resizer-h {
    height: 0;          /* no visual height — button floats via absolute, handle is the only line */
    overflow: visible;
    flex-shrink: 0;
    position: relative;
    background: transparent;
    cursor: pointer;
    z-index: 13;        /* must be > agent-resize-handle (11) so button renders above the line */
}
.nh-panel-resizer-h:hover .panel-resizer-hit {
    background: rgba(234,51,35,0.08);
}
.panel-collapse-btn-h {
    position: absolute;
    left: 50%;
    /* Sit ON the resize handle line (which is at the bottom of this bar):
       button height=18px, so -9px centers it on the bottom edge */
    bottom: -9px;
    transform: translateX(-50%);
    height: 18px;
    padding: 0 12px;
    border-radius: 4px;
    border: 1px solid var(--accent-crimson);
    background: var(--bg-panel);
    color: var(--accent-crimson);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    z-index: 12;
    transition: all 0.15s;
    white-space: nowrap;
}
.nh-panel-resizer-h:hover .panel-collapse-btn-h,
.panel-collapse-btn-h:hover {
    color: var(--accent-crimson);
    border-color: var(--accent-crimson);
}
.panel-collapse-btn-h svg {
    transition: transform 0.2s;
}
.panel-collapse-btn-h.expanded svg {
    transform: rotate(90deg);
}

/* â”€â”€ TRANSCRIPT PANEL CONTROLS BAR â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tp-controls-bar {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 4px 8px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 4px;
    flex-shrink: 0;
    overflow: visible;
}

.tp-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    flex-shrink: 1;
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.tp-tabs::-webkit-scrollbar { height: 3px; }
.tp-tabs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.tp-util-btns {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}

/* â”€â”€ FULL-WIDTH PLAYER BAR â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tp-player-bar {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 8px;
    gap: 6px;
    background: var(--bg-surface, #0f0f0f);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}
/* Track utility actions (rename / lang / retranscribe / markers / delete) */
.tp-track-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
    flex-shrink: 0;
}
/* Add-file button â€” always visible at right of tabs row */
.tp-tab-add {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px dashed var(--border-panel);
    background: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s;
    margin-right: 4px;
}
.tp-tab-add:hover { border-color: var(--accent-crimson); color: var(--accent-crimson); }
.tp-player-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 100%;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.12s, background 0.12s;
}
.tp-player-btn:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }
.tp-player-play {
    width: 34px;
    height: 34px;
    font-size: 14px;
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    flex-shrink: 0;
    align-self: center;
}
.tp-player-play:hover { background: rgba(255,255,255,0.14); }
.tp-player-time {
    display: flex;
    align-items: center;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0 4px;
}
/* Waveform fills all remaining width â€” height MUST be capped so the 44px player bar stays 44px */
.tp-player-waveform {
    flex: 1;
    min-width: 0;
    height: 32px;          /* explicit cap â€” prevents canvas natural size from exploding */
    max-height: 32px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(0,0,0,0.25);
    align-self: center;
}
.tp-player-waveform .tp-marker-track {
    height: 16px;
    position: relative;
    background: rgba(0,0,0,0.3);
    flex-shrink: 0;
    overflow: visible;
}
.tp-player-waveform .tp-waveform-container {
    flex: 1;
    height: 26px;          /* explicit fallback so flex:1 doesn't collapse when canvas is empty */
    position: relative;
    overflow: hidden;
}

/* â”€â”€ WAVEFORM ROW (standalone, kept for any remaining legacy references) â”€â”€â”€â”€â”€â”€ */

.tp-tab {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    border: none;
    border-right: 1px solid var(--border-subtle);
    background: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.12s;
}
.tp-tab.active {
    background: #1e293b;
    color: var(--text-primary);
    font-weight: 600;
}
.tp-tab:hover:not(.active) { background: rgba(255,255,255,0.04); }

.tp-tab-add {
    padding: 4px 8px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.12s;
}
.tp-tab-add:hover { color: var(--text-primary); }

.tp-controls-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Inline waveform (sits between time display and utility buttons in controls bar) */
.tp-waveform-inline {
    flex: 1;
    min-width: 60px;
    max-width: 220px;
    height: 30px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}
.tp-waveform-inline .tp-marker-track {
    height: 5px;
    position: relative;
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
    overflow: visible;
}
.tp-waveform-inline .tp-waveform-container {
    flex: 1;
    position: relative;
    background: rgba(0,0,0,0.15);
    cursor: pointer;
    border-radius: 2px;
}

.tp-ctrl-btn {
    padding: 3px 6px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 11px;
    border-radius: 4px;
    transition: all 0.12s;
    line-height: 1;
}
.tp-ctrl-btn:hover { background: rgba(255,255,255,0.08); }
.tp-ctrl-btn.tp-ctrl-muted { color: var(--text-secondary); }
.tp-ctrl-btn.tp-ctrl-danger:hover { color: var(--accent-crimson); }

.tp-time {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
}

.tp-lang-select {
    border: none;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
}

/* â”€â”€ WAVEFORM ROW (standalone, kept for any remaining legacy references) â”€â”€â”€â”€â”€â”€ */
.tp-waveform-row {
    flex-shrink: 0;
}

.tp-marker-track {
    height: 14px;
    position: relative;
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
    overflow: visible;
}

.tp-waveform-container {
    height: 40px;
    position: relative;
    background: rgba(0,0,0,0.15);
    flex-shrink: 0;
    cursor: pointer;
}

.tp-waveform {
    width: 100%;
    height: 100%;
    display: block;
}

.tp-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255,255,255,0.8);
    pointer-events: none;
    left: 0;
    transition: left 0.05s linear;
}

/* NLE-style marker pennant */
.nle-marker {
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 14px;
    transform: translateX(-50%);
    cursor: pointer;
    z-index: 2;
}
.nle-marker svg { width: 10px; height: 14px; }
.nle-marker:hover .nle-marker-tip { opacity: 1; }
.nle-marker-tip {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #f1f5f9;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
}

/* Inline transcript marker pennant (above word) */
.word-marker {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 10px;
    height: 10px;
    z-index: 3;
}

/* Inline transcript marker - Premiere pennant sitting ABOVE the word
   (.word must have position:relative; pennant is position:absolute) */
.marker-pennant {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 8px;       /* -25% from 10px */
    height: 10px;     /* -25% from 13px */
    clip-path: polygon(0% 0%, 100% 0%, 100% 62%, 50% 100%, 0% 62%);
    background: var(--c, #888888);
    cursor: pointer;
    z-index: 10;
    pointer-events: auto;
    transition: filter 0.12s, transform 0.12s;
}
.marker-pennant:hover {
    filter: brightness(1.35);
    transform: translateX(-50%) scaleY(1.15);
}
.marker-pennant::after {
    content: attr(data-marker-label);
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e1e;
    border: 1px solid var(--c, #888);
    color: var(--c, #fff);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s;
    z-index: 100;
}
.marker-pennant:hover::after { opacity: 1; }

/* Waveform marker track — same shape & size as transcript pennants */
.marker-dot {
    position: absolute;
    bottom: 0;          /* pin to bottom of the waveform track */
    width: 8px;         /* matches .marker-pennant width */
    height: 10px;       /* matches .marker-pennant height */
    clip-path: polygon(0% 0%, 100% 0%, 100% 62%, 50% 100%, 0% 62%);
    background: var(--c, #fff);
    transform: translateX(-50%);
    cursor: pointer;
    z-index: 2;
    transition: filter 0.1s, transform 0.1s;
}
.marker-dot:hover { filter: brightness(1.4); transform: translateX(-50%) scaleY(1.15); }


/* ── NLE-style segment selection (clicking REC block in script) ─────────── */
/* Individual words are tagged .seg-selected for JS tracking only — no background here.
   The visible highlight is provided by .seg-highlight-overlay positioned divs
   that span each visual line (including spaces) and work across speaker blocks. */
.word.seg-selected { /* JS bookkeeping class — background intentionally omitted */ }

/* Crimson overlay div drawn over each visual line of the selected range */
.seg-highlight-overlay {
    position: absolute;
    background: rgba(234,51,35,0.25);
    border-radius: 2px;
    pointer-events: none;
    z-index: 1;
}
/* Ensure word text/pennants render above the overlay */
.word {
    position: relative;
    z-index: 2;
}
.seg-range-mark { display: contents; } /* legacy — kept as no-op so old marks don’t break layout */

/* Current word during playback — crimson highlight */
.word-current {
    background: rgba(234,51,35,0.25) !important;
    border-radius: 2px;
    z-index: 3 !important;
}

/* ── TRANSCRIPT SEARCH BAR ────────────────────────────────────────────────── */
.tp-search-bar {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    gap: 6px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}
.tp-search-input {
    flex: 1;
    border: 1px solid var(--border-panel);
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 12px;
    background: rgba(255,255,255,0.04);
    outline: none;
    color: var(--text-primary);
}
.tp-search-count {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    min-width: 30px;
}

/* â”€â”€ TRANSCRIPT CONTENT â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tp-transcript-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    position: relative;
}

.tp-transcript-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    gap: 8px;
}
.tp-placeholder-icon { font-size: 32px; opacity: 0.4; }
.tp-transcript-placeholder p {
    font-size: 13px;
    color: var(--text-secondary);
}
.tp-placeholder-sub { font-size: 12px !important; color: var(--text-muted) !important; }
.tp-inline-link {
    background: none;
    border: none;
    color: var(--accent-crimson);
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

/* Transcript flow */
.transcript-flow {
    font-size: 15px;
    line-height: 2.4;
    color: var(--text-primary);
    user-select: text !important;  /* allow transcript text to be selected for popup */
    position: relative;            /* required for .seg-highlight-overlay positioning */
}
/* RTL transcript (Hebrew, Arabic): right-to-left layout */
.transcript-flow.rtl {
    direction: rtl;
    text-align: right;
}
/* RTL: flip speaker label margins */
.transcript-flow.rtl .transcript-speaker {
    text-align: right;
}
/* RTL trim handles: in-handle on right, out on left */
.transcript-flow.rtl .seg-trim-in  { order: 1; }
.transcript-flow.rtl .seg-trim-out { order: -1; }

/* REC block RTL text: auto-detect via dir=auto on <p> */
.sp-block--rec .sp-block-text[dir="auto"]:dir(rtl),
.sp-block--rec .sp-block-text[dir="auto"]:has(~ *:dir(rtl)) {
    /* handled by browser unicode-bidi: isolate — dir=auto on the <p> is sufficient */
}
/* Explicit RTL SoundBite block class (set from JS when transcript is RTL) */
/* Border stays on physical LEFT always — do not flip to border-right for RTL */
.sp-block--rec.rtl {
    /* no border override — border-left is always correct */
}
.sp-block--rec.rtl .sp-block-text {
    direction: rtl;
    text-align: right;
}
.sp-block--rec.rtl .block-label {
    /* badge stays top-right on RTL — position is absolute, not flow */
}
.sp-block--rec.rtl .sp-block-label-row.top-right {
    left: 10px;
    right: auto;
}
.sp-block--rec.rtl .sp-block-label-row:not(.top-right) {
    flex-direction: row-reverse;
}

.transcript-speaker {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 12px 0 2px;
}
.transcript-speaker:first-child { margin-top: 0; }

.transcript-word {
    display: inline;
    position: relative;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.1s;
}
.transcript-word:hover { background: rgba(255,255,255,0.06); }
.transcript-word.active { background: rgba(234,51,35,0.3); text-decoration: underline; text-decoration-thickness: 1px; }
.transcript-word.highlighted,
.word.highlighted {
    background: rgba(234,51,35,0.25); /* crimson */
    border-radius: 2px;
}
.transcript-word.in-rec { background: var(--accent-crimson-2); }

/* â”€â”€ NLE-style segment selection (clicking REC block in script) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* Amber highlight matching V0 design */
.word.seg-selected {
    /* JS bookkeeping class — background intentionally omitted, handled by .seg-highlight-overlay */
}

/* Bracket handles â€” vertical amber bars with knob */
.seg-trim-handle {
    display: inline-block;
    width: 10px;      /* wider = easier to grab */
    height: 1.4em;
    background: rgba(251,146,60,0.85);
    border-radius: 3px;
    cursor: ew-resize;
    position: relative;
    vertical-align: middle;
    user-select: none;
    flex-shrink: 0;
    z-index: 3;
    touch-action: none;
}
.seg-trim-handle::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(251,146,60,0.9);
    border: 1.5px solid rgba(255,255,255,0.4);
}
.seg-trim-in  { cursor: w-resize; border-radius: 2px 0 0 2px; }
.seg-trim-out { cursor: e-resize; border-radius: 0 2px 2px 0; }
.seg-trim-in::before {
    content: '[';
    position: absolute;
    top: -2px;
    left: -7px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(251,146,60,0.9);
    font-family: var(--font-mono, monospace);
    line-height: 1;
}
.seg-trim-out::before {
    content: ']';
    position: absolute;
    top: -2px;
    right: -7px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(251,146,60,0.9);
    font-family: var(--font-mono, monospace);
    line-height: 1;
}

/* Timecode tooltip shown during drag */
.seg-trim-tooltip {
    position: fixed;
    background: rgba(251,146,60,0.95);
    color: #000;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
}

/* Add-to-script bubble */
.add-to-script-bubble {
    position: fixed;
    background: var(--accent-crimson);
    border-radius: 6px;
    overflow: hidden;
    z-index: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.add-to-script-bubble button {
    padding: 6px 12px;
    border: none;
    background: none;
    color: white;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* â”€â”€ AGENT SECTION (bottom of transcript panel) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tp-agent-section {
    flex-shrink: 0;
    /* No border-top here — the agent-resize-handle is the single visible line */
}

.tp-agent-bar {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 8px;
    gap: 8px;
}

.tp-agent-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: rgba(96,165,250,0.1);
    color: var(--accent-blue);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 5px;
    transition: all 0.12s;
}
.tp-agent-toggle:hover { background: rgba(96,165,250,0.2); }
.agent-arrow { transition: transform 0.2s; }
.agent-arrow.expanded { transform: rotate(90deg); }

.tp-script-lang {
    margin-left: 2px;
    border: none;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    color: var(--text-secondary);
    outline: none;
    cursor: pointer;
}

.tp-script-lang-label {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 8px;
}

/* Agent expanded panel */
.tp-agent-panel {
    display: flex;
    flex-direction: column;
    max-height: 200px;
    position: relative;
}
.tp-agent-panel.expanded { max-height: 50%; }

.agent-resize-handle {
    height: 6px;
    cursor: row-resize;
    background: transparent;
    flex-shrink: 0;
    position: relative;
    /* Pull up to sit exactly ON the tp-agent-section border-top */
    margin-top: -3px;
    z-index: 11;
}
/* Permanent visible crimson center-line — overlays the section border */
.agent-resize-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 2px;
    transform: translateY(-50%);
    background: rgba(234,51,35,0.35);
    transition: background 0.15s;
    pointer-events: none;
}
.agent-resize-handle:hover::before {
    background: rgba(234,51,35,0.85);
}
.agent-resize-handle::after {
    content: '';
    position: absolute;
    inset: 0;
    transition: background 0.15s;
}
.agent-resize-handle:hover::after { background: rgba(234,51,35,0.08); }

.agent-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.agent-msg {
    max-width: 92%;
    font-size: 12px;
    line-height: 1.45;
    padding: 6px 10px;
    border-radius: 8px;
}
.agent-msg--user {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    align-self: flex-end;
    border: 1px solid var(--border-panel);
}
.agent-msg--agent {
    background: rgba(234,51,35,0.08);
    color: var(--text-primary);
    align-self: flex-start;
    border: 1px solid rgba(234,51,35,0.15);
}
.agent-msg--thinking {
    opacity: 0.6;
    font-style: italic;
}

/* Legacy class aliases used by sendChat() â€” map to new visual styles */
.msg { max-width: 92%; font-size: 12px; line-height: 1.45; padding: 6px 10px; border-radius: 8px; }
.msg.user  { background: rgba(255,255,255,0.06); color: var(--text-primary); align-self: flex-end; border: 1px solid var(--border-panel); }
.msg.agent { background: rgba(234,51,35,0.08);  color: var(--text-primary); align-self: flex-start; border: 1px solid rgba(234,51,35,0.15); }

.agent-input-row {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 6px 8px;
    border-top: 1px solid var(--border-subtle);
    position: relative;
}

.agent-input {
    flex: 1;
    border: 1px solid var(--border-panel);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 12px;
    line-height: 1.4;
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
    outline: none;
    resize: none;
    min-height: 30px;
    max-height: 80px;
}
.agent-input::placeholder { color: var(--text-muted); }
.agent-input:focus { border-color: rgba(234,51,35,0.4); }

.agent-send-group {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
}
.agent-send-btn {
    padding: 6px 10px;
    background: var(--accent-crimson);
    border: none;
    border-radius: 5px 0 0 5px;
    color: white;
    font-size: 13px;
    font-weight: 700;
    transition: opacity 0.15s;
}
.agent-send-btn:hover { opacity: 0.85; }
.agent-send-arrow {
    padding: 6px 5px;
    background: rgba(234,51,35,0.7);
    border: none;
    border-left: 1px solid rgba(255,255,255,0.15);
    border-radius: 0 5px 5px 0;
    color: white;
    font-size: 9px;
    cursor: pointer;
    transition: background 0.15s;
}
.agent-send-arrow:hover { background: rgba(234,51,35,0.9); }

.agent-send-popup {
    position: absolute;
    right: 8px;
    bottom: 100%;
    margin-bottom: 4px;
    background: #1a1a1a;
    border: 1px solid var(--border-panel);
    border-radius: 7px;
    padding: 4px;
    z-index: 200;
    min-width: 220px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.agent-send-opt {
    display: block;
    width: 100%;
    padding: 6px 10px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 11px;
    text-align: left;
    border-radius: 5px;
    transition: background 0.1s;
}
.agent-send-opt:hover { background: rgba(255,255,255,0.06); }

.agent-retry-banner {
    padding: 6px 10px;
    background: rgba(234,51,35,0.1);
    border-top: 1px solid rgba(234,51,35,0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--accent-crimson);
}
.agent-retry-banner button {
    padding: 3px 8px;
    border: 1px solid var(--accent-crimson);
    border-radius: 4px;
    background: none;
    color: var(--accent-crimson);
    font-size: 11px;
    transition: all 0.12s;
}
.agent-retry-banner button:hover { background: rgba(234,51,35,0.15); }

/* â”€â”€ AGENT QUEUE TRAY â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.agent-queue-tray {
    border-top: 1px solid var(--border-subtle);
    padding: 6px 8px;
    background: rgba(251,191,36,0.05);
    transition: max-height 0.2s ease-in-out, padding 0.2s;
    box-sizing: border-box;
    z-index: 1000;
}
.agent-queue-tray:not(.expanded) {
    max-height: 28px;
    min-height: 28px;
    overflow: hidden;
    cursor: pointer;
    padding-top: 4px;
    padding-bottom: 4px;
}
.agent-queue-tray:not(.expanded):hover {
    background: rgba(251,191,36,0.08);
}
.agent-queue-tray:not(.expanded) .queue-tray-list {
    display: none;
}
.agent-queue-tray.expanded {
    position: absolute;
    bottom: 52px; /* sits right above the input row */
    left: 8px;
    right: 8px;
    top: 8px;     /* occupies the full height of the chat history area */
    background: #131722; /* match dark theme */
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    max-height: none;
    overflow: hidden;
}
.agent-queue-tray.expanded .queue-tray-header {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 6px;
    margin-bottom: 6px;
    cursor: pointer;
}
.agent-queue-tray.expanded .queue-tray-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.queue-tray-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    color: #fbbf24;
    margin-bottom: 4px;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.queue-tray-clear {
    font-size: 10px;
    padding: 2px 6px;
    border: 1px solid rgba(251,191,36,0.3);
    border-radius: 4px;
    background: none;
    color: #fbbf24;
    cursor: pointer;
}
.queue-tray-clear:hover { background: rgba(251,191,36,0.1); }
.queue-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px;
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
}
.queue-item:last-child { border-bottom: none; }
.queue-item:hover { background: rgba(251,191,36,0.08); }
.queue-item-icon {
    font-size: 10px;
    flex-shrink: 0;
    color: #fbbf24;
    opacity: 0.7;
}
.queue-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.queue-item-label {
    font-size: 10px;
    font-weight: 600;
    color: #fbbf24;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.queue-item-comment {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.queue-item-cancel {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.1s, color 0.1s;
}
.queue-item:hover .queue-item-cancel { opacity: 1; }
.queue-item-cancel:hover { color: #f87171; background: rgba(239,68,68,0.1); }

/* â”€â”€ SCRIPT PANEL HEADER â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sp-header {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    gap: 8px;
}

.sp-header-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    flex-shrink: 0;
}
.sp-header-dash {
    flex: 1;
    height: 1px;
    background: var(--border-panel);
}
.sp-total-time {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    flex-shrink: 0;
    white-space: nowrap;
}

.sp-suggestion-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.sp-accept-all {
    padding: 3px 8px;
    border: 1px solid rgba(52,211,153,0.4);
    border-radius: 4px;
    background: rgba(52,211,153,0.1);
    color: #34d399;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.12s;
}
.sp-accept-all:hover { background: rgba(52,211,153,0.2); }
.sp-reject-all {
    padding: 3px 8px;
    border: 1px solid rgba(234,51,35,0.4);
    border-radius: 4px;
    background: rgba(234,51,35,0.08);
    color: var(--accent-crimson);
    font-size: 10px;
    font-weight: 600;
    transition: all 0.12s;
}
.sp-reject-all:hover { background: rgba(234,51,35,0.15); }

.sp-collapse-btn {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 12px;
    padding: 3px 5px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.12s;
}
.sp-collapse-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

/* Script Language selector in sp-header */
.sp-lang-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.sp-lang-select {
    font-size: 10px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--border-panel);
    border-radius: 4px;
    color: var(--text-secondary);
    padding: 2px 4px;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
}
.sp-lang-select:focus { border-color: var(--accent-crimson); }
.sp-lang-select option { background: var(--bg-panel); }

.sp-actions-group { position: relative; flex-shrink: 0; }
.sp-actions-btn {
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 3px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.12s;
}
.sp-actions-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.sp-actions-popup {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: #1a1a1a;
    border: 1px solid var(--border-panel);
    border-radius: 7px;
    padding: 4px;
    z-index: 200;
    min-width: 160px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.sp-action-opt {
    display: block;
    width: 100%;
    padding: 7px 10px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 12px;
    text-align: left;
    border-radius: 5px;
    transition: background 0.1s;
}
.sp-action-opt:hover { background: rgba(255,255,255,0.06); }

/* â”€â”€ NARRATIVE BRIEF â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.narrative-brief {
    border-bottom: 2px solid rgba(234,51,35,0.35);
    background: var(--bg-narrative);
    flex-shrink: 0;
}

.narrative-brief-bar {
    display: flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    cursor: pointer;
    gap: 6px;
}

.nb-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-crimson);
}
.nb-arrow {
    font-size: 9px;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.narrative-brief.expanded .nb-arrow { transform: rotate(90deg); }
.nb-bar-right {
    margin-left: auto;
    display: flex;
    gap: 4px;
}
.nb-edit-btn, .nb-close-btn {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.12s;
}
.nb-edit-btn:hover { color: var(--text-primary); }
.nb-close-btn:hover { color: var(--accent-crimson); }

.narrative-brief-body {
    padding: 4px 10px 8px;
    overflow-y: auto;
    box-sizing: border-box;
}
/* Default (collapsed) â€” body is hidden via .hidden class in JS */
/* Expanded: take ~25% of script panel height */
.narrative-brief.expanded .narrative-brief-body {
    height: 25vh;
    max-height: 25vh;
}
.nb-textarea {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
    resize: none;
    outline: none;
    min-height: 40px;
    overflow-y: auto;
}
.nb-textarea::placeholder { color: var(--text-muted); }
.nb-save-status {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
}
/* Drag resize handle at bottom of narrative brief */
#nbResizeHandle {
    height: 6px;
    cursor: ns-resize;
    background: transparent;
    border-top: 1px solid var(--border-subtle);
    transition: border-color 0.15s;
}
#nbResizeHandle:hover { border-top-color: var(--accent-crimson); }

/* â”€â”€ SCRIPT BLOCKS CONTAINER â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sp-blocks-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: visible;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
    padding-bottom: 60px;
    padding-left: 18px;  /* room for drag handles */
}

.sp-empty-state { padding: 16px 20px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 12px; }

.sp-empty-cursor-block {
    position: relative;
    padding: 16px 20px;
    flex: 1;
}
.sp-add-block-persistent {
    display: block;
    width: 100%;
    padding: 6px;
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 5px;
    background: none;
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
    margin-top: 8px;
    transition: all 0.15s;
}
.sp-add-block-persistent:hover {
    border-color: var(--accent-crimson);
    color: var(--accent-crimson);
    background: rgba(234,51,35,0.04);
}
.sp-add-bottom { margin: 12px; width: calc(100% - 24px); }

/* â”€â”€ SCRIPT BLOCKS (new block-editor style) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* ── SCRIPT BLOCKS (V0 spec alignment) ─────────────────────────────────── */
.sp-block {
    margin: 0 38px 2px 0; /* 38px right margin = exclusive badge gutter outside the block */
    border-radius: 0;
    padding: 0;
    position: relative;
    transition: opacity 0.15s;
}
/* Drag handle — hidden until hover */
.sp-block-drag-handle {
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: -2px;
    opacity: 0;
    cursor: grab;
    user-select: none;
    transition: opacity 0.15s;
    z-index: 10;
    line-height: 1;
    padding: 4px 2px;
}
.sp-block:hover .sp-block-drag-handle { opacity: 0.5; }
.sp-block-drag-handle:hover { opacity: 1 !important; cursor: grab; }
/* Drag states */
.sp-block-dragging { opacity: 0.4; outline: 2px dashed var(--accent-crimson); }
.sp-block-drag-over { box-shadow: 0 -3px 0 0 var(--accent-blue); position: relative; z-index: 10; }
/* Empty state hint */
.sp-empty-hint {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    padding: 12px 24px 20px;
    line-height: 1.6;
}
.sp-empty-hint-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}


/* VO — no border by default (draft state: no color signal needed).
   Border appears ONLY when the block is focused/selected:
     – TTS generated  → Magenta  (var(--accent-vo))
     – Recorded/approved → Teal  (var(--accent-vo-rec))           */
.sp-block--vo {
    background: transparent;
    border-left: 3px solid transparent; /* placeholder — colour set by focus/active rules below */
    padding: 8px 14px 8px 16px;
    position: relative;                 /* REQUIRED: absolute children (label, drag, badge-col) */
    transition: border-left-color 0.15s;
}
.sp-block--vo:hover { background: rgba(255,255,255,0.015); }

/* ── VO selected/focused: show colour based on VO state ────────────────── */
/* Draft VO (no audio): show faint crimson on focus if needed — currently none */
.sp-block--vo:focus-within,
.sp-block--vo.active-seg {
    border-left-color: var(--accent-vo);          /* Magenta — TTS default */
    background: rgba(217,70,239,0.03);
}
/* Recorded / approved VO: teal when selected */
.sp-block--vo.sp-block--approved:focus-within,
.sp-block--vo.sp-block--approved.active-seg {
    border-left-color: var(--accent-vo-rec);      /* Teal */
    background: rgba(20,184,166,0.03);
}
/* Rejected VO: crimson when selected */
.sp-block--vo.sp-block--rejected:focus-within,
.sp-block--vo.sp-block--rejected.active-seg {
    border-left-color: var(--accent-crimson);
    background: rgba(234,51,35,0.03);
}

/* REC — forest green (matches Premiere SB label color) */
.sp-block--rec {
    background: var(--bg-card-rec);              /* #0f172a dark / #eff6ff light */
    border-left: 2px solid var(--accent-rec) !important; /* #267336 Premiere green — !important guards against generic overrides */
    padding: 8px 14px 8px 14px;
    cursor: pointer;
    position: relative;  /* needed for .top-right absolute positioning */
}
.sp-block--rec:hover { filter: brightness(1.14); }
/* Active REC block: green glow when its segment is selected in transcript */
.sp-block--rec.active-seg {
    border-left-color: var(--accent-rec) !important;
    border-left-width: 3px !important;
    background: rgba(38,115,54,0.08) !important;
    box-shadow: 0 0 0 1px var(--accent-rec-2), 0 0 12px 2px var(--accent-rec-2) !important;
    filter: brightness(1.1);
    transition: box-shadow 0.2s ease, border-left-width 0.15s ease;
}
/* RTL active-seg: glow stays on left */
.sp-block--rec.rtl.active-seg {
    border-left-color: var(--accent-rec) !important;
    border-left-width: 3px !important;
    box-shadow: 0 0 0 1px var(--accent-rec-2), 0 0 12px 2px var(--accent-rec-2) !important;
}

.sp-block.suggested {
    opacity: 0.6;
    border: 1px dashed var(--accent-blue);
    background: rgba(96,165,250,0.05);
}
.sp-block.suggested:hover {
    opacity: 1;
}
.sp-suggested-actions {
    display: flex;
    gap: 6px;
    margin-left: 12px;
}
.sp-suggest-btn {
    background: none;
    border: 1px solid var(--border-panel);
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.sp-suggest-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.sp-suggest-btn.accept:hover { border-color: #10b981; color: #10b981; }
.sp-suggest-btn.reject:hover { border-color: var(--accent-crimson); color: var(--accent-crimson); }


/* NOTE — white border, dark text on panel for clear distinction from SoundUp */
.sp-block--note {
    background: rgba(255,255,255,0.04);
    border-left: 2px solid #ffffff;
    padding: 8px 48px 8px 14px;
}

/* Label row is now minimal — just a header bar for REC/NOTE */
.sp-block-label-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: nowrap;
    justify-content: space-between;
}

/* VO label: top-LEFT corner — keeps the right side clear for the badge column */
.sp-block--vo .sp-block-label-row {
    position: absolute;
    top: 8px;
    left: 16px;
    margin: 0;
    gap: 4px;
    opacity: 0.55;
}
/* REC/NOTE label: top-right, left of badge column */
.sp-block-label-row.top-right {
    position: absolute;
    top: 8px;
    right: 34px;          /* 28px badge col + 6px gap */
    margin: 0;
    z-index: 1;
}

/* NH-110: badge slot — flex row on the same line as block text start */
.nh-badge-slot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25em;
}
/* SB variant: slim row above the text paragraph */
.nh-badge-slot--sb,
.nh-badge-slot--vo {
    min-height: 0;
    padding: 0 0 0.2em 0;
    opacity: 1;
}
/* Empty slots collapse to zero height */
.nh-badge-slot:empty {
    display: none;
}

/* NH-111: Block Approval System */
/* Approval state: background tint only — border colour is handled per block-type above.
   VO blocks use the focus/active rules; non-VO blocks keep their own borders. */
.sp-block--approved { background: rgba(16,185,129,0.03); }
.sp-block--rejected { background: rgba(239,68,68,0.03); opacity: 0.88; }
.nh-vo-content { min-height: 3em; padding: 0.375em 0.5em; line-height: 1.6; color: var(--text-primary); cursor: default; user-select: text; border: 1px solid rgba(255,255,255,0.06); border-radius: 0.25em; font-size: inherit; word-break: break-word; opacity: 0.88; outline: none; /* NH-122: teal left-border is the focus indicator */ }
.nh-vo-content mark.nh-note-inline-mark { background: rgba(245,158,11,0.28); border-radius: 0.125em; padding: 0 0.0625em; }
.nh-approval-row { display: flex; gap: 0.375em; margin-top: 0.375em; flex-wrap: wrap; }
.nh-approve-btn, .nh-reject-btn, .nh-edit-btn { font-size: 0.7rem; padding: 0.2em 0.6em; border-radius: 0.25em; border: 1px solid; cursor: pointer; font-weight: 600; transition: opacity 0.15s; }
.nh-approve-btn { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.4); color: #10B981; }
.nh-approve-btn:hover { opacity: 0.8; }
.nh-reject-btn { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.35); color: #EF4444; }
.nh-reject-btn:hover { opacity: 0.8; }
.nh-edit-btn { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.35); color: #818cf8; }
.nh-edit-btn:hover { opacity: 0.8; }
.nh-rejection-row { margin-top: 0.375em; display: flex; flex-direction: column; gap: 0.25em; }
.sp-rejection-note { width: 100%; font-size: 0.75rem; padding: 0.3em 0.5em; background: rgba(239,68,68,0.07); border: 1px solid rgba(239,68,68,0.25); border-radius: 0.25em; color: var(--text-primary); resize: vertical; font-family: inherit; box-sizing: border-box; }
.nh-send-del-btn { align-self: flex-start; font-size: 0.7rem; padding: 0.2em 0.7em; border-radius: 0.25em; border: 1px solid rgba(239,68,68,0.4); background: rgba(239,68,68,0.14); color: #EF4444; cursor: pointer; font-weight: 600; transition: opacity 0.15s; }
.nh-send-del-btn:hover { opacity: 0.8; }
/* NH-112: Stale / draft badge states */


.nh-note-badge--stale { filter: saturate(0.4) brightness(1.3); outline: 1px dashed rgba(245,158,11,0.6); outline-offset: 1px; }
.nh-note-badge--draft { opacity: 0.45; cursor: help; }
/* NH-112: Stale EN banner inside approved blocks */
.nh-stale-banner { display: flex; align-items: center; gap: 0.375em; font-size: 0.68rem; color: #f59e0b; background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); border-radius: 0.25em; padding: 0.2em 0.5em; margin-top: 0.3em; }


.sp-block-tc {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.04em;
}
.sp-block-src {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Shrink gracefully: takes all available space up to 55% of parent */
    flex: 1 1 0;
    min-width: 0;
    max-width: 55%;
}
.sp-block-dur {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* REC transcript text: 14px, italic, muted */
.sp-block--rec .sp-block-text {
    font-size: 14px;
    line-height: 1.55;
    color: #6b7280;
    font-style: italic;
    margin: 0;
    /* Prevent text from overflowing flex parent */
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Make the block wrapper also flex-shrink correctly */
.script-block--rec,
.script-block--vo {
    min-width: 0;
    overflow: hidden;
}

/* Quick Generate: slightly different look */
.sp-vo-quick {
    border-color: rgba(251, 191, 36, 0.4) !important;
    color: #fbbf24 !important;
    margin-left: 4px !important;
}
.sp-vo-quick:hover { background: rgba(251,191,36,0.10) !important; }

/* ── Compact inline VO recorder ── */
.nh-inline-rec {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 6px;
    animation: fadeIn 0.15s ease;
}
.nh-ir-rec-btn, .nh-ir-stop-btn, .nh-ir-cancel {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}
.nh-ir-rec-btn {
    background: #ef4444;
    color: #fff;
}
.nh-ir-rec-btn:hover:not(:disabled) { background: #dc2626; }
.nh-ir-stop-btn {
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.15);
}
.nh-ir-stop-btn:hover:not(:disabled) { background: rgba(255,255,255,0.14); }
.nh-ir-stop-btn:disabled, .nh-ir-rec-btn:disabled { opacity: 0.4; cursor: default; }
.nh-ir-cancel {
    background: transparent;
    color: var(--text-muted, #6b7280);
    font-size: 13px;
    padding: 2px 6px;
}
.nh-ir-cancel:hover { color: var(--text-primary); }
.nh-ir-timer {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
    min-width: 28px;
}

/* VO text: 16px, normal, primary — the star of the show */
.sp-vo-text {
    width: 100%;
    box-sizing: border-box;
    resize: none;
    min-height: 48px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
    font-family: inherit;
    padding: 0;
    display: block;
}
.sp-vo-text:focus {
    outline: none;
    background: rgba(255,255,255,0.02);
}
.sp-vo-text::placeholder { color: #374151; }

/* Speaker inline at start of REC text */
.sp-speaker-inline {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-crimson);
    margin-left: 6px; /* RTL fix */
    margin-right: 6px;
}
/* Generic active-seg highlight — explicitly excluded from .sp-block--rec which has its own green rule */
.sp-block.active-seg:not(.sp-block--rec) {
    background: rgba(234, 51, 35, 0.1) !important;
    border-left: 3px solid var(--accent-crimson) !important;
    box-shadow: 0 0 15px rgba(234, 51, 35, 0.1);
    transition: all 0.2s ease;
}
.sp-block.active-seg:not(.sp-block--rec) textarea {
    font-weight: 500;
}
    font-style: normal;
    unicode-bidi: isolate;
    display: inline-block;
}

/* Speaker chip (legacy — keep for compat) */
.sp-speaker-chip {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--spk-color) 20%, transparent);
    color: var(--spk-color);
    border: 1px solid color-mix(in srgb, var(--spk-color) 40%, transparent);
}

.sp-vo-player {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.sp-vo-audio { flex: 1; height: 28px; }
.sp-vo-regen, .sp-vo-gen {
    padding: 3px 10px;
    border-radius: 5px;
    border: 1px solid var(--border-panel);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.12s;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.sp-vo-regen:hover, .sp-vo-gen:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

/* Play button on REC block footer */
.sp-rec-play {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(59,130,246,0.4);
    background: rgba(59,130,246,0.12);
    color: #60a5fa;
    font-size: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    flex-shrink: 0;
    transition: background 0.12s, border-color 0.12s;
    padding: 0;
}
.sp-rec-play:hover { background: rgba(59,130,246,0.25); border-color: #60a5fa; }

/* â”€â”€ BETWEEN-BLOCK ADD ZONE â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.block-add-zone {
    position: relative;
    height: 4px;
    margin: 0;
}
.block-add-zone:hover { height: 20px; }

.block-add-zone:hover .block-add-btn {
    opacity: 1;
}
.block-add-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--border-panel);
    background: var(--bg-panel);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    cursor: pointer;
    z-index: 5;
}
.block-add-btn:hover {
    border-color: var(--accent-crimson);
    color: var(--accent-crimson);
    background: rgba(234,51,35,0.08);
}

/* â”€â”€ NH ADD ZONE (inter-block) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.nh-add-zone {
    position: relative;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 12px;
    cursor: pointer;
}
.nh-add-zone-line {
    position: absolute;
    left: 0; right: 0;
    height: 1px;
    background: transparent;
    transition: background 0.15s;
}
.nh-add-zone:hover .nh-add-zone-line {
    background: rgba(234,51,35,0.35);
}
.nh-add-zone-btn {
    position: relative;
    z-index: 2;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--border-panel);
    background: var(--bg-panel);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, border-color 0.15s, color 0.15s;
    cursor: pointer;
}
.nh-add-zone:hover .nh-add-zone-btn {
    opacity: 1;
}
.nh-add-zone-btn:hover {
    border-color: var(--accent-crimson);
    color: var(--accent-crimson);
    background: rgba(234,51,35,0.08);
}

/* â”€â”€ SCRIPT BLOCKS â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.script-block {
    position: relative;
    margin-right: 38px; /* match sp-block badge gutter */
    group: block;
}
.script-block:hover .block-hover-actions { display: flex; }

/* Block hover actions (â–¶ â‹¯) */
.block-hover-actions {
    display: none;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    gap: 4px;
    z-index: 10;
    background: var(--bg-panel);
    padding: 2px 4px;
    border-radius: 5px;
    border: 1px solid var(--border-panel);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.block-action-btn {
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 11px;
    padding: 3px 5px;
    border-radius: 3px;
    transition: all 0.1s;
    line-height: 1;
}
.block-action-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

/* Block type label */
.block-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 3px;
    position: absolute;
    top: 6px;
    right: 36px;
}
.block-label--vo { color: var(--text-muted); }
.block-label--rec { color: var(--accent-crimson); }
.block-label--note { color: var(--accent-note); }
.block-label--suggested { color: var(--accent-blue); }

/* VO Block */
.script-block--vo {
    padding: 8px 12px;
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.025);
}
.script-block--vo .vo-textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 16px;
    line-height: 1.55;
    color: var(--text-primary);
    font-weight: 400;
    resize: none;
    outline: none;
    font-family: inherit;
    padding-right: 60px; /* space for label */
}
.script-block--vo .vo-textarea::placeholder { color: var(--text-placeholder); }
.vo-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 2px;
}
.vo-read-time {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.vo-status-badge {
    font-size: 9px;
    color: var(--text-muted);
}

/* VO collapsed state */
.script-block--vo.collapsed .vo-collapse-preview {
    font-size: 16px;
    line-height: 1.55;
    color: var(--text-primary);
    cursor: text;
}
.vo-collapse-ellipsis {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin: 2px 0;
    letter-spacing: 0.1em;
}
.vo-expand-btn {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 10px;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
}
.vo-expand-btn:hover { color: var(--text-secondary); }

/* REC Block */
.script-block--rec {
    background: var(--bg-card-rec);
    border-left: 2px solid var(--accent-crimson);
    padding: 5px 12px;
}
.rec-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    font-style: italic;
}
.rec-speaker {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-crimson);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline;
    margin-right: 6px;
}
.rec-timecode {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    float: right;
    margin-top: 2px;
    white-space: nowrap;
}

/* NOTE Block — white border, legible text */
.script-block--note {
    background: rgba(255,255,255,0.04);
    border-left: 2px solid #ffffff;
    padding: 6px 12px;
}
.note-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    font-style: italic;
}
.note-textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    font-style: italic;
    resize: none;
    outline: none;
    font-family: inherit;
    padding-right: 50px;
}
.note-textarea::placeholder { color: rgba(251,191,36,0.3); }

/* SUGGESTED Block */
.script-block--suggested {
    opacity: 0.65;
    border: 1px dashed rgba(99,102,241,0.5) !important;
    background: var(--accent-suggested);
    border-left: none !important;
    margin: 0 8px;
    border-radius: 4px;
}
.script-block--suggested .block-label { color: #818cf8; }
.suggested-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    justify-content: flex-end;
    padding-right: 8px;
}
.suggested-accept {
    padding: 3px 8px;
    border: 1px solid rgba(52,211,153,0.5);
    border-radius: 4px;
    background: rgba(52,211,153,0.1);
    color: #34d399;
    font-size: 10px;
    font-weight: 600;
}
.suggested-reject {
    padding: 3px 8px;
    border: 1px solid rgba(234,51,35,0.4);
    border-radius: 4px;
    background: rgba(234,51,35,0.08);
    color: var(--accent-crimson);
    font-size: 10px;
    font-weight: 600;
}

/* â”€â”€ BALLOON ANNOTATIONS â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.script-annotation {
    position: absolute;
    right: -220px;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.35);
    border-radius: 8px;
    padding: 8px 10px;
    z-index: 20;
    font-size: 12px;
}
.annotation-connector {
    position: absolute;
    left: -20px;
    top: 50%;
    width: 20px;
    height: 1px;
    background: rgba(245,158,11,0.4);
}
.annotation-textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-primary);
    resize: none;
    outline: none;
    min-height: 40px;
}
.annotation-footer {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    justify-content: flex-end;
}
.annotation-send-btn {
    padding: 3px 8px;
    border: 1px solid rgba(245,158,11,0.5);
    border-radius: 4px;
    background: rgba(245,158,11,0.12);
    color: var(--accent-note);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}
.annotation-close-btn {
    padding: 3px 6px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
}
.annotation-pending {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-note);
    font-size: 11px;
}
.annotation-pending-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-note);
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0);   opacity: 1; }
    40%           { transform: translateY(-6px); opacity: 0.7; }
}
/* bouncing dots loader */
.bounce-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}
.bounce-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-crimson);
    display: inline-block;
    animation: bounce 1.2s ease-in-out infinite;
}
.bounce-dots span:nth-child(2) { animation-delay: 0.2s; }
.bounce-dots span:nth-child(3) { animation-delay: 0.4s; }

.annotation-resolved {
    background: rgba(52,211,153,0.08);
    border-color: rgba(52,211,153,0.25);
    cursor: pointer;
}
.annotation-resolved-icon {
    font-size: 12px;
}

/* â”€â”€ MARKERS FLOATING PANEL â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.markers-panel {
    position: fixed;
    top: calc(var(--topbar-h) + 8px);
    left: 42%;
    width: 360px;
    background: #131313;
    border: 1px solid var(--border-panel);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 300;
    display: flex;
    flex-direction: column;
    max-height: 60vh;
}

.markers-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--border-panel);
    flex-shrink: 0;
}
.markers-panel-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}
.markers-panel-close {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 2px;
    transition: color 0.12s;
}
.markers-panel-close:hover { color: var(--accent-crimson); }

.markers-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
    scrollbar-width: thin;
}

.marker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.1s;
}
.marker-item:hover { background: rgba(255,255,255,0.03); }
.marker-item:hover .marker-item-delete { opacity: 1; }

.marker-pennant-icon {
    flex-shrink: 0;
}
.marker-timecode {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
}
.marker-category-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}
.marker-name-preview {
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.marker-item-delete {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.1s;
    padding: 2px;
    flex-shrink: 0;
}
.marker-item-delete:hover { color: var(--accent-crimson); }

.markers-add-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 8px;
    border-top: 1px solid var(--border-panel);
    flex-shrink: 0;
}
.markers-add-btn {
    padding: 6px 4px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 5px;
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary, #aaa);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: all 0.12s;
    border-color: rgba(255,255,255,0.07);
}
.markers-add-btn:hover {
    color: var(--text-primary, #fff);
    background: color-mix(in srgb, var(--mc), transparent 80%);
    border-color: var(--mc);
}

/* â”€â”€ MINI-PLAYER â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mini-player {
    position: fixed;
    right: 16px;
    top: 60px;
    width: 240px;
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    z-index: 400;
    padding: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.mini-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.mini-player-title {
    font-size: 10px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mini-player-close {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.12s;
}
.mini-player-close:hover { color: var(--accent-crimson); }
.mini-player-waveform {
    width: 100%;
    height: 40px;
    display: block;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
}
.mini-player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mp-btn {
    border: none;
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 12px;
    transition: background 0.1s;
}
.mp-btn:hover { background: rgba(255,255,255,0.12); }
.mp-btn-play {
    background: rgba(234,51,35,0.15);
    color: var(--accent-crimson);
}
.mp-btn-play:hover { background: rgba(234,51,35,0.25); }
.mp-time {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-left: auto;
}

/* â”€â”€ BLOCK PICKER â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.block-picker {
    position: fixed;
    background: #1e1e1e;
    border: 1px solid var(--border-panel);
    border-radius: 8px;
    padding: 6px;
    z-index: 500;
    display: flex;
    gap: 2px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.bp-opt {
    padding: 6px 10px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 11px;
    border-radius: 5px;
    white-space: nowrap;
    transition: all 0.1s;
}
.bp-opt:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }

/* â”€â”€ TRANSCRIPT SELECTION POPUP â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ts-popup {
    position: fixed;
    z-index: 600;
    display: flex;
    align-items: center;
    gap: 0;
    background: #1e1e1e;
    border: 1px solid var(--border-panel);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    padding: 4px;
    animation: ts-popup-in 0.1s ease;
}
@keyframes ts-popup-in {
    from { opacity: 0; transform: translateY(4px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ts-popup-btn {
    padding: 5px 10px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    border-radius: 5px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.1s;
    letter-spacing: 0.02em;
}
.ts-popup-btn:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }
.ts-popup-add:hover { color: #60a5fa !important; }
.ts-popup-agent:hover { color: #a78bfa !important; }
.ts-popup-divider {
    width: 1px;
    height: 16px;
    background: var(--border-panel);
    margin: 0 2px;
    flex-shrink: 0;
}
/* add-zone insert mode: pulse the zones to indicate "click to insert here" */
.nh-add-zone.insert-mode .nh-add-zone-line {
    background: #60a5fa;
    opacity: 1;
}
.nh-add-zone.insert-mode .nh-add-zone-btn {
    background: #60a5fa;
    color: #fff;
    animation: zone-pulse 1s ease-in-out infinite;
}
@keyframes zone-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(96,165,250,0.6); }
    50%       { box-shadow: 0 0 0 5px rgba(96,165,250,0); }
}

/* â”€â”€ KEYBOARD SHORTCUTS â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.shortcuts-help-btn {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border-panel);
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    z-index: 50;
    transition: all 0.15s;
}
.shortcuts-help-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    border-color: var(--text-muted);
}

.shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shortcuts-panel {
    background: #141414;
    border: 1px solid var(--border-panel);
    border-radius: 12px;
    padding: 20px;
    min-width: 320px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}
.shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.shortcuts-close {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.12s;
}
.shortcuts-close:hover { color: var(--text-primary); }
.shortcuts-table {
    width: 100%;
    border-collapse: collapse;
}
.shortcuts-table tr { border-bottom: 1px solid var(--border-panel); }
.shortcuts-table tr:last-child { border-bottom: none; }
.shortcuts-table td {
    padding: 5px 0;
    font-size: 12px;
    color: var(--text-secondary);
}
.shortcuts-table td:first-child {
    width: 120px;
    padding-right: 12px;
    white-space: nowrap;
}
kbd {
    display: inline-block;
    padding: 2px 5px;
    border: 1px solid var(--border-panel);
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* â”€â”€ PROJECT BROWSER â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.project-browser {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    max-height: 60vh;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: slideDown 0.2s ease;
}
@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.browser-overlay {
    position: fixed;
    inset: 0;
    top: var(--topbar-h);
    z-index: 190;
    background: transparent;
}

.browser-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
    flex-shrink: 0;
}
.browser-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}
.browser-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.browser-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}
.browser-search {
    flex: 1;
    max-width: 280px;
    border: 1px solid var(--border-panel);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.12s;
}
.browser-search:focus { border-color: rgba(234,51,35,0.4); }
.browser-search::placeholder { color: var(--text-muted); }

.browser-filter-group {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    padding: 2px;
}
.browser-filter-btn {
    padding: 3px 8px;
    border: none;
    background: none;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 11px;
    transition: all 0.12s;
}
.browser-filter-btn.active {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

.browser-close-btn {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 13px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.12s;
}
.browser-close-btn:hover { color: var(--accent-crimson); }

.browser-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 12px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
}

/* ── Folder browser drill-down (RM-026 / NH-132 Phase 4) ───────────────── */
.browser-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 7px 16px;
    font-size: 12px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}
.browser-breadcrumb.hidden { display: none; }
.browser-crumb { color: var(--text-secondary); cursor: pointer; }
.browser-crumb:hover { color: var(--text-primary); text-decoration: underline; }
.browser-crumb.current { color: var(--text-primary); cursor: default; text-decoration: none; }
.browser-crumb-sep { color: var(--text-muted); opacity: 0.6; }

.folder-card .project-card-count {
    background: rgba(234,51,35,0.14);
    color: var(--accent-crimson);
}
.project-card-chips { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.project-card-chip {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
}
.project-card-team {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(99,102,241,0.18);
    color: #a5b4fc;
    margin-left: 6px;
}
/* Lock (manage-access, Phase 3) + move-to-folder action buttons — match rename/delete */
.project-card-access,
.project-card-move {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 12px;
    padding: 3px 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.12s;
}
.project-card-access:hover,
.project-card-move:hover { color: var(--text-primary); }

.project-card {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 7px 10px;
    cursor: pointer;
    transition: background 0.12s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}
.project-card:hover {
    background: rgba(255,255,255,0.07);
}
/* light mode */
[data-theme="light"] .project-card:hover {
    background: rgba(0,0,0,0.05);
}
.project-card.active {
    background: rgba(234,51,35,0.1);
    border-left: 2px solid var(--accent-crimson);
    padding-left: 8px;
}
/* session name label inside the card */
.project-card-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.project-card-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* file count badge - left anchor */
.project-card-count {
    min-width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--border-panel);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* body fills the middle */
.project-card-body {
    flex: 1;
    min-width: 0;
}

/* actions group - hidden until hover */
.project-card-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s;
}
.project-card:hover .project-card-actions {
    opacity: 1;
    pointer-events: auto;
}
.project-card-rename,
.project-card-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 4px;
    color: var(--text-muted);
    transition: color 0.12s;
}
.project-card-rename:hover { color: var(--text-primary) !important; }
.project-card-delete:hover { color: var(--accent-crimson) !important; }

/* delete button - old single-button style (kept for fallback) */
.project-card-delete {
    opacity: 0;
    pointer-events: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 4px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: opacity 0.12s, color 0.12s;
}
.project-card:hover .project-card-delete {
    opacity: 1;
    pointer-events: auto;
}
.project-card-delete:hover {
    color: var(--accent-crimson) !important;
}

.project-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.project-card-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.project-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 6px;
}
.tag-chip {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.05em;
    background: rgba(107,114,128,0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(107,114,128,0.3);
}
.project-card-meta {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.project-card-meta .team-badge {
    font-weight: 600;
}
.meta-dot { opacity: 0.4; }

.browser-new-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--border-subtle);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
    transition: all 0.12s;
    flex-shrink: 0;
}
.browser-new-card:hover {
    background: rgba(234,51,35,0.05);
    color: var(--accent-crimson);
}
.browser-new-icon {
    font-size: 16px;
    line-height: 1;
}

/* â”€â”€ MODALS â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.record-modal {
    /* Fills the transcript panel exactly — positioned absolute inside .nh-transcript-panel */
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(6px);
    z-index: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.record-modal-content {
    background: #121212;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    position: relative;
    color: var(--text-primary);
}
.record-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.record-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}
.record-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.15s;
}
.record-modal-close:hover { color: var(--text-primary); }

.record-modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.record-setting-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.record-setting-row label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.record-mic-select {
    background: #1a1a1a;
    border: 1px solid var(--border-panel);
    border-radius: 8px;
    padding: 10px 12px;
    width: 100%;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    outline: none;
}
.record-mic-select:focus { border-color: var(--accent-crimson); }

.record-monitor-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.record-monitor-row input { cursor: pointer; }

.record-name-input {
    background: #1a1a1a;
    border: 1px solid var(--border-panel);
    border-radius: 8px;
    padding: 10px 12px;
    width: 100%;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}
.record-name-input:focus { border-color: var(--accent-crimson); }
.record-name-input::placeholder { color: var(--text-muted); }

.record-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
}
.record-big-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid rgba(234,51,35,0.2);
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
}
.record-big-btn:hover { background: rgba(234,51,35,0.1); border-color: rgba(234,51,35,0.35); }
.record-big-btn.recording {
    border-color: rgba(234,51,35,0.4);
    animation: pulse-red 2s infinite;
}
.record-inner {
    width: 40px;
    height: 40px;
    background: #ea3323;
    border-radius: 50%;
    transition: all 0.2s;
}
.record-big-btn.recording .record-inner {
    border-radius: 4px;
    width: 30px;
    height: 30px;
}
.record-status {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(234,51,35, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(234,51,35, 0); }
    100% { box-shadow: 0 0 0 0 rgba(234,51,35, 0); }
}
}
.vu-meter {
    border-radius: 5px;
    overflow: hidden;
}

/* â”€â”€ ADD FILE POPUP â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.add-file-popup {
    position: fixed;
    background: #1a1a1a;
    border: 1px solid var(--border-panel);
    border-radius: 8px;
    padding: 5px;
    z-index: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    min-width: 150px;
}
.add-file-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: left;
    border-radius: 5px;
    transition: all 0.1s;
}
.add-file-opt:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

/* â”€â”€ MARKER EDITOR POPOVER â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.marker-editor-popover {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
}
.popover-content {
    background: #1a1a1a;
    border: 1px solid var(--border-panel);
    border-radius: 10px;
    padding: 16px;
    width: 280px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.popover-content h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.marker-name-input {
    width: 100%;
    border: 1px solid var(--border-panel);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 12px;
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    outline: none;
    margin-bottom: 10px;
}
.category-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 12px;
}
.category-options .opt {
    padding: 5px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 5px;
    background: none;
    color: var(--c);
    font-size: 10px;
    font-weight: 700;
    transition: all 0.12s;
}
.category-options .opt:hover { background: color-mix(in srgb, var(--c), transparent 80%); }
.popover-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.delete-marker-btn {
    padding: 6px 10px;
    border: 1px solid rgba(234,51,35,0.4);
    border-radius: 6px;
    background: rgba(234,51,35,0.1);
    color: var(--accent-crimson);
    font-size: 11px;
    cursor: pointer;
}
.close-popover {
    padding: 6px 10px;
    border: 1px solid var(--border-panel);
    border-radius: 6px;
    background: none;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
}

/* â”€â”€ STATUS TOAST â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.status-toast {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    border: 1px solid var(--border-panel);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-primary);
    z-index: 900;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    animation: fadeInUp 0.2s ease;
}
@keyframes fadeInUp {
    from { transform: translate(-50%, 8px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* â”€â”€ SCROLLBARS â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* Light mode scrollbars */
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); }

/* NH-035: light mode toast — soften the black overlay */
[data-theme="light"] .status-toast {
    background: rgba(30, 32, 38, 0.92);
    color: #f0f0f0;
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

/* â”€â”€ RTL support for VO blocks (Hebrew / Arabic) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.vo-textarea:lang(he), .vo-textarea:lang(ar) {
    direction: rtl;
    text-align: right;
}

/* â”€â”€ Fixed Action Bar (legacy action bar ported to new UI) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* Script panel must be flex-column so the bar sticks to the bottom */
.nh-script-panel {
    display: flex;
    flex-direction: column;
}
.sp-blocks-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.lnh-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bg-card, #141414);
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    flex-shrink: 0;
    flex-wrap: wrap;
}
.lnh-action-left  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lnh-action-right { display: flex; align-items: center; gap: 8px; }
.lnh-vo-controls  { display: flex; align-items: center; gap: 6px; }
.lnh-vo-label     { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted, #6b7280); text-transform: uppercase; }
.lnh-vo-icon      { font-size: 13px; }
.lnh-ml           { margin-left: 4px; }

.lnh-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 72px; height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.15);
    outline: none; cursor: pointer;
}
.lnh-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--accent-crimson, #ea3323);
    cursor: pointer;
}
.lnh-slider-val { font-size: 10px; color: var(--text-muted, #6b7280); min-width: 30px; }

.lnh-bulk-btn {
    padding: 5px 10px; font-size: 11px; font-weight: 600;
    border: 1px solid rgba(234,51,35,0.35); border-radius: 6px;
    background: rgba(234,51,35,0.08); color: var(--accent-crimson, #ea3323);
    cursor: pointer; transition: background 0.15s;
}
.lnh-bulk-btn:hover { background: rgba(234,51,35,0.16); }

/* Save button (left half of pair) */
.lnh-save-btn {
    padding: 6px 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
    border: 1px solid var(--border-2, rgba(255,255,255,0.1)); border-radius: 6px 0 0 6px;
    background: rgba(255,255,255,0.05); color: var(--text-primary, #f1f5f9);
    cursor: pointer; transition: background 0.15s;
}
.lnh-save-btn:hover { background: rgba(255,255,255,0.1); }

/* Save group: SAVE + LOAD folder icon as a button pair */
.lnh-save-group { position: relative; display: inline-flex; align-items: stretch; }
.lnh-load-btn {
    padding: 6px 8px; font-size: 12px;
    border: 1px solid var(--border-2, rgba(255,255,255,0.1)); border-left: none;
    border-radius: 0 6px 6px 0;
    background: rgba(255,255,255,0.05); color: var(--text-muted);
    cursor: pointer; transition: background 0.15s, color 0.15s;
}
.lnh-load-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

/* Snapshot dropdown panel */
.snapshot-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 230px;
    max-height: 260px;
    overflow-y: auto;
    background: var(--bg-surface, #1a1a1a);
    border: 1px solid var(--border-panel);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
    z-index: 900;
    padding: 4px;
}
.snapshot-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 10px; border-radius: 5px; cursor: default;
    font-size: 11px; color: var(--text-primary);
    transition: background 0.1s;
}
.snapshot-item:hover { background: rgba(255,255,255,0.04); }
.snapshot-item-ts { font-weight: 600; flex: 1; }
.snapshot-item-count { font-size: 10px; color: var(--text-muted); }
.snapshot-item-load {
    font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
    border: 1px solid var(--border-panel); background: none;
    color: var(--text-secondary); cursor: pointer; flex-shrink: 0;
}
.snapshot-item-load:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.snapshot-empty { padding: 12px 10px; font-size: 11px; color: var(--text-muted); text-align: center; }

/* Approve button */
.lnh-approve-btn {
    padding: 6px 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
    border: none; border-radius: 6px;
    background: var(--accent-crimson, #ea3323); color: #fff;
    cursor: pointer; transition: opacity 0.15s, background 0.15s;
    position: relative;
}
.lnh-approve-btn:hover { opacity: 0.85; }
/* Show data-status as a compact tooltip above the button */
.lnh-approve-btn[data-status]::after {
    content: attr(data-status);
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    background: #1e293b;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 5px;
    white-space: nowrap;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.06);
    letter-spacing: 0;
}

.lnh-play-full-btn {
    padding: 6px 12px; font-size: 11px; font-weight: 600;
    border: 1px solid rgba(255,255,255,0.12); border-radius: 6px;
    background: rgba(255,255,255,0.06); color: var(--text-primary, #f1f5f9);
    cursor: pointer; transition: background 0.15s;
}
.lnh-play-full-btn:hover { background: rgba(255,255,255,0.12); }

/* Script ▾ and VO ▾ dropdown menu items */
.lnh-menu-item {
    display: block; width: 100%; text-align: left;
    padding: 7px 14px; border: none; background: none;
    color: var(--text-secondary, #9ca3af); font-size: 12px;
    cursor: pointer; transition: background 0.1s, color 0.1s;
}
.lnh-menu-item:hover { background: rgba(255,255,255,0.07); color: var(--text-primary, #f1f5f9); }
[data-theme="light"] .lnh-menu-item { color: var(--text-secondary); }
[data-theme="light"] .lnh-menu-item:hover { background: rgba(0,0,0,0.05); color: var(--text-primary); }
[data-theme="light"] .lnh-dropdown { background: var(--bg-panel) !important; border-color: var(--border-panel) !important; }


[data-theme="light"] .lnh-action-bar {
    background: #f8f8f8;
    border-top-color: rgba(0,0,0,0.08);
}

/* â”€â”€ Transcript search highlights â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.search-hit {
    background: rgba(251, 191, 36, 0.35);
    border-radius: 3px;
    outline: 1px solid rgba(251, 191, 36, 0.5);
}
.search-hit-active {
    background: rgba(251, 130, 30, 0.55);
    outline: 2px solid #fb821e;
    border-radius: 3px;
}
.tp-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: inherit;
    font-size: 12px;
    flex: 1;
    min-width: 0;
    padding: 0 4px;
}

/* â”€â”€ Marker list items (inside markers panel) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.marker-list-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}
.marker-list-item:hover { background: rgba(255,255,255,0.06); }
.mli-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}
/* mli-body: wraps name + comment text in column */
.mli-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.mli-name {
    font-size: 12px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}
.mli-comment-text {
    font-size: 10px;
    font-style: italic;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.mli-tc   { color: #888; font-size: 11px; font-variant-numeric: tabular-nums; flex-shrink: 0; margin-top: 2px; }

.mli-edit, .mli-del {
    border: none;
    background: none;
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.12s, background 0.1s;
    flex-shrink: 0;
}
.marker-list-item:hover .mli-edit,
.marker-list-item:hover .mli-del { opacity: 1; }
.mli-edit:hover { background: rgba(255,255,255,0.1); color: var(--text-primary, #fff); }
.mli-del:hover  { background: rgba(234,51,35,0.15); color: #ea3323; }

/* Marker editor — drag-from hint (NH-021) */
.marker-was-tc {
    display: block;
    color: #aaa;
    font-size: 11px;
    margin: -2px 0 6px;
    font-style: italic;
    letter-spacing: 0.02em;
    white-space: pre-line;  /* renders \n as line break */
    line-height: 1.5;
}
.marker-was-tc.hidden { display: none; }

/* Marker editor dialog \u2014 extra fields */
.marker-editor-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.marker-tc-input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text-primary, #f1f5f9);
    font-size: 12px;
    font-family: var(--font-mono, monospace);
}
.marker-comment-input {
    width: 100%;
    resize: vertical;
    min-height: 60px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text-primary, #f1f5f9);
    font-size: 12px;
    font-family: var(--font-sans, inherit);
    line-height: 1.5;
}
.marker-comment-input::placeholder,
.marker-tc-input::placeholder { color: #4b5563; }
.save-marker-btn {
    background: rgba(52,211,153,0.15);
    border: 1px solid rgba(52,211,153,0.4);
    color: #34d399;
    border-radius: 6px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.15s;
}
.save-marker-btn:hover { background: rgba(52,211,153,0.3); }

/* ============================================================================
   LIGHT MODE OVERRIDES
   All hardcoded dark colors that don't use CSS variables are overridden here.
   Dark mode defaults are preserved as-is above.
   ============================================================================ */

/* ── Waveform backgrounds ─────────────────────────────────────────────────── */
[data-theme="light"] .tp-player-waveform {
    background: rgba(0,0,0,0.06);
}
[data-theme="light"] .tp-player-waveform .tp-marker-track {
    background: rgba(0,0,0,0.08);
}
[data-theme="light"] .tp-waveform-container {
    background: rgba(0,0,0,0.06);
}
[data-theme="light"] .tp-marker-track {
    background: rgba(0,0,0,0.08);
}
[data-theme="light"] .tp-waveform-inline .tp-waveform-container {
    background: rgba(0,0,0,0.05);
}
[data-theme="light"] .tp-waveform-inline .tp-marker-track {
    background: rgba(0,0,0,0.07);
}

/* ── Active tab ────────────────────────────────────────────────────────────── */
[data-theme="light"] .tp-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ── Marker pennant tooltip ────────────────────────────────────────────────── */
[data-theme="light"] .marker-pennant::after {
    background: var(--bg-panel);
    color: var(--text-primary);
}

/* ── Floating panels & popups ─────────────────────────────────────────────── */
[data-theme="light"] .markers-panel,
[data-theme="light"] .mini-player,
[data-theme="light"] .block-picker,
[data-theme="light"] .ts-popup,
[data-theme="light"] .agent-send-popup,
[data-theme="light"] .sp-actions-popup,
[data-theme="light"] .shortcuts-panel,
[data-theme="light"] .add-file-popup,
[data-theme="light"] .popover-content {
    background: var(--bg-panel);
    border-color: var(--border-panel);
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

/* ── Modals ────────────────────────────────────────────────────────────────── */
[data-theme="light"] .record-modal-content {
    background: var(--bg-panel);
    border-color: var(--border-panel);
}

/* ── Mini-player specific border ─────────────────────────────────────────── */
[data-theme="light"] .mini-player {
    border-color: var(--border-panel);
}

/* ── Hover states: white overlays → dark overlays ─────────────────────────── */
[data-theme="light"] .marker-item:hover        { background: rgba(0,0,0,0.04); }
[data-theme="light"] .marker-list-item:hover   { background: rgba(0,0,0,0.05); }
[data-theme="light"] .agent-send-opt:hover     { background: rgba(0,0,0,0.05); }
[data-theme="light"] .sp-action-opt:hover      { background: rgba(0,0,0,0.05); }
[data-theme="light"] .bp-opt:hover             { background: rgba(0,0,0,0.05); color: var(--text-primary); }
[data-theme="light"] .mli-edit:hover           { background: rgba(0,0,0,0.08); }
[data-theme="light"] .sp-actions-btn:hover     { background: rgba(0,0,0,0.06); color: var(--text-primary); }
[data-theme="light"] .tp-player-play:hover     { background: rgba(0,0,0,0.08); }
[data-theme="light"] .tp-player-btn:hover      { background: rgba(0,0,0,0.06); }

/* ── Markers add buttons ─────────────────────────────────────────────────── */
[data-theme="light"] .markers-add-btn {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.12);
}
[data-theme="light"] .markers-add-btn:hover {
    background: color-mix(in srgb, var(--mc), transparent 85%);
    border-color: var(--mc);
}

/* ── Action bar buttons ───────────────────────────────────────────────────── */
[data-theme="light"] .lnh-slider      { background: rgba(0,0,0,0.12); }
[data-theme="light"] .lnh-save-btn    { background: rgba(0,0,0,0.04); border-color: var(--border-panel); }
[data-theme="light"] .lnh-save-btn:hover { background: rgba(0,0,0,0.08); }
[data-theme="light"] .lnh-play-full-btn { background: rgba(0,0,0,0.04); border-color: var(--border-panel); }
[data-theme="light"] .lnh-play-full-btn:hover { background: rgba(0,0,0,0.08); }

/* ── Marker editor inputs ─────────────────────────────────────────────────── */
[data-theme="light"] .marker-tc-input,
[data-theme="light"] .marker-comment-input {
    background: rgba(0,0,0,0.04);
    border-color: var(--border-panel);
    color: var(--text-primary);
}
[data-theme="light"] .marker-tc-input::placeholder,
[data-theme="light"] .marker-comment-input::placeholder {
    color: var(--text-muted);
}




/* -- NH Generic Modal System ----------------------------------------------- */
.nh-modal-backdrop {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.nh-modal-backdrop.hidden { display: none; }
.nh-modal {
    background: var(--bg-surface, #141414);
    border: 1px solid var(--border-panel, rgba(255,255,255,0.1));
    border-radius: 14px;
    padding: 24px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    color: var(--text-primary);
    font-family: var(--font-sans, Inter, sans-serif);
    animation: nhModalIn 0.18s ease;
}
@keyframes nhModalIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
.nh-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 4px; font-size: 15px; font-weight: 700;
    color: var(--text-primary);
}
.nh-modal-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 16px; padding: 2px 4px;
    transition: color 0.12s; border-radius: 4px;
}
.nh-modal-close:hover { color: var(--text-primary); }
.nh-modal-footer {
    display: flex; gap: 10px; justify-content: flex-end;
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    padding-top: 16px; margin-top: 4px;
}
.nh-modal-btn-primary {
    padding: 8px 18px; font-size: 12px; font-weight: 700;
    border: none; border-radius: 7px;
    background: var(--accent-crimson, #ea3323); color: #fff;
    cursor: pointer; transition: opacity 0.15s;
}
.nh-modal-btn-primary:hover { opacity: 0.85; }
.nh-modal-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.nh-modal-btn-secondary {
    padding: 8px 18px; font-size: 12px; font-weight: 600;
    border: 1px solid var(--border-panel, rgba(255,255,255,0.1)); border-radius: 7px;
    background: rgba(255,255,255,0.05); color: var(--text-secondary);
    cursor: pointer; transition: background 0.15s;
}
.nh-modal-btn-secondary:hover { background: rgba(255,255,255,0.1); }
[data-theme="light"] .nh-modal { background: var(--bg-panel); border-color: var(--border-panel); }
[data-theme="light"] .nh-modal-btn-secondary { background: rgba(0,0,0,0.04); border-color: var(--border-panel); }
[data-theme="light"] .nh-modal-btn-secondary:hover { background: rgba(0,0,0,0.08); }

/* ============================================================
   NH-081: Comment Balloon
   ============================================================ */

/* Floating card */
.nh-comment-balloon {
    position: fixed;
    z-index: 8500;
    width: 280px;
    background: #1a1f2e;
    border: 1px solid #374151;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.35);
    padding: 12px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: nhBalloonIn .15s ease;
}
.nh-comment-balloon.hidden { display: none; }

@keyframes nhBalloonIn {
    from { opacity: 0; transform: translateY(6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Triangle pointer at bottom (flips to top when balloon is below selection) */
.nh-comment-balloon::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
}
.nh-comment-balloon:not(.flip-down)::after {
    bottom: -14px;
    border-top-color: #374151;
    border-bottom: none;
}
.nh-comment-balloon.flip-down::after {
    top: -14px;
    border-bottom-color: #374151;
    border-top: none;
}

/* Marker title input (editorial note mode only) */
.nh-note-title-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0,0,0,0.08); /* subtle tint — visible on both light (note) and dark (comment) balloon */
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 6px;
    color: inherit; /* inherits #1c1917 in note mode, var(--text-primary) in comment mode */
    font-size: 12px;
    font-family: inherit;
    padding: 6px 9px;
    outline: none;
    transition: border-color .15s;
    margin-bottom: 2px;
}
.nh-note-title-input:focus { border-color: #fbbf24; }
.nh-note-title-input::placeholder { color: #6b7280; font-style: italic; }
.nh-note-title-input.hidden { display: none; }

/* Textarea */
.nh-comment-balloon textarea {
    width: 100%;
    box-sizing: border-box;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 6px;
    color: #f1f5f9;
    font-size: 12px;
    font-family: inherit;
    line-height: 1.5;
    padding: 7px 9px;
    resize: none;
    outline: none;
    transition: border-color .15s;
}
.nh-comment-balloon textarea:focus { border-color: #60a5fa; }
.nh-comment-balloon textarea::placeholder { color: #6b7280; }

/* Status line (sending / error) */
.nh-comment-status {
    font-size: 11px;
    min-height: 14px;
    color: #fbbf24;
}
.nh-comment-status.ok    { color: #34d399; }
.nh-comment-status.error { color: #f87171; }

/* Action row */
.nh-comment-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}
.nh-comment-queue-btn {
    background: none;
    border: 1px solid #4b5563;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 11px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.nh-comment-queue-btn:hover  { background: rgba(255,255,255,0.06); color: #e5e7eb; }
.nh-comment-send-btn {
    background: #ea3323;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 13px;
    cursor: pointer;
    transition: opacity .15s;
}
.nh-comment-send-btn:hover   { opacity: .85; }
.nh-comment-send-btn:disabled { opacity: .45; cursor: not-allowed; }
.nh-comment-discard-btn {
    background: none;
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: 6px;
    color: #f87171;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 11px;
    cursor: pointer;
    transition: background .15s;
}
.nh-comment-discard-btn:hover { background: rgba(239,68,68,0.12); }
.nh-comment-cancel-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 11px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.nh-comment-cancel-btn:hover { background: rgba(255,255,255,0.06); color: #9ca3af; }


/* Script-panel floating pill trigger */
.nh-comment-pill {
    position: fixed;
    z-index: 8200;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 20px;
    padding: 4px 11px;
    font-size: 11px;
    color: #e2e8f0;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    transition: background .12s, transform .12s;
    user-select: none;
}
.nh-comment-pill:hover   { background: #334155; transform: translateY(-1px); }
.nh-comment-pill.hidden  { display: none; }

/* NH-081: Selected-text excerpt shown at top of comment balloon */
.nh-comment-excerpt {
    font-size: 11.5px;
    color: #c4b5fd;                          /* soft purple — visible, not harsh */
    background: rgba(139,92,246,0.10);
    border-left: 2px solid rgba(139,92,246,0.6);
    padding: 5px 9px;
    margin-bottom: 4px;
    border-radius: 0 4px 4px 0;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    box-sizing: border-box;
    line-height: 1.4;
}
.nh-comment-excerpt.hidden { display: none; }

/* Transcript word highlight when comment is being authored */

.nh-comment-mark {
    background: rgba(251,191,36,0.22);
    border-radius: 2px;
    outline: 1px solid rgba(251,191,36,0.4);
    outline-offset: 0;
}

/* ─── Badge gutter ─── absolute strip on the right edge of each script block.
   Stacks 📝 note and 💬 comment badges vertically without touching block layout.
   Delete btn is pinned to the bottom of the strip, not a flex child. */
.nh-badge-col {
    position: absolute;
    top: 0;
    right: -36px;  /* positioned in the 38px margin gap OUTSIDE the block */
    bottom: 0;
    width: 32px;
    /* NH-114: no flex — badges are position:absolute within this col,
       each at the Y offset of their associated text selection row */
    overflow: visible;
    background: transparent;
    z-index: 4;
    pointer-events: auto;
}
.nh-badge-col::-webkit-scrollbar { display: none; }



/* Queue badge — transcript inline variant (inserted after last selected word) */
.nh-comment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(139,92,246,0.18);
    border: 1px solid rgba(139,92,246,0.55);
    border-radius: 50%;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    margin-left: 3px;
    vertical-align: middle;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: transform .12s, background .12s;
    user-select: none;
}
.nh-comment-badge:hover {
    transform: scale(1.2);
    background: rgba(139,92,246,0.35);
}

/* Note badge — lives inside .nh-badge-col, 50% bigger than old inline size */
.nh-note-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 3px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    background: rgba(139,92,246,0.18);
    border: 1px solid rgba(139,92,246,0.35);
    color: rgba(200,180,255,0.9);
    transition: transform .12s, background .12s;
    user-select: none;
    white-space: nowrap;
}
.nh-note-badge:hover {
    transform: scale(1.12);
    background: rgba(139,92,246,0.30);
}

/* Delete button — absolute on the block itself (bottom-right corner), NOT in the margin gap. */
.nh-delete-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.15s, background 0.12s;
    user-select: none;
    padding: 0;
    z-index: 5;
}
.nh-delete-badge:hover {
    opacity: 1 !important;
    background: rgba(234,51,35,0.15);
    color: var(--accent-crimson);
}

/* Script-block comment badge — lives inside .nh-badge-col */
.sp-comment-badge {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 13px;
    border-radius: 4px;
    background: rgba(139,92,246,0.18);
    border: 1px solid rgba(139,92,246,0.5);
    cursor: pointer;
    transition: transform .12s, background .12s;
    user-select: none;
    box-shadow: 0 1px 5px rgba(0,0,0,0.35);
}
.sp-comment-badge:hover {
    transform: scale(1.18);
    background: rgba(139,92,246,0.35);
}

/* NH-081: Script block highlight when its balloon is open. */
.sp-block:focus, .script-block:focus { outline: none; }
.nh-block-active {
    box-shadow: inset 0 0 0 2px rgba(139,92,246,0.55), 0 0 10px rgba(139,92,246,0.2);
    outline: none;
}

/* NH-081: Multi-note navigation row inside the balloon */
.nh-note-nav-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 0 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 6px;
}
.nh-note-nav-row.hidden { display: none; }
.nh-note-nav-btn {
    background: rgba(139,92,246,0.15);
    border: 1px solid rgba(139,92,246,0.3);
    color: rgba(200,180,255,0.9);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background .12s;
}
.nh-note-nav-btn:hover { background: rgba(139,92,246,0.30); }
.nh-note-nav-count {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 36px;
    text-align: center;
}

/* NH-081/089: Textarea selection mirror — pointer-events only on handles */
.nh-ta-mirror {
    position: absolute;
    pointer-events: none;     /* pass-through except for handles below */
    z-index: 2;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: hidden;
    color: transparent;
    background: transparent;
    border: none;
    outline: none;
    box-sizing: border-box;
}
.nh-sel-mark {
    background: rgba(139,92,246,0.28);
    color: transparent;
    border-radius: 2px;
    position: relative;
    display: inline;
}
/* Handles: narrow bar with extended hit-area via padding */
.nh-sel-handle {
    display: inline-block;
    width: 2px;
    background: rgba(139,92,246,0.95);
    border-radius: 1px;
    vertical-align: text-bottom;
    position: relative;
    pointer-events: all;      /* handles ARE interactive */
    cursor: ew-resize;
    /* extend hit area without affecting layout */
    padding: 0 5px;
    margin: 0 -5px;
    box-sizing: content-box;
    z-index: 3;
}
.nh-sel-handle--start { margin-right: -4px; }
.nh-sel-handle--end   { margin-left:  -4px; }
/* Cursor feedback while dragging */
.nh-ta-mirror.nh-dragging { cursor: ew-resize; }
.nh-ta-mirror.nh-dragging .nh-sel-handle { background: rgba(139,92,246,1); }


/* Light mode */
[data-theme="light"] .nh-comment-balloon {
    background: #ffffff;
    border-color: #d1d5db;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
[data-theme="light"] .nh-comment-balloon::after  { border-top-color: #d1d5db; }
[data-theme="light"] .nh-comment-balloon textarea {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}
[data-theme="light"] .nh-comment-pill {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}


/* NH: Send button disabled state */
.agent-send-btn { cursor: pointer; }
.agent-send-btn:hover:not(:disabled) { opacity: 0.85; }
.agent-send-btn:disabled { opacity: 0.28; cursor: not-allowed; }

/* ============================================================
   NH-081/089: Annotation Balloon — two-mode visual system
   ============================================================ */

/* Balloon header row */
.nh-balloon-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 2px;
    cursor: grab;
    user-select: none;
}
.nh-balloon-header:active { cursor: grabbing; }
.nh-balloon-icon  { font-size: 14px; line-height: 1; flex-shrink: 0; }
.nh-balloon-title { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* ── Mode: Comment to agent (dark, red left-border) ────────── */
.nh-comment-balloon.mode-comment {
    border-left: 3px solid #ea3323;
    background: #1a1f2e;
    border-color: #374151;
    border-left-color: #ea3323;
}
.nh-comment-balloon.mode-comment .nh-balloon-title { color: #ea3323; }
.nh-comment-balloon.mode-comment .nh-balloon-header { border-bottom-color: rgba(234,51,35,0.15); }

/* ── Mode: Editorial Note (white/off-white, amber left-border) ── */
.nh-comment-balloon.mode-note {
    border-left: 3px solid #f59e0b;
    background: #faf9f6;
    border-color: #e5e0d5;
    border-left-color: #f59e0b;
    color: #1c1917;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.12);
}
.nh-comment-balloon.mode-note .nh-balloon-title  { color: #b45309; }
.nh-comment-balloon.mode-note .nh-balloon-header { border-bottom-color: rgba(245,158,11,0.2); }
.nh-comment-balloon.mode-note .nh-comment-excerpt {
    color: #92400e;
    background: rgba(245,158,11,0.10);
    border-left-color: rgba(245,158,11,0.7);
}
.nh-comment-balloon.mode-note textarea {
    background: #fff;
    border-color: #d6c9a8;
    color: #1c1917;
}
.nh-comment-balloon.mode-note textarea::placeholder { color: #9ca3af; }
.nh-comment-balloon.mode-note textarea:focus { border-color: #f59e0b; }
.nh-comment-balloon.mode-note .nh-comment-status { color: #92400e; }
.nh-comment-balloon.mode-note .nh-comment-status.ok    { color: #15803d; }
.nh-comment-balloon.mode-note .nh-comment-status.error { color: #b91c1c; }

/* ── Note save button ───────────────────────────────────────── */
.nh-note-save-btn {
    background: #f59e0b;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 14px;
    cursor: pointer;
    transition: opacity .15s;
}
.nh-note-save-btn:hover   { opacity: .85; }
.nh-note-save-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Two-option annotPill (script panel) ────────────────────── */
.nh-annot-pill {
    position: fixed;
    z-index: 8300;
    display: flex;
    flex-direction: column;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.45);
    min-width: 170px;
}
.nh-annot-pill.hidden { display: none; }
.nh-annot-opt {
    background: none;
    border: none;
    padding: 8px 13px;
    font-size: 11.5px;
    font-weight: 600;
    color: #e2e8f0;
    cursor: pointer;
    text-align: left;
    transition: background .1s;
    white-space: nowrap;
}
.nh-annot-opt:hover { background: rgba(255,255,255,0.07); }
.nh-annot-comment { border-bottom: 1px solid rgba(255,255,255,0.06); }
.nh-annot-comment:hover { color: #fca5a5; }
.nh-annot-note:hover    { color: #fcd34d; }

/* ── Transcript popup: editorial note button ────────────────── */
.ts-popup-note:hover { color: #fcd34d !important; }

/* ── Editorial Note badge (block bottom-right) ────────────────
   NH-FIX: Obsolete duplicate definition removed to prevent layout conflicts.
*/
/* Inline variant — sits in the footer row alongside timecode/play btn */
.nh-note-badge--inline {
    position: static;
    display: inline-flex;
    width: 18px;
    height: 18px;
    margin-left: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Light-mode overrides for note balloon */
[data-theme="light"] .nh-comment-balloon.mode-note {
    background: #fffdf6;
    border-color: #e8dcc8;
    border-left-color: #f59e0b;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
}

/* ── NH: Inline editorial note highlight in SoundBite <p> blocks ── */
/* Applied by _nhReinjectNoteBadges when sel_text is present on the note */
mark.nh-note-inline-mark {
    background: rgba(245, 158, 11, 0.22);   /* amber tint — matches the note balloon colour */
    color: inherit;
    border-radius: 2px;
    outline: 1px solid rgba(245, 158, 11, 0.45);
    outline-offset: 0;
    cursor: pointer;
    transition: background .15s, outline-color .15s;
}
mark.nh-note-inline-mark:hover {
    background: rgba(245, 158, 11, 0.38);
    outline-color: rgba(245, 158, 11, 0.75);
}
[data-theme="light"] mark.nh-note-inline-mark {
    background: rgba(245, 158, 11, 0.18);
    outline-color: rgba(245, 158, 11, 0.55);
}


/* NH-111: Approve All — bottom action bar */
.lnh-approve-all-btn {
    background: linear-gradient(135deg, rgba(16,185,129,0.25), rgba(16,185,129,0.12));
    border: 1px solid rgba(16,185,129,0.55);
    color: #6ee7b7;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
    margin-right: 8px;
}
.lnh-approve-all-btn:hover {
    background: linear-gradient(135deg, rgba(16,185,129,0.4), rgba(16,185,129,0.22));
    transform: translateY(-1px);
}
.lnh-approve-all-btn.hidden { display: none !important; }


/* NH-110: multiple inline badges on same block — space them out */
.nh-note-badge--inline-text + .nh-note-badge--inline-text {
    margin-inline-start: 4px;
}

/* ── RM-030: Admin Console ── */
#nhAdminConsole {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    background: rgba(10,10,12,0.92);
    backdrop-filter: blur(8px);
    font-family: 'Inter', system-ui, sans-serif;
    color: #e6e6ee;
    opacity: 1;
    transition: opacity 0.2s ease;
}
#nhAdminConsole.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}
.nh-admin-sidebar {
    width: 240px;
    background: #0f0f15;
    border-right: 1px solid #222230;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
}
.nh-admin-brand {
    font-size: 16px;
    font-weight: 700;
    padding: 0 24px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}
.nh-admin-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
    flex: 1;
}
.nh-admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    color: #9aa8b6;
    cursor: pointer;
    background: transparent;
    border: none;
    text-align: left;
    transition: all 0.15s ease;
}
.nh-admin-nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.04);
}
.nh-admin-nav-item.active {
    color: #fff;
    background: rgba(96,165,250,0.12);
    border: 1px solid rgba(96,165,250,0.2);
    font-weight: 500;
}
.nh-admin-nav-item.hidden {
    display: none !important;
}
.nh-admin-sidebar-footer {
    padding: 0 24px;
}
.nh-admin-close-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    color: #9aa8b6;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.nh-admin-close-btn:hover {
    background: #222230;
    color: #fff;
}
.nh-admin-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #111116;
}
.nh-admin-header {
    height: 70px;
    border-bottom: 1px solid #222230;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}
.nh-admin-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}
.nh-admin-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.nh-admin-panel {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}
.nh-admin-panel.hidden {
    display: none !important;
}

/* User table and cards styling inside console */
.nh-admin-card {
    background: #15151e;
    border: 1px solid #222230;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.nh-admin-subtitle {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: #cbd5e1;
}
.nh-admin-table-container {
    background: #15151e;
    border: 1px solid #222230;
    border-radius: 12px;
    overflow: hidden;
}
.nh-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}
.nh-admin-table th {
    background: #191924;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a8aa0;
    border-bottom: 1px solid #222230;
}
.nh-admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #20202c;
    vertical-align: middle;
    color: #cbd5e1;
}
.nh-admin-table tr:last-child td {
    border-bottom: none;
}
.nh-admin-table tr:hover td {
    background: rgba(255,255,255,0.01);
}
.nh-admin-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}
.nh-admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}
.nh-admin-badge.success {
    background: rgba(16,185,129,0.1);
    color: #34d399;
    border: 1px solid rgba(16,185,129,0.2);
}
.nh-admin-badge.warning {
    background: rgba(245,158,11,0.1);
    color: #fbbf24;
    border: 1px solid rgba(245,158,11,0.2);
}
.nh-admin-badge.info {
    background: rgba(96,165,250,0.1);
    color: #60a5fa;
    border: 1px solid rgba(96,165,250,0.2);
}
.nh-admin-badge.danger {
    background: rgba(239,68,68,0.1);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.2);
}

/* Admin action buttons (Users table, Teams, Approvals, Permissions) */
.nh-uact {
    padding: 6px 12px;
    margin-left: 6px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #2a2a3a;
    background: #1a1a26;
    color: #cbd5e1;
    transition: all 0.15s ease;
}
.nh-uact:hover { background: #222230; color: #fff; }
.nh-uact:disabled { opacity: 0.55; cursor: default; }
.nh-uact.approve {
    background: rgba(16,185,129,0.12);
    color: #34d399;
    border-color: rgba(16,185,129,0.3);
}
.nh-uact.approve:hover { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.nh-uact.delete {
    background: rgba(239,68,68,0.1);
    color: #f87171;
    border-color: rgba(239,68,68,0.28);
}
.nh-uact.delete:hover { background: rgba(239,68,68,0.18); color: #fca5b5; }
.nh-users-msg { font-size: 12.5px; color: #9aa8b6; min-height: 16px; }

/* RM-030 Phase 2 — Pending-Approval tray (cards grid) */
.nh-approvals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.nh-approvals-empty {
    color: #8a8aa0;
    font-size: 13.5px;
    padding: 28px;
    text-align: center;
    background: #15151e;
    border: 1px dashed #2a2a3a;
    border-radius: 12px;
}
.nh-approval-card {
    background: #15151e;
    border: 1px solid #222230;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.nh-approval-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nh-approval-avatar {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.nh-approval-id { min-width: 0; flex: 1; }
.nh-approval-email {
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nh-approval-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.nh-approval-co { font-size: 11.5px; color: #8a8aa0; }
.nh-approval-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.nh-approval-actions .nh-uact { margin-left: 0; flex: 1; text-align: center; white-space: nowrap; }

/* RM-030 Phase 4 — Permissions overview grants */
.nh-perm-grants { display: flex; flex-wrap: wrap; gap: 6px; }
.nh-perm-grant {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a1a26;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 12px;
    color: #cbd5e1;
}
.nh-perm-grant em { color: #8a8aa0; font-style: normal; }
.nh-perm-role {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 600;
}
.nh-perm-role-admin { background: rgba(245,158,11,0.14); color: #fbbf24; }
.nh-perm-role-editor { background: rgba(96,165,250,0.14); color: #60a5fa; }
.nh-perm-role-viewer { background: rgba(148,163,184,0.14); color: #cbd5e1; }

/* NH-150 — conventional close (✕) at the admin header top-right */
.nh-admin-x {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #2a2a3a;
    background: #1a1a24;
    color: #9aa8b6;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}
.nh-admin-x:hover { background: #2a1620; border-color: #7f1d2e; color: #fca5b5; }

/* NH-148 — Platform Superusers warning banner */
.nh-platform-warn {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.28);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #fbbf24;
}
.nh-platform-warn strong { color: #fcd34d; }

/* NH-154 — invite a user (Users tab) */
.nh-invite-bar { display: flex; gap: 8px; margin-bottom: 4px; }
.nh-invite-bar input[type="email"] {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #33334a;
    background: #0e0e15;
    color: #fff;
    border-radius: 7px;
    font-size: 13px;
}
.nh-invite-bar select {
    padding: 8px 10px;
    border: 1px solid #33334a;
    background: #0e0e15;
    color: #fff;
    border-radius: 7px;
    font-size: 13px;
}
.nh-invites-head {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a8aa0;
    margin: 4px 0 8px;
}
.nh-invite-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #222230;
    border-radius: 8px;
    background: #15151e;
    margin-bottom: 6px;
}
.nh-invite-email { font-size: 13px; color: #e6e6ee; flex: 1; min-width: 0; }
.nh-invite-exp { font-size: 11.5px; color: #8a8aa0; }

/* NH-156 — audit log table */
.nh-audit-when { white-space: nowrap; font-size: 12px; color: #9aa8b6; }
.nh-audit-action { font-size: 12px; color: #a5b4fc; background: #1a1a26; padding: 1px 6px; border-radius: 5px; }
.nh-audit-dim { color: #8a8aa0; }

/* NH-149 — org-context selector in the admin header. The console is a fixed dark
   surface (same in both app themes), so the select was rendering as a default
   white box with the console's light text inherited → white-on-white. Style it
   dark to match the other admin selects so it's legible in light and dark mode. */
#nhAdminFilterBar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #cbd5e1;
    white-space: nowrap;
}
#nhAdminFilterBar select {
    background: #0e0e15;
    color: #fff;
    border: 1px solid #33334a;
    border-radius: 7px;
    padding: 6px 9px;
    font-size: 12.5px;
    cursor: pointer;
}
#nhAdminFilterBar select:hover { border-color: #4a4a66; }
/* Explicit option colors so the dropdown list isn't white-on-white either. */
#nhAdminFilterBar select option { background: #0e0e15; color: #fff; }

/* RM-030 — Organizations (tenants) management — full-width rows (one org per line) */
.nh-orgs-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nh-org-card {
    background: #15151e;
    border: 1px solid #222230;
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.nh-org-id { min-width: 0; flex: 1; }
.nh-org-name {
    font-size: 14.5px;
    font-weight: 600;
    color: #fff;
}
/* Keep the meta on one line now that each org has full row width. */
.nh-org-meta { font-size: 12px; color: #8a8aa0; margin-top: 3px; white-space: nowrap; }
.nh-org-actions { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: nowrap; }
/* NH-151 — seat usage pill in the org meta line */
.nh-org-seats { color: #a5b4fc; }
.nh-org-seats.full { color: #fca5b5; font-weight: 600; }
/* NH-152 — requested-organization banner in the approve/manage modal */
.nh-ue-reqorg {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #1e3a52;
    border-radius: 8px;
    background: #11202e;
    font-size: 12.5px;
    color: #cbd5e1;
}
.nh-ue-reqorg strong { color: #fff; }

