/* AI Translator — "Soft Depth" Design System
   Inspired by Resend, Stripe, Supabase dashboards.
   Dark background with subtle radial gradient glows, glassmorphism cards,
   gradient accent buttons with glow shadows. Depth and warmth. */

@import url('https://api.fontshare.com/v2/css?f[]=satoshi@700,500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Palette — deep with color */
    --bg: #0a0a0f;
    --bg-subtle: #0d0d14;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-solid: #111118;
    --surface-2: rgba(255, 255, 255, 0.05);
    --surface-3: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.12);
    --ring: rgba(129, 140, 248, 0.25);

    --text: #f0f0f5;
    --text-secondary: #a0a0b4;
    --text-tertiary: #6b6b80;
    --text-quaternary: #4a4a5a;

    /* Accent — indigo-violet gradient range */
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-deep: #6366f1;
    --accent-muted: rgba(129, 140, 248, 0.15);
    --accent-subtle: rgba(129, 140, 248, 0.06);

    /* Secondary accent — emerald for success/progress */
    --emerald: #34d399;
    --emerald-muted: rgba(52, 211, 153, 0.12);

    --green: #34d399;
    --green-muted: rgba(52, 211, 153, 0.12);
    --yellow: #fbbf24;
    --yellow-muted: rgba(251, 191, 36, 0.12);
    --red: #f87171;
    --red-muted: rgba(248, 113, 113, 0.10);

    /* Typography */
    --font-display: 'Satoshi', -apple-system, sans-serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

    /* Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);

    /* Glow */
    --glow-accent: rgba(99, 102, 241, 0.15);
    --glow-emerald: rgba(52, 211, 153, 0.10);
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* === AMBIENT BACKGROUND GLOWS === */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(ellipse, var(--glow-accent), transparent 70%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}
body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(ellipse, var(--glow-emerald), transparent 70%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* === NAVIGATION === */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.75);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    padding: 0 24px;
    gap: 32px;
}
.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.4px;
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.logo:hover { opacity: 0.85; }
.logo-mark {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--accent), #a78bfa, var(--emerald));
    border-radius: 7px;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.3);
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}
.nav-links a {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-decoration: none;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-links a:hover {
    color: var(--text-secondary);
    background: var(--surface-2);
}
.nav-links a.active {
    color: var(--text);
    background: var(--surface-3);
}
.nav-links .nav-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
    margin: 0 8px;
}

/* === LAYOUT === */
main {
    padding: 48px 24px 80px;
    position: relative;
    z-index: 1;
}
.container { max-width: 1100px; margin: 0 auto; }
.container-narrow { max-width: 560px; margin: 0 auto; }
.container-mid { max-width: 740px; margin: 0 auto; }

/* === TYPOGRAPHY === */
.page-header { margin-bottom: 32px; }
.page-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.6px;
    line-height: 1.2;
}
.page-subtitle {
    font-size: 14px;
    color: var(--text-quaternary);
    margin-top: 6px;
}

h2 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}
h3 {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* === CARD (Glassmorphism) === */
.card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card:hover {
    border-color: var(--border-hover);
}
.card + .card { margin-top: 16px; }
.card-body { padding: 24px; }
.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
}
.card-desc {
    font-size: 13px;
    color: var(--text-quaternary);
    margin-top: 4px;
}

/* === TABS === */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
}
.tab {
    flex: 1;
    padding: 14px 16px;
    text-align: center;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s var(--ease), border-color 0.25s var(--ease), background 0.2s;
    position: relative;
}
.tab:hover {
    color: var(--text-secondary);
    background: var(--surface-2);
}
.tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.25s var(--ease); }

/* === ANIMATIONS === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 500px; }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px var(--glow-accent); }
    50% { box-shadow: 0 0 40px var(--glow-accent), 0 0 60px rgba(99, 102, 241, 0.08); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Staggered reveal for cards */
.card { animation: fadeInUp 0.4s var(--ease) both; }
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.12s; }
.card:nth-child(4) { animation-delay: 0.18s; }

/* === INPUTS === */
select, input[type="text"], input[type="number"], input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
    appearance: none;
    outline: none;
}
select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b80' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
option {
    background: #1a1a24;
    color: var(--text);
}
select:focus, input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--ring);
    background: rgba(255, 255, 255, 0.04);
}
select:hover, input[type="text"]:hover, input[type="number"]:hover, input[type="password"]:hover {
    border-color: var(--border-hover);
}

textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--ring);
    background: rgba(255, 255, 255, 0.04);
}
textarea:hover { border-color: var(--border-hover); }
textarea.mono {
    font-family: var(--font-mono);
    font-size: 12px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.3px;
}

/* === DROPZONE === */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s;
    position: relative;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-subtle);
    box-shadow: 0 0 30px rgba(129, 140, 248, 0.08);
}
.dropzone-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.3;
    transition: opacity 0.2s, transform 0.3s var(--ease);
}
.dropzone:hover .dropzone-icon { opacity: 0.5; transform: translateY(-2px); }
.dropzone-text {
    font-size: 14px;
    color: var(--text-tertiary);
}
.dropzone-text strong {
    color: var(--accent);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s;
}
.dropzone-text strong:hover { color: var(--accent-hover); }
.dropzone-hint {
    font-size: 12px;
    color: var(--text-quaternary);
    margin-top: 6px;
}
.dropzone-file {
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.dropzone-file::before {
    content: '';
    width: 16px;
    height: 16px;
    background: var(--accent);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z'/%3E%3Cpath d='M13 2v7h7'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z'/%3E%3Cpath d='M13 2v7h7'/%3E%3C/svg%3E") no-repeat center;
    flex-shrink: 0;
}

/* File preview */
.file-preview {
    margin-top: 12px;
    padding: 14px 16px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    animation: fadeIn 0.3s var(--ease);
}
.file-preview-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    font-family: var(--font-mono);
}
.file-preview-text {
    max-height: 120px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 12px;
    color: var(--text-quaternary);
    font-family: var(--font-mono);
    line-height: 1.5;
}

/* === LANGUAGE ROW === */
.lang-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: 20px;
}
.lang-row .field { flex: 1; }
.swap-btn {
    width: 38px;
    height: 38px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
    flex-shrink: 0;
    margin-bottom: 1px;
}
.swap-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-subtle);
    transform: rotate(180deg);
}
.swap-btn:active { transform: rotate(180deg) scale(0.95); }

/* === MODEL SELECTORS === */
.model-selectors {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}
.model-block {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 12px;
    transition: border-color 0.2s var(--ease);
}
.model-block:hover {
    border-color: var(--border-hover);
}
.model-block-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.model-block-header svg {
    color: var(--accent);
    opacity: 0.7;
}
.model-block-controls {
    display: flex;
    gap: 8px;
}
.model-block-controls select {
    font-size: 12px;
}
.thinking-field {
    min-width: 90px;
}
.thinking-field select {
    font-size: 12px;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary — gradient with glow */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-deep), var(--accent));
    color: #fff;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 8px 30px rgba(99, 102, 241, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: var(--border-hover);
    color: var(--text);
    transform: translateY(-1px);
}
.btn-secondary:active:not(:disabled) { transform: translateY(0); }

.btn-danger {
    background: var(--red-muted);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.15);
}
.btn-danger:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.3);
    box-shadow: 0 4px 16px rgba(248, 113, 113, 0.1);
}

.btn-ghost {
    background: none;
    color: var(--text-tertiary);
    padding: 7px 12px;
}
.btn-ghost:hover:not(:disabled) {
    color: var(--text-secondary);
    background: var(--surface-2);
}

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

/* Loading state for buttons */
.btn-loading {
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* === ADVANCED SETTINGS === */
.advanced-toggle {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}
.advanced-toggle summary {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-quaternary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    letter-spacing: 0.3px;
    transition: color 0.15s;
}
.advanced-toggle summary::-webkit-details-marker { display: none; }
.advanced-toggle summary::before {
    content: '\203A';
    font-size: 15px;
    font-weight: 600;
    transition: transform 0.25s var(--ease);
    display: inline-block;
    width: 12px;
}
.advanced-toggle[open] summary::before { transform: rotate(90deg); }
.advanced-toggle summary:hover { color: var(--text-tertiary); }
.advanced-body {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fadeIn 0.3s var(--ease);
}
.adv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.15s;
}
.checkbox-item:hover { color: var(--text); }
.checkbox-item input[type="checkbox"] {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* === ESTIMATE === */
.estimate-box {
    margin-top: 16px;
    padding: 16px 20px;
    background: var(--accent-subtle);
    border: 1px solid var(--accent-muted);
    border-radius: var(--radius);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    animation: fadeIn 0.3s var(--ease);
}
.est-item { text-align: center; }
.est-value {
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
}
.est-label {
    font-size: 11px;
    color: var(--text-quaternary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 3px;
}

.error-box {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--red-muted);
    border: 1px solid rgba(248, 113, 113, 0.15);
    border-radius: var(--radius-sm);
    color: var(--red);
    font-size: 13px;
    animation: fadeIn 0.2s var(--ease);
}
.warning-box {
    padding: 12px 16px;
    background: var(--yellow-muted);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: var(--radius-sm);
    color: var(--yellow);
    font-size: 13px;
    margin-bottom: 20px;
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.5;
}
.badge-pending, .badge-queued { background: rgba(255,255,255,0.06); color: var(--text-tertiary); }
.badge-analyzing, .badge-translating {
    background: var(--accent-muted);
    color: var(--accent);
    animation: pulse-glow-badge 2s ease-in-out infinite;
}
@keyframes pulse-glow-badge {
    0%, 100% { box-shadow: 0 0 8px transparent; }
    50% { box-shadow: 0 0 12px var(--glow-accent); }
}
.badge-completed { background: var(--green-muted); color: var(--green); }
.badge-failed { background: var(--red-muted); color: var(--red); }
.badge-cancelled { background: var(--yellow-muted); color: var(--yellow); }
.badge-draft { background: var(--surface-3); color: var(--text-tertiary); }
.badge-paused { background: var(--yellow-muted); color: var(--yellow); }
.badge-waiting_user { background: var(--accent-muted); color: var(--accent); animation: pulse-glow 2s ease-in-out infinite; }

/* === PROGRESS BAR === */
.progress-bar-outer {
    height: 6px;
    background: var(--surface-3);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--emerald));
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.8s var(--ease);
    position: relative;
    animation: progress-gradient 3s ease infinite;
}
@keyframes progress-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}
.progress-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 13px;
}
.progress-label { color: var(--text-secondary); }
.progress-pct {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text);
    font-size: 14px;
}

/* === STATS === */
.stats-bar {
    display: flex;
    gap: 28px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.stat-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.stat-label {
    font-size: 11px;
    color: var(--text-quaternary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

/* === JOB TABS === */
.job-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}
.job-tab {
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.15s;
    font-family: var(--font-body);
}
.job-tab:hover {
    color: var(--text-secondary);
    background: var(--surface-2);
}
.job-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.job-tab-content { display: none; }
.job-tab-content.active { display: block; animation: fadeIn 0.25s var(--ease); }

/* === LIVE PREVIEW (reading mode) === */
.live-preview {
    background: var(--surface);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    max-height: calc(100vh - 360px);
    min-height: 300px;
    overflow-y: auto;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--text-secondary);
    scroll-behavior: smooth;
}
.live-preview::-webkit-scrollbar { width: 6px; }
.live-preview::-webkit-scrollbar-track { background: transparent; }
.live-preview::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.live-preview::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* Rendered markdown in preview */
.preview-rendered h1, .preview-rendered h2, .preview-rendered h3 {
    font-family: var(--font-display);
    color: var(--text);
    margin: 14px 0 5px;
    letter-spacing: -0.3px;
}
.preview-rendered h1:first-child, .preview-rendered h2:first-child, .preview-rendered h3:first-child { margin-top: 0; }
.preview-rendered h1 { font-size: 1.3em; }
.preview-rendered h2 { font-size: 1.15em; }
.preview-rendered h3 { font-size: 1.02em; }
.preview-rendered p { margin: 6px 0; }
.preview-rendered ul, .preview-rendered ol { margin: 6px 0; padding-left: 22px; }
.preview-rendered li { margin: 2px 0; }
.preview-rendered strong { color: var(--text); }
.preview-rendered em { color: var(--text-secondary); }
.preview-rendered code {
    background: var(--surface-3);
    padding: 2px 7px;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.88em;
}
.preview-rendered pre {
    background: var(--surface-2);
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 14px 0;
    border: 1px solid var(--border-subtle);
}
.preview-rendered pre code { background: none; padding: 0; }
.preview-rendered blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    color: var(--text-tertiary);
    margin: 14px 0;
    font-style: italic;
}

/* === TRACE TABLE === */
.trace-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-family: var(--font-mono);
}
.trace-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-quaternary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--border);
}
.trace-table td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}
.trace-table tbody tr { transition: background 0.15s; }
.trace-table tbody tr:hover { background: var(--accent-subtle); }
.trace-type { font-weight: 600; }
.trace-type-analyze { color: var(--yellow); }
.trace-type-translate { color: var(--green); }
.trace-type-summary { color: var(--accent); }

/* === HISTORY TABLE === */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(8px);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-quaternary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    background: var(--surface-2);
    overflow: hidden;
}
.data-table th:hover { color: var(--text-tertiary); }
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
    color: var(--text-secondary);
    vertical-align: middle;
}
.data-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.filename {
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.filename-text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text);
}
.source-badge {
    display: inline-block;
    font-size: 9px;
    font-family: var(--font-mono);
    color: var(--text-quaternary);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0 3px;
    margin-left: 6px;
    vertical-align: middle;
}
.lang-pair {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
}
.model-name { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
.date-col { color: var(--text-quaternary); font-size: 12px; white-space: nowrap; }
.cost-col { font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }

.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-quaternary);
    font-size: 15px;
}
.empty-state a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
.empty-state a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Search / filter bar */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}
.filter-bar input[type="text"] { max-width: 280px; }
.filter-bar select { width: auto; min-width: 150px; }
.filter-bar .spacer { flex: 1; }
.total-cost {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-tertiary);
    padding: 8px 16px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}
.total-cost strong { color: var(--text); }
.total-cost .monthly-jobs { color: var(--text-tertiary); margin-left: 4px; }
.total-cost .expand-icon { vertical-align: middle; margin-left: 4px; transition: transform 0.2s; opacity: 0.5; }
.cost-summary { position: relative; }
.daily-costs {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px;
    z-index: 100;
    min-width: 280px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.daily-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12px; }
.daily-table th { color: var(--text-tertiary); font-weight: 500; text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border-subtle); }
.daily-table td { padding: 4px 8px; color: var(--text-secondary); }
.daily-table tr:hover td { color: var(--text); }

/* === SETTINGS === */
.settings-section { margin-bottom: 24px; }
.key-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: background 0.15s, border-color 0.15s;
    border: 1px solid transparent;
}
.key-item:hover {
    background: var(--surface-3);
    border-color: var(--border-subtle);
}
.key-info { display: flex; align-items: center; gap: 12px; }
.key-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}
.btn-icon {
    background: none;
    border: none;
    color: var(--text-quaternary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1;
}
.btn-icon:hover { color: var(--red); background: var(--red-muted); }
.add-key-form { display: flex; gap: 8px; }
.key-input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
}
.key-message { font-size: 13px; margin-top: 8px; min-height: 18px; }
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    transition: border-color 0.2s;
}
.info-item:hover { border-color: var(--border-hover); }
.info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-quaternary);
}
.info-value { font-size: 14px; color: var(--text); font-weight: 500; }

/* === LOGIN === */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
}
.login-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 44px 40px 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), 0 0 80px var(--glow-accent);
    animation: fadeInUp 0.5s var(--ease);
}
.login-card h1 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    color: var(--text);
    letter-spacing: -0.4px;
}
.login-card .field { margin-bottom: 16px; }
.login-card .btn {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    font-size: 14px;
}
.login-error {
    background: var(--red-muted);
    border: 1px solid rgba(248, 113, 113, 0.15);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--red);
    font-size: 13px;
    margin-bottom: 16px;
    animation: fadeIn 0.2s var(--ease);
}
.turnstile-field {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

/* === TRACE PAGE === */
.trace-card {
    background: var(--surface);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.trace-card:hover { border-color: var(--border-hover); }
.trace-card-header {
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-2);
}
.trace-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    white-space: nowrap;
}
.trace-badge.analyze { background: var(--accent-muted); color: var(--accent); }
.trace-badge.translate { background: var(--green-muted); color: var(--green); }
.trace-badge.summary { background: var(--yellow-muted); color: var(--yellow); }
.trace-meta {
    color: var(--text-quaternary);
    font-size: 12px;
    font-family: var(--font-mono);
}
.trace-card details { border-top: 1px solid var(--border-subtle); }
.trace-card summary {
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-tertiary);
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, color 0.15s;
    list-style: none;
}
.trace-card summary::-webkit-details-marker { display: none; }
.trace-card summary:hover { background: var(--surface-2); color: var(--text-secondary); }
.trace-card summary .size { color: var(--text-quaternary); font-size: 11px; opacity: 0.7; margin-left: auto; }
.trace-content {
    padding: 18px 22px;
    background: rgba(0, 0, 0, 0.2);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 600px;
    overflow-y: auto;
    color: var(--text-tertiary);
}
.trace-summary-bar {
    text-align: center;
    color: var(--text-quaternary);
    font-size: 13px;
    margin-bottom: 20px;
    font-family: var(--font-mono);
}
.trace-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}
.trace-explanation {
    background: var(--surface);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.7;
}
.trace-explanation strong { color: var(--text-secondary); }
.trace-step-label {
    padding: 6px 18px;
    font-size: 12px;
    color: var(--text-quaternary);
    background: var(--surface);
    border-bottom: 1px solid var(--border-subtle);
    font-style: italic;
}

/* === JOB META === */
.job-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.job-meta .sep { color: var(--text-quaternary); }
.section-name {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    font-style: italic;
}

/* Download / view links */
.download-links {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.view-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.view-links-label { color: var(--text-quaternary); }

/* Prompt section */
.prompt-section { margin-top: 20px; }
.prompt-section summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--text-tertiary);
    padding: 8px 0;
    list-style: none;
    transition: color 0.15s;
}
.prompt-section summary::-webkit-details-marker { display: none; }
.prompt-section summary:hover { color: var(--text-secondary); }

/* Preview toggle */
.toggle-raw-btn {
    margin-left: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-quaternary);
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.15s;
}
.toggle-raw-btn:hover { color: var(--text-tertiary); border-color: var(--border-hover); }

/* Preview text container */
.preview-text {
    background: var(--surface);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    font-size: 14px;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
}

/* === COMPLETION TRANSITION === */
.result-reveal {
    animation: fadeInUp 0.5s var(--ease) both;
}
.result-reveal .download-links { animation: fadeInUp 0.5s 0.1s var(--ease) both; }
.result-reveal .view-links { animation: fadeInUp 0.5s 0.15s var(--ease) both; }
.result-reveal .stats-bar { animation: fadeInUp 0.5s 0.05s var(--ease) both; }
.result-reveal .actions { animation: fadeInUp 0.5s 0.2s var(--ease) both; }

/* === UTILITY === */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Delete button in table */
.delete-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--text-quaternary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}
.data-table tbody tr:hover .delete-btn { opacity: 1; }
.delete-btn:hover { color: var(--red); background: var(--red-muted); }

/* Favorite star button */
.fav-cell { width: 32px; padding: 0 4px !important; text-align: center; }
.fav-btn {
    background: none;
    border: none;
    color: var(--text-quaternary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}
.fav-btn:hover { color: var(--yellow); }
.fav-btn.active { color: var(--yellow); }

/* Favorite filter button */
.fav-filter-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-quaternary);
    cursor: pointer;
    padding: 7px 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
}
.fav-filter-btn:hover { color: var(--yellow); border-color: var(--yellow); }
.fav-filter-btn.active { color: var(--yellow); border-color: var(--yellow); background: var(--yellow-muted); }

/* Active job row highlight */
.data-table tbody tr.active-job {
    background: var(--accent-subtle);
    border-left: 3px solid var(--accent);
}
.data-table tbody tr.active-job td:first-child { padding-left: 13px; }

/* === SCROLLBAR GLOBAL === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* === EXPANDABLE TRACE ROWS === */
.trace-row-toggle:hover { background: var(--accent-subtle); }
.trace-row-toggle td:first-child::before {
    content: '\25B6';
    font-size: 8px;
    margin-right: 6px;
    display: inline-block;
    transition: transform 0.15s var(--ease);
    color: var(--text-quaternary);
}
.trace-row-expanded td:first-child::before {
    transform: rotate(90deg);
    color: var(--accent);
}
.trace-detail-row { background: rgba(0, 0, 0, 0.2); }
.trace-detail-cell { padding: 12px 16px !important; }
.trace-detail-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-quaternary);
    margin-bottom: 6px;
    margin-top: 16px;
}
.trace-detail-label:first-child { margin-top: 0; }
.trace-detail-text {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-tertiary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}

/* === RESULT PAGE === */
.result-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.result-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.result-actions-label {
    font-size: 12px;
    color: var(--text-quaternary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-right: 2px;
}
.result-tabs { margin-bottom: 0; }
.result-tab-content { display: none; }
.result-tab-content.active { display: block; animation: fadeIn 0.25s var(--ease); }
.result-preview {
    background: var(--surface);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 20px 24px;
    font-size: 14px;
    max-height: calc(100vh - 340px);
    min-height: 300px;
    overflow-y: auto;
    line-height: 1.6;
    word-break: break-word;
    color: var(--text-secondary);
}
.result-preview.preview-rendered { white-space: normal; line-height: 1.45; }
.result-preview pre, pre.result-preview { white-space: pre-wrap; }
.result-preview-header {
    display: flex;
    justify-content: flex-end;
    padding: 6px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
}
.result-preview-iframe {
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
    height: 500px;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    main { padding: 28px 16px 60px; }
    .nav-inner { gap: 16px; }
    .nav-links a { padding: 6px 10px; font-size: 12px; }
    .lang-row { flex-wrap: wrap; }
    .lang-row .field { flex: 1 1 40%; }
    .adv-grid { grid-template-columns: 1fr; }
    .stats-bar { gap: 16px; }
    .info-grid { grid-template-columns: 1fr; }
    .estimate-box { grid-template-columns: 1fr; }
    .filter-bar { flex-wrap: wrap; }
    .filter-bar input[type="text"] { max-width: none; flex: 1; }
    .container-narrow { max-width: 100%; }
    .live-preview { padding: 20px; font-size: 14px; }
    .login-card { padding: 32px 24px; margin: 16px; }
    .data-table { min-width: 700px; }
    .model-selectors { flex-direction: column; }
    .model-block-controls { flex-direction: column; }
    .compare-side-by-side { grid-template-columns: 1fr; }
    .job-tabs { gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .job-tab { padding: 9px 12px; font-size: 12px; white-space: nowrap; }
    .result-actions { flex-direction: column; gap: 10px; }
    .result-actions-group { flex-wrap: wrap; }
}

/* === v2 additions === */

/* Side-by-side comparison */
.compare-side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}
.compare-pane {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: auto;
    max-height: 600px;
    padding: 16px;
}
.compare-pane-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Option hints in Advanced settings */
.opt-hint {
    display: block;
    font-size: 11px;
    color: var(--text-quaternary);
    font-weight: 400;
    margin-top: 2px;
    line-height: 1.3;
}
.checkbox-item[title] { cursor: help; }

/* Button separator */
.btn-separator {
    display: inline-block;
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
    vertical-align: middle;
}

/* Images in preview */
.preview-rendered img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px 0;
}

/* Prompt editor */
.prompt-section { margin-bottom: 24px; }
.prompt-section:last-child { margin-bottom: 0; }
.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.prompt-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}
.prompt-actions { display: flex; gap: 8px; }
.prompt-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}
.prompt-editor {
    width: 100%;
    min-height: 160px;
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.5;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    resize: vertical;
    tab-size: 2;
}
.prompt-editor:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 127, 255, 0.15);
}
.badge-warning {
    background: rgba(255, 180, 50, 0.15);
    color: #ffb432;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Step-by-step pause banner */
.step-banner {
    background: var(--accent-muted);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.step-banner-text h3 {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    margin: 0;
}
.step-banner-text p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 3px 0 0;
}
.step-banner-actions {
    display: flex;
    gap: 8px;
}

/* Editable tab pill */
.tab-editable-pill {
    font-size: 10px;
    background: var(--accent-muted);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}

/* Comparison columns */
.comparison-split {
    display: flex;
    gap: 12px;
}
.comparison-col {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    overflow-y: auto;
    max-height: calc(100vh - 400px);
    min-height: 200px;
}
.comparison-col-header {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

/* Step-mode ghost link */
.upload-only-link {
    display: block;
    text-align: center;
    margin-top: 10px;
    color: var(--text-tertiary);
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}
.upload-only-link:hover {
    color: var(--accent);
}

/* === COMPACT GLOSSARY TABLE === */
#live-glossary .data-table td,
#live-glossary .data-table th {
    padding: 4px 8px;
    line-height: 1.4;
}
#live-glossary .data-table {
    table-layout: auto;
}
