/* BADR EDU — ingliz tili bo'limi. Brend: _brend/BREND.md. Asosiy mavzu to'q; yorug' — tugma orqali. */
@font-face { font-family: "Manrope"; src: url("../fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "LMC"; src: url("../fonts/lmromancaps.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "LMR"; src: url("../fonts/lmroman.woff2") format("woff2"); font-display: swap; }

:root, [data-theme="dark"] {
  --bg: #060A1E;
  --screen: radial-gradient(circle at 50% 0%, rgba(244, 223, 166, .16) 0%, rgba(201, 162, 74, .05) 32%, transparent 60%), linear-gradient(162deg, #0A1030 0%, #121F4A 52%, #1B1848 100%);
  --surface: #0f193e;                    /* to'liq rang (oyna, panel) */
  --card: rgba(15, 25, 62, .56);         /* kartochka */
  --card-line: rgba(195, 204, 230, .14);
  --ink: #ffffff;
  --ink-2: #C3CCE6;
  --muted: #8f9bc2;
  --gold-hi: #FFF3D0;
  --gold: #F4DFA6;                       /* oltin matn */
  --gold-deep: #C9A24A;                  /* oltin chiziq */
  --gold-2: rgba(201, 162, 74, .62);
  --gold-3: rgba(201, 162, 74, .26);
  --gold-grad: linear-gradient(135deg, #FFF3D0 0%, #F4DFA6 32%, #C9A24A 100%);
  --on-gold: #121F4A;
  --line: rgba(195, 204, 230, .10);
  --accent: #16c2bb;                     /* ingliz tili: firuza */
  --accent-hi: #45ddd6;
  --accent-ink: #03201f;
  --accent-soft: rgba(22, 194, 187, .14);
  --glow: rgba(22, 194, 187, .28);
  --ok: #37cf8b; --ok-soft: rgba(55, 207, 139, .14);
  --bad: #ff7a7a; --bad-soft: rgba(255, 122, 122, .14);
  --warn: #f2c35f; --warn-soft: rgba(242, 195, 95, .14);
  --shadow: 0 14px 36px rgba(0, 0, 0, .38);
  --girih-op: .055;
  /* imtihon ekrani: toza, yuqori kontrast */
  --x-bg: #070c22;
  --x-card: #0f1838;
  --x-line: rgba(255, 255, 255, .14);
  --x-line-2: rgba(255, 255, 255, .07);
  --x-ink: #f6f7fc;
  --x-ink-2: #d3d9ea;
  --x-sel: #ffffff;
  --x-sel-ink: #0a1030;
  --x-sel-bg: rgba(255, 255, 255, .09);
  --x-input: #0a1230;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f5f1e6;
  --screen: radial-gradient(circle at 50% 0%, rgba(201, 162, 74, .16) 0%, transparent 55%), linear-gradient(162deg, #faf7ef 0%, #f3eedf 60%, #efe8d6 100%);
  --surface: #fffdf7;
  --card: rgba(255, 253, 247, .88);
  --card-line: rgba(18, 31, 74, .12);
  --ink: #0e1838;
  --ink-2: #34406a;
  --muted: #6c7598;
  --gold: #8a6a22;
  --gold-deep: #C9A24A;
  --gold-2: rgba(169, 129, 50, .62);
  --gold-3: rgba(169, 129, 50, .26);
  --line: rgba(14, 24, 56, .09);
  --accent: #0ea59e;
  --accent-hi: #0b8f89;
  --accent-ink: #ffffff;
  --accent-soft: rgba(14, 165, 158, .11);
  --glow: rgba(14, 165, 158, .16);
  --ok: #12804f; --ok-soft: rgba(18, 128, 79, .10);
  --bad: #c0392b; --bad-soft: rgba(192, 57, 43, .09);
  --warn: #9a5f06; --warn-soft: rgba(154, 95, 6, .10);
  --shadow: 0 10px 28px rgba(60, 45, 10, .10);
  --girih-op: .10;
  --x-bg: #f3f4f7;
  --x-card: #ffffff;
  --x-line: #d3d8e3;
  --x-line-2: #e8ebf1;
  --x-ink: #0a1030;
  --x-ink-2: #2c3754;
  --x-sel: #0a1030;
  --x-sel-ink: #ffffff;
  --x-sel-bg: #eef1f7;
  --x-input: #fbfcfd;
  color-scheme: light;
}
:root {
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .7, .3, 1);
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "LMC", "Latin Modern Roman Caps", Georgia, serif;
  --serif-r: "LMR", "Latin Modern Roman", Georgia, serif;
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 16px; line-height: 1.5; min-height: 100vh; min-height: 100dvh; font-weight: 500; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: .14em; }

/* himoya */
.no-select, .no-select * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.no-select input { -webkit-user-select: text; user-select: text; }

/* bezakli fon: brend gradienti, tepada oltin nur, girih 5–6% */
.decor { position: relative; min-height: 100vh; min-height: 100dvh; isolation: isolate; }
.decor::before { content: ""; position: fixed; inset: 0; z-index: -2; background: var(--screen); pointer-events: none; }
.decor::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("../img/naqsh.svg"); background-size: 96px 96px; opacity: var(--girih-op);
}

#wm { position: fixed; inset: 0; z-index: 9000; pointer-events: none; background-repeat: repeat; }

/* brend */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 40px; height: 40px; flex: none; display: block; }
.brand-word { font-family: var(--serif); font-weight: 400; letter-spacing: .2em; font-size: 17px; line-height: 1; color: var(--gold); white-space: nowrap; }

/* qo'sh oltin chiziq: qalin 1.6px + ingichka 0.6px */
.rule { width: 100%; display: flex; align-items: center; gap: 10px; }
.rule .l { flex: 1; height: 5px; border-top: 1.6px solid var(--gold-deep); border-bottom: .6px solid var(--gold-deep); }
.rule span { font-family: var(--serif-r); font-size: 15px; color: var(--gold); font-variant-numeric: oldstyle-nums; letter-spacing: .06em; white-space: nowrap; }
.sub-caps { font-family: var(--serif); font-size: 13px; letter-spacing: .35em; color: var(--ink-2); padding-left: .35em; }

/* belgilar */
.ic { width: 22px; height: 22px; flex: none; }
.ic-btn {
  width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--card-line); background: transparent;
  display: inline-grid; place-items: center; color: var(--gold); transition: background .18s var(--ease), border-color .18s var(--ease);
}
.ic-btn:hover { background: var(--gold-3); border-color: var(--gold-2); }
.ic-btn .ic { width: 21px; height: 21px; }
.tools { display: flex; gap: 6px; align-items: center; }

/* tugmalar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 16px; border: 1px solid transparent;
  font-weight: 800; font-size: 16px; letter-spacing: .01em;
  background: var(--gold-grad); color: var(--on-gold);
  box-shadow: 0 8px 24px rgba(201, 162, 74, .22), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .15s var(--ease), filter .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn[disabled] { opacity: .38; pointer-events: none; box-shadow: none; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--gold-2); box-shadow: none; }
.btn.ghost:hover { background: var(--gold-3); }
.btn.quiet { background: transparent; color: var(--ink-2); box-shadow: none; min-height: 48px; padding: 0 12px; font-weight: 700; }
.btn.quiet:hover { background: var(--line); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); box-shadow: none; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { min-height: 48px; padding: 0 16px; font-size: 15px; border-radius: 14px; }

/* pastki asosiy tugma (barmoq yetadigan joy) */
.cta-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 14px 16px calc(16px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 55%, transparent); }
.cta-bar .in { max-width: 520px; margin: 0 auto; display: grid; gap: 10px; }
.has-cta { padding-bottom: 120px !important; }

/* maydonlar */
.field { display: block; }
.field span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 14px; outline: none;
  border: 1px solid rgba(244, 223, 166, .45); background: transparent; color: var(--ink); font-size: 18px; font-weight: 600;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
[data-theme="light"] .input { border-color: var(--gold-2); background: #fff; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(244, 223, 166, .12); }
.input.code { text-transform: uppercase; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; padding-left: calc(16px + .5em); }
.input.code::placeholder { color: var(--muted); opacity: .8; }
.err { color: var(--bad); font-size: 14px; margin: 10px 0 0; text-align: center; font-weight: 600; }
.err:empty { margin: 0; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--line); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: rgba(244, 223, 166, .12); color: var(--gold); }
.badge.plain { background: transparent; border: 1px solid var(--card-line); color: var(--muted); }
.badge.plain::before { display: none; }

/* kartochka va plitka */
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); }
.tile {
  position: relative; border-radius: 20px; padding: 18px;
  background: radial-gradient(130% 85% at 50% 0%, var(--glow), transparent 60%), var(--card);
  border: 1px solid var(--gold-2);
  box-shadow: inset 0 0 0 4px rgba(6, 10, 30, .35), inset 0 0 0 5px var(--gold-3), var(--shadow);
  backdrop-filter: blur(6px);
}
[data-theme="light"] .tile { box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--gold-3), var(--shadow); }
.tile-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none;
  color: var(--accent-hi); border: 1px solid var(--gold-2);
  background: radial-gradient(circle, var(--accent-soft), transparent 72%);
  box-shadow: inset 0 0 0 3px rgba(6, 10, 30, .3), inset 0 0 0 4px var(--gold-3);
}
[data-theme="light"] .tile-icon { color: var(--accent); }
.tile-icon .ic { width: 26px; height: 26px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.mini { border-radius: 16px; padding: 12px 14px; min-height: 64px; background: var(--card); border: 1px solid var(--card-line); display: flex; align-items: center; gap: 10px; opacity: .58; }
.mini .tile-icon { width: 40px; height: 40px; border-radius: 11px; color: var(--gold); }
.mini .tile-icon .ic { width: 20px; height: 20px; }
.mini b { font-size: 14.5px; flex: 1; min-width: 0; font-weight: 700; }
.mini .lock { color: var(--muted); display: grid; }
.mini .lock .ic { width: 15px; height: 15px; }

/* kirish ekrani (B namuna) */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 10px 30px calc(48px + var(--safe-b)); }
.login-top { align-self: stretch; display: flex; justify-content: flex-end; gap: 6px; }
.login-top .ic-btn { border-color: transparent; color: var(--muted); }
.login-mark { flex: 0 0 auto; height: 22vh; min-height: 150px; max-height: 210px; display: flex; align-items: flex-end; justify-content: center; }
.login-mark img { width: 92px; height: 92px; display: block; }
.wordmark { white-space: nowrap; font-family: var(--serif); font-size: 31px; letter-spacing: .18em; color: var(--gold); margin: 22px 0 10px; padding-left: .22em; text-shadow: 0 0 18px rgba(244, 223, 166, .25); line-height: 1.2; }
[data-theme="light"] .wordmark { text-shadow: none; }
.login .rule, .login .sub-caps { max-width: 360px; }
.login .sub-caps { margin-top: 12px; }
.login-card { margin-top: auto; width: 100%; max-width: 380px; padding: 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--card-line); }
.login-card .input { margin: 0 0 14px; }

/* sahifa */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(6, 10, 30, .82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--gold-3); }
[data-theme="light"] .topbar { background: rgba(245, 241, 230, .9); }
.topbar-in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; min-height: 64px; }
.page { max-width: 760px; margin: 0 auto; padding: 24px 16px 40px; animation: rise .22s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.hello { margin: 4px 0 20px; }
.hello h2 { font-family: var(--serif); font-weight: 400; font-size: 25px; letter-spacing: .08em; margin: 0; color: var(--ink); }
.hello .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-hi); margin-bottom: 8px; }
[data-theme="light"] .hello .eyebrow { color: var(--accent); }
.sec-head { display: flex; align-items: center; gap: 14px; }
.sec-head > div { flex: 1; min-width: 0; }
.sec-title { font-family: var(--serif); font-size: 21px; letter-spacing: .12em; margin: 0; font-weight: 400; color: var(--ink); }
.sec-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.tile.click { cursor: pointer; transition: transform .18s var(--ease); }
.tile.click:active { transform: scale(.99); }
.tile .actions { margin-top: 16px; }
.meta-row { display: flex; margin: 16px 0 6px; border-top: 1px solid var(--gold-3); border-bottom: 1px solid var(--gold-3); }
.meta-row div { flex: 1; text-align: center; padding: 10px 0; font-size: 12px; color: var(--muted); }
.meta-row div + div { border-left: 1px solid var(--gold-3); }
.meta-row b { display: block; font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 800; }
.actions { display: grid; gap: 10px; }
.title-rule { margin: 16px 0 4px; }
.title-rule span { font-size: 16px; }

/* qoidalar */
.rules { margin: 0; padding: 0; list-style: none; counter-reset: r; }
.rules li { position: relative; padding: 12px 0 12px 40px; border-bottom: 1px solid var(--line); font-size: 15.5px; color: var(--ink-2); }
.rules li:last-child { border-bottom: 0; }
.rules li::before { counter-increment: r; content: counter(r); position: absolute; left: 0; top: 11px; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--gold-2); color: var(--gold); font: 400 15px var(--serif-r); font-variant-numeric: oldstyle-nums; display: grid; place-items: center; }

/* ================= imtihon ekrani: toza ================= */
.exam { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--x-bg); color: var(--x-ink); }
.exam-top { position: sticky; top: 0; z-index: 30; background: var(--x-card); border-bottom: 1px solid var(--gold-2); }
.exam-top-in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 16px; min-height: 60px; }
.exam-title { flex: 1; min-width: 0; }
.exam-title b { display: block; font-family: var(--serif); font-weight: 400; font-size: 17px; letter-spacing: .1em; }
.exam-title span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 17px; padding: 0 10px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--gold-2); color: var(--gold); min-width: 76px; }
.timer.low { border-color: var(--bad); color: var(--bad); }
.mode-tag { font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-hi); }
[data-theme="light"] .mode-tag { color: var(--accent); }

.audio-bar { border-top: 1px solid var(--x-line-2); }
.audio-in { max-width: 760px; margin: 0 auto; padding: 9px 16px 10px; }
.audio-row { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--x-ink-2); }
.audio-state { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; }
.audio-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.audio-state .dot.live { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.audio-time { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.track { position: relative; height: 3px; background: var(--x-line-2); border-radius: 3px; margin-top: 9px; overflow: hidden; }
.track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); width: 0; transition: width .4s linear; }
.where { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 0 0 0 10px; border-left: 2px solid var(--gold-deep); font-size: 13.5px; color: var(--x-ink-2); min-height: 40px; }
.where b { color: var(--x-ink); }
.where button { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--gold-2); background: transparent; color: var(--gold); font-weight: 800; font-size: 13.5px; white-space: nowrap; }
.audio-ctl { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--x-line); display: grid; place-items: center; background: transparent; color: var(--x-ink); }
.icon-btn:hover { background: var(--x-sel-bg); }
.icon-btn svg { width: 20px; height: 20px; }
.seek { width: 100%; margin: 8px 0 0; accent-color: var(--accent); height: 22px; }

.exam-body { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 18px 16px 180px; }
.exam-body > .part { animation: rise .2s var(--ease); }
.exam .q, .exam .gap { scroll-margin-top: 210px; }
.part-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 0 12px; }
.part-head h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 23px; letter-spacing: .14em; }
.part-head .range { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
.instr { font-size: 16px; color: var(--x-ink-2); border-left: 2px solid var(--accent); padding: 2px 0 2px 12px; margin: 0 0 18px; font-style: italic; }

.q { background: var(--x-card); border: 1px solid var(--x-line); border-radius: 14px; padding: 14px; margin-bottom: 12px; transition: border-color .2s var(--ease); }
.q.current { border-color: var(--x-ink-2); }
.q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 30px; }
.q-num { flex: none; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--x-line); color: var(--x-ink); font-weight: 800; font-size: 14px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.q-text { font-weight: 700; flex: 1; font-size: 17px; line-height: 1.4; }
.q-st { margin-left: auto; display: inline-flex; gap: 10px; align-items: center; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.q-st > span { display: none; align-items: center; gap: 4px; }
.q-st .ic { width: 15px; height: 15px; }
.q.answered .st-done { display: inline-flex; color: var(--accent-hi); }
[data-theme="light"] .q.answered .st-done { color: var(--accent); }
.q.flagged .st-flag { display: inline-flex; color: var(--warn); }

.opts { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 54px; padding: 10px 12px; border: 1px solid var(--x-line); border-radius: 12px; background: transparent; color: var(--x-ink); font-size: 16px; font-weight: 600; transition: border-color .18s var(--ease), background .18s var(--ease), transform .12s var(--ease); }
.opt:active { transform: scale(.99); }
.opt .k { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--x-line); display: grid; place-items: center; font-weight: 800; font-size: 14px; transition: background .18s var(--ease), color .18s var(--ease); }
@media (hover: hover) { .opt:hover { border-color: var(--x-ink-2); } }
.opt.sel { border-color: var(--x-sel); background: var(--x-sel-bg); box-shadow: inset 0 0 0 1px var(--x-sel); }
.opt.sel .k { background: var(--x-sel); border-color: var(--x-sel); color: var(--x-sel-ink); }
.opt.is-right { border-color: var(--ok); background: var(--ok-soft); }
.opt.is-right .k { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.is-wrong .k { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt[disabled] { cursor: default; }

.letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.letter { height: 48px; min-width: 0; border-radius: 10px; border: 1px solid var(--x-line); background: transparent; color: var(--x-ink); font-weight: 800; font-size: 16px; transition: background .18s var(--ease), border-color .18s var(--ease); }
.letter.sel { background: var(--x-sel); border-color: var(--x-sel); color: var(--x-sel-ink); }
.letter.is-right { background: var(--ok); border-color: var(--ok); color: #fff; }
.letter.is-wrong { background: var(--bad); border-color: var(--bad); color: #fff; }

.legend { background: var(--x-card); border: 1px solid var(--x-line); border-radius: 14px; padding: 4px 14px; margin-bottom: 14px; }
.legend div { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--x-line-2); font-size: 16px; }
.legend div:last-child { border-bottom: 0; }
.legend b { width: 18px; flex: none; }

.notes { background: var(--x-card); border: 1px solid var(--x-line); border-radius: 14px; padding: 16px 14px; }
.notes h4 { margin: 0 0 8px; text-align: center; font-family: var(--serif); font-weight: 400; font-size: 16px; letter-spacing: .2em; }
.notes p { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--x-line-2); line-height: 2.3; font-size: 17px; }
.notes p:last-child { border-bottom: 0; }
.gap { display: inline-flex; align-items: center; vertical-align: middle; position: relative; margin: 0 2px; }
.gap b { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-weight: 800; pointer-events: none; }
.gap input { width: 140px; height: 48px; border: 1px solid var(--x-line); border-radius: 10px; padding: 0 8px 0 28px; font-size: 16px; font-weight: 600; background: var(--x-input); color: var(--x-ink); outline: none; transition: border-color .18s var(--ease); }
.gap input:focus { border-color: var(--x-sel); box-shadow: 0 0 0 1px var(--x-sel); }
.gap.current input { border-color: var(--x-ink-2); }
.gap.flagged input { border-color: var(--warn); }
.gap.is-right input { border-color: var(--ok); background: var(--ok-soft); }
.gap.is-wrong input { border-color: var(--bad); background: var(--bad-soft); }
.gap-key { display: inline-block; vertical-align: middle; font-size: 13.5px; line-height: 1; color: var(--ok); background: var(--ok-soft); border: 1px solid var(--ok); font-weight: 800; margin: 0 4px; padding: 6px 9px; border-radius: 7px; }

.map { background: #fff; border: 1px solid var(--x-line); border-radius: 14px; padding: 10px; margin-bottom: 14px; color: #0a1030; cursor: zoom-in; }
.map h4 { margin: 2px 0 10px; text-align: center; font-family: var(--serif); font-weight: 400; font-size: 15px; letter-spacing: .18em; }
.map img { display: block; width: 100%; height: auto; }
.group-h { margin: 20px 0 9px; }
.group-h b { display: block; font-family: var(--serif); font-weight: 400; font-size: 15px; letter-spacing: .2em; color: var(--x-ink-2); }
.group-h span { font-style: italic; color: var(--x-ink-2); font-size: 16px; }

/* pastki panel */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--x-card); border-top: 1px solid var(--gold-2); padding-bottom: var(--safe-b); }
.dock-in { max-width: 760px; margin: 0 auto; }
.navstrip { display: flex; gap: 14px; overflow-x: auto; padding: 10px 12px 6px; scrollbar-width: none; scroll-behavior: smooth; }
.navstrip::-webkit-scrollbar { display: none; }
.navpart { flex: none; }
.navpart > span { display: block; font-family: var(--serif); font-size: 12px; letter-spacing: .16em; color: var(--muted); margin: 0 0 5px 2px; }
.chips { display: flex; gap: 6px; }
.chip { position: relative; width: 44px; height: 48px; border-radius: 10px; border: 1px solid var(--x-line); background: transparent; color: var(--x-ink-2); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 0; transition: background .18s var(--ease), color .18s var(--ease); }
.chip.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.cur { box-shadow: 0 0 0 2px var(--x-card), 0 0 0 3.5px var(--gold); }
.chip.flag::after { content: ""; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--warn); border: 2px solid var(--x-card); }
.chip[disabled] { opacity: .3; cursor: default; }
.chip.right { background: var(--ok); border-color: var(--ok); color: #fff; }
.chip.wrong { background: var(--bad); border-color: var(--bad); color: #fff; }
.dock-row { display: flex; align-items: center; gap: 8px; padding: 6px 12px 10px; }
.dock-row .grow { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.25; font-size: 13px; font-weight: 800; color: var(--x-ink-2); min-width: 0; }
.savestate { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.savestate.err { color: var(--warn); font-weight: 700; }
.navbtn { width: 52px; height: 48px; border-radius: 12px; border: 1px solid var(--x-line); background: transparent; color: var(--x-ink); display: grid; place-items: center; flex: none; }
.navbtn svg { width: 22px; height: 22px; }
.navbtn[disabled] { opacity: .3; }
.flagtoggle { display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--x-line); background: transparent; color: var(--x-ink-2); font-size: 14px; font-weight: 700; transition: all .18s var(--ease); flex: none; }
.flagtoggle svg { width: 17px; height: 17px; }
.flagtoggle.on { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.typing .dock { display: none; }

/* oyna */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(3, 6, 18, .64); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s var(--ease); }
@media (min-width: 640px) { .modal-bg { align-items: center; padding: 20px; } }
.modal {
  background: var(--surface); color: var(--ink); width: 100%; max-width: 460px; border-radius: 22px 22px 0 0; padding: 24px 20px calc(20px + var(--safe-b));
  border: 1px solid var(--gold-2); border-bottom: 0; box-shadow: var(--shadow); animation: up .22s var(--ease);
}
@media (min-width: 640px) { .modal { border-radius: 22px; border-bottom: 1px solid var(--gold-2); } }
.modal h3 { margin: 0 0 8px; font-size: 19px; font-weight: 800; }
.modal p { margin: 0 0 18px; color: var(--ink-2); }
.modal.warn h3 { color: var(--warn); }
.modal.bad h3 { color: var(--bad); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(20px); opacity: .6; } }
.about { text-align: center; }
.about img { width: 72px; height: 72px; display: block; margin: 0 auto 10px; }
.about .wordmark { font-size: 24px; margin: 12px 0 10px; }
.about .rule { margin-bottom: 18px; }
.about dl { margin: 0 0 18px; text-align: left; border-top: 1px solid var(--gold-3); }
.about dl div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--gold-3); font-size: 14px; }
.about dt { color: var(--muted); }
.about dd { margin: 0; font-weight: 700; text-align: right; }
.about .founder { color: var(--ink-2); margin: 0 0 18px; font-size: 14px; font-weight: 600; }

.toast { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); z-index: 9500; background: var(--surface); color: var(--ink); border: 1px solid var(--gold-2); padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); animation: fade .2s; max-width: calc(100% - 32px); }
.viewer { position: fixed; inset: 0; z-index: 120; background: #fff; overflow: auto; }
.viewer img { width: 200%; max-width: none; display: block; }
.viewer .close { position: fixed; top: 10px; right: 10px; z-index: 2; background: #0a1030; color: #fff; }

/* natija kartochkasi (sertifikat) */
.cert { position: relative; text-align: center; padding: 22px 20px 18px; border-radius: 22px; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 0%, rgba(244, 223, 166, .14), transparent 60%), radial-gradient(90% 60% at 50% 100%, var(--accent-soft), transparent 70%), var(--card);
  border: 1px solid var(--gold-2); box-shadow: inset 0 0 0 5px rgba(6, 10, 30, .35), inset 0 0 0 6px var(--gold-3), var(--shadow); }
[data-theme="light"] .cert { box-shadow: inset 0 0 0 5px var(--surface), inset 0 0 0 6px var(--gold-3), var(--shadow); }
.cert-logo { width: 54px; height: 54px; display: block; margin: 0 auto 8px; }
.cert .brand-word { font-size: 14px; letter-spacing: .3em; padding-left: .3em; }
.cert-test { font-family: var(--serif); font-size: 19px; letter-spacing: .12em; color: var(--ink); margin: 16px 0 10px; line-height: 1.3; }
.cert .rule { margin-bottom: 16px; }
.cert-name { font-family: var(--serif); font-size: 22px; letter-spacing: .08em; color: var(--gold); line-height: 1.25; }
.cert-date { font-family: var(--serif-r); font-variant-numeric: oldstyle-nums; color: var(--muted); font-size: 15px; margin-top: 4px; }
.cert-score { font-family: var(--serif-r); font-size: 76px; line-height: 1; color: var(--ink); margin: 18px 0 2px; font-variant-numeric: lining-nums; }
.cert-score small { font-size: 28px; color: var(--muted); }
.cert-kind { font-family: var(--serif); font-size: 12px; letter-spacing: .35em; color: var(--ink-2); padding-left: .35em; }
.cert-parts { display: grid; grid-template-columns: repeat(6, 1fr); margin-top: 18px; border-top: 1px solid var(--gold-3); }
.cert-parts div { padding: 10px 0 2px; font-size: 11.5px; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.cert-parts div + div { border-left: 1px solid var(--gold-3); }
.cert-parts b { display: block; font-family: var(--serif-r); font-size: 18px; color: var(--ink); font-weight: 400; font-variant-numeric: lining-nums; }
.cert-void { font-family: var(--serif); font-size: 22px; letter-spacing: .1em; color: var(--bad); margin: 18px 0 6px; }
.lock-note { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--gold); padding: 14px 0 0; font-size: 14px; font-weight: 700; }
.lock-note .ic { width: 18px; height: 18px; }

.review-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.review-row .you { color: var(--ink-2); }
.review-row .you.bad { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.review-row .key { color: var(--ok); font-weight: 800; }
.mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.mark .ic { width: 14px; height: 14px; }
.mark.ok { background: var(--ok-soft); color: var(--ok); }
.mark.bad { background: var(--bad-soft); color: var(--bad); }

.center-screen { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.center-screen h2 { margin: 16px 0 18px; font-family: var(--serif); font-weight: 400; letter-spacing: .08em; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--gold-3); border-top-color: var(--gold); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.seal { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; color: var(--bad); border: 1px solid var(--bad); box-shadow: inset 0 0 0 4px rgba(6, 10, 30, .3), inset 0 0 0 5px var(--bad-soft); }
.seal .ic { width: 30px; height: 30px; }

/* ================= ustoz paneli ================= */
.wide .topbar-in, .wide .page { max-width: 1180px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.toolbar h2 { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 20px; letter-spacing: .1em; }
.toolbar .sub { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--gold-3); margin: 0 0 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab { border: 0; background: none; min-height: 48px; padding: 0 14px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 14.5px; }
.tab.on { color: var(--ink); border-bottom-color: var(--gold); }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .12em; padding: 12px; border-bottom: 1px solid var(--gold-3); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: var(--accent-soft); }
.tbl .r { text-align: right; }
.tbl .total { font-weight: 800; }
.tbl .code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 2px; font-weight: 700; color: var(--gold); }
.only-narrow { display: none; }
@media (max-width: 680px) { .only-wide { display: none; } .only-narrow { display: block; } }
.scards { display: grid; gap: 10px; }
.scard { background: var(--card); border: 1px solid var(--card-line); border-radius: 16px; overflow: hidden; }
.scard summary { list-style: none; display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; min-height: 64px; padding: 10px 14px; cursor: pointer; }
.scard summary::-webkit-details-marker { display: none; }
.scard .nm { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard .sc { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.scard .sc span { color: var(--muted); font-size: 13px; }
.scard .body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.scard .pgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 12px 0; text-align: center; }
.scard .pgrid div { font-size: 11px; color: var(--muted); font-weight: 700; }
.scard .pgrid b { display: block; font-size: 15px; color: var(--ink); }
.scard .ex { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.panel { padding: 16px 18px; }
.panel h3 { margin: 0 0 12px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
.cell { border-radius: 10px; padding: 7px 4px; text-align: center; font-size: 12px; font-weight: 700; }
.cell b { display: block; font-size: 13px; }
.lvl0 { background: rgba(255, 122, 122, .22); color: var(--bad); }
.lvl1 { background: rgba(242, 160, 79, .20); color: var(--warn); }
.lvl2 { background: rgba(242, 210, 79, .16); color: var(--warn); }
.lvl3 { background: rgba(55, 207, 139, .16); color: var(--ok); }
.lvl4 { background: rgba(55, 207, 139, .28); color: var(--ok); }
.lvlx { background: var(--line); color: var(--muted); }
.bars { padding: 4px 0; }
.bar { display: grid; grid-template-columns: 56px 1fr 44px; align-items: center; gap: 12px; padding: 7px 0; font-size: 14px; color: var(--ink-2); }
.bar .t { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar .t i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.bar b { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.miss { display: grid; grid-template-columns: 36px 1fr 48px; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; font-size: 14.5px; }
.miss:last-child { border-bottom: 0; }
.miss .w { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.miss .q-num, .review-row .q-num, .keyrow .q-num { border-color: var(--gold-3); color: var(--ink); }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.note { font-size: 13.5px; color: var(--muted); margin: 12px 0 0; text-align: center; }
.drawer-bg { position: fixed; inset: 0; z-index: 100; background: rgba(3, 6, 18, .55); animation: fade .18s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 101; width: min(560px, 100%); background: var(--bg); overflow: auto; border-left: 1px solid var(--gold-2); box-shadow: -10px 0 40px rgba(0, 0, 0, .35); animation: slide .22s var(--ease); }
@keyframes slide { from { transform: translateX(30px); opacity: .6; } }
.drawer-head { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--gold-3); padding: 10px 12px 10px 18px; display: flex; align-items: center; gap: 10px; z-index: 2; }
.drawer-head h3 { margin: 0; font-size: 17px; flex: 1; font-weight: 800; }
.drawer-body { padding: 16px; }
.drawer-body .panel { margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.kv div { background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 10px 12px; font-size: 12px; color: var(--muted); }
.kv b { display: block; color: var(--ink); font-size: 19px; font-variant-numeric: tabular-nums; }
.keyrow { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.keyrow:last-child { border-bottom: 0; }
.keyrow .ctx { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.var { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; min-height: 36px; padding: 0 4px 0 10px; border-radius: 10px; border: 1px solid var(--gold-2); }
.var.main { border-color: var(--ok); color: var(--ok); padding-right: 10px; }
.var button { border: 0; background: none; color: var(--muted); width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border-radius: 8px; }
.var button:hover { background: var(--bad-soft); color: var(--bad); }
.var button svg { width: 15px; height: 15px; }
.addvar { display: flex; gap: 6px; }
.addvar input { width: 140px; height: 44px; border-radius: 10px; border: 1px solid var(--gold-3); background: transparent; color: var(--ink); padding: 0 10px; font-size: 15px; outline: none; }
.addvar input:focus { border-color: var(--gold); }
.addvar .btn.small { min-height: 44px; padding: 0 14px; }
.suggest { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.suggest button { min-height: 36px; border: 1px dashed var(--gold-2); background: none; color: var(--ink-2); border-radius: 9px; padding: 0 10px; font-size: 13.5px; font-weight: 600; }
.suggest button:hover { border-style: solid; color: var(--ink); }
.sel-sec { height: 44px; font-size: 15px; padding: 0 12px; margin-bottom: 10px; border-radius: 12px; border: 1px solid var(--gold-3); background: var(--surface); color: var(--ink); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* tuzatishlar (skrinshotlardan keyin) */
.hello h2 { font-size: 22px; letter-spacing: .06em; line-height: 1.3; }
.sec-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-top .btn.quiet { padding: 0 10px; font-size: 14px; }
.dock-row .grow > span:first-child { white-space: nowrap; }
.teacher-line { margin-top: 6px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.cert-teacher { margin-top: 2px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.cert-test { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(14px, 4.3vw, 19px); letter-spacing: .1em; }
.tsel { height: 44px; min-width: 180px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--gold-3); background: var(--surface); color: var(--ink); font: inherit; font-size: 14.5px; }
.addteach { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.addteach input { flex: 1; min-width: 180px; height: 48px; border-radius: 12px; border: 1px solid var(--gold-3); background: transparent; color: var(--ink); padding: 0 12px; font: inherit; outline: none; }
.addteach input:focus { border-color: var(--gold); }

/* ustoz: o'quvchilar yorlig'i */
.stu-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.stulist { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .stulist { grid-template-columns: 1fr 1fr; } }
.stucard { background: var(--card); border: 1px solid var(--card-line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.stu-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stu-name { font-size: 16px; flex: 1; min-width: 0; }
.stu-code { font-size: 15px; }
.stu-act { display: flex; gap: 8px; flex-wrap: wrap; }
.stu-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: center; }
.sharebox { margin: 0 0 16px; padding: 14px; border-radius: 12px; border: 1px solid var(--gold-3); background: var(--bg-2); color: var(--ink); font: 600 15px/1.6 var(--sans); white-space: pre-wrap; word-break: break-word; user-select: text; -webkit-user-select: text; }
.input.area { height: auto; min-height: 140px; padding: 12px 16px; font-size: 16px; line-height: 1.5; resize: vertical; display: block; }
.scard .nm .badge { margin-left: 6px; vertical-align: middle; }
