/* --- ENCABO' Transcriber --- */

/* Fonts from encabo.works */
@font-face { font-family: 'TimesNow'; src: url('https://encabo.works/fonts/TimesNow-Light.ttf') format('truetype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'TimesNow'; src: url('https://encabo.works/fonts/TimesNow-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'PPNeueMontreal'; src: url('https://encabo.works/fonts/PPNeueMontreal-Book.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'PPNeueMontreal'; src: url('https://encabo.works/fonts/PPNeueMontreal-Medium.otf') format('opentype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'PPNeueMontreal'; src: url('https://encabo.works/fonts/PPNeueMontreal-Bold.otf') format('opentype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'FraktionMono'; src: url('https://encabo.works/fonts/FraktionMono-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'FraktionMono'; src: url('https://encabo.works/fonts/FraktionMono-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }

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

:root {
    /* Brand constants */
    --black: #0b0b0b;
    --navy: #08082a;
    --lime: #dbff00;
    --lime-rgb: 219, 255, 0;
    --cream: #eff0ed;
    --white: #fafaf8;
    --error: #ff6b6b;
    --success: #4ade80;

    /* Typography */
    --font-heading: 'TimesNow', Georgia, 'Times New Roman', serif;
    --font-body: 'PPNeueMontreal', system-ui, -apple-system, sans-serif;
    --font-mono: 'FraktionMono', 'Courier New', monospace;

    /* Radii */
    --radius: 10px;
    --radius-sm: 6px;
    --radius-xs: 3px;
}

/* --- Light Theme --- */
[data-theme="light"] {
    color-scheme: light;
    --page-bg: #fafaf8;
    --text-primary: #08082a;
    --text-secondary: rgba(8, 8, 42, 0.55);
    --text-tertiary: rgba(8, 8, 42, 0.3);
    --border: rgba(8, 8, 42, 0.1);
    --border-hover: rgba(8, 8, 42, 0.18);
    --accent: #08082a;
    --neutral-rgb: 8, 8, 42;
    --accent-rgb: 8, 8, 42;
    --select-bg: #f0f0ee;
    --select-chevron: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2308082a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    --grain-opacity: 0.25;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
    color-scheme: dark;
    --page-bg: #08082a;
    --text-primary: #eff0ed;
    --text-secondary: rgba(239, 240, 237, 0.5);
    --text-tertiary: rgba(239, 240, 237, 0.28);
    --border: rgba(239, 240, 237, 0.08);
    --border-hover: rgba(239, 240, 237, 0.15);
    --accent: #dbff00;
    --neutral-rgb: 239, 240, 237;
    --accent-rgb: 219, 255, 0;
    --select-bg: #0e0e3a;
    --select-chevron: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23eff0ed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    --grain-opacity: 0.5;
}

/* --- Base --- */

body {
    font-family: var(--font-body);
    background-color: var(--page-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* Grain texture */
.grain {
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: var(--grain-opacity);
}

/* --- Layout --- */

.container {
    position: relative;
    z-index: 1;
    max-width: 740px;
    margin: 0 auto;
    padding: 56px 24px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* --- Header --- */

header {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}

.brand-mark {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
    opacity: 0;
    animation: fadeDown 0.6s ease forwards;
}

header h1 {
    font-family: var(--font-heading);
    font-size: 3.2rem;
    font-weight: 300;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.05;
    margin-bottom: 12px;
    opacity: 0;
    animation: fadeDown 0.6s ease 0.1s forwards;
}

.subtitle {
    font-family: var(--font-body);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0;
    animation: fadeDown 0.6s ease 0.2s forwards;
}

/* --- Theme Toggle --- */

.theme-toggle {
    position: absolute;
    top: 4px;
    right: 0;
    padding: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: rgba(var(--neutral-rgb), 0.04);
    border-color: var(--border-hover);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* --- Auth --- */

.auth-section {
    opacity: 0;
    animation: fadeUp 0.6s ease 0.3s forwards;
}

.auth-box {
    max-width: 420px;
    margin: 0 auto;
}

.auth-box label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
}

.auth-input-row {
    display: flex;
    gap: 10px;
}

.auth-input-row input {
    flex: 1;
    padding: 14px 18px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background-color: rgba(var(--neutral-rgb), 0.04);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: all 0.25s ease;
}

.auth-input-row input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: rgba(var(--accent-rgb), 0.02);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.06);
}

.auth-input-row button {
    padding: 14px 30px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    background-color: var(--lime);
    color: var(--black);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.auth-input-row button:hover {
    background-color: #e5ff33;
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(var(--lime-rgb), 0.2);
}

.auth-hint {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 12px;
    text-align: center;
}

/* --- Input Tabs --- */

.input-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
    background: rgba(var(--neutral-rgb), 0.03);
    border-radius: var(--radius);
    padding: 3px;
    opacity: 0;
    animation: fadeUp 0.5s ease 0.2s forwards;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(var(--neutral-rgb), 0.04);
}

.tab-btn.active {
    color: var(--text-primary);
    background: rgba(var(--accent-rgb), 0.08);
    font-weight: 500;
}

.tab-btn svg {
    opacity: 0.5;
}

.tab-btn.active svg {
    opacity: 1;
    stroke: var(--accent);
}

.tab-content {
    display: none;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.tab-content.active {
    display: block;
}

/* --- URL Input --- */

.url-input-box {
    position: relative;
    margin-bottom: 16px;
}

.url-input-box .input-wrapper {
    position: relative;
}

.url-input-box .input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.url-input-box input {
    width: 100%;
    padding: 16px 18px 16px 48px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background-color: rgba(var(--neutral-rgb), 0.04);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: all 0.25s ease;
}

.url-input-box input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: rgba(var(--accent-rgb), 0.02);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.06);
}

.url-input-box input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

/* Platform badge */
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 5px 12px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: var(--radius-xs);
    animation: fadeIn 0.3s ease;
}

.platform-badge.youtube { background: rgba(255, 0, 0, 0.1); color: #ff4444; border: 1px solid rgba(255, 0, 0, 0.18); }
.platform-badge.instagram { background: rgba(225, 48, 108, 0.1); color: #e1306c; border: 1px solid rgba(225, 48, 108, 0.18); }
.platform-badge.tiktok { background: rgba(0, 242, 234, 0.1); color: #00f2ea; border: 1px solid rgba(0, 242, 234, 0.18); }
.platform-badge.twitter { background: rgba(var(--neutral-rgb), 0.06); color: var(--text-primary); border: 1px solid var(--border-hover); }
.platform-badge.vimeo { background: rgba(26, 183, 234, 0.1); color: #1ab7ea; border: 1px solid rgba(26, 183, 234, 0.18); }
.platform-badge.loom { background: rgba(98, 77, 254, 0.1); color: #624dfe; border: 1px solid rgba(98, 77, 254, 0.18); }
.platform-badge.facebook { background: rgba(66, 103, 178, 0.1); color: #4267b2; border: 1px solid rgba(66, 103, 178, 0.18); }
.platform-badge.other { background: rgba(var(--accent-rgb), 0.06); color: rgba(var(--accent-rgb), 0.55); border: 1px solid rgba(var(--accent-rgb), 0.15); }

/* --- File Upload --- */

.drop-zone {
    border: 1.5px dashed var(--border-hover);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    transition: all 0.25s ease;
    cursor: pointer;
    margin-bottom: 16px;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background-color: rgba(var(--accent-rgb), 0.03);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.drop-zone-content svg {
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.drop-zone-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

.upload-btn {
    padding: 10px 24px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    background-color: rgba(var(--accent-rgb), 0.08);
    color: var(--accent);
    border: 1.5px solid rgba(var(--accent-rgb), 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.upload-btn:hover {
    background-color: rgba(var(--accent-rgb), 0.15);
    border-color: rgba(var(--accent-rgb), 0.4);
}

.file-types {
    font-family: var(--font-mono);
    font-size: 0.62rem !important;
    color: var(--text-tertiary) !important;
    letter-spacing: 0.02em;
    margin-top: 4px;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(var(--accent-rgb), 0.04);
    border: 1px solid rgba(var(--accent-rgb), 0.12);
    border-radius: var(--radius);
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

.file-info-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-info-content svg {
    color: var(--accent);
    flex-shrink: 0;
}

.file-info-content div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#file-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

#file-size {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.remove-file-btn {
    padding: 6px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all 0.2s ease;
}

.remove-file-btn:hover {
    color: var(--error);
    background: rgba(255, 107, 107, 0.1);
}

/* --- Options Row --- */

.options-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeUp 0.5s ease 0.3s forwards;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.option-group label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.option-group select {
    padding: 12px 36px 12px 14px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    background-color: rgba(var(--neutral-rgb), 0.04);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: var(--select-chevron);
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.option-group select:focus {
    outline: none;
    border-color: var(--accent);
}

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

.transcribe-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    background-color: var(--lime);
    color: var(--black);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.transcribe-btn:hover {
    background-color: #e5ff33;
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(var(--lime-rgb), 0.2);
}

.transcribe-btn:active {
    transform: translateY(0) scale(0.98);
}

.transcribe-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.transcribe-btn svg {
    stroke: var(--black);
}

/* --- Progress --- */

.progress-section {
    padding: 24px;
    background: rgba(var(--accent-rgb), 0.03);
    border: 1px solid rgba(var(--accent-rgb), 0.1);
    border-radius: var(--radius);
    margin-bottom: 24px;
    animation: fadeIn 0.4s ease;
}

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

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-hover);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

#progress-message {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 400;
}

.progress-container {
    width: 100%;
    height: 3px;
    background-color: rgba(var(--neutral-rgb), 0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--lime), #e5ff66);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 2px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.step-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(var(--neutral-rgb), 0.08);
    border: 1.5px solid var(--border-hover);
    transition: all 0.3s ease;
}

.step.active .step-dot {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.35);
}

.step.done .step-dot {
    background: var(--success);
    border-color: var(--success);
}

.step span {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.step.active span,
.step.done span {
    color: var(--text-secondary);
}

/* --- Error --- */

.error-section {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    background-color: rgba(255, 107, 107, 0.05);
    border: 1px solid rgba(255, 107, 107, 0.15);
    border-radius: var(--radius);
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease;
}

.error-section svg {
    color: var(--error);
    flex-shrink: 0;
    margin-top: 1px;
}

#error-message {
    color: var(--error);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- Result --- */

.result-section {
    background: rgba(var(--neutral-rgb), 0.025);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    animation: fadeIn 0.5s ease;
}

.result-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.result-header h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-badge {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    background: rgba(var(--neutral-rgb), 0.05);
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.corrections-badge {
    background: rgba(var(--accent-rgb), 0.06);
    color: rgba(var(--accent-rgb), 0.55);
}

/* --- Result Toolbar --- */

.result-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(var(--neutral-rgb), 0.015);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 34px;
    height: 18px;
    background: rgba(var(--neutral-rgb), 0.1);
    border-radius: 9px;
    transition: all 0.2s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toggle-label input:checked + .toggle-switch {
    background: var(--lime);
}

.toggle-label input:checked + .toggle-switch::after {
    left: 18px;
    background: var(--black);
}

.result-actions {
    display: flex;
    gap: 4px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(var(--neutral-rgb), 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    color: var(--text-primary);
    background: rgba(var(--neutral-rgb), 0.08);
    border-color: var(--border-hover);
}

.action-btn.copied {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.25);
    background: rgba(var(--accent-rgb), 0.06);
}

.action-btn svg {
    opacity: 0.6;
}

/* --- Result Text --- */

.result-text {
    padding: 24px;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-primary);
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.result-text .timestamp {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(var(--accent-rgb), 0.55);
    margin-right: 6px;
    user-select: none;
}

/* --- Dictionary Panel --- */

.dictionary-panel {
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeUp 0.5s ease 0.4s forwards;
}

.dictionary-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(var(--neutral-rgb), 0.025);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.88rem;
}

.dictionary-toggle:hover {
    background: rgba(var(--neutral-rgb), 0.04);
    border-color: var(--border-hover);
}

.dictionary-toggle-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dictionary-toggle-left svg {
    opacity: 0.4;
}

.dictionary-toggle-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dict-count {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 3px 8px;
    background: rgba(var(--accent-rgb), 0.06);
    color: rgba(var(--accent-rgb), 0.55);
    border-radius: var(--radius-xs);
}

.chevron {
    transition: transform 0.2s ease;
    opacity: 0.35;
}

.dictionary-toggle.open .chevron {
    transform: rotate(180deg);
}

.dictionary-toggle.open {
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom-color: transparent;
}

.dictionary-content {
    padding: 16px 18px 18px;
    background: rgba(var(--neutral-rgb), 0.015);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    animation: fadeIn 0.3s ease;
}

.dict-search-row {
    margin-bottom: 12px;
}

.dict-search-row input {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    background: rgba(var(--neutral-rgb), 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.dict-search-row input:focus {
    outline: none;
    border-color: var(--accent);
}

.dict-search-row input::placeholder {
    color: var(--text-tertiary);
}

.dict-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.dict-add-row input {
    flex: 1;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    background: rgba(var(--neutral-rgb), 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.dict-add-row input:focus {
    outline: none;
    border-color: var(--accent);
}

.dict-add-row input::placeholder {
    color: var(--text-tertiary);
}

.dict-add-btn {
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dict-add-btn:hover {
    background: rgba(var(--accent-rgb), 0.15);
    border-color: rgba(var(--accent-rgb), 0.35);
}

.dict-list {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dict-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-xs);
    background: rgba(var(--neutral-rgb), 0.02);
    transition: background 0.15s ease;
}

.dict-item:hover {
    background: rgba(var(--neutral-rgb), 0.05);
}

.dict-item-error {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    min-width: 140px;
    text-decoration: line-through;
    opacity: 0.65;
}

.dict-item-arrow {
    color: var(--text-tertiary);
    margin: 0 12px;
    font-size: 0.7rem;
}

.dict-item-correction {
    color: var(--text-primary);
    font-weight: 500;
}

/* --- Footer --- */

footer {
    text-align: center;
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

footer p {
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* --- Hidden --- */

.hidden {
    display: none !important;
}

/* --- Animations --- */

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

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* --- Selection --- */

::selection {
    background-color: rgba(var(--accent-rgb), 0.2);
    color: var(--text-primary);
}

/* --- Scrollbar --- */

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--neutral-rgb), 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--neutral-rgb), 0.18);
}

/* --- Responsive --- */

@media (max-width: 600px) {
    .container {
        padding: 28px 16px 24px;
    }

    header {
        margin-bottom: 32px;
    }

    header h1 {
        font-size: 2.4rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .options-row {
        flex-direction: column;
    }

    .option-group select {
        width: 100%;
    }

    .transcribe-btn {
        width: 100%;
    }

    .result-toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .result-actions {
        width: 100%;
    }

    .result-actions .action-btn {
        flex: 1;
        justify-content: center;
    }

    .dict-add-row {
        flex-direction: column;
    }

    .progress-steps {
        gap: 4px;
    }

    .step span {
        font-size: 0.52rem;
    }

    .platform-badge {
        font-size: 0.62rem;
    }
}
