/* ====================================================
   NAAD Eval — STT Evaluation Platform
   Professional branded UI (ink + copper)
   ==================================================== */

/* ------------------------------------------------
   CSS Custom Properties (Design Tokens)
   ------------------------------------------------ */
:root {
    /* Background & Surface — deep ink, not purple */
    --bg-primary: #0c1118;
    --bg-secondary: #121a24;
    --bg-surface: #172231;
    --bg-surface-hover: #1e2c3f;
    --bg-glass: rgba(18, 28, 40, 0.82);
    --bg-glass-border: rgba(214, 196, 168, 0.12);

    /* Text */
    --text-primary: #eef2f6;
    --text-secondary: #a8b4c4;
    --text-muted: #6d7b8d;
    --text-accent: #e8a35c;

    /* Accent — copper / saffron (Indic lab, not AI-purple) */
    --accent-primary: #d4783a;
    --accent-secondary: #e8a35c;
    --accent-gradient: linear-gradient(120deg, #c45e28 0%, #e8a35c 55%, #f0c48a 100%);
    --accent-blue: #5b9fd4;
    --accent-teal: #3d9b8f;
    --brand-mark: #f3ebe0;

    /* Diff Highlight Colors */
    --diff-added-bg: rgba(76, 175, 80, 0.25);
    --diff-added-text: #81c784;
    --diff-added-border: rgba(76, 175, 80, 0.5);

    --diff-deleted-bg: rgba(244, 67, 54, 0.25);
    --diff-deleted-text: #ef5350;
    --diff-deleted-border: rgba(244, 67, 54, 0.5);

    --diff-changed-bg: rgba(255, 235, 59, 0.25);
    --diff-changed-text: #fff176;
    --diff-changed-border: rgba(255, 235, 59, 0.5);

    --diff-missing-bg: rgba(158, 158, 158, 0.25);
    --diff-missing-text: #bdbdbd;
    --diff-missing-border: rgba(158, 158, 158, 0.5);

    --diff-script-mismatch-bg: rgba(255, 152, 0, 0.25);
    --diff-script-mismatch-text: #ffb74d;
    --diff-script-mismatch-border: rgba(255, 152, 0, 0.5);

    /* Layout */
    --font-display: 'Syne', 'Noto Sans Gujarati', sans-serif;
    --font-body: 'IBM Plex Sans', 'Noto Sans Gujarati', sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.28);
    --shadow-glow: none;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

/* Atmospheric ink field + subtle grid */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(212, 120, 58, 0.16) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 90% 10%, rgba(61, 155, 143, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 100%, rgba(91, 159, 212, 0.08) 0%, transparent 55%),
        linear-gradient(180deg, #0c1118 0%, #0e1520 40%, #0c1118 100%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(243, 235, 224, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(243, 235, 224, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

/* ------------------------------------------------
   Typography
   ------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

/* ------------------------------------------------
   App Layout
   ------------------------------------------------ */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 28px 48px;
    min-height: 100vh;
    animation: pageEnter 0.55s var(--transition-slow) both;
}

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

/* ------------------------------------------------
   Brand chrome
   ------------------------------------------------ */
.brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding: 14px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--accent-gradient);
    color: #1a120c;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.04em;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 18px rgba(196, 94, 40, 0.28);
    animation: markIn 0.7s var(--transition-slow) both;
}

@keyframes markIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--brand-mark);
    line-height: 1;
}

.brand-name span {
    color: var(--accent-secondary);
    font-weight: 600;
}

.brand-tagline {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.product-nav {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.28);
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-glass-border);
}

.product-nav a {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.product-nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.product-nav a.active {
    color: #1a120c;
    background: var(--accent-gradient);
}

/* ------------------------------------------------
   Header / page hero
   ------------------------------------------------ */
.app-header {
    text-align: left;
    padding: 28px 28px 26px;
    margin-bottom: 24px;
    background:
        linear-gradient(135deg, rgba(212, 120, 58, 0.1) 0%, transparent 42%),
        var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
}

.app-header::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 163, 92, 0.12), transparent 70%);
    pointer-events: none;
}

.app-header .page-kicker {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.app-header h1 {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    color: var(--brand-mark);
    background: none;
    -webkit-text-fill-color: unset;
    margin-bottom: 8px;
    max-width: 18ch;
}

.app-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.98rem;
    font-weight: 400;
    max-width: 52ch;
    line-height: 1.5;
}

.app-header .header-links {
    margin-top: 14px;
}

.app-header .header-links a {
    color: var(--accent-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.app-header .header-links a:hover {
    border-bottom-color: var(--accent-secondary);
    color: var(--brand-mark);
}

/* ------------------------------------------------
   Control Bar
   ------------------------------------------------ */
.control-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 24px;
    margin-bottom: 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}

/* ------------------------------------------------
   Buttons
   ------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #1a120c;
    box-shadow: 0 4px 16px rgba(196, 94, 40, 0.28);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(196, 94, 40, 0.35);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--bg-glass-border);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #c62828, #ef5350);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ------------------------------------------------
   Form Select
   ------------------------------------------------ */
.form-select {
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.form-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* ------------------------------------------------
   Toggle Switches
   ------------------------------------------------ */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-glass-border);
}

.toggle-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-primary);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    transition: background var(--transition-normal);
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition-normal);
}

.toggle-switch:checked {
    background: var(--accent-primary);
}

.toggle-switch:checked::before {
    left: 18px;
    background: white;
}

/* ------------------------------------------------
   Mode Selector
   ------------------------------------------------ */
.mode-selector {
    display: flex;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-glass-border);
    overflow: hidden;
}

.mode-btn {
    padding: 8px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

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

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

/* ------------------------------------------------
   Editor Grid (3 input panels)
   ------------------------------------------------ */
.editor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .editor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .editor-grid {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------
   Editor Panel
   ------------------------------------------------ */
.editor-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-soft);
}

.editor-panel:hover {
    border-color: rgba(233, 69, 96, 0.2);
    box-shadow: var(--shadow-glow);
}

.editor-panel:focus-within {
    border-color: rgba(233, 69, 96, 0.4);
}

.hidden-panel {
    display: none !important;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--bg-glass-border);
}

.panel-header h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.panel-label-a { background: var(--accent-primary); }
.panel-label-b { background: var(--accent-blue); }
.panel-label-c { background: var(--accent-purple); }

.panel-actions {
    display: flex;
    gap: 6px;
}

.panel-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.panel-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.panel-body {
    padding: 0;
}

.text-editor {
    width: 100%;
    min-height: 220px;
    max-height: 400px;
    padding: 16px 18px;
    border: none;
    outline: none;
    resize: vertical;
    background: transparent;
    color: var(--text-primary);
    font-family: 'Noto Sans Gujarati', 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    line-height: 1.8;
    overflow-y: auto;
}

.text-editor::placeholder {
    color: var(--text-muted);
}

/* Custom scrollbar */
.text-editor::-webkit-scrollbar {
    width: 6px;
}

.text-editor::-webkit-scrollbar-track {
    background: transparent;
}

.text-editor::-webkit-scrollbar-thumb {
    background: var(--bg-surface-hover);
    border-radius: 3px;
}

.panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid var(--bg-glass-border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ------------------------------------------------
   Results Section
   ------------------------------------------------ */
.results-section {
    margin-top: 28px;
    display: none;
    animation: fadeSlideUp 0.5s var(--transition-slow) forwards;
}

.results-section.visible {
    display: block;
}

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

/* ------------------------------------------------
   Similarity Cards
   ------------------------------------------------ */
.similarity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .similarity-grid {
        grid-template-columns: 1fr;
    }
}

.sim-card {
    padding: 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-normal);
}

.sim-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.sim-card .sim-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.sim-card .sim-value {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sim-card .sim-bar {
    margin-top: 12px;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.sim-card .sim-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent-gradient);
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------------
   Diff Summary
   ------------------------------------------------ */
.diff-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .diff-summary {
        grid-template-columns: 1fr;
    }
}

.summary-card {
    padding: 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
}

.summary-card h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.stat-badge.added {
    background: var(--diff-added-bg);
    color: var(--diff-added-text);
    border: 1px solid var(--diff-added-border);
}

.stat-badge.deleted {
    background: var(--diff-deleted-bg);
    color: var(--diff-deleted-text);
    border: 1px solid var(--diff-deleted-border);
}

.stat-badge.changed {
    background: var(--diff-changed-bg);
    color: var(--diff-changed-text);
    border: 1px solid var(--diff-changed-border);
}

.stat-badge.missing {
    background: var(--diff-missing-bg);
    color: var(--diff-missing-text);
    border: 1px solid var(--diff-missing-border);
}

.stat-badge.script-mismatch {
    background: var(--diff-script-mismatch-bg);
    color: var(--diff-script-mismatch-text);
    border: 1px solid var(--diff-script-mismatch-border);
}

.word-changes-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 8px;
}

.word-changes-list::-webkit-scrollbar {
    width: 6px;
}
.word-changes-list::-webkit-scrollbar-track {
    background: transparent;
}
.word-changes-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.word-change-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: 'Noto Sans Gujarati', sans-serif;
    border: 1px solid rgba(255,255,255,0.05);
}

.word-change-item span {
    padding: 2px 8px;
    border-radius: 4px;
}

.word-change-arrow {
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0 !important;
}

/* ------------------------------------------------
   Result Panels (3 synchronized)
   ------------------------------------------------ */
.result-panels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .result-panels {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .result-panels {
        grid-template-columns: 1fr;
    }
}

.result-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.result-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--bg-glass-border);
}

.result-panel-header h3 {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-panel-body {
    padding: 18px;
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Noto Sans Gujarati', 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    line-height: 2;
    word-break: break-word;
    white-space: pre-wrap;
}

/* Custom scrollbar for result panels */
.result-panel-body::-webkit-scrollbar {
    width: 6px;
}

.result-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.result-panel-body::-webkit-scrollbar-thumb {
    background: var(--bg-surface-hover);
    border-radius: 3px;
}

/* ------------------------------------------------
   Diff Highlights
   ------------------------------------------------ */
.diff-added {
    background: var(--diff-added-bg);
    padding: 2px 5px;
    border-radius: 4px;
    border-bottom: 2px solid var(--diff-added-border);
    transition: all var(--transition-fast);
}

.diff-added:hover {
    background: rgba(76, 175, 80, 0.4);
}

.diff-deleted {
    background: var(--diff-deleted-bg);
    padding: 2px 5px;
    border-radius: 4px;
    border-bottom: 2px solid var(--diff-deleted-border);
    transition: all var(--transition-fast);
}

.diff-deleted:hover {
    background: rgba(244, 67, 54, 0.4);
}

.diff-changed {
    background: var(--diff-changed-bg);
    padding: 2px 5px;
    border-radius: 4px;
    border-bottom: 2px solid var(--diff-changed-border);
    transition: all var(--transition-fast);
}

.diff-changed:hover {
    background: rgba(255, 235, 59, 0.4);
}

.diff-missing {
    background: var(--diff-missing-bg);
    padding: 2px 5px;
    border-radius: 4px;
    border-bottom: 2px solid var(--diff-missing-border);
    font-style: italic;
    transition: all var(--transition-fast);
}

.diff-missing:hover {
    background: rgba(158, 158, 158, 0.4);
}

.diff-script-mismatch {
    background: var(--diff-script-mismatch-bg);
    padding: 2px 5px;
    border-radius: 4px;
    border-bottom: 2px solid var(--diff-script-mismatch-border);
    transition: all var(--transition-fast);
}

.diff-script-mismatch:hover {
    background: rgba(255, 152, 0, 0.4);
}

.legend-color.script-mismatch {
    background: var(--diff-script-mismatch-bg);
    border: 1px solid var(--diff-script-mismatch-border);
}

/* ------------------------------------------------
   Legend
   ------------------------------------------------ */
.legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 14px 24px;
    margin-bottom: 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.added { background: var(--diff-added-bg); border: 1px solid var(--diff-added-border); }
.legend-color.deleted { background: var(--diff-deleted-bg); border: 1px solid var(--diff-deleted-border); }
.legend-color.changed { background: var(--diff-changed-bg); border: 1px solid var(--diff-changed-border); }
.legend-color.missing { background: var(--diff-missing-bg); border: 1px solid var(--diff-missing-border); }

/* ------------------------------------------------
   Loading Overlay
   ------------------------------------------------ */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}

.loading-overlay.visible {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-surface);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 1rem;
    color: var(--text-secondary);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

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

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-soft);
    animation: toastIn 0.4s var(--transition-slow) forwards;
    max-width: 360px;
}

.toast.success { background: linear-gradient(135deg, #2e7d32, #4caf50); }
.toast.error { background: linear-gradient(135deg, #c62828, #ef5350); }
.toast.info { background: linear-gradient(135deg, #1565c0, #42a5f5); }

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.fade-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* ------------------------------------------------
   File Upload Drop Zone
   ------------------------------------------------ */
.drop-zone {
    border: 2px dashed var(--bg-glass-border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin: 0 18px 12px;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(233, 69, 96, 0.05);
}

.drop-zone-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.drop-zone-text strong {
    color: var(--accent-primary);
}

.file-input-hidden {
    display: none;
}

/* ------------------------------------------------
   Responsive Adjustments
   ------------------------------------------------ */
@media (max-width: 768px) {
    .app-container {
        padding: 12px;
    }

    .app-header {
        padding: 20px 16px;
    }

    .app-header h1 {
        font-size: 1.4rem;
    }

    .control-bar {
        padding: 12px;
        gap: 8px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .similarity-grid,
    .diff-summary {
        grid-template-columns: 1fr;
    }

    .legend {
        gap: 12px;
    }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ------------------------------------------------
   Print Styles
   ------------------------------------------------ */
@media print {
    body {
        background: white;
        color: #333;
    }

    body::before {
        display: none;
    }

    .app-header,
    .control-bar,
    .editor-grid,
    .loading-overlay,
    .toast-container {
        display: none !important;
    }

    .results-section {
        display: block !important;
    }

    .sim-card,
    .summary-card,
    .result-panel {
        background: #fafafa;
        border: 1px solid #ddd;
        backdrop-filter: none;
    }

    .diff-added { background: #c8e6c9; color: #2e7d32; -webkit-text-fill-color: #2e7d32; }
    .diff-deleted { background: #ffcdd2; color: #c62828; -webkit-text-fill-color: #c62828; }
    .diff-changed { background: #fff9c4; color: #f57f17; -webkit-text-fill-color: #f57f17; }
    .diff-missing { background: #eeeeee; color: #616161; -webkit-text-fill-color: #616161; }
}

/* ------------------------------------------------
   JSON View Styles
   ------------------------------------------------ */

.json-entries-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.json-entry-card {
    background: var(--bg-surface);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.json-entry-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.json-entry-card.entry-added {
    border-left: 3px solid var(--diff-added-text);
}

.json-entry-card.entry-deleted {
    border-left: 3px solid var(--diff-deleted-text);
}

.json-entry-card.entry-changed {
    border-left: 3px solid var(--diff-changed-text);
}

.json-entry-card.entry-equal {
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}

.json-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--bg-glass-border);
    font-size: 0.78rem;
}

.json-entry-index {
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.json-entry-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.json-entry-status.status-equal { color: var(--text-muted); }
.json-entry-status.status-changed { color: var(--diff-changed-text); background: var(--diff-changed-bg); }
.json-entry-status.status-added { color: var(--diff-added-text); background: var(--diff-added-bg); }
.json-entry-status.status-deleted { color: var(--diff-deleted-text); background: var(--diff-deleted-bg); }

.json-entry-body {
    padding: 10px 14px;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
}

.json-field {
    display: flex;
    gap: 8px;
    padding: 2px 0;
}

.json-key {
    color: var(--accent-secondary);
    white-space: nowrap;
    min-width: 80px;
    flex-shrink: 0;
}

.json-value {
    color: #4ade80;
}

.json-value-string {
    color: #fbbf24;
}

.json-text-diff-container {
    margin-top: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-glass-border);
}

.json-text-diff-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.json-text-diff-label.label-a {
    color: var(--accent-primary);
}

.json-text-diff-label.label-b {
    color: var(--accent-blue);
}

.json-text-diff-content {
    font-family: 'Inter', 'Segoe UI', 'Noto Sans Gujarati', system-ui, sans-serif;
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--text-primary);
    word-break: break-word;
}

.json-text-side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

.json-text-side-by-side .json-text-diff-container {
    margin-top: 0;
}

/* Ensure diff highlights work inside JSON view */
.json-text-diff-content .diff-added,
.json-text-diff-content .diff-deleted,
.json-text-diff-content .diff-changed,
.json-text-diff-content .diff-script-mismatch {
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .json-text-side-by-side {
        grid-template-columns: 1fr;
    }
}

/* ====================================================
   STT Evaluation Platform — Wizard & Dashboard
   ==================================================== */

.wizard-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 24px;
    padding: 8px;
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
}

.wizard-step {
    flex: 1;
    min-width: 110px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    position: relative;
}

.wizard-step.active {
    background: rgba(212, 120, 58, 0.16);
    color: var(--brand-mark);
    border-color: rgba(232, 163, 92, 0.35);
}

.wizard-step.active::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px 2px 0 0;
}

.wizard-step.done {
    border-color: rgba(76, 175, 80, 0.35);
    color: var(--diff-added-text);
}

.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
}

.step-intro {
    margin-bottom: 20px;
}

.step-intro h2 {
    font-size: 22px;
    margin-bottom: 6px;
}

.step-intro p {
    color: var(--text-secondary);
    font-size: 14px;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--bg-glass-border);
}

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

.panel-label-gt {
    background: linear-gradient(135deg, #3d9b8f, #5b9fd4);
}

.optional-tag {
    font-size: 12px;
    color: var(--text-muted);
    font-style: normal;
    font-weight: 400;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.lang-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-glass-border);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
}

.lang-card span {
    color: var(--text-secondary);
    font-size: 13px;
}

.lang-card.selected,
.lang-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.mapping-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.mapping-card {
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
}

.mapping-card h3 {
    margin-bottom: 4px;
}

.mapping-card .meta {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 12px;
}

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

.mapping-card select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-glass-border);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.options-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.options-card {
    padding: 18px;
    background: var(--bg-surface);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
}

.options-card h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

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

.rule-list {
    list-style: none;
    margin-bottom: 10px;
    font-size: 13px;
}

.rule-list.enabled li {
    color: var(--diff-added-text);
    margin-bottom: 4px;
}

.rule-list.disabled li {
    color: var(--text-muted);
    margin-bottom: 4px;
}

.options-card .note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.dashboard-section {
    margin-bottom: 28px;
    padding: 22px 24px;
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: sectionIn 0.4s var(--transition-slow) both;
}

.dashboard-section h3 {
    margin-bottom: 14px;
    color: var(--brand-mark);
    font-size: 1.15rem;
}

.table-wrap {
    overflow-x: auto;
}

.wer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.wer-table th,
.wer-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--bg-glass-border);
    text-align: center;
}

.wer-table th:first-child,
.wer-table td:first-child {
    text-align: left;
    color: var(--text-secondary);
}

.wer-table th {
    color: var(--text-muted);
    font-weight: 600;
}

/* ---- Gap analysis (ElevenLabs vs Naad) ---- */
.gap-winner {
    margin: 12px 0 18px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(34, 160, 107, 0.12), rgba(74, 144, 217, 0.1));
    border: 1px solid rgba(34, 160, 107, 0.35);
}
.gap-winner-badge {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.gap-winner-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-accent);
}
.gap-winner-label { font-weight: 500; opacity: 0.7; font-size: 16px; }
.gap-winner-meta { margin-top: 4px; color: var(--text-secondary); font-size: 13px; }

.gap-rank-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.gap-rank-card {
    flex: 1 1 140px;
    min-width: 120px;
    padding: 12px 14px;
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.12);
}
.gap-rank-card.is-winner {
    border-color: rgba(34, 160, 107, 0.5);
    background: rgba(34, 160, 107, 0.08);
}
.gap-rank-num { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.gap-rank-name { font-weight: 600; color: var(--text-primary); }
.gap-rank-wer { font-size: 13px; margin-top: 4px; }
.gap-rank-wer.muted { color: var(--text-muted); }

.gap-recs {
    margin: 14px 0 18px;
    padding: 14px 16px;
    border-left: 3px solid rgba(74, 144, 217, 0.8);
    background: rgba(74, 144, 217, 0.06);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.gap-recs h4 { margin: 0 0 8px; color: var(--text-accent); }
.gap-recs ul { margin: 0; padding-left: 18px; }
.gap-recs li { margin-bottom: 6px; color: var(--text-secondary); font-size: 13px; line-height: 1.45; }

.gap-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.gap-stat {
    flex: 1 1 140px;
    text-align: center;
    padding: 14px 10px;
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
}
.gap-stat-n {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-accent);
    line-height: 1.1;
}
.gap-stat-l {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.35;
}

.gap-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.gap-col h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.gap-chip-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.gap-chip-list li {
    margin-bottom: 6px;
    padding: 6px 8px;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
}
.gap-ref { color: #7ec8ff; }
.gap-hyp { color: #ffd666; }
.gap-empty { color: var(--text-muted); font-size: 13px; }

.gap-error-table-wrap { margin-top: 8px; }
.gap-error-table-wrap h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--text-accent);
}
.gap-error-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.gap-error-table th,
.gap-error-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--bg-glass-border);
    text-align: left;
    vertical-align: top;
}
.gap-error-table th { color: var(--text-muted); font-weight: 600; }
.gap-note { color: var(--text-muted); font-size: 12px; }
.gap-type {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.gap-type-substitute { background: rgba(255, 180, 50, 0.2); color: #ffc266; }
.gap-type-delete { background: rgba(255, 90, 90, 0.2); color: #ff8a8a; }
.gap-type-insertion { background: rgba(120, 180, 255, 0.2); color: #9bc4ff; }

.legend-eval {
    margin-bottom: 12px;
}

.legend-color.gt-diff {
    background: rgba(74, 144, 217, 0.35);
    border: 1px solid rgba(74, 144, 217, 0.7);
}

.legend-color.pred-diff {
    background: rgba(255, 235, 59, 0.3);
    border: 1px solid rgba(255, 235, 59, 0.6);
}

.tok-gt-diff {
    background: rgba(74, 144, 217, 0.35);
    color: #90caf9;
    padding: 1px 4px;
    border-radius: 3px;
    border-bottom: 2px solid rgba(74, 144, 217, 0.8);
}

.tok-pred-diff {
    background: rgba(255, 235, 59, 0.28);
    color: #fff176;
    padding: 1px 4px;
    border-radius: 3px;
    border-bottom: 2px solid rgba(255, 235, 59, 0.7);
}

.tok-equal {
    color: var(--text-primary);
}

.compare-view .gt-block,
.compare-view .hyp-block,
.compare-view .pred-block {
    margin-bottom: 14px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.compare-view h4,
.compare-view h5 {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.token-line {
    line-height: 1.9;
    word-break: break-word;
}

.speaker-card {
    padding: 14px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.speaker-map {
    margin-top: 10px;
}

.map-row {
    margin-top: 6px;
    font-size: 13px;
}

.map-arrow {
    display: inline-block;
    margin: 0 8px;
    color: var(--accent-secondary);
}

.calc-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.calc-col h4 {
    margin-bottom: 8px;
    font-size: 14px;
}

.btn-secondary {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border: 1px solid var(--bg-glass-border);
}

.loading-overlay.active {
    display: flex;
}

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

.mode-line {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.similarity-totals {
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.7;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.metric-card {
    padding: 12px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-glass-border);
    text-align: center;
}

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.metric-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.viewer-title {
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 16px;
    color: var(--text-secondary);
}

.legend-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.diff-viewer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.diff-viewer-side {
    padding: 14px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-glass-border);
    min-height: 80px;
}

.diff-viewer-header {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 600;
}

.diff-viewer-pair {
    margin-bottom: 14px;
}

.secondary-pair {
    opacity: 0.95;
    border-top: 1px dashed var(--bg-glass-border);
    padding-top: 12px;
}

@media (max-width: 768px) {
    .diff-viewer-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Bulk Drive QA ---- */
.bulk-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.bulk-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.bulk-form-grid input,
.bulk-form-grid select {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-glass-border);
    background: rgba(0, 0, 0, 0.28);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.92rem;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.bulk-form-grid input:focus,
.bulk-form-grid select:focus {
    outline: none;
    border-color: rgba(232, 163, 92, 0.55);
    background: rgba(0, 0, 0, 0.38);
}
.bulk-nav {
    margin-top: 22px;
    justify-content: flex-start;
    gap: 16px;
    align-items: center;
}
.bulk-progress-bar {
    height: 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.35);
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--bg-glass-border);
}
.bulk-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    transition: width 0.35s ease;
}
.bulk-subh {
    margin: 22px 0 10px;
    color: var(--accent-secondary);
    font-size: 1rem;
}

.issue-prompts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}
.issue-prompt-card {
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.22);
    padding: 12px 14px;
}
.issue-prompt-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.issue-prompt-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--brand-mark);
    font-size: 0.95rem;
}
.issue-prompt-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.issue-prompt-card textarea {
    width: 100%;
    min-height: 140px;
    resize: vertical;
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-glass-border);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.45;
    padding: 10px 12px;
}
.issue-prompt-card .btn {
    padding: 7px 12px;
    font-size: 0.8rem;
}

@keyframes sectionIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
    .brand-bar {
        align-items: stretch;
    }
    .product-nav {
        width: 100%;
    }
    .product-nav a {
        flex: 1;
        text-align: center;
    }
    .app-header h1 {
        max-width: none;
    }
}
