/* ═════════ Govori — dizayn tizimi ═════════ */
:root {
  --blue: #1D3B8F;
  --blue-2: #2A4FB8;
  --sky: #60A5FA;
  --red: #EF4444;
  --green: #22C55E;
  --amber: #F59E0B;

  --bg: #F6F8FC;
  --surface: #FFFFFF;
  --surface-2: #EEF2F9;
  --text: #0F172A;
  --muted: #64748B;
  --line: #E2E8F0;
  --ok-bg: #DCFCE7;
  --ok-tx: #166534;
  --bad-bg: #FEE2E2;
  --bad-tx: #991B1B;
  --primary: var(--blue);
  --primary-tx: #fff;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 24px rgba(15, 23, 42, .06);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0B1220;
  --surface: #121B2E;
  --surface-2: #1A2540;
  --text: #E6ECF7;
  --muted: #93A3BE;
  --line: #24314F;
  --ok-bg: #0F3A24;
  --ok-tx: #86EFAC;
  --bad-bg: #431818;
  --bad-tx: #FCA5A5;
  --primary: #3B6BE0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
body.marketing, body.focus { padding-bottom: 0; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-weight: 800; }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
a { color: var(--primary); }
[data-theme="dark"] a { color: var(--sky); }
button { font-family: inherit; color: inherit; }
kbd { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; gap: .5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row-center { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
main, main:focus, main:focus-visible { outline: none; }

/* ── Tugmalar ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 2px solid transparent; border-radius: 14px;
  padding: .6rem 1.1rem; font-size: 1rem; font-weight: 800;
  text-decoration: none; cursor: pointer; transition: transform .08s, background .15s, box-shadow .15s;
  background: var(--surface-2); color: var(--text) !important; white-space: nowrap;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-lg { padding: .85rem 1.5rem; font-size: 1.05rem; }
.btn-primary { background: var(--primary); color: #fff !important; box-shadow: 0 4px 0 #142a66; }
.btn-primary:active { box-shadow: 0 1px 0 #142a66; }
.btn-primary:disabled { box-shadow: none; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-light { background: #fff; color: var(--blue) !important; }
.btn-ok { background: var(--green); color: #fff !important; box-shadow: 0 4px 0 #15803d; }
.btn-bad { background: var(--red); color: #fff !important; box-shadow: 0 4px 0 #b91c1c; }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red) !important; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 0; background: transparent; cursor: pointer; font-size: 1.15rem; text-decoration: none; flex: none;
}
.icon-btn:hover { background: var(--surface-2); }

/* ── Yuqori panel ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem max(1rem, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text) !important; font-weight: 900; font-size: 1.35rem; letter-spacing: -.5px; }
[data-theme="dark"] .brand { color: #fff !important; }
.logo-mark { width: 34px; height: 34px; }
.top-actions { margin-left: auto; display: flex; gap: .5rem; }
.top-nav { display: none; gap: .25rem; margin-left: 1rem; }
.top-nav .nav-item { flex-direction: row; padding: .45rem .8rem; border-radius: 12px; font-size: .95rem; }
.top-stats { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.stat { display: inline-flex; align-items: center; gap: .25rem; padding: .3rem .6rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .95rem; }

.nav-item { display: flex; flex-direction: column; align-items: center; gap: .1rem; text-decoration: none; color: var(--muted) !important; font-weight: 700; font-size: .72rem; padding: .35rem .25rem; flex: 1; }
.nav-item.active { color: var(--primary) !important; }
[data-theme="dark"] .nav-item.active { color: var(--sky) !important; }
.top-nav .nav-item.active { background: var(--surface-2); }
.nav-ic { position: relative; font-size: 1.3rem; line-height: 1; }
.top-nav .nav-ic { font-size: 1.05rem; }
.dot { position: absolute; top: -6px; right: -12px; background: var(--red); color: #fff; font-size: .62rem; font-weight: 800; border-radius: 999px; padding: 1px 5px; min-width: 18px; text-align: center; }
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding: .25rem .25rem calc(.25rem + env(safe-area-inset-bottom));
}
.bottomnav:empty { display: none; }
body.focus .topbar, body.focus .bottomnav { display: none; }

@media (min-width: 900px) {
  .top-nav { display: flex; }
  .bottomnav { display: none; }
  body { padding-bottom: 0; }
}
@media (max-width: 520px) { .hide-sm { display: none; } }

/* ── Kartalar va sahifa ── */
main { max-width: 1080px; margin: 0 auto; padding: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem; box-shadow: var(--shadow); }
.page { max-width: 860px; margin: 0 auto; display: grid; gap: 1rem; }
.page.narrow, .narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.page-title { margin: .5rem 0 0; }
.grid2 { display: grid; gap: 1rem; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.center-card { text-align: center; max-width: 560px; margin: 1.5rem auto; padding: 2rem 1.25rem; }
.big-emoji { font-size: 3.5rem; line-height: 1; margin-bottom: .75rem; }
.note { background: var(--surface-2); border-radius: var(--radius-sm); padding: .75rem 1rem; }
.note.ok { background: var(--ok-bg); color: var(--ok-tx); }
.inp {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--text);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: .7rem .9rem; outline: none; transition: border-color .15s;
}
.inp:focus { border-color: var(--sky); }
.inp.is-ok { border-color: var(--green); background: var(--ok-bg); }
.inp.is-bad { border-color: var(--red); background: var(--bad-bg); }
.search { margin-bottom: .25rem; }

.progress { flex: 1; height: 14px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--sky), var(--blue-2)); border-radius: 999px; transition: width .4s ease; }

/* ── Landing ── */
.hero { display: grid; gap: 2rem; align-items: center; padding: 1.5rem 0 2.5rem; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.15fr 1fr; padding: 3rem 0 4rem; } }
.pill { display: inline-block; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; font-weight: 700; font-size: .9rem; margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.3rem); font-weight: 900; letter-spacing: -1px; margin-bottom: 1rem; }
.hl { color: var(--red); position: relative; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0 .75rem; }
.hero-art { position: relative; padding: 1rem; }
.demo { max-width: 400px; margin: 0 auto; transform: rotate(-2deg); }
.demo-top { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.demo-x { color: var(--muted); font-weight: 800; }
.demo .opt { pointer-events: none; }
.demo-fb { margin-top: 1rem; background: var(--ok-bg); color: var(--ok-tx); border-radius: var(--radius-sm); padding: .7rem 1rem; font-weight: 800; }
.float-chip { position: absolute; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 999px; padding: .45rem .9rem; font-weight: 800; animation: bob 4s ease-in-out infinite; }
.float-chip.c1 { top: 0; right: 8%; }
.float-chip.c2 { bottom: 0; left: 4%; animation-delay: -2s; color: var(--blue); }
[data-theme="dark"] .float-chip.c2 { color: var(--sky); }
@keyframes bob { 50% { transform: translateY(-8px); } }

.section { padding: 2rem 0; }
.sec-title { text-align: center; font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: .5rem; }
.ladder { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; align-items: end; margin-top: 1.5rem; }
.step-lvl { text-align: center; }
.step-bar { height: var(--h); background: var(--surface-2); border-radius: 12px 12px 4px 4px; display: grid; place-items: center; color: var(--muted); font-size: 1.1rem; }
.step-lvl.open .step-bar { background: linear-gradient(180deg, var(--sky), var(--blue)); color: #fff; }
.step-name { font-weight: 800; font-size: .8rem; margin-top: .4rem; }
.step-status { font-size: .72rem; color: var(--muted); }
@media (max-width: 520px) { .step-name { font-size: .65rem; } .step-status { font-size: .6rem; } }
.feats { display: grid; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 640px) { .feats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .feats { grid-template-columns: repeat(3, 1fr); } }
.feat-ic { font-size: 2rem; margin-bottom: .5rem; }
.feat p { margin: 0; }
.how { display: grid; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 760px) { .how { grid-template-columns: repeat(3, 1fr); } }
.how-n { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 900; margin-bottom: .6rem; }
.act-chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1.25rem; }
.act-chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; font-weight: 700; }
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin-top: .6rem; }
.faq summary { font-weight: 800; cursor: pointer; }
.faq p { margin: .6rem 0 0; color: var(--muted); }
.cta-band { text-align: center; background: linear-gradient(135deg, var(--blue), #2C5BD3); color: #fff; border-radius: var(--radius); padding: 2.5rem 1rem; margin: 2rem 0; }
.cta-band h2 { font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: 1.2rem; }
.footer { display: flex; align-items: center; justify-content: center; gap: .6rem; color: var(--muted); font-size: .9rem; padding: 1rem 0 2rem; }
.footer .logo-mark { width: 22px; height: 22px; }

/* ── Onboarding ── */
.onb { max-width: 560px; margin: 1.5rem auto; padding: 1.5rem; display: grid; gap: 1rem; }
.onb-steps { display: flex; gap: .4rem; }
.onb-steps span { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); }
.onb-steps span.on { background: var(--primary); }
.onb-actions { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; }
.field { display: grid; gap: .35rem; font-weight: 700; }
.field-label { font-weight: 700; margin: .5rem 0 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.choice-list { display: grid; gap: .6rem; }
.choice {
  border: 2px solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  padding: .8rem 1rem; font-weight: 700; font-size: 1rem; cursor: pointer; text-align: left; transition: border-color .15s, background .15s;
}
.choice:hover { border-color: var(--sky); }
.choice.sel { border-color: var(--primary); background: color-mix(in srgb, var(--sky) 14%, var(--surface)); }
.choice.row { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; }
.choice.big { display: flex; gap: 1rem; align-items: center; padding: 1rem; }
.ch-ic { font-size: 2rem; }

/* ── Dashboard ── */
.dash { display: grid; gap: 1rem; max-width: 900px; margin: 0 auto; }
.hello { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: linear-gradient(135deg, var(--blue), #2C5BD3); color: #fff; border: 0; }
.hello .muted { color: #C7D6F5; }
.hello h1 { margin-bottom: .25rem; }
.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring-bg { stroke: rgba(255, 255, 255, .2); }
.ring-fg { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.ring-txt b { font-size: 1.3rem; }
.ring-txt span { font-size: .7rem; opacity: .85; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .5rem; text-align: center; display: grid; gap: .05rem; }
.tile-ic { font-size: 1.3rem; }
.tile b { font-size: 1.25rem; }
.tile span:last-child { font-size: .75rem; color: var(--muted); }
.continue { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; border: 2px solid var(--sky); }
.continue .btn { grid-column: 1 / -1; }
@media (min-width: 640px) { .continue { grid-template-columns: auto 1fr auto; } .continue .btn { grid-column: auto; } }
.cont-ic { font-size: 2.6rem; width: 64px; height: 64px; display: grid; place-items: center; background: var(--surface-2); border-radius: 18px; }
.cont-txt h2 { margin: .1rem 0 .2rem; }
.cont-txt p { margin: 0; }
.big-num { font-size: 2rem; font-weight: 900; color: var(--primary); }
[data-theme="dark"] .big-num { color: var(--sky); }
.wod-word { font-size: 1.6rem; font-weight: 900; display: flex; align-items: center; gap: .25rem; }
.week-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.wk { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; height: 160px; align-items: end; padding-top: 1rem; }
.wk-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .25rem; position: relative; z-index: 1; }
.wk-bar { width: 100%; max-width: 40px; background: var(--surface-2); border-radius: 8px 8px 4px 4px; transition: height .6s ease; }
.wk-bar.hit { background: linear-gradient(180deg, var(--sky), var(--blue)); }
.wk-col.today .wk-bar:not(.hit) { background: color-mix(in srgb, var(--sky) 55%, var(--surface-2)); }
.wk-val { font-size: .72rem; color: var(--muted); font-weight: 700; min-height: 1em; }
.wk-lbl { font-size: .78rem; font-weight: 800; color: var(--muted); }
.wk-col.today .wk-lbl { color: var(--text); }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; margin-top: .5rem; }
.tool { display: grid; gap: .1rem; padding: .9rem; border-radius: var(--radius-sm); background: var(--surface-2); text-decoration: none; color: var(--text) !important; transition: transform .1s; }
.tool:hover { transform: translateY(-2px); }
.tool > span { font-size: 1.5rem; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; margin-top: .5rem; }
.badge { display: grid; justify-items: center; text-align: center; gap: .15rem; padding: .8rem .5rem; border-radius: var(--radius-sm); background: var(--surface-2); opacity: .45; filter: grayscale(1); }
.badge.got { opacity: 1; filter: none; background: color-mix(in srgb, var(--amber) 15%, var(--surface)); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); }
.badge span { font-size: 1.8rem; }
.badge b { font-size: .85rem; }
.badge small { font-size: .7rem; color: var(--muted); }

/* ── Darslar xaritasi ── */
.level-block { display: grid; gap: .75rem; margin-bottom: 1rem; }
.level-head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.level-head h2 { margin: 0; }
.level-head p { margin: 0; }
.lvl-badge { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--blue); color: #fff; font-weight: 900; font-size: 1.2rem; flex: none; }
.lvl-prog { margin-left: auto; display: flex; align-items: center; gap: .5rem; min-width: 160px; }
.level-block.soon { opacity: .6; }
.level-block.soon .lvl-badge { background: var(--muted); }
.soon-tag { margin-left: auto; font-weight: 800; color: var(--muted); }
.module-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.module-head h3 { margin: 0; flex: 1; }
.m-emoji { font-size: 1.6rem; }
.path { display: grid; gap: .5rem; }
.node {
  display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: var(--radius-sm);
  border: 2px solid var(--line); text-decoration: none; color: var(--text) !important; background: var(--surface); transition: transform .1s, border-color .15s;
}
a.node:hover { transform: translateX(3px); border-color: var(--sky); }
.node-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 1.25rem; flex: none; font-weight: 900; }
.node-txt { display: grid; }
.node.done .node-ic { background: var(--green); color: #fff; }
.node.current { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 25%, transparent); }
.node.current .node-ic { background: var(--primary); color: #fff; animation: pulse 2s infinite; }
.node.locked { opacity: .55; cursor: not-allowed; }
.node.test.done .node-ic { background: var(--amber); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, .6); } 50% { box-shadow: 0 0 0 8px rgba(96, 165, 250, 0); } }

/* ── Dars / mashq ── */
.lesson { max-width: 680px; margin: 0 auto; min-height: calc(100vh - 2rem); display: flex; flex-direction: column; }
.lesson-top { display: flex; align-items: center; gap: .75rem; padding: .25rem 0 1rem; position: relative; }
.lesson-xp { font-weight: 800; font-size: .95rem; min-width: 54px; text-align: right; }
.xp-float { position: absolute; right: 0; top: 2rem; font-weight: 900; color: var(--amber); animation: floatUp 1.1s ease forwards; pointer-events: none; }
@keyframes floatUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-28px); } }
.lesson-body { flex: 1; padding-bottom: 1rem; }
.lesson-body.enter { animation: enter .25s ease; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.lesson-foot {
  position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: .75rem; flex-wrap: wrap;
  margin: 0 -1rem; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line); min-height: 76px;
}
.lesson-foot:empty { border-top-color: transparent; }
.lesson-foot .btn-lg { min-width: 180px; }
.lesson-foot.ok { background: var(--ok-bg); color: var(--ok-tx); border-top-color: transparent; }
.lesson-foot.bad { background: var(--bad-bg); color: var(--bad-tx); border-top-color: transparent; }
.lesson-foot #ex-skip { margin-right: auto; }
.foot-hint { margin: 0 auto 0 0; color: var(--muted); font-size: .9rem; }
.fb { flex: 1; min-width: 200px; }
.fb-title { font-size: 1.2rem; font-weight: 900; }
.fb-expl { font-size: .92rem; opacity: .9; margin-top: .2rem; }
@media (max-width: 560px) { .lesson-foot .btn-lg { width: 100%; } }

.ex-label { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; font-size: .78rem; margin-bottom: .6rem; }
.q { font-size: clamp(1.3rem, 4.5vw, 1.7rem); margin-bottom: 1.25rem; display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.uz-q { color: var(--primary); }
[data-theme="dark"] .uz-q { color: var(--sky); }
.blank { display: inline-block; min-width: 70px; padding: 0 .5rem; border-bottom: 3px dashed var(--sky); color: var(--muted); text-align: center; }
.blank.filled { color: var(--primary); border-bottom-style: solid; }
[data-theme="dark"] .blank.filled { color: var(--sky); }

.options { display: grid; gap: .6rem; }
@media (min-width: 560px) { .options { grid-template-columns: 1fr 1fr; } }
.opt, .chip {
  display: flex; align-items: center; gap: .75rem; text-align: left;
  border: 2px solid var(--line); border-bottom-width: 4px; background: var(--surface); border-radius: var(--radius-sm);
  padding: .85rem 1rem; font-size: 1.08rem; font-weight: 700; cursor: pointer; transition: border-color .12s, background .12s, transform .08s;
}
.opt:hover:not(:disabled), .chip:hover:not(:disabled) { border-color: var(--sky); }
.opt:active:not(:disabled), .chip:active:not(:disabled) { transform: translateY(2px); }
.opt:disabled, .chip:disabled { cursor: default; }
.opt kbd, .chip kbd { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 7px; font-size: .8rem; color: var(--muted); flex: none; }
.chip.sel { border-color: var(--primary); background: color-mix(in srgb, var(--sky) 16%, var(--surface)); }
.opt.is-ok, .chip.is-ok { border-color: var(--green); background: var(--ok-bg); color: var(--ok-tx); }
.opt.is-bad, .chip.is-bad { border-color: var(--red); background: var(--bad-bg); color: var(--bad-tx); animation: shake .35s; }
.chips { display: flex; flex-wrap: wrap; gap: .6rem; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.tf-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.tf-row .opt { justify-content: center; padding: 1.1rem; }
.timer { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 1rem; }
.timer-bar { height: 100%; background: var(--amber); transform-origin: left; animation: timer linear forwards; }
@keyframes timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.listen-box { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: .5rem 0 1.5rem; }
.play { border: 0; cursor: pointer; border-radius: 50%; display: grid; place-items: center; transition: transform .1s; }
.play:active { transform: scale(.94); }
.play.big { width: 96px; height: 96px; font-size: 2.4rem; background: var(--primary); color: #fff; box-shadow: 0 6px 0 #142a66; }
.play.slow { width: 56px; height: 56px; font-size: 1.5rem; background: var(--surface-2); }

.answer-input { display: flex; gap: .5rem; align-items: center; }
.answer-input .inp { font-size: 1.2rem; padding: .85rem 1rem; }
.kb-wrap { margin-top: .75rem; }
.kb { display: grid; gap: .35rem; user-select: none; }
.kb-row { display: flex; gap: .3rem; justify-content: center; }
.kb-key {
  flex: 1; max-width: 46px; min-width: 0; height: 46px; border-radius: 9px; border: 1px solid var(--line); border-bottom-width: 3px;
  background: var(--surface); font-size: 1.05rem; font-weight: 800; cursor: pointer; padding: 0; transition: background .1s, transform .05s;
}
.kb-key:active { transform: translateY(2px); }
.kb-key.wide { max-width: 160px; flex: 3; font-size: .85rem; }
.kb-key.in-set { background: color-mix(in srgb, var(--sky) 18%, var(--surface)); border-color: var(--sky); }
.kb-key.hint { background: var(--amber); color: #fff; border-color: var(--amber); }
.kb-key.ok { background: var(--green); color: #fff; }
.kb-key.bad { background: var(--red); color: #fff; }
@media (max-width: 420px) { .kb-key { height: 42px; font-size: .92rem; border-radius: 7px; } .kb-row { gap: .2rem; } }
.kb-target { text-align: center; margin-bottom: 1.25rem; }
.kb-letter { font-size: 4.5rem; font-weight: 900; line-height: 1.1; color: var(--primary); }
[data-theme="dark"] .kb-letter { color: var(--sky); }

.case-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.case-tag { background: var(--red); color: #fff; font-weight: 800; border-radius: 999px; padding: .25rem .8rem; font-size: .85rem; }
.case-base { font-size: 1.2rem; font-weight: 800; }

.build-line { min-height: 64px; border-bottom: 2px solid var(--line); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .5rem 0; margin-bottom: 1.25rem; }
.build-line.is-ok { border-color: var(--green); }
.build-line.is-bad { border-color: var(--red); }
.build-bank { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.tok { border: 2px solid var(--line); border-bottom-width: 4px; background: var(--surface); border-radius: 12px; padding: .55rem .9rem; font-size: 1.08rem; font-weight: 700; cursor: pointer; }
.tok:hover:not(:disabled) { border-color: var(--sky); }
.tok.used { visibility: hidden; }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.mcol { display: grid; gap: .6rem; align-content: start; }
.mitem { border: 2px solid var(--line); border-bottom-width: 4px; background: var(--surface); border-radius: var(--radius-sm); padding: .8rem .6rem; font-size: 1rem; font-weight: 700; cursor: pointer; min-height: 56px; transition: all .12s; }
.mitem.ru { font-size: 1.08rem; }
.mitem.sel { border-color: var(--primary); background: color-mix(in srgb, var(--sky) 18%, var(--surface)); }
.mitem.matched { border-color: var(--green); background: var(--ok-bg); color: var(--ok-tx); opacity: .6; cursor: default; }
.mitem.wrong { border-color: var(--red); background: var(--bad-bg); animation: shake .35s; }

/* Flashcard */
.flip { perspective: 1000px; height: 240px; cursor: pointer; margin: .5rem 0 1rem; outline: none; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--radius); display: grid; place-content: center; text-align: center; gap: .5rem; padding: 1rem; border: 2px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.flip-back { transform: rotateY(180deg); background: linear-gradient(135deg, var(--blue), #2C5BD3); color: #fff; border: 0; }
.flip-back .muted { color: #C7D6F5; }
.flip:focus-visible .flip-face { outline: 3px solid var(--sky); }
.big-ru { font-size: clamp(1.8rem, 7vw, 2.6rem); font-weight: 900; }
.big-uz { font-size: clamp(1.4rem, 5vw, 2rem); font-weight: 800; }

/* Nazariya */
.theory { padding: 1.4rem; }
.theory-emoji { font-size: 2.4rem; }
.theory-html { font-size: 1.04rem; }
.theory-html h3 { margin-top: 1rem; }
.theory-html ul { padding-left: 1.2rem; }
.tbl { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; font-size: 1rem; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: .5rem .6rem; text-align: left; vertical-align: middle; }
.tbl th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
.tbl td:first-child { font-weight: 800; }
.say { border: 0; background: color-mix(in srgb, var(--sky) 16%, transparent); color: var(--primary); font: inherit; font-weight: 800; border-radius: 8px; padding: .1rem .45rem; cursor: pointer; }
[data-theme="dark"] .say { color: var(--sky); }
.say::after { content: " 🔊"; font-size: .8em; }
.say:hover { background: color-mix(in srgb, var(--sky) 30%, transparent); }
.tip { background: color-mix(in srgb, var(--amber) 14%, var(--surface)); border-left: 4px solid var(--amber); border-radius: 10px; padding: .8rem 1rem; margin-top: .75rem; }
.dialog p { margin: .4rem 0; }

/* ── Natijalar ── */
.result { max-width: 560px; margin: 1.5rem auto; text-align: center; padding: 2rem 1.25rem; }
.res-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 1.25rem 0; }
.res-stats div { background: var(--surface-2); border-radius: var(--radius-sm); padding: .8rem .4rem; display: grid; }
.res-stats b { font-size: 1.4rem; }
.res-stats span { font-size: .8rem; color: var(--muted); }
.res-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.25rem; }
.mistakes { text-align: left; background: var(--bad-bg); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.mistakes summary { font-weight: 800; cursor: pointer; color: var(--bad-tx); }
.mistakes ul { list-style: none; padding: 0; margin: .6rem 0; display: grid; gap: .4rem; }
.mistakes li { display: flex; justify-content: space-between; gap: 1rem; background: var(--surface); border-radius: 8px; padding: .45rem .7rem; }
.mistakes li b { color: var(--ok-tx); text-align: right; }
.lvl-big { display: inline-grid; place-items: center; width: 110px; height: 110px; border-radius: 28px; background: linear-gradient(135deg, var(--sky), var(--blue)); color: #fff; font-size: 2.6rem; font-weight: 900; margin-bottom: 1rem; }
.pl-bars { display: grid; gap: .5rem; margin: 1rem 0; }
.pl-bar { display: grid; grid-template-columns: 34px 1fr 40px; align-items: center; gap: .6rem; font-weight: 800; }

/* ── Takrorlash ── */
.review-hero { display: flex; align-items: center; gap: 1rem; }
.review-hero p { margin: 0; }
.mode-card { text-align: left; cursor: pointer; font: inherit; display: grid; gap: .35rem; justify-items: start; transition: transform .1s, border-color .15s; }
.mode-card:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--sky); }
.mode-card:disabled { opacity: .6; cursor: not-allowed; }
.mode-ic { font-size: 2rem; }
.srs-card { text-align: center; padding: 2.5rem 1rem; display: grid; gap: 1rem; justify-items: center; margin-top: .5rem; }
.srs-answer { border-top: 2px dashed var(--line); padding-top: 1rem; width: 100%; }
.srs-actions { margin-top: 1rem; display: grid; }
.srs-grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.grade { flex-direction: column; gap: 0; padding: .7rem .3rem; white-space: normal; }
.grade small { font-weight: 600; font-size: .72rem; opacity: .8; }
.g1 { background: var(--bad-bg); color: var(--bad-tx) !important; }
.g3 { background: color-mix(in srgb, var(--amber) 20%, var(--surface)); }
.g5 { background: var(--ok-bg); color: var(--ok-tx) !important; }

/* ── Lug'at ── */
.toolbar { display: grid; gap: .6rem; }
@media (min-width: 640px) { .toolbar { grid-template-columns: 1fr auto; align-items: center; } }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: .5rem .8rem; border-radius: 9px; font-weight: 800; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.wgroup h3 { margin-bottom: .5rem; }
.wrow { display: grid; grid-template-columns: auto 1fr 1fr auto; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.wrow:last-child { border-bottom: 0; }
.wru { font-size: 1.05rem; }
.wuz { color: var(--muted); }
.str { display: inline-flex; gap: 2px; }
.str i { width: 6px; height: 14px; border-radius: 2px; background: var(--surface-2); }
.str i.on { background: var(--green); }
@media (max-width: 520px) { .wrow { grid-template-columns: auto 1fr auto; } .wuz { grid-column: 2; grid-row: 2; font-size: .9rem; } .wrow .str { grid-row: 1 / span 2; grid-column: 3; } }

/* ── Grammatika ── */
.gram summary { display: flex; align-items: center; gap: .6rem; cursor: pointer; flex-wrap: wrap; list-style: none; }
.gram summary::-webkit-details-marker { display: none; }
.gram summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
.gram[open] summary::after { transform: rotate(180deg); }
.gram[open] summary { margin-bottom: .75rem; }
.gram .btn { margin-top: .75rem; }

/* ── Sozlamalar ── */
.form { display: grid; gap: 1rem; }
.switch { display: flex; align-items: center; gap: .6rem; font-weight: 700; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--primary); }

/* ── Toast va konfetti ── */
#toast { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: .5rem; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: .75rem 1rem; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow); animation: toastIn .25s ease; transition: opacity .35s, transform .35s; text-align: center; }
.toast.badge { background: linear-gradient(135deg, #F59E0B, #EF4444); color: #fff; }
.toast.bad { background: var(--red); color: #fff; }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 2.6s ease-in forwards; }
@keyframes fall { to { top: 105%; transform: rotate(720deg) translateX(40px); } }

@media (prefers-reduced-motion: reduce) {
  *:not(.timer-bar), *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
