/* G'oya: ustozni tinchlantirish. Bitta aksent, ko'p bo'sh joy, ingichka chiziqlar.
   Qizil rang faqat xato javobda; imtihon paytida ekranda hech narsa shoshirmaydi. */
:root {
  --bg: #fbfbf9; --card: #ffffff; --text: #1a1d1f; --muted: #6d7377; --line: #e9e9e4; --sunk: #f2f2ee;
  --accent: #1c6b66; --on-accent: #ffffff; --soft: #e6f1ef;
  --ok: #1c6b66; --ok-soft: #e6f1ef; --bad: #c2574a; --bad-soft: #f9ece9;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="dark"] {
  --bg: #111413; --card: #181c1b; --text: #eceeed; --muted: #979e9c; --line: #272c2b; --sunk: #1f2423;
  --accent: #62c4b8; --on-accent: #0c1110; --soft: #1a2d2b;
  --ok: #62c4b8; --ok-soft: #1a2d2b; --bad: #e58d80; --bad-soft: #33211e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111413; --card: #181c1b; --text: #eceeed; --muted: #979e9c; --line: #272c2b; --sunk: #1f2423;
    --accent: #62c4b8; --on-accent: #0c1110; --soft: #1a2d2b;
    --ok: #62c4b8; --ok-soft: #1a2d2b; --bad: #e58d80; --bad-soft: #33211e;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { font-size: calc(16px * var(--scale, 1)); }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; }
.wrap { max-width: 520px; margin: 0 auto; padding: 20px 20px 112px; }
.wrap.in { animation: enter .24s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
h1 { font-size: 1.75rem; line-height: 1.18; margin: 0; font-weight: 700; letter-spacing: -.022em; }
h2 { font-size: 1rem; margin: 0 0 8px; font-weight: 650; }
.muted { color: var(--muted); font-size: .875rem; }
.small { font-size: .8125rem; }
.center { text-align: center; padding: 56px 8px; }
.err { color: var(--bad); }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.sec { margin-top: 30px; }
.note { font-size: .75rem; color: var(--muted); margin: 26px 0 0; line-height: 1.5; }
.lead { color: var(--muted); margin: 8px 0 0; }
.label { font-size: .75rem; font-weight: 650; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

/* tugmalar */
.btn { display: block; width: 100%; min-height: 50px; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer; text-align: center; transition: transform .12s var(--ease), opacity .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn:disabled { opacity: .4; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: .875rem; cursor: pointer; }
.plain { background: none; border: 0; padding: 0; font-weight: 600; cursor: pointer; }

/* bosh sahifa */
.head { display: flex; justify-content: space-between; align-items: center; min-height: 40px; }
.step { margin-top: 26px; }
.step h1 { margin-top: 8px; }
.step .btn { margin-top: 20px; }
.done { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--soft); margin-bottom: 12px; }
.done svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .1s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.goal { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.scale { position: relative; height: 6px; background: var(--sunk); border-radius: 99px; margin: 12px 0 6px; }
.scale i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); border-radius: 99px; transition: width .7s var(--ease); }
.scale u { position: absolute; top: -4px; width: 2px; height: 14px; background: var(--text); border-radius: 2px; }
.rows { margin-top: 10px; border-top: 1px solid var(--line); }
.rowi { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 58px; text-align: left; padding: 11px 0; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; transition: opacity .12s; }
.rowi:active { opacity: .55; }
.rowi:disabled { opacity: .45; cursor: default; }
.rowi b { display: block; font-weight: 550; }
.rowi .side { flex: none; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.bar { height: 4px; background: var(--sunk); border-radius: 99px; overflow: hidden; margin-top: 7px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .6s var(--ease); }
details > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 58px; font-weight: 550; border-bottom: 1px solid var(--line); }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "›"; color: var(--muted); font-size: 1.2rem; transition: transform .2s var(--ease); }
details[open] > summary::after { transform: rotate(90deg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 6px; }
.tag { border: 1px solid var(--line); background: none; border-radius: 99px; padding: 8px 14px; font-size: .875rem; cursor: pointer; transition: transform .12s var(--ease); }
.tag:active { transform: scale(.96); }
.search { width: 100%; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; outline: none; }
.search:focus { border-color: var(--accent); }
textarea.search { resize: vertical; min-height: 92px; }
.spark { display: block; width: 100%; height: 56px; color: var(--accent); margin-top: 8px; }
.choice { display: block; width: 100%; text-align: left; padding: 14px 0; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.choice b { display: block; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
td, th { text-align: left; padding: 8px 4px; border-top: 1px solid var(--line); }

/* pastki menyu */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; justify-content: center; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.nav button { flex: 1; max-width: 170px; min-height: 48px; background: none; border: 0; color: var(--muted); font-size: .6875rem; font-weight: 600; display: grid; justify-items: center; align-content: center; gap: 2px; cursor: pointer; transition: color .15s; }
.nav button.on { color: var(--accent); }
.nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* savol */
.top { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 6px 0 12px; margin: -6px 0 0; }
.prog { height: 3px; background: var(--sunk); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.prog i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .35s var(--ease); }
.timer { background: none; border: 0; padding: 8px 0 8px 8px; min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); cursor: pointer; }
.iconbtn { background: none; border: 0; min-width: 40px; min-height: 40px; padding: 0; text-align: left; color: var(--muted); cursor: pointer; font-size: 1.05rem; }
.count { background: none; border: 0; min-height: 40px; font-weight: 600; font-size: .9375rem; cursor: pointer; }
.qbox { padding-top: 10px; }
.qbox.next { animation: qnext .22s var(--ease); }
.qbox.prev { animation: qprev .22s var(--ease); }
@keyframes qnext { from { opacity: 0; transform: translateX(12px); } }
@keyframes qprev { from { opacity: 0; transform: translateX(-12px); } }
.topic { font-size: .8125rem; color: var(--muted); }
.q { font-size: 1.125rem; font-weight: 600; line-height: 1.45; margin: 6px 0 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.code { margin: 0 0 16px; padding: 14px; border-radius: 12px; background: var(--sunk); font: .875rem/1.55 ui-monospace, Consolas, monospace; overflow-x: auto; }
.items { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--sunk); font-size: .9375rem; }
.items div { padding: 3px 0; }
.opt { display: flex; gap: 12px; align-items: flex-start; width: 100%; min-height: 54px; text-align: left; padding: 14px; margin: 8px 0; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 1rem; line-height: 1.4; cursor: pointer; transition: border-color .15s, background .15s, transform .1s var(--ease); }
.opt:active:not(:disabled) { transform: scale(.99); }
.opt .l { flex: none; width: 24px; color: var(--muted); font-weight: 600; font-size: .875rem; line-height: 1.6; transition: color .15s; }
.opt.sel { border-color: var(--accent); background: var(--soft); box-shadow: inset 0 0 0 1px var(--accent); }
.opt.sel .l { color: var(--accent); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok); }
.opt.right .l { color: var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .l { color: var(--bad); }
.opt:disabled { cursor: default; }
.expl { padding: 14px 0 0; font-size: .9375rem; animation: enter .24s var(--ease); }
.foot { display: flex; justify-content: space-between; align-items: center; min-height: 40px; margin-top: 6px; }
.flag { background: none; border: 0; padding: 6px 0; color: var(--muted); font-weight: 550; font-size: .875rem; cursor: pointer; }
.flag.on { color: var(--accent); }
.saved { font-size: .8125rem; color: var(--muted); transition: opacity .3s; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); }
.bottom .row { max-width: 480px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.cell { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: none; font-size: .8125rem; font-weight: 600; cursor: pointer; padding: 0; color: var(--muted); }
.cell.ans { background: var(--soft); color: var(--accent); border-color: transparent; }
.cell.fl { box-shadow: inset 0 0 0 1.5px var(--text); }
.cell.cur { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.cell.right { background: var(--soft); color: var(--accent); border-color: transparent; }
.cell.wrong { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.toast { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 20; background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 99px; font-size: .875rem; font-weight: 550; white-space: nowrap; animation: toast 3.4s var(--ease) forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -8px); } 8%, 90% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* natija */
.big { font-size: 3.5rem; font-weight: 700; line-height: 1; letter-spacing: -.035em; margin-top: 18px; }
.big small { font-size: 1.1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.trow { margin: 14px 0; font-size: .9375rem; }
.price { font-size: 1.375rem; font-weight: 700; letter-spacing: -.02em; }
.plan { display: block; width: 100%; text-align: left; padding: 16px; margin: 10px 0; border: 1px solid var(--line); border-radius: 16px; background: none; cursor: pointer; transition: transform .12s var(--ease); }
.plan:active { transform: scale(.99); }
.plan.best { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.rev { padding: 16px 0; border-bottom: 1px solid var(--line); }

/* pastki oyna */
.modal { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 12, 12, .4); animation: fade .18s; }
.modal.out { animation: fade .16s reverse forwards; }
.sheet { width: 100%; max-width: 520px; max-height: 86vh; overflow: auto; background: var(--card); border-radius: 22px 22px 0 0; padding: 24px 20px calc(18px + env(safe-area-inset-bottom)); animation: up .28s var(--ease); }
.modal.out .sheet { animation: up .16s reverse forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
.tips { margin: 12px 0 18px; padding: 0; list-style: none; color: var(--muted); font-size: .9375rem; }
.tips li { padding: 5px 0; }

/* yuklanish */
.sk { border-radius: 14px; margin: 14px 0; background: linear-gradient(100deg, var(--sunk) 30%, var(--line) 50%, var(--sunk) 70%); background-size: 200% 100%; animation: sk 1.3s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
