/* =========================================================================
   ovos play Recording Studio – Design System
   Dark mode default, Light mode toggle
   ========================================================================= */

/* --- CSS Custom Properties (Dark = default) --- */
:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #222536;
    --bg-card-hover: #2a2e42;
    --bg-input: #181b25;
    --bg-overlay: rgba(15, 17, 23, 0.85);

    --text-primary: #e8eaf0;
    --text-secondary: #9ca3b8;
    --text-muted: #6b7280;
    --text-inverse: #0f1117;

    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-soft: rgba(99, 102, 241, 0.15);
    --accent-glow: rgba(99, 102, 241, 0.3);

    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.15);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.15);
    --info: #3b82f6;
    --info-soft: rgba(59, 130, 246, 0.15);

    --border: #2d3148;
    --border-light: #383d56;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;

    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* --- Light mode --- */
:root.light {
    --bg-primary: #f5f7fb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f2f8;
    --bg-input: #f0f2f8;
    --bg-overlay: rgba(245, 247, 251, 0.9);

    --text-primary: #1a1d27;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;

    --border: #e2e5f0;
    --border-light: #d1d5e0;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);

    --accent-soft: rgba(99, 102, 241, 0.1);
    --accent-glow: rgba(99, 102, 241, 0.15);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
}

/* --- Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease, background var(--transition);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin-bottom: 24px;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.sidebar-logo h1 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-logo h1 small {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-glow);
}

.nav-item .nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* --- Language Switcher --- */
.lang-switch {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-xs);
    margin-bottom: 4px;
}

.lang-btn {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: all var(--transition);
}

.lang-btn.active {
    background: var(--accent);
    color: white;
}

.lang-btn:hover:not(.active) {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* --- Theme Toggle --- */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.theme-toggle .toggle-track {
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 11px;
    position: relative;
    transition: background var(--transition);
}

.theme-toggle .toggle-thumb {
    width: 18px;
    height: 18px;
    background: var(--text-primary);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--transition);
}

:root.light .theme-toggle .toggle-thumb {
    transform: translateX(18px);
}

:root.light .theme-toggle .toggle-track {
    background: var(--accent);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    max-width: 1200px;
}

/* --- Page containers --- */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.card-header .card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.card-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.card-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Landing page tool cards --- */
.tool-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #a855f7);
    opacity: 0;
    transition: opacity 0.3s;
}

.tool-card:hover {
    border-color: var(--accent-glow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card .tool-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 16px;
}

.tool-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.tool-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

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

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: all var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

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

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

/* Field type badges (sanity checker style) */
.badge-asset { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-answer { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.badge-resolution { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-infobox { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge-scene { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.badge-invisible { background: rgba(251, 146, 60, 0.15); color: #fb923c; }

/* Template badges */
.badge-tpl { font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.badge-tpl-qa { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-tpl-cloze-choose { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.badge-tpl-cloze-text { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge-tpl-flashcard { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.badge-tpl-imagemap { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.badge-tpl-survey { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.badge-tpl-info { background: rgba(34, 197, 94, 0.1); color: #86efac; }
.badge-tpl-default { background: var(--bg-input); color: var(--text-secondary); }

/* Light mode badge adjustments */
:root.light .badge-asset { background: #dbeafe; color: #1e40af; }
:root.light .badge-answer { background: #d1fae5; color: #065f46; }
:root.light .badge-resolution { background: #fef3c7; color: #92400e; }
:root.light .badge-infobox { background: #ede9fe; color: #5b21b6; }
:root.light .badge-scene { background: #fce7f3; color: #9d174d; }
:root.light .badge-invisible { background: #fed7aa; color: #9a3412; }
:root.light .badge-tpl-qa { background: #fef3c7; color: #92400e; }
:root.light .badge-tpl-cloze-choose { background: #e0e7ff; color: #3730a3; }
:root.light .badge-tpl-cloze-text { background: #ddd6fe; color: #5b21b6; }
:root.light .badge-tpl-flashcard { background: #d1fae5; color: #065f46; }
:root.light .badge-tpl-imagemap { background: #fce7f3; color: #9d174d; }
:root.light .badge-tpl-survey { background: #cffafe; color: #155e75; }
:root.light .badge-tpl-info { background: #f0fdf4; color: #166534; }
:root.light .badge-tpl-default { background: #f1f5f9; color: #475569; }

/* --- Tables --- */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-input);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

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

tr:hover td {
    background: var(--bg-card-hover);
}

td .editable-text {
    width: 100%;
    min-height: 36px;
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition);
}

td .editable-text:focus {
    border-color: var(--accent);
}

td .text-changed {
    border-color: var(--warning);
    background: var(--warning-soft);
}

/* --- Progress Bar --- */
.progress-container {
    margin: 20px 0;
}

.progress-bar-wrapper {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a855f7);
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- Steps Wizard --- */
.steps-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    padding: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.step-indicator {
    flex: 1;
    padding: 10px 16px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition);
}

.step-indicator.active {
    background: var(--accent);
    color: white;
}

.step-indicator.completed {
    color: var(--success);
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* --- Info Box --- */
.info-box {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.85rem;
    line-height: 1.6;
    border-left: 3px solid;
}

.info-box.info {
    background: var(--info-soft);
    border-color: var(--info);
    color: var(--info);
}

.info-box.success {
    background: var(--success-soft);
    border-color: var(--success);
    color: var(--success);
}

.info-box.warning {
    background: var(--warning-soft);
    border-color: var(--warning);
    color: var(--warning);
}

.info-box.danger {
    background: var(--danger-soft);
    border-color: var(--danger);
    color: var(--danger);
}

.info-box strong {
    display: block;
    margin-bottom: 4px;
}

/* --- Audio Player --- */
.audio-player {
    width: 100%;
    margin: 12px 0;
    border-radius: var(--radius-sm);
}

audio {
    width: 100%;
    border-radius: var(--radius-sm);
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Collapsible section --- */
.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 12px 0;
}

.collapsible-header .arrow {
    transition: transform 0.2s;
}

.collapsible-header.open .arrow {
    transform: rotate(180deg);
}

.collapsible-body {
    display: none;
    padding-bottom: 12px;
}

.collapsible-body.open {
    display: block;
}

/* --- Toast notifications --- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    min-width: 280px;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.7s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }
.toast.warning { background: #d97706; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* --- Filters & Search (Vertone step 4) --- */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-bar .search-input {
    flex: 1;
    min-width: 200px;
}

.filter-bar-full {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 0.82rem;
}

.filter-bar-full .filter-select {
    width: auto;
    min-width: 120px;
    padding: 6px 10px;
    font-size: 0.8rem;
}

.filter-bar-full .filter-search {
    flex: 1;
    min-width: 150px;
    padding: 6px 10px;
    font-size: 0.8rem;
}

.filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

/* =========================================================================
   SANITY CHECKER ITEM LAYOUT (for Vertone step 4)
   4-column grid: Original | Sprechtext | Audio | Votes
   ========================================================================= */

.item-list {
    padding: 0;
}

.sc-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 8px;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 12px;
    align-items: center;
    transition: border-color 0.2s, background 0.2s;
}

.sc-item:first-child {
    margin-top: 0;
}

.sc-item.checked-ok {
    border-left: 3px solid var(--success);
    background: rgba(34, 197, 94, 0.05);
}

.sc-item.checked-bad {
    border-left: 3px solid var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

:root.light .sc-item.checked-ok {
    background: #f0fdf4;
}

:root.light .sc-item.checked-bad {
    background: #fef2f2;
}

.sc-item-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.sc-item-text {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.sc-item-text .label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.sc-item-text p {
    margin-top: 2px;
    word-break: break-word;
    font-size: 0.85rem;
    line-height: 1.5;
}

.sc-item-text p.speak {
    background: rgba(34, 197, 94, 0.08);
    padding: 6px 8px;
    border-radius: 4px;
    border-left: 2px solid var(--success);
    font-style: italic;
    color: var(--success);
    cursor: text;
    outline: none;
    min-height: 1.4em;
}

:root.light .sc-item-text p.speak {
    background: #f0fdf4;
    color: #166534;
}

.sc-item-text p.speak:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
    background: var(--bg-card);
}

:root.light .sc-item-text p.speak:focus {
    background: white;
}

.sc-item-text p.speak.edited {
    border-left-color: var(--warning);
    background: rgba(245, 158, 11, 0.08);
}

:root.light .sc-item-text p.speak.edited {
    background: #fffbeb;
}

.sc-item-text p.speak.no-changes {
    border-left-color: var(--border);
    color: var(--text-muted);
    background: var(--bg-input);
}

.sc-audio-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    min-width: 180px;
}

.sc-audio-col audio {
    width: 180px;
    height: 32px;
}

.sc-audio-col .no-audio {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sc-vote-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vote-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--bg-card);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-btn:hover {
    transform: scale(1.1);
}

.vote-btn.up:hover,
.vote-btn.up.active {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.15);
}

.vote-btn.down:hover,
.vote-btn.down.active {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
}

:root.light .vote-btn {
    background: white;
}

:root.light .vote-btn.up:hover,
:root.light .vote-btn.up.active {
    background: #dcfce7;
}

:root.light .vote-btn.down:hover,
:root.light .vote-btn.down.active {
    background: #fee2e2;
}

/* --- Overview bar (review progress) --- */
.overview-bar {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.overview-bar .num {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.overview-bar .sep {
    color: var(--border);
}

.review-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 4px 16px;
    border-right: 2px solid var(--border);
}

.review-hero-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--success);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.review-hero-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overview-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overview-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.check-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-bar {
    flex: 1;
    min-width: 200px;
    height: 10px;
    background: var(--bg-input);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.check-bar-ok {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--success);
    transition: width 0.3s;
}

.check-bar-bad {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--danger);
    transition: width 0.3s, left 0.3s;
}

/* --- Pagination bar --- */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Rules editor --- */
.rule-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    margin-bottom: 8px;
}

.rule-item .form-input,
.rule-item .form-select {
    flex: 1;
}

.rule-item .btn-remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--danger-soft);
    color: var(--danger);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition);
}

.rule-item .btn-remove:hover {
    background: var(--danger);
    color: white;
}

/* --- Mobile hamburger --- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 101;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.hamburger {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 1.4rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* --- Loading Spinner --- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-secondary);
}

/* --- Quality meter --- */
.quality-meter {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quality-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.quality-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.quality-fill.excellent { background: var(--success); }
.quality-fill.good { background: #84cc16; }
.quality-fill.fair { background: var(--warning); }
.quality-fill.poor { background: var(--danger); }

/* --- Responsive --- */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 72px 16px 24px;
    }

    .tool-cards {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps-nav {
        flex-direction: column;
    }

    .sc-item {
        grid-template-columns: 1fr;
    }

    .sc-audio-col {
        flex-direction: row;
        min-width: unset;
    }

    .sc-vote-col {
        flex-direction: row;
    }

    .filter-bar-full {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar-full .filter-select,
    .filter-bar-full .filter-search {
        width: 100%;
    }
}

/* --- Utility --- */
.hidden { display: none !important; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Tab filters (kept for backward compat) */
.tab-filters {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: var(--bg-input);
    border-radius: var(--radius-xs);
    margin-bottom: 16px;
}

.tab-filter {
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition);
}

.tab-filter.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Keyboard shortcut hint bar */
.shortcut-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    display: inline-block;
    margin-bottom: 8px;
}

kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 3px;
    box-shadow: 0 1px 0 var(--border);
    color: var(--text-primary);
}
