:root {
    --bg-dark: #000000;
    --bg-panel: rgba(30, 30, 30, 0.4);
    --bg-output: #131314;
    --text-primary: #e3e3e3;
    --text-secondary: #c4c7c5;
    --accent: #a8c7fa;
    --accent-hover: #d3e3fd;
    --accent-glow: rgba(168, 199, 250, 0.15);
    --border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --error: #ef4444;
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 0%, rgba(168, 199, 250, 0.08) 0%, transparent 40%),
                      radial-gradient(circle at 50% 100%, rgba(168, 199, 250, 0.05) 0%, transparent 40%);
    min-height: 100vh;
    padding: 40px 20px;
    font-family: var(--font-ui);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
}

.page {
    width: 100%;
    max-width: 860px;
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    padding: 50px 60px;
    position: relative;
    /* must stay visible: any overflow clipping here silently kills
       position:sticky for the review screen's pinned control bar */
    overflow: visible;
}

/* Subtle top glow on the page */
.page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
}

/* ── Masthead ── */
.masthead {
    text-align: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
    margin-bottom: 32px;
}

.masthead h1 {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin: 8px 0;
    background: linear-gradient(90deg, #fff, #a8c7fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.masthead .sub {
    font-size: 14px;
    color: var(--text-secondary);
}

.docket-line {
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
}

/* ── User controls (top-right strip) ── */
#user-controls {
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

#user-email {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* ── State panels ── */
#login-state,
#dashboard-state {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

#login-state.active,
#dashboard-state.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Login panel ── */
.login-panel {
    text-align: center;
    padding: 60px 20px;
}

.login-panel p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* ── Email/password auth (sits below the Google button) ── */
.login-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 24px 0 8px; color: var(--text-secondary); font-size: 12px;
}
.login-divider::before, .login-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.email-auth { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.email-auth input[type="email"], .email-auth input[type="password"] {
    width: 100%; padding: 16px 20px; background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border); border-radius: 24px;
    font-family: var(--font-ui); font-size: 14px; color: var(--text-primary);
    outline: none; transition: all 0.2s ease;
}
.email-auth input[type="email"]:focus, .email-auth input[type="password"]:focus {
    border-color: var(--accent); background: rgba(0, 0, 0, 0.6); box-shadow: 0 0 0 3px var(--accent-glow);
}
.email-auth input::placeholder { color: #5f6368; }
.email-auth .btn-primary { margin-top: 4px; }
.auth-error { color: var(--error); font-size: 13px; min-height: 18px; text-align: center; }
.auth-links { display: flex; justify-content: space-between; font-size: 13px; }
.auth-links a { color: var(--accent); cursor: pointer; }
.auth-links a:hover { color: var(--accent-hover); }

/* ── Section ── */
.section {
    margin-bottom: 32px;
}

.section-label {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
    font-weight: 600;
}

label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

input[type="text"] {
    width: 100%;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 24px;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

input[type="text"]:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="text"]::placeholder {
    color: #5f6368;
}

/* ── Proc type radios ── */
.radio-group {
    display: flex;
    gap: 32px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 0;
}

.radio-group input[type="radio"],
.checkbox-section input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-section label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

/* ── Upload zone ── */
#upload-zone {
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.2);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

#upload-zone:hover,
#upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(168, 199, 250, 0.03);
}

#upload-zone p {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

#upload-zone p:last-child {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ── Buttons ── */
button {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: #000000;
    font-weight: 600;
    width: 100%;
    margin-top: 16px;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

.btn-primary:disabled {
    background: #2a2a2a;
    color: #555555;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 24px;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* ── Progress container ── */
#progress-container {
    display: none;
    margin-top: 24px;
}

#progress-container.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.progress-track {
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

#progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px var(--accent-glow);
}

#progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: right;
}

/* ── Tabs / output container ── */
#tabs-container {
    display: none;
    margin-top: 40px;
    border-top: 1px solid var(--border);
    padding-top: 32px;
}

#tabs-container.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

/* ── Pipeline steps ── */
.steps-row {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 24px;
}

.step {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #475569;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.step:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    color: #334155;
    font-size: 14px;
}

.step.active {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.step.complete {
    color: #fff;
    background: var(--success);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

/* ── Output header ── */
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.output-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Transcript output ── */
#tab-clean {
    width: 100%;
    min-height: 480px;
    padding: 24px;
    background: var(--bg-output);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.8;
    color: #ffffff; /* pure white letters on dark background */
    overflow-y: auto;
    white-space: pre-wrap;
    tab-size: 5; /* any leftover tab characters render ~5 wide, matching Tab = 5 spaces */
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

/* Custom scrollbar for output */
#tab-clean::-webkit-scrollbar {
    width: 10px;
}
#tab-clean::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 8px 8px 0;
}
#tab-clean::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 5px;
}
#tab-clean::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ── Footer ── */
.footer-note {
    margin-top: 32px;
    font-size: 12px;
    color: #475569;
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

/* ── Karaoke Player ── */
.k-word {
    cursor: pointer;
    transition: color 0.1s ease, background-color 0.1s ease;
}

.k-word:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.k-word.highlight {
    background-color: rgba(168, 199, 250, 0.3);
    color: #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(168, 199, 250, 0.4);
}

/* ── PDF Upload Zone ── */
.pdf-section {
    margin-top: 16px;
}

.pdf-drop-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-top: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    background: rgba(0, 0, 0, 0.2);
}

.pdf-drop-zone:hover,
.pdf-drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(168, 199, 250, 0.03);
}

.pdf-filename {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ── Select Input ── */
.select-input {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    font-family: inherit;
}

/* ── Output Actions ── */
.output-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ── Save Controls ── */
.save-controls {
    display: none;
    margin-top: 16px;
    text-align: right;
}

.save-status {
    margin-right: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-save {
    width: auto;
}

/* ── Content Editable ── */
#tab-clean[contenteditable="true"] {
    outline: none;
}

#tab-clean[contenteditable="true"]:focus {
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5), 0 0 0 1px var(--accent);
}

/* ── Pro review (karaoke) screen ── */
#review-state {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

#review-state.active {
    display: block;
}

.review-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.review-topbar .btn-secondary {
    flex: 0 0 auto;
    width: auto;
}

#review-title {
    font-weight: 600;
    font-size: 0.95rem;
}

#review-counter {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Sticky so the audio + flag detail stay visible while scrolling the text */
.review-player {
    position: sticky;
    top: 8px;
    z-index: 80; /* above the bubble player and hover tooltip */
    background: var(--bg-output);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
}

#review-audio {
    width: 100%;
}

.review-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.review-nav .btn-secondary {
    width: auto;
}

.review-follow {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: auto;
    cursor: pointer;
}

#flag-detail {
    margin-top: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.85rem;
    line-height: 1.6;
}

#flag-detail .fd-label {
    color: var(--text-secondary);
    margin-right: 6px;
}

#review-transcript {
    margin-top: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-output);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    white-space: pre-wrap;
    tab-size: 5; /* leftover tab characters render ~5 wide, matching Tab = 5 spaces */
    word-wrap: break-word;
}

#review-transcript .tk {
    cursor: pointer;
    border-radius: 2px;
}

#review-transcript .tk:hover {
    background: rgba(255, 255, 255, 0.08);
}

#review-transcript .rflag {
    background: rgba(239, 68, 68, 0.18);
    border-bottom: 1px solid var(--error);
}

/* Words may be MISSING at this spot (engines heard speech the transcript
   does not have). The ▲ is a CSS pseudo-element: visible on screen but
   never part of the editable text, so it can't leak into a save. */
#review-transcript .rmiss {
    background: rgba(239, 68, 68, 0.10);
    border-bottom: 2px dashed var(--error);
}

#review-transcript .rmiss::before {
    content: '▲';
    color: var(--error);
    font-size: 0.7em;
    margin-right: 2px;
    vertical-align: 1px;
}

#review-transcript .rmiss.rdone::before {
    color: var(--success);
}

/* Possible DROPPED testimony: raw-audio words that didn't survive formatting.
   Amber, to set it apart from the red engine flags. The ▲ is a pseudo-element
   so it never becomes part of the editable text (can't leak into a save). */
#review-transcript .rdrop {
    background: rgba(245, 158, 11, 0.18);
    border-bottom: 2px dashed #e0a800;
}

#review-transcript .rdrop::after {
    content: '▲';
    color: #e0a800;
    font-size: 0.7em;
    margin-left: 2px;
    vertical-align: 1px;
}

#review-transcript .rdrop.rdone::after {
    color: var(--success);
}

/* Optional low engine-confidence hint — off by default, toggled on by the
   reviewer. A weak signal, so it's just a faint dotted underline (no
   background, so it never fights the karaoke "playing" highlight). Hidden
   entirely unless the container carries .show-lowconf. */
#review-transcript.show-lowconf .rlow {
    border-bottom: 1px dotted var(--text-secondary);
}

#review-transcript .rdone {
    background: rgba(16, 185, 129, 0.12);
    border-bottom-color: var(--success);
}

#review-transcript .ractive {
    outline: 2px solid var(--accent);
    background: var(--accent-glow);
}

#review-transcript .playing {
    background: var(--accent);
    color: #000;
}

.review-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 5px;
    vertical-align: -1px;
}

.swatch-flag {
    background: rgba(239, 68, 68, 0.18);
    border-bottom: 1px solid var(--error);
}

.swatch-miss {
    background: rgba(239, 68, 68, 0.10);
    border-bottom: 1px dashed var(--error);
}

.swatch-drop {
    background: rgba(245, 158, 11, 0.18);
    border-bottom: 1px dashed #e0a800;
}

.swatch-lowconf {
    background: rgba(148, 163, 184, 0.18);
    border-bottom: 1px dotted var(--text-secondary);
}

.swatch-done {
    background: rgba(16, 185, 129, 0.12);
    border-bottom: 1px solid var(--success);
}

/* ── Review editor wrap (positioning parent for the hover tooltip) ── */
#review-editor-wrap {
    position: relative;
    margin-top: 16px;
}

#review-editor-wrap > #review-transcript {
    margin-top: 0;
}

/* the playback-speed dropdown in the sticky control bar */
.review-nav select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 24px;
    padding: 6px 10px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 0.85rem;
}

.review-nav select:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* lit up while follow is suspended by a manual scroll */
#mp-jump.attn {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

/* ── Editable review transcript ── */
#review-transcript[contenteditable="true"] {
    outline: none;
    cursor: text;
}

#review-transcript[contenteditable="true"]:focus {
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent);
}

#review-transcript[contenteditable="true"] .tk {
    cursor: text;
}

#review-save-status {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: 12px;
}

/* ── Hover tooltip on flagged words: what each engine heard ── */
#flag-tip {
    position: absolute;
    display: none;
    z-index: 70;
    max-width: 420px;
    padding: 8px 12px;
    background: rgba(20, 20, 22, 0.97);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    line-height: 1.5;
    pointer-events: none;
}

#flag-tip .ft-label {
    color: var(--accent);
    margin-right: 6px;
    font-weight: 600;
}

#flag-tip .ft-muted {
    color: var(--text-secondary);
    font-style: italic;
}

/* ── Speaker-attribution flags: right words, possibly wrong label ── */
#review-transcript .rspk {
    background: rgba(168, 130, 250, 0.16);
    border-bottom: 2px solid #a882fa;
}

/* reviewed state must win over the purple */
#review-transcript .rflag.rdone {
    background: rgba(16, 185, 129, 0.12);
    border-bottom-color: var(--success);
}

.swatch-spk {
    background: rgba(168, 130, 250, 0.16);
    border-bottom: 2px solid #a882fa;
}

/* ── Weak flags: only one engine disagreed (the other agreed) ── */
#review-transcript .rweak {
    background: rgba(239, 68, 68, 0.07);
    border-bottom: 1px dotted rgba(239, 68, 68, 0.6);
}

/* "Strong flags only": weak flags melt back into plain text */
#review-transcript.hide-weak .rweak {
    background: transparent;
    border-bottom: none;
}

#review-transcript.hide-weak .rweak.ractive {
    outline: none;
}

/* ── Dashboard: transcripts list (Otter-style) ── */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dash-header .section-label {
    margin-bottom: 0;
}

.dash-header .btn-primary {
    width: auto;
    margin-top: 0;
    padding: 8px 18px;
}

#jobs-list {
    margin-bottom: 24px;
}

.job-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.job-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent);
}

.job-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.job-meta {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 2px;
}

.job-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: 1px;
}

.job-badge.proc {
    background: rgba(184, 134, 11, 0.15);
    color: #e0a800;
    border: 1px solid #b8860b;
}

.job-badge.err {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 1px solid var(--error);
}

.job-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.job-actions .btn-secondary {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.job-empty {
    color: var(--text-secondary);
    padding: 20px 16px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    text-align: center;
}

#new-job-form {
    margin-bottom: 28px;
}

/* ── Otter-style app shell (dashboard) ── */
/* When the dashboard is showing, the page card becomes a wide transparent
   frame so the sidebar+main shell provides its own surfaces. Login and the
   karaoke review keep the original centered card. */
.page.dash {
    max-width: 1180px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.page.dash::before { display: none; }

.dash-shell {
    display: flex;
    min-height: 620px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}

.dash-sidebar {
    width: 212px;
    flex: none;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid var(--border);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.dash-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.dash-logo { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; background: var(--accent); color: #0b1020; border-radius: 8px; }
.dash-brandname { font-size: 17px; font-weight: 600; color: var(--text-primary); }
.dash-newbtn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--accent); color: #0b1020; border: none;
    padding: 10px; border-radius: 10px; font-size: 14px; font-weight: 600;
    font-family: var(--font-ui); cursor: pointer; margin-bottom: 12px;
}
.dash-newbtn:hover { background: var(--accent-hover); }
.dash-newbtn.open { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.dash-nav { display: flex; flex-direction: column; gap: 2px; }
.dash-navitem {
    display: flex; align-items: center; gap: 10px;
    background: none; border: none; width: 100%; text-align: left;
    padding: 9px 10px; border-radius: 8px; cursor: pointer;
    color: var(--text-secondary); font-size: 13.5px; font-family: var(--font-ui);
}
.dash-navtext { flex: 1; }
.dash-navitem:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.dash-navitem.active { background: var(--accent-glow); color: var(--accent-hover); }
.dash-count { font-size: 12px; opacity: 0.75; }
.dash-foldlabel { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); opacity: 0.65; margin: 18px 10px 6px; }
.dash-folders-soon { font-size: 12px; color: var(--text-secondary); opacity: 0.45; padding: 2px 10px; }
.dash-spacer { flex: 1; min-height: 16px; }
.dash-sidebar #user-controls {
    flex-direction: column; align-items: flex-start; gap: 8px;
    border-top: 1px solid var(--border); padding-top: 12px; margin: 0;
}
.dash-sidebar #user-email { font-size: 12px; }
.dash-sidebar #btn-logout { padding: 6px 12px; font-size: 12px; }

.dash-main { flex: 1; min-width: 0; padding: 20px 24px; }
.dash-main-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.dash-title { font-size: 20px; font-weight: 600; color: var(--text-primary); }
.dash-search {
    margin-left: auto; display: flex; align-items: center; gap: 8px;
    background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border);
    border-radius: 10px; padding: 8px 12px; width: 250px; color: var(--text-secondary);
}
#job-search {
    width: 100%; padding: 0; background: none; border: none; outline: none;
    border-radius: 0; color: var(--text-primary); font-family: var(--font-ui); font-size: 13.5px;
}
#job-search:focus { box-shadow: none; border: none; background: none; }

.job-group-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); opacity: 0.65; margin: 16px 4px 8px; }

.dash-main .job-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border: 1px solid transparent; border-radius: 10px;
    margin-bottom: 3px; cursor: pointer;
}
.dash-main .job-row:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--border); }
.job-play {
    width: 32px; height: 32px; flex: none; border-radius: 50%;
    border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.job-play:hover { color: var(--accent); border-color: var(--accent); }
.dash-main .job-main { flex: 1; min-width: 0; }
.dash-main .job-name { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-main .job-meta { margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.job-sub { font-size: 12px; color: var(--text-secondary); opacity: 0.65; }
.job-right { display: flex; align-items: center; gap: 10px; flex: none; }
.job-time { font-size: 12px; color: var(--text-secondary); opacity: 0.8; width: 64px; text-align: right; }
.job-flags { font-size: 11.5px; padding: 2px 9px; border-radius: 8px; display: inline-flex; align-items: center; gap: 4px; }
.job-flags.has { background: rgba(184, 134, 11, 0.18); color: #e0a800; }
.job-flags.none { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.job-badge.done { background: rgba(168, 199, 250, 0.15); color: var(--accent); border: 1px solid rgba(168, 199, 250, 0.4); }
.job-rename { background: none; border: none; cursor: pointer; color: var(--text-secondary); opacity: 0.4; padding: 2px; display: inline-flex; }
.job-rename:hover { opacity: 0.9; color: var(--accent); }
.job-star { background: none; border: none; cursor: pointer; color: var(--text-secondary); opacity: 0.4; padding: 2px; display: inline-flex; }
.job-star:hover { opacity: 0.9; color: var(--accent); }
.job-star.on { opacity: 1; color: #f5c451; }

/* Full-bleed: edge-to-edge, used by both the dashboard and the
   karaoke review. Login keeps the original centered card. */
body.dash-mode, body.review-mode { padding: 0; display: block; overflow: hidden; height: 100vh; }
body.dash-mode .footer-note, body.review-mode .footer-note { display: none; }
.page.dash, .page.review-full {
    max-width: none; width: 100%; height: 100vh;
    padding: 0; background: transparent; border: none; border-radius: 0;
    box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.page.dash::before, .page.review-full::before { display: none; }
.dash-shell { height: 100vh; min-height: 0; border: none; border-radius: 0; background: var(--bg-output); }
.dash-sidebar { height: 100vh; overflow-y: auto; }
.dash-main { height: 100vh; overflow-y: auto; }

/* ── Karaoke review: full-bleed, Google-Docs-style document editor ──
   app bar (title/save) | toolbar (tools) | scrolling page | playback bar. */
body.review-mode #review-state.active { display: flex; flex-direction: column; height: 100vh; }

.rev-appbar { display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-bottom: 1px solid var(--border); background: var(--bg-output); flex: none; }
.rev-appbar .rev-back { width: auto; flex: none; }
.rev-titlewrap { display: flex; flex-direction: column; min-width: 0; }
.rev-titlewrap #review-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rev-titlewrap #review-counter { font-size: 0.8rem; color: var(--text-secondary); }
.rev-appbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.rev-appbar-right #review-save-status { font-size: 0.8rem; color: var(--text-secondary); }
.rev-appbar-right .btn-secondary { width: auto; }

.rev-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 18px; border-bottom: 1px solid var(--border); background: var(--bg-output); flex: none; }
.rev-tgroup { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rev-toolbar .btn-secondary { width: auto; }
.rev-tsep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.review-follow.rev-tlabel { margin-left: 0; }
.rev-toolbar #find-replace { flex-basis: 100%; margin-top: 8px; }

body.review-mode #flag-detail { flex: none; margin: 0; border-radius: 0; border-left: none; border-right: none; border-top: none; }

.rev-docarea { flex: 1; min-height: 0; overflow-y: auto; background: var(--bg-dark); padding: 28px 24px 48px; }
.rev-page { max-width: 880px; margin: 0 auto; background: var(--bg-output); border: 1px solid var(--border); border-radius: 10px; padding: 48px 64px; min-height: 72vh; }
.rev-page #review-editor-wrap { margin: 0; }
.rev-page #review-transcript { margin: 0; padding: 0; border: none; background: transparent; font-size: 0.95rem; line-height: 2.0; }

.rev-playbar { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--bg-output); flex: none; }
.rev-playbar #review-audio { width: auto; flex: 1 1 260px; max-width: 360px; height: 36px; }
.rev-playbar .btn-secondary { width: auto; flex: none; }
.rev-legend-mini { margin: 0 0 0 auto; gap: 12px; font-size: 0.72rem; flex-wrap: wrap; }

/* ── Find & replace panel (review screen, Ctrl+H) ── */
#find-replace {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

#find-replace input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 6px 10px;
    width: 230px;
    font-family: var(--font-ui);
    font-size: 0.85rem;
}

#find-replace input:focus {
    outline: none;
    border-color: var(--accent);
}

#find-replace .btn-secondary {
    padding: 6px 12px;
    font-size: 0.8rem;
}

#fr-status {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ── Clipboard panel (Word-style copy history) ── */
.rev-toolbar #clipboard-panel { flex-basis: 100%; margin-top: 8px; }
#clipboard-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
#clip-list { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.clip-label { color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; }
.clip-empty { color: var(--text-secondary); font-size: 0.85rem; }
.clip-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 5px 10px;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    cursor: pointer;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.clip-item:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--accent); }
#clipboard-panel .btn-secondary { padding: 6px 12px; font-size: 0.8rem; width: auto; }

/* ── Tool hover notes (control-bar buttons explain themselves) ── */
#tool-tip {
    position: fixed;
    display: none;
    z-index: 90;
    max-width: 320px;
    padding: 9px 13px;
    background: rgba(20, 20, 22, 0.98);
    border: 1px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    font-family: var(--font-ui);
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-primary);
    pointer-events: none;
}
