/* ReadUz AI — Samarqand firuzasi + lojuvard siyoh, daftar chiziqlari, sariq marker */
:root {
  --ink: #1d2a57;          /* lojuvard siyoh — asosiy matn */
  --ink-soft: #55608a;
  --muted: #8b93b0;
  --paper: #f3f6f8;        /* sovuq oq qog'oz */
  --sheet: #ffffff;
  --line: #dfe5ee;         /* daftar chizig'i */
  --turq: #12808f;         /* Registon firuzasi — brend */
  --turq-deep: #0b5f6b;
  --turq-pale: #e2f3f4;
  --marker: #ffe066;       /* joriy so'z markeri */
  --ok: #1e9e5a;
  --bad: #d6453d;
  --bad-pale: #fdeceb;
  --ok-pale: #e5f6ec;
  --gold: #c99a1e;
  --radius-lg: 18px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 0 var(--line), 0 6px 18px -12px rgba(29, 42, 87, .35);
  --font: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e6eaf7; --ink-soft: #aab3d4; --muted: #7c86a8;
    --paper: #10162b; --sheet: #182040; --line: #2a3459;
    --turq: #3fb6c4; --turq-deep: #7fd5df; --turq-pale: #15343f;
    --marker: #8a7414; --ok: #4cc485; --bad: #ff7a70; --bad-pale: #3a1f26; --ok-pale: #17372a;
    --shadow: 0 1px 0 var(--line); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e6eaf7; --ink-soft: #aab3d4; --muted: #7c86a8;
  --paper: #10162b; --sheet: #182040; --line: #2a3459;
  --turq: #3fb6c4; --turq-deep: #7fd5df; --turq-pale: #15343f;
  --marker: #8a7414; --ok: #4cc485; --bad: #ff7a70; --bad-pale: #3a1f26; --ok-pale: #17372a;
  --shadow: 0 1px 0 var(--line); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--ink);
  background: var(--paper); -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--turq-deep); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.85rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 3px solid var(--turq); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); } .small { font-size: .86rem; }
.hidden { display: none !important; }

/* ---------- Ustki panel ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--sheet); border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: var(--turq); font-size: 1rem; font-weight: 700;
  background-image: repeating-conic-gradient(from 45deg, rgba(255,255,255,.14) 0 25%, transparent 0 50%);
  background-size: 12px 12px;
}
.brand small { font-weight: 400; color: var(--muted); font-size: .8rem; margin-left: 2px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--ink-soft); padding: 8px 12px; border-radius: 999px; font-size: .95rem;
}
.nav a:hover { color: var(--ink); background: var(--paper); }
.nav a.active { color: var(--turq-deep); background: var(--turq-pale); font-weight: 600; }
.userchip { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.userchip .ava { font-size: 1.3rem; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--paper); font-size: .85rem; white-space: nowrap; }
.chip.fire { color: #c2410c; } .chip.xp { color: var(--turq-deep); }

/* Mobil pastki menyu */
.tabbar { display: none; }
@media (max-width: 760px) {
  .nav { display: none; }
  .topbar-in .chips { margin-left: auto; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--sheet);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: .72rem; padding: 4px 0; }
  .tabbar a .i { display: block; font-size: 1.25rem; line-height: 1.2; }
  .tabbar a.active { color: var(--turq-deep); font-weight: 600; }
  main { padding-bottom: 86px !important; }
}

main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }

/* ---------- Umumiy bloklar ---------- */
.sheet { background: var(--sheet); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px; }
.sheet + .sheet, .stack > * + * { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid > .sheet + .sheet, .grid > * + * { margin-top: 0; }
.grid > .kpi, .kpi.lift { background: var(--sheet); box-shadow: var(--shadow); padding: 14px 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: 11px 20px; cursor: pointer;
  background: var(--paper); color: var(--ink); display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; line-height: 1.2; transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--turq); color: #fff; }
.btn-primary:hover { background: var(--turq-deep); }
:root[data-theme="dark"] .btn-primary, :root:not([data-theme="light"]) .btn-primary { color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--paper); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .88rem; }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }
.btn-icon { padding: 8px 10px; }

label.f { display: block; font-size: .88rem; color: var(--ink-soft); margin-bottom: 12px; }
label.f > span { display: block; margin-bottom: 5px; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--sheet); width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
}
textarea { min-height: 160px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--turq); border-color: transparent; }
.check { display: flex; gap: 8px; align-items: center; font-size: .95rem; }
.check input { width: auto; }

.seg { display: inline-flex; background: var(--paper); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { font: inherit; border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer; color: var(--ink-soft); font-size: .9rem; }
.seg button.on { background: var(--sheet); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: .82rem; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.bar { height: 8px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--turq); border-radius: 99px; transition: width .4s; }

.empty { text-align: center; padding: 32px 16px; color: var(--ink-soft); }
.empty .big { font-size: 2.4rem; display: block; margin-bottom: 6px; }

.toast-host { position: fixed; left: 50%; bottom: 24px; pointer-events: none; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(92vw, 420px); }
@media (max-width: 760px) { .toast-host { bottom: 92px; } }
.toast { background: var(--ink); color: var(--sheet); padding: 12px 16px; border-radius: 12px; font-size: .93rem; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); animation: pop .2s ease-out; }
.toast.err { background: var(--bad); color: #fff; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }

.modal-back { position: fixed; inset: 0; background: rgba(16, 22, 43, .45); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--sheet); border-radius: var(--radius-lg); width: min(760px, 100%); max-height: 90vh; overflow: auto; padding: 24px; }

/* ---------- Bosh sahifa ---------- */
.hello { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: stretch; }
@media (max-width: 760px) { .hello { grid-template-columns: 1fr; } }
.continue {
  position: relative; overflow: hidden; background: var(--turq); color: #fff; border-radius: var(--radius-lg); padding: 26px;
}
.continue::after { /* koshin naqshi */
  content: ""; position: absolute; right: -30px; top: -30px; width: 200px; height: 200px; opacity: .16;
  background:
    radial-gradient(circle at 50% 50%, transparent 38%, #fff 39% 41%, transparent 42%),
    repeating-conic-gradient(from 22.5deg, #fff 0 12.5%, transparent 0 25%);
  border-radius: 50%;
}
.continue h2 { font-size: 1.6rem; margin-bottom: 6px; }
.continue p { opacity: .9; }
.continue .btn { background: #fff; color: var(--turq-deep); margin-top: 8px; }
.continue .lvl { font-size: .88rem; opacity: .85; }
.me-card { display: grid; gap: 10px; align-content: start; }
.me-line { display: flex; align-items: center; gap: 12px; }
.me-line .ava { font-size: 2.2rem; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: var(--paper); border-radius: var(--radius); padding: 10px 12px; }
.kpi b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .8rem; color: var(--muted); }

/* O'quv yo'li — 8 daraja (ketma-ket, shuning uchun raqamlangan) */
.path { list-style: none; margin: 0; padding: 0; position: relative; }
.path::before { content: ""; position: absolute; left: 23px; top: 24px; bottom: 24px; width: 2px; background: var(--line); }
.step { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 14px; padding: 10px 0; }
.step-n {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem;
  background: var(--sheet); border: 2px solid var(--line); color: var(--ink-soft); z-index: 1;
}
.step.done .step-n { background: var(--turq); border-color: var(--turq); color: #fff; }
.step.current .step-n { border-color: var(--turq); color: var(--turq-deep); box-shadow: 0 0 0 5px var(--turq-pale); }
.step-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; cursor: pointer; padding-top: 4px; }
.step-head h3 { margin: 0; }
.step-body { margin-top: 10px; display: grid; gap: 8px; }
.textlink {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--sheet); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.textlink:hover { border-color: var(--turq); }
.textlink .tick { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; background: var(--paper); color: var(--muted); flex: none; }
.textlink.passed .tick { background: var(--ok); color: #fff; }
.textlink .meta { margin-left: auto; font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* ---------- O'qish sahnasi (asosiy, esda qoladigan element) ---------- */
.reader-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.reader-top h1 { font-size: 1.35rem; margin: 0; }
.reader-top .back { text-decoration: none; font-size: 1.3rem; color: var(--ink-soft); }
.notebook {
  position: relative; background: var(--sheet); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 34px 28px 26px 64px; overflow: hidden;
}
.notebook::before { /* daftar hoshiyasi */
  content: ""; position: absolute; left: 44px; top: 0; bottom: 0; width: 2px; background: #f2b8b5; opacity: .7;
}
.sentence-no { position: absolute; left: 0; width: 44px; text-align: center; top: 38px; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.stage {
  --lh: 2.2em;
  font-size: clamp(1.6rem, 4.2vw, 2.6rem); line-height: var(--lh); min-height: calc(var(--lh) * 2);
  background-image: linear-gradient(to bottom, transparent calc(var(--lh) - 2px), var(--line) calc(var(--lh) - 2px), var(--line) var(--lh), transparent var(--lh));
  background-size: 100% var(--lh); letter-spacing: .01em; word-spacing: .12em;
}
.stage.big-letters { font-size: clamp(3rem, 12vw, 6rem); text-align: center; }
.w {
  display: inline; padding: .04em .12em; margin: 0 .02em; border-radius: 4px; cursor: pointer; color: var(--muted);
  transition: color .15s, background-color .2s;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.w.kok { color: var(--ink); background: linear-gradient(to top, var(--marker) 0 46%, transparent 46%); font-weight: 600; }
.w.yashil { color: var(--ok); }
.w.qizil { color: var(--bad); text-decoration: underline wavy; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.w:hover { background-color: var(--paper); }
.heard { min-height: 1.6em; margin-top: 14px; color: var(--ink-soft); font-style: italic; font-size: .95rem; }
.heard b { font-style: normal; font-weight: 500; color: var(--muted); }
.sent-progress { display: flex; gap: 4px; margin: 18px 0 0; }
.sent-progress i { flex: 1; height: 6px; border-radius: 99px; background: var(--line); }
.sent-progress i.ok { background: var(--ok); } .sent-progress i.bad { background: var(--bad); } .sent-progress i.cur { background: var(--marker); }

.controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.mic {
  width: 78px; height: 78px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.9rem;
  background: var(--turq); color: #fff; display: grid; place-items: center; position: relative;
}
.mic:disabled { opacity: .5; cursor: not-allowed; }
.mic.on { background: var(--bad); }
.mic.on::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 3px solid var(--bad); opacity: .5; transform: scale(var(--lvl, 1)); transition: transform .08s; }
@media (prefers-reduced-motion: reduce) { .mic.on::after { transform: none; } }
.status { text-align: center; min-height: 1.5em; margin-top: 12px; font-size: .95rem; color: var(--ink-soft); }
.status.good { color: var(--ok); } .status.bad { color: var(--bad); }
.live { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.live .kpi { min-width: 110px; text-align: center; }
.mode-pill { font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--turq-pale); color: var(--turq-deep); }
.mistakes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mistake { background: var(--bad-pale); color: var(--bad); padding: 6px 12px; border-radius: 999px; border: 0; font: inherit; cursor: pointer; }
.mistake::before { content: "🔊 "; font-size: .8em; }

.result-hero { text-align: center; padding: 10px 0 6px; }
.result-hero .score { font-size: 4rem; font-weight: 700; line-height: 1; color: var(--turq-deep); font-variant-numeric: tabular-nums; }
.result-hero .score.fail { color: var(--bad); }
.ach-new { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.ach-new div { background: var(--turq-pale); border-radius: var(--radius); padding: 10px 14px; text-align: center; }
.ach-new div span { font-size: 1.8rem; display: block; }

/* ---------- Profil / statistika ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart .b { fill: var(--turq); } .chart .b0 { fill: var(--line); }
.chart .l1 { stroke: var(--turq); fill: none; stroke-width: 2.5; }
.chart .l2 { stroke: var(--gold); fill: none; stroke-width: 2.5; stroke-dasharray: 5 4; }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--ink-soft); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 6px; background: var(--turq); }
.legend i.g { background: var(--gold); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.badge { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 10px; text-align: center; }
.badge .ic { font-size: 1.9rem; display: block; }
.badge b { display: block; font-size: .88rem; margin-top: 4px; }
.badge span { font-size: .75rem; color: var(--muted); }
.badge.off { opacity: .45; filter: grayscale(1); }
.levelbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; font-size: .9rem; }
.avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.avatars button { font-size: 1.5rem; background: var(--paper); border: 2px solid transparent; border-radius: 10px; padding: 4px 8px; cursor: pointer; }
.avatars button.on { border-color: var(--turq); }
.code { font-size: 1.6rem; font-weight: 700; letter-spacing: .18em; color: var(--turq-deep); font-variant-numeric: tabular-nums; }

/* ---------- Reyting ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 12px; align-items: end; margin-bottom: 18px; }
.podium > div { background: var(--sheet); border-radius: var(--radius-lg); box-shadow: var(--shadow); text-align: center; padding: 16px 8px; }
.podium .p1 { padding-top: 26px; border-top: 4px solid var(--gold); }
.podium .ava { font-size: 2.2rem; display: block; }
.podium .place { font-weight: 700; color: var(--muted); }
.rank { font-weight: 700; color: var(--muted); width: 36px; }
tr.me td { background: var(--turq-pale); }

/* ---------- Kirish ---------- */
.auth { max-width: 440px; margin: 20px auto; }
.auth .tabs { margin-bottom: 18px; }
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.roles button { font: inherit; border: 1px solid var(--line); background: var(--sheet); border-radius: var(--radius); padding: 10px 6px; cursor: pointer; color: var(--ink); font-size: .88rem; }
.roles button span { display: block; font-size: 1.4rem; }
.roles button.on { border-color: var(--turq); background: var(--turq-pale); }

/* ---------- Admin ---------- */
.admin-tabs { margin-bottom: 18px; overflow-x: auto; max-width: 100%; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; background: var(--paper); color: var(--ink-soft); }
.pill.ok { background: var(--ok-pale); color: var(--ok); } .pill.bad { background: var(--bad-pale); color: var(--bad); }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.list-pick { max-height: 70vh; overflow: auto; display: grid; gap: 4px; }
.list-pick button { text-align: left; font: inherit; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); display: flex; justify-content: space-between; gap: 8px; }
.list-pick button:hover { background: var(--paper); }
.list-pick button.on { background: var(--turq-pale); color: var(--turq-deep); }
.list-pick .grp { font-size: .78rem; color: var(--muted); padding: 10px 10px 2px; }

/* Telefon: mikrofon markazda, yonida Tingla / Keyingi */
@media (max-width: 560px) {
  .notebook { padding: 26px 16px 20px 46px; }
  .notebook::before { left: 34px; }
  .sentence-no { width: 34px; top: 30px; font-size: .75rem; }
  .controls { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px 8px; align-items: center; }
  .controls #b-listen { order: 1; justify-content: center; }
  .controls #b-mic { order: 2; }
  .controls #b-next { order: 3; justify-content: center; }
  .controls #b-retry { order: 4; grid-column: 1 / 3; justify-self: start; }
  .controls #b-min { order: 6; justify-self: end; }
  .controls #b-write { order: 5; justify-self: center; }
  .controls .btn { padding: 10px 12px; font-size: .92rem; }
  .reader-top .seg { margin-left: auto; }
  .podium { gap: 6px; } .podium b { font-size: .85rem; }
}

/* O'qilishi va tarjima (koreys va boshqa tillar) */
.gloss { display: flex; gap: 14px; align-items: baseline; justify-content: center; flex-wrap: wrap; min-height: 1.6em; margin-top: 6px; }
.gloss .hint { color: var(--turq-deep); font-size: 1.15rem; letter-spacing: .02em; }
.gloss .tr { color: var(--ink-soft); font-size: 1.05rem; }
.gloss .tr::before { content: "— "; color: var(--muted); }
.stage[lang="ko"] { font-family: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", var(--font); }
.langs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.lang-tab { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--sheet); color: var(--ink); cursor: pointer; font: inherit; text-align: left; }
.lang-tab .fl { font-size: 1.6rem; line-height: 1; }
.lang-tab small { display: block; color: var(--muted); font-size: .78rem; }
.lang-tab.on { border-color: var(--turq); background: var(--turq-pale); }
.lang-tab:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Hangul yozish ---------- */
.jamo-grid { display: grid; gap: 10px; }
.jamo-grid.v { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.jamo-grid.c { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 860px) { .jamo-grid.v, .jamo-grid.c { grid-template-columns: repeat(5, minmax(0, 1fr)); } .jamo-tile .g { font-size: 2rem; } }
.jamo-tile { position: relative; display: grid; justify-items: center; gap: 2px; padding: 14px 6px 10px; border-radius: 14px;
  background: var(--sheet); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.jamo-tile:hover { border-color: var(--turq); }
.jamo-tile .g { font: 600 2.6rem/1.1 "Noto Sans KR", "Malgun Gothic", var(--font); }
.jamo-tile .n { font-size: .85rem; } .jamo-tile .r { font-size: .75rem; color: var(--muted); }
.jamo-tile.done { background: var(--turq-pale); }
.jamo-tile .ok { position: absolute; top: 6px; right: 8px; color: var(--ok); font-weight: 700; }
.write-wrap { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 760px) { .write-wrap { grid-template-columns: 1fr; } }
.write-pad { width: 100%; max-width: 460px; }
.write-pad canvas { display: block; border-radius: var(--radius-lg); box-shadow: var(--shadow); touch-action: none; cursor: crosshair; }
.write-status { min-height: 2.6em; margin-top: 12px; color: var(--ink-soft); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.write-status.good { color: var(--ok); } .write-status.bad { color: var(--bad); }
.write-info .big-jamo { font: 600 5.5rem/1 "Noto Sans KR", "Malgun Gothic", var(--font); color: var(--turq-deep); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 16px 0 0; align-items: center; }
.facts dt { color: var(--muted); font-size: .88rem; } .facts dd { margin: 0; }
.facts .syl { font: 600 1.6rem "Noto Sans KR", var(--font); margin-right: 6px; }
.write-banner { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink); margin-top: 18px; }
.write-banner .g { font: 700 2.4rem/1 "Noto Sans KR", var(--font); color: var(--turq-deep); letter-spacing: .05em; }
.write-banner:hover { outline: 2px solid var(--turq); }

/* O'qish sahnasi: katta harf/so'zlarda ortiqcha bo'sh joy bo'lmasin */
.stage.big-letters { --lh: 1.5em; min-height: var(--lh); }
.notebook { padding-bottom: 20px; }

@media (max-width: 560px) {
  .langs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 4px; scrollbar-width: none; }
  .lang-tab { flex: none; padding: 8px 12px; }
  .lang-tab small { display: none; }
  .lang-tab .fl { font-size: 1.3rem; }
  .reader-top h1 { font-size: 1.15rem; }
}
.write-banner .g { white-space: nowrap; flex: none; }
@media (max-width: 560px) { .write-banner { flex-wrap: wrap; } .write-banner .g { font-size: 1.8rem; } .write-banner .btn { margin-left: 0 !important; } }
