:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    background: #0a0f1c;
    color: #e2e8f0;
    min-height: 100vh;
    line-height: 1.5;
}

.topbar { text-align: center; padding: 26px 16px 10px; }
.topbar h1 { margin: 0; font-size: 34px; letter-spacing: -0.5px; }
.topbar h1 span { color: #f5c518; }
.tagline { margin: 6px 0 0; color: #94a3b8; }

.search {
    display: flex; gap: 10px; flex-wrap: wrap;
    max-width: 900px; margin: 14px auto 0; padding: 0 16px;
}
.search input[type=text] {
    flex: 1; min-width: 220px; padding: 13px 16px; border-radius: 12px;
    border: 1px solid #334155; background: #0f172a; color: #e2e8f0; font-size: 15px; outline: none;
}
.search input[type=text]:focus { border-color: #f5c518; }
.search select {
    padding: 0 12px; border-radius: 12px; border: 1px solid #334155;
    background: #0f172a; color: #e2e8f0; font-size: 14px;
}
.search button {
    padding: 0 22px; border: none; border-radius: 12px; background: #f5c518;
    color: #1a1a1a; font-weight: 700; font-size: 15px; cursor: pointer;
}
.search button:disabled { opacity: .6; cursor: default; }

.error {
    max-width: 900px; margin: 14px auto 0; padding: 12px 16px; border-radius: 10px;
    background: #45161a; color: #fca5a5; border: 1px solid #7f1d1d; text-align: center;
}
.hint { text-align: center; color: #94a3b8; margin-top: 16px; }

#workspace { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
    padding: 10px 18px; border: 1px solid #1e293b; background: #0f172a;
    color: #cbd5e1; border-radius: 10px; cursor: pointer; font-size: 14px;
}
.tab.active { background: #1c2740; border-color: #f5c518; color: #fff; }

.tabpane { animation: fade .2s; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.player-wrap {
    position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 14px;
    overflow: hidden; background: #000; box-shadow: 0 10px 40px rgba(0,0,0,.45);
}
.player-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.overlay {
    position: absolute; left: 0; right: 0; bottom: 8%; text-align: center;
    pointer-events: none; padding: 0 6%;
}
.overlay .ru {
    display: inline-block; background: rgba(0,0,0,.6); color: #fff;
    padding: 3px 10px; border-radius: 6px; font-size: clamp(14px, 2.4vw, 22px); margin: 2px 0;
}
.overlay .uz {
    display: block; background: rgba(0,0,0,.6); color: #f5c518; font-weight: 600;
    padding: 3px 10px; border-radius: 6px; font-size: clamp(14px, 2.4vw, 22px);
    margin: 2px auto 0; width: fit-content; max-width: 100%;
}

.controls { display: flex; gap: 16px; margin: 12px 0; color: #cbd5e1; font-size: 14px; flex-wrap: wrap; }
.controls label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

.transcript {
    max-height: 45vh; overflow-y: auto; border: 1px solid #1e293b;
    border-radius: 12px; background: #0b1220;
}
.line { display: flex; gap: 12px; padding: 11px 14px; border-bottom: 1px solid #131c2e; cursor: pointer; }
.line:hover { background: #111c30; }
.line.active { background: #1c2740; border-left: 3px solid #f5c518; padding-left: 11px; }
.line .time { flex-shrink: 0; font-size: 12px; color: #64748b; min-width: 46px; padding-top: 2px; }
.line .ru { margin: 0; font-size: 14px; color: #cbd5e1; }
.line .uz { margin: 4px 0 0; font-size: 14px; color: #fcd34d; }
.line.active .ru { color: #fff; }

.field-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.field-row label { display: flex; gap: 8px; align-items: center; }
.field-row select, .field-row input[type=file] {
    padding: 8px; border-radius: 8px; border: 1px solid #334155; background: #0f172a; color: #e2e8f0;
}
.dl-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
    display: inline-block; padding: 11px 20px; background: #f5c518; color: #1a1a1a;
    border: none; border-radius: 10px; font-weight: 700; cursor: pointer;
    text-decoration: none; font-size: 14px;
}
.btn:disabled { opacity: .6; cursor: default; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0b1220; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 6px; }

@media (max-width: 640px) { .search { flex-direction: column; } }
