/* ==========================================================================
   Fonetik Tahlil — "Spektr" dizayn tizimi
   Tartib: tokenlar → asos → maket → komponentlar → sahifalar → moslashuv.
   Mavzu: <html data-theme="light|dark"> (base.html'dagi inline skript o'rnatadi).
   result.js / player.js o'qiydigan o'zgaruvchilar: --surface --text --border
   --muted --accent --accent-soft --wave --sans (nomlarini o'zgartirmang).
   ========================================================================== */

:root {
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #EEF1F5;
  --border: #E1E5EC;
  --border-strong: #CBD1DB;
  --text: #14171D;
  --text-2: #434B5C;
  --text-3: #5F687A;
  --accent: #2E4FD6;
  --accent-hover: #2440B8;
  --accent-soft: #E8ECFC;
  --on-accent: #FFFFFF;
  --signal: #B33A0B;
  --signal-fill: #EA580C;
  --signal-soft: #FDEDE3;
  --ok: #18794E;
  --ok-soft: #E3F4EA;
  --warn: #8A5300;
  --warn-soft: #FFF1D6;
  --err: #B42318;
  --err-soft: #FDECEA;
  --wave: #9AA3B2;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 1px 2px rgba(16, 24, 40, .04), 0 16px 40px -16px rgba(16, 24, 40, .18);
  --radius-sm: 7px;
  --radius: 8px;
  --radius-lg: 12px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --maxw: 1280px;
  --gutter: clamp(16px, 4vw, 32px);
  /* eski nomlar (JS shu nomlarni o'qiydi) */
  --muted: var(--text-3);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0D0F13;
  --surface: #14171D;
  --surface-2: #1B1F27;
  --border: #262B35;
  --border-strong: #363C48;
  --text: #E9EBEF;
  --text-2: #BCC2CD;
  --text-3: #959CAA;
  --accent: #8EA2FF;
  --accent-hover: #AEBBFF;
  --accent-soft: #1E2542;
  --on-accent: #0D0F13;
  --signal: #FF9F66;
  --signal-fill: #F47B3B;
  --signal-soft: #3A2216;
  --ok: #5FD39A;
  --ok-soft: #132A1F;
  --warn: #F2B860;
  --warn-soft: #2E2414;
  --err: #FF8A80;
  --err-soft: #331816;
  --wave: #5B6475;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .65);
  color-scheme: dark;
}

/* ---------- Asos ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { margin: 0; color: var(--text); }
h1 { font-size: clamp(26px, 3vw, 32px); line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 16px; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
b, strong { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--text); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.muted { color: var(--text-3); }
.small-hint { font-size: 13px; color: var(--text-3); }
.center { text-align: center; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-3);
}

/* ---------- Yuqori panel ---------- */
.topnav {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); min-height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap;
}
.topnav-left { display: flex; align-items: center; gap: 4px 28px; flex-wrap: wrap; min-width: 0; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--text); font-weight: 600; font-size: 17px; letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand-mark { flex: none; display: block; }
.brand-mark .bm-bars { stroke: var(--text); }
.brand-mark .bm-hot { stroke: var(--signal-fill); }
.nav-links { display: flex; align-items: center; gap: 4px 22px; flex-wrap: wrap; }
.nav-link { display: inline-block; padding: 18px 2px; color: var(--text-2); font-weight: 500; font-size: 15px; }
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }
.nav-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-user {
  font-size: 14px; color: var(--text-3); padding-right: 6px;
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-public { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; }
.inline-form { display: inline; margin: 0; }
.theme-toggle { width: 40px; padding: 0; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Maket ---------- */
.page {
  flex: 1 0 auto; width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: 32px var(--gutter) 72px;
}
.page.page-full { max-width: none; padding: 0; }
.container { width: 100%; }
.container.narrow { max-width: 880px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-sub { color: var(--text-2); }
.breadcrumb { display: flex; gap: 8px; font-size: 14px; color: var(--text-3); margin-bottom: 10px; }

.footer { border-top: 1px solid var(--border); }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 20px var(--gutter);
  display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between;
  font-size: 13px; color: var(--text-3);
}
.footer-links { display: flex; gap: 16px; }

/* ---------- Tugmalar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius);
  font-family: inherit; font-size: 15px; font-weight: 500; line-height: 1; white-space: nowrap;
  border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-invert { background: var(--bg); color: var(--text); }
.btn-invert:hover { color: var(--text); opacity: .92; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn svg { flex: none; }
.copy-btn.is-copied { color: var(--ok); }

/* ---------- Kartochka, chip, nishon ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.card-pad { padding: clamp(20px, 3vw, 24px); display: flex; flex-direction: column; gap: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head-text { display: flex; flex-direction: column; gap: 4px; }
.card-sub { font-size: 14px; color: var(--text-3); }

.chip, .badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap; vertical-align: middle;
}
.chip-ok, .chip-success, .badge-done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip-err, .badge-error { background: var(--err-soft); color: var(--err); border-color: transparent; }
.chip-warn, .badge-awaiting_confirmation { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip-accent, .badge-transcribing, .badge-analyzing { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip-signal { background: var(--signal-soft); color: var(--signal); border-color: transparent; }
.chip-muted { background: transparent; color: var(--text-3); }
.badge-queued, .badge-analyzing_queued { background: var(--surface-2); color: var(--text-2); }

/* ---------- Formalar ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 14px; font-weight: 500; color: var(--text); }
.input, .field input[type="email"], .field input[type="password"], .field input[type="text"] {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 15px;
}
.input:focus, .field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: .8; }
.field-error { font-size: 13px; color: var(--err); }
.field-hint { font-size: 13px; color: var(--text-3); }
.textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 15px; line-height: 1.6; resize: vertical; min-height: 110px;
}
.textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
select, .select {
  min-height: 36px; padding: 0 30px 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background-color: var(--surface); color: var(--text); font-size: 14px;
}
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--accent); }

.alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap;
}
.alert-error { background: var(--err-soft); color: var(--err); }
.alert-warning { background: var(--warn-soft); color: var(--warn); }
.alert-info { background: var(--surface-2); color: var(--text-2); }
.card.alert { border: 0; }

/* ---------- Jadval ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
  padding: 10px 12px; background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 500; border-bottom: 1px solid var(--border);
}
.table td { padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg); }
.mono-table td { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- Spinner, progress ---------- */
@keyframes ft-spin { to { transform: rotate(360deg); } }
@keyframes ft-pulse { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes ft-fade { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.lex-spinner, .spinner {
  display: inline-block; flex: none; width: 16px; height: 16px; border-radius: 999px;
  border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: ft-spin .8s linear infinite;
}
.progress-bar-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .4s ease; }

/* ==========================================================================
   Bosh sahifa (landing)
   ========================================================================== */
.lp-wrap { max-width: 1200px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.lp-hero { padding-top: 72px; padding-bottom: 64px; display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.lp-hero-text { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.lp-hero h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.025em; }
.lp-lead { font-size: 18px; line-height: 1.6; color: var(--text-2); max-width: 540px; }
.lp-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.lp-note { font-size: 13px; color: var(--text-3); }
.lp-band { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lp-section { padding-top: 80px; padding-bottom: 80px; }
.lp-section-head { display: flex; flex-direction: column; gap: 12px; max-width: 640px; margin-bottom: 40px; }
.lp-section-head h2 { font-size: clamp(28px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -0.02em; }
.lp-section-head p { font-size: 17px; color: var(--text-2); }

.inspector {
  flex: 1 1 520px; min-width: 0; margin: 0; padding: 20px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg);
}
.inspector-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inspector-word { display: flex; align-items: baseline; gap: 12px; }
.inspector-word .mono { font-size: 22px; font-weight: 500; }
.inspector-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.inspector-sylls, .inspector-tier { display: flex; gap: 2px; font-family: var(--mono); font-size: 12px; }
.inspector-sylls > div { padding: 5px 8px; background: var(--surface-2); color: var(--text-2); }
.inspector-sylls > div:first-child { border-radius: 6px 0 0 6px; }
.inspector-sylls > div:last-child { border-radius: 0 6px 6px 0; background: var(--signal-soft); color: var(--signal); font-weight: 600; }
.inspector-tier > div { padding: 5px 0; text-align: center; border: 1px solid var(--border); border-radius: 4px; color: var(--text-2); }
.inspector-tier > div.hot { background: var(--signal-fill); border-color: transparent; color: #FFFFFF; font-weight: 600; }
.inspector-wave { border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.inspector svg { display: block; }
.inspector-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.inspector-metrics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.metric { display: flex; flex-direction: column; gap: 2px; }
.metric-label { font-size: 12px; color: var(--text-3); }
.metric-value { font-family: var(--mono); font-size: 18px; font-weight: 500; }
.metric-value small { font-size: 12px; color: var(--text-3); }
.inspector figcaption, .lp-figure figcaption { font-size: 13px; color: var(--text-3); }

.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }
.lp-steps li { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 2px solid var(--text); }
.lp-steps li.is-signal { border-top-color: var(--signal-fill); }
.lp-steps .step-n { font-family: var(--mono); font-size: 13px; color: var(--text-3); }
.lp-steps li.is-signal .step-n { color: var(--signal); }
.lp-steps h3 { font-size: 20px; }
.lp-steps p { color: var(--text-2); }

.lp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.feature { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.feature h3 { font-size: 18px; }
.feature p { color: var(--text-2); }
.feature-tags { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.feature-icon { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature-icon.is-signal { stroke: var(--signal-fill); }

.lp-showcase { display: flex; flex-wrap: wrap; gap: 16px; }
.lp-figure { flex: 1 1 460px; min-width: 0; margin: 0; padding: 20px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.lp-figure-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.lp-figure-head h3 { font-size: 16px; }
.lp-cta {
  background: var(--text); color: var(--bg); border-radius: 16px; padding: clamp(32px, 5vw, 56px);
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.lp-cta h2 { color: var(--bg); font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -0.02em; }
.lp-cta p { font-size: 17px; opacity: .8; margin-top: 10px; }
.vs-axis { font: 400 11px var(--mono); fill: var(--text-3); }
.vs-axis-title { font: 500 11px var(--mono); fill: var(--text-2); }
.vs-label { font: 600 15px var(--mono); fill: var(--text); }
.vs-grid { stroke: var(--border); stroke-dasharray: 2 4; }
.vs-frame { stroke: var(--border-strong); }

/* ==========================================================================
   Kirish / ro'yxat / kutish
   ========================================================================== */
.auth-wrap {
  max-width: 1120px; margin: 0 auto; padding: clamp(8px, 5vw, 56px) 0;
  display: flex; flex-wrap: wrap; gap: clamp(32px, 6vw, 80px); align-items: center;
}
.auth-intro { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.auth-intro h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; }
.auth-lead { font-size: 17px; color: var(--text-2); max-width: 460px; }
.auth-card { flex: 0 1 440px; min-width: 0; padding: clamp(24px, 4vw, 36px); display: flex; flex-direction: column; gap: 20px; box-shadow: var(--shadow-lg); }
.auth-card-head { display: flex; flex-direction: column; gap: 6px; }
.auth-card-head h2 { font-size: 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-foot { font-size: 14px; color: var(--text-3); text-align: center; }
.auth-figure { margin: 8px 0 0; max-width: 420px; display: flex; flex-direction: column; gap: 8px; }
.auth-figure figcaption { font-size: 13px; color: var(--text-3); }
.num-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; max-width: 440px; }
.num-steps li { display: flex; gap: 14px; align-items: flex-start; }
.num-steps .n {
  flex: none; width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text-2);
}
.num-steps li.is-first .n { background: var(--text); color: var(--bg); border-color: var(--text); }
.num-steps .t { display: flex; flex-direction: column; gap: 2px; }
.num-steps .t span { font-size: 14px; color: var(--text-2); }

.pending-card { max-width: 520px; margin: clamp(16px, 6vw, 72px) auto; padding: clamp(28px, 5vw, 44px); display: flex; flex-direction: column; gap: 24px; }
.pending-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); display: flex; align-items: center; justify-content: center; }
.timeline { list-style: none; margin: 0; padding: 16px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.timeline li { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.timeline .dot { flex: none; width: 22px; height: 22px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--border-strong); }
.timeline li.is-done .dot { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.timeline li.is-current .dot { border-color: var(--accent); }
.timeline li.is-current .dot::after { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); }
.timeline li.is-todo { color: var(--text-3); font-weight: 400; }
.timeline .note { font-size: 13px; color: var(--text-3); font-weight: 400; }

/* ==========================================================================
   Yangi tahlil
   ========================================================================== */
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stepper li { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 3px solid var(--border-strong); color: var(--text-3); }
.stepper li.is-done { border-top-color: var(--text); color: var(--text); }
.stepper li.is-current { border-top-color: var(--accent); color: var(--text); }
.stepper .step-num { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.stepper .step-label { font-size: 14px; font-weight: 500; }

.tabs { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.tab-btn {
  min-height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 0; background: transparent;
  color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .14); }

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 36px 20px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--bg); text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--accent); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone-icon { width: 48px; height: 48px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.dropzone-title { font-weight: 500; overflow-wrap: anywhere; }
.dropzone-hint { font-size: 13px; color: var(--text-3); }

.recorder { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 20px; border-radius: var(--radius-lg); background: var(--bg); }
.record-stage { position: relative; display: flex; }
.record-btn {
  position: relative; width: 76px; height: 76px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--signal-fill); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 8px var(--signal-soft);
}
.record-btn-active { background: var(--err); }
.record-btn-ring { position: absolute; inset: -8px; border-radius: 999px; border: 2px solid var(--signal-fill); animation: ft-pulse 1.4s ease-out infinite; pointer-events: none; }
.record-timer { font-family: var(--mono); font-size: 22px; font-weight: 500; }
.record-hint { font-size: 13px; color: var(--text-3); text-align: center; max-width: 380px; }

.ab-preview-loading { display: flex; gap: 10px; align-items: center; color: var(--text-2); font-size: 14px; }
.ab-variants { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.ab-variant-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; background: var(--surface);
  display: flex; flex-direction: column; gap: 12px; cursor: pointer; min-width: 0;
}
.ab-variant-card:hover { border-color: var(--border-strong); }
.ab-variant-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ab-variant-head { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.ab-variant-check {
  flex: none; width: 18px; height: 18px; border-radius: 999px; border: 2px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center;
}
.ab-variant-card.is-selected .ab-variant-check { border-color: var(--accent); }
.ab-variant-card.is-selected .ab-variant-check::after { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); }
.ab-variant-title { font-weight: 600; }
.ab-variant-tag { margin-left: auto; }
.ab-variant-spectro-wrap { border-radius: 6px; overflow: hidden; background: var(--bg); }
.ab-variant-spectro-wrap img { display: block; width: 100%; height: 96px; object-fit: cover; }
.ab-variant-spectro-wrap img:not([src]) { visibility: hidden; }

.manual-transcript-card { padding: 4px clamp(20px, 3vw, 24px); }
.manual-transcript-toggle {
  width: 100%; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0; border: 0;
  background: transparent; color: var(--text); font-size: 16px; font-weight: 600; text-align: left; cursor: pointer;
}
.manual-transcript-chevron { flex: none; transition: transform .15s; }
.manual-transcript-toggle[aria-expanded="true"] .manual-transcript-chevron { transform: rotate(90deg); }
.manual-transcript-optional { font-weight: 400; font-size: 14px; color: var(--text-3); }
.manual-transcript-card.is-required .manual-transcript-optional { color: var(--signal); }
.manual-transcript-body { display: flex; flex-direction: column; gap: 8px; padding-bottom: 20px; }
.manual-transcript-body.is-collapsed { display: none; }
.manual-transcript-hint { font-size: 14px; color: var(--text-2); }

.field-submit { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.field-submit .btn-primary { min-width: 220px; }

.progress-card { gap: 20px; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.progress-stage-label { font-weight: 500; }
.progress-percent { font-family: var(--mono); font-size: 22px; font-weight: 500; }
.progress-message { font-size: 14px; color: var(--text-3); min-height: 1.5em; }
.stage-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.stage-col { display: flex; flex-direction: column; gap: 10px; }
.stage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.stage-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-3); }
.stage-list li::before {
  content: ""; flex: none; width: 10px; height: 10px; margin: 0 3px; border-radius: 999px;
  border: 1.5px solid var(--border-strong); box-sizing: border-box;
}
.stage-list li.is-done { color: var(--text); }
.stage-list li.is-done::before {
  width: 16px; height: 16px; margin: 0; border: 0;
  background: var(--ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.5 12.5 9.5 17.5 19.5 7' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.5 12.5 9.5 17.5 19.5 7' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.stage-list li.is-current { color: var(--text); font-weight: 600; }
.stage-list li.is-current::before {
  width: 14px; height: 14px; margin: 0 1px; border: 2px solid var(--accent-soft); border-top-color: var(--accent);
  animation: ft-spin .8s linear infinite;
}
.stage-list li.is-skip::before { height: 2px; border: 0; border-radius: 1px; background: var(--border-strong); }
.stage-list .note { font-size: 12px; color: var(--text-3); font-weight: 400; }
.progress-note { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); font-size: 14px; color: var(--text-2); }

.transcript-confirm-card { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.confirm-audio { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.confirm-audio audio { width: 100%; height: 36px; }
.confirm-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.confirm-actions .btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Audio pleer (player.js) ---------- */
.uzplayer { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.uzplayer-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.uzplayer-play-btn {
  flex: none; width: 40px; height: 40px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center;
}
.uzplayer-play-btn:hover { background: var(--accent-hover); }
.uzplayer-wave-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.uzplayer-wave { width: 100%; }
.uzplayer-skel { display: none; position: absolute; left: 0; right: 0; top: 35%; bottom: 35%; border-radius: 6px; background: var(--surface-2); animation: ft-fade 1.2s ease-in-out infinite; }
.uzplayer.is-loading .uzplayer-skel { display: block; }
.uzplayer-time { flex: none; font-size: 12px; color: var(--text-3); }
.uzplayer-spectrogram { border-radius: 6px; overflow: hidden; }
.uzplayer-native-audio { width: 100%; }

/* ==========================================================================
   Natija
   ========================================================================== */
.result-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.result-head-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.result-head h1 { font-size: clamp(22px, 3vw, 30px); overflow-wrap: anywhere; }
.result-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.result-meta .date { font-size: 13px; color: var(--text-3); }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.is-busy { opacity: .75; cursor: progress; }

.player-card { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.player-transcript { font-size: 15px; line-height: 1.7; color: var(--text-2); }
.player-transcript-label { font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-right: 6px; }

.result-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.side-nav { position: sticky; top: 76px; }
.side-nav-inner { display: flex; flex-direction: column; gap: 2px; }
.side-nav-title { padding: 0 12px 8px; }
.side-nav-link {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 36px;
  padding: 8px 12px; border-radius: var(--radius); color: var(--text-2); font-size: 14px; font-weight: 500;
}
.side-nav-link:hover { background: var(--surface-2); color: var(--text); }
.side-nav-link.active { background: var(--surface); color: var(--text); box-shadow: inset 2px 0 0 var(--accent), var(--shadow-sm); }
.side-nav-count { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.result-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.result-section { padding: clamp(20px, 3vw, 28px); display: flex; flex-direction: column; gap: 20px; scroll-margin-top: 76px; }
.result-section > h2, .section-head-row h2 { font-size: 22px; }
.section-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-hint { font-size: 14px; color: var(--text-3); }
.subsection-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.subcard { border: 1px solid var(--border); border-radius: 10px; padding: 18px; background: var(--bg); display: flex; flex-direction: column; gap: 14px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--bg); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-label { font-size: 13px; color: var(--text-3); }
.tile-value { font-family: var(--mono); font-size: 22px; font-weight: 500; overflow-wrap: anywhere; }
.tile-value.is-small { font-size: 15px; padding-top: 4px; }
.tile-value small { font-size: 14px; color: var(--text-3); }
.tile-value .ok { color: var(--ok); }

.stress-mark-demo, .stress {
  padding: 0 2px; border-radius: 4px; background: var(--signal-soft); color: var(--signal);
  font-weight: 600; box-shadow: inset 0 -2px 0 var(--signal-fill);
}
.word-list { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; min-height: 36px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  font-family: var(--mono); font-size: 14px; color: var(--text); cursor: pointer;
}
.word-chip:hover { border-color: var(--border-strong); background: var(--bg); }
.word-chip-text { white-space: nowrap; }
.stress-badge { font-family: var(--sans); font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.badge-match { background: var(--ok-soft); color: var(--ok); }
.badge-mismatch { background: var(--err-soft); color: var(--err); }

.sliders { display: flex; flex-direction: column; gap: 12px; }
.slider-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 52px; gap: 12px; align-items: center; }
.slider-row label { font-size: 14px; font-weight: 500; }
.slider-row input[type="range"] { width: 100%; margin: 0; }
.slider-row .mono { text-align: right; }
.stress-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.stress-actions .btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.slider-sum-row { font-size: 13px; color: var(--text-3); }
.restress-status { font-size: 13px; color: var(--ok); }

.plots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.plots-grid.is-collapsed { overflow: hidden; }
.plot-thumb {
  display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); cursor: zoom-in; min-width: 0;
}
.plot-thumb:hover { border-color: var(--border-strong); }
.plot-thumb img { display: block; width: 100%; height: 120px; object-fit: contain; border-radius: 6px; background: #FFFFFF; }
.plot-thumb-label { font-family: var(--mono); font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plots-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.vspace-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.vspace-controls > label:not(.checkbox-row) { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.checkbox-row { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; color: var(--text); }
.checkbox-row input { width: 16px; height: 16px; margin: 0; }
.plot-frame { border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: var(--surface); }
.plotly-plot { width: 100%; min-height: 440px; }
.plotly-plot-sm { min-height: 300px; }
.table-actions-row { display: flex; justify-content: flex-end; }
.row-stressed td { background: var(--signal-soft); }
.table tbody tr.row-stressed:hover td { background: var(--signal-soft); }

.consonant-manner-legend { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.legend-title { font-size: 13px; font-weight: 500; color: var(--text-2); }
.legend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.legend-list li { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); font-family: var(--mono); }
.legend-list .chip { font-family: var(--sans); font-weight: 600; color: var(--text); background: transparent; border: 0; padding: 0; height: auto; }
.legend-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; flex: none; }

.validation-word { font-family: var(--mono); font-size: 14px; }
.accented-vowel { color: var(--signal); font-weight: 600; }
.status-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.status-match { background: var(--ok-soft); color: var(--ok); }
.status-mismatch { background: var(--err-soft); color: var(--err); }

.grafiklar-collapse { display: flex; flex-direction: column; gap: 16px; }
.grafiklar-collapse.is-collapsed { max-height: 0; overflow: hidden; visibility: hidden; margin-top: -20px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.chart-card { margin: 0; border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; background: var(--surface); }
.chart-caption { font-size: 13px; color: var(--text-3); }

.pending-block { padding: 24px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }

/* ---------- Modal (so'z grafigi) ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 10, 14, .72); }
.modal-content {
  position: relative; width: min(1200px, 100%); max-height: calc(100vh - 32px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.modal-close {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 999px; border: 0;
  background: var(--surface-2); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer;
}
.modal-zoom-controls { display: flex; align-items: center; gap: 6px; padding-right: 48px; }
.modal-zoom-level { min-width: 52px; text-align: center; font-size: 13px; color: var(--text-2); }
.modal-scroll { overflow: auto; max-height: calc(100vh - 160px); border-radius: var(--radius); background: #FFFFFF; }
/* Fit-to-viewer at 100%: the whole plot is always visible without scrolling (letterboxed if
   its aspect differs); zooming lifts the cap and the container becomes pannable. */
.modal-scroll img { display: block; width: 100%; height: auto; max-height: calc(100vh - 160px); object-fit: contain; cursor: zoom-in; }
.modal-scroll.is-zoomed img { max-width: none; max-height: none; }
.modal-caption { font-size: 13px; color: var(--text-3); }

/* ==========================================================================
   Tarix
   ========================================================================== */
.filter-tabs { margin-bottom: 16px; }
.history-table td { font-size: 14px; padding: 12px 16px; }
.history-table th { padding: 12px 16px; }
.history-table .file { font-weight: 500; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.history-table .id { color: var(--text-3); font-family: var(--mono); }
.history-table .date { color: var(--text-3); }
.history-table .act { text-align: right; }
.minibar { display: inline-block; width: 64px; height: 6px; margin-left: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; vertical-align: middle; }
.minibar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.table-card { overflow: hidden; }
.table-card .table-scroll { border: 0; border-radius: 0; }
.empty-state { padding: clamp(32px, 6vw, 64px) 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; }
.empty-state p { color: var(--text-2); max-width: 420px; }

/* ==========================================================================
   Lug'at
   ========================================================================== */
.lexicon-page { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.lexicon-hero { display: flex; flex-direction: column; gap: 10px; }
.lexicon-hero h1 { font-size: clamp(28px, 3.6vw, 36px); }
.lexicon-subtitle { color: var(--text-2); max-width: 680px; }
.lexicon-search-wrap { position: relative; margin-top: 12px; }
.lexicon-search-icon { position: absolute; left: 16px; top: 16px; color: var(--text-3); pointer-events: none; }
.lexicon-search-input {
  width: 100%; min-height: 52px; padding: 0 16px 0 46px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 16px;
}
.lexicon-search-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.lexicon-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.lexicon-count-hint { font-size: 14px; color: var(--text-3); }
.lexicon-results-wrap { display: flex; flex-direction: column; gap: 16px; }
.lexicon-status { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; text-align: center; color: var(--text-2); }
#lexicon-loading { flex-direction: row; justify-content: center; padding: 16px; }
.lexicon-empty-icon { font-size: 22px; color: var(--text-3); }
.lexicon-list-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.lexicon-table td { font-size: 14px; padding: 11px 16px; }
.lexicon-table th { padding: 12px 16px; }
.lex-word-cell { font-family: var(--mono); font-weight: 500; }
.lexicon-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lexicon-page-info { font-family: var(--mono); font-size: 13px; color: var(--text-3); }

/* ==========================================================================
   Moslashuv
   ========================================================================== */
@media (max-width: 960px) {
  /* Kirish/ro'yxat: forma birinchi chiqsin (autofocus sahifani pastga sakratmasin). */
  .auth-card { order: -1; flex: 1 1 100%; max-width: 520px; margin: 0 auto; }
  .auth-intro { flex-basis: 100%; }
  .auth-figure { display: none; }
  .result-layout { grid-template-columns: minmax(0, 1fr); }
  .side-nav { position: sticky; top: 60px; z-index: 5; margin: 0 calc(var(--gutter) * -1); padding: 8px var(--gutter); background: var(--bg); border-bottom: 1px solid var(--border); }
  .side-nav-title { display: none; }
  .side-nav-inner { flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .side-nav-inner::-webkit-scrollbar { display: none; }
  .side-nav-link { flex: none; white-space: nowrap; border: 1px solid var(--border); background: var(--surface); }
  .side-nav-link.active { box-shadow: none; border-color: var(--accent); }
  html { scroll-padding-top: 130px; }
  .result-section { scroll-margin-top: 130px; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .topnav { position: static; }
  .topnav-left { display: contents; }
  .brand { order: 1; }
  .nav-right { order: 2; }
  .nav-links { order: 3; flex-basis: 100%; }
  .nav-link { padding: 10px 2px; }
  .nav-user, .nav-admin { display: none; }
  .page { padding-top: 24px; }
  .slider-row { grid-template-columns: minmax(0, 1fr) 52px; }
  .slider-row label { grid-column: 1 / -1; }
  .slider-row input[type="range"] { grid-column: 1; }
  .stepper .step-label { font-size: 13px; }
  .inspector-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .metric-value { font-size: 16px; }
  .side-nav { top: 0; }
  .plotly-plot { min-height: 340px; }
  .field-submit .btn-primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
