/* SIL DETEKTIVI — "tibbiy laboratoriya" uslubi */
:root {
  --bg: #eef5f7;
  --bg-grid: rgba(14, 94, 115, .06);
  --surface: #ffffff;
  --surface-2: #f4f9fa;
  --line: #d3e3e8;
  --text: #0f2a33;
  --muted: #557079;
  --primary: #0b6a80;
  --primary-2: #0e8aa3;
  --primary-ink: #ffffff;
  --primary-soft: #dcf0f4;
  --accent: #d6336c;
  --accent-soft: #fde4ec;
  --ok: #138a4b;
  --ok-soft: #dcf5e6;
  --bad: #c62828;
  --bad-soft: #fde2e2;
  --warn: #b26a00;
  --star: #f2a516;
  --shadow: 0 1px 2px rgba(10, 40, 50, .06), 0 6px 20px rgba(10, 40, 50, .07);
  --radius: 16px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #081419; --bg-grid: rgba(80, 200, 220, .05); --surface: #10232b; --surface-2: #0c1c23; --line: #1f3c47;
    --text: #e3f1f5; --muted: #8fb0ba; --primary: #2bb3cc; --primary-2: #46c6dd; --primary-ink: #04161c; --primary-soft: #11353f;
    --accent: #ff5c8f; --accent-soft: #3a1626; --ok: #3ccf7f; --ok-soft: #0f3322; --bad: #ff6b6b; --bad-soft: #3a1515;
    --warn: #f0a640; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #081419; --bg-grid: rgba(80, 200, 220, .05); --surface: #10232b; --surface-2: #0c1c23; --line: #1f3c47;
  --text: #e3f1f5; --muted: #8fb0ba; --primary: #2bb3cc; --primary-2: #46c6dd; --primary-ink: #04161c; --primary-soft: #11353f;
  --accent: #ff5c8f; --accent-soft: #3a1626; --ok: #3ccf7f; --ok-soft: #0f3322; --bad: #ff6b6b; --bad-soft: #3a1515;
  --warn: #f0a640; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background-color: var(--bg);
  background-image: linear-gradient(var(--bg-grid) 1px, transparent 1px), linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  touch-action: manipulation; overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 .75em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1; }

/* ---------- Ilova karkasi ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.appbar .title { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .title small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.icon-btn {
  min-width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: inline-grid; place-items: center; font-size: 18px; padding: 0 8px;
}
.icon-btn:active { transform: scale(.96); }
.pts-pill { font-family: var(--mono); font-size: 13px; padding: 4px 10px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-weight: 700; white-space: nowrap; }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.study-banner { background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; text-align: center; padding: 6px 12px; }

/* ---------- Kartalar va tugmalar ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card.soft { background: var(--surface-2); box-shadow: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; text-decoration: none; color: var(--text);
  transition: transform .12s, background-color .15s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; font-size: 17px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.chip-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); }
.chip-tag.accent { background: var(--accent-soft); color: var(--accent); }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 0 6px; }
input[type=text], select {
  width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); font-size: 17px;
}
input[type=text]:focus, select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
label.lbl { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }

/* ---------- Bosh ekran ---------- */
.hero { position: relative; overflow: hidden; padding: 22px 18px; border-radius: 22px; color: #fff;
  background: radial-gradient(circle at 85% 15%, rgba(255,92,143,.55), transparent 45%), linear-gradient(135deg, #073d4b, #0b6a80 60%, #0e8aa3); box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(26px, 7.5vw, 38px); letter-spacing: .5px; margin-bottom: 2px; }
.hero h1 span { color: #ffc2d5; }
.hero .sub { font-size: 17px; opacity: .92; margin-bottom: 12px; font-weight: 600; }
.hero p { opacity: .92; max-width: 46ch; }
.hero .rod { position: absolute; width: 60px; height: 6px; border-radius: 6px; background: #ff7aa5; opacity: .5; }
.hero .rod.r1 { right: 18px; top: 70px; transform: rotate(-30deg); }
.hero .rod.r2 { right: 64px; top: 34px; width: 40px; transform: rotate(20deg); }
.hero .rod.r3 { right: 34px; top: 112px; width: 46px; transform: rotate(65deg); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; }
.stat b { display: block; font-family: var(--mono); font-size: 20px; color: var(--primary); }
.stat span { font-size: 12px; color: var(--muted); }

.map { position: relative; padding: 4px 0; }
.map-node { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 12px 14px; margin: 0 0 12px;
  border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.map-node:nth-child(even) { margin-left: 8%; width: 92%; }
.map-node .ico { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: var(--primary-soft); border: 2px solid var(--primary); }
.map-node.done .ico { background: var(--ok-soft); border-color: var(--ok); }
.map-node.locked { opacity: .6; }
.map-node.locked .ico { filter: grayscale(1); border-style: dashed; }
.map-node.next { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.map-node.final .ico { background: var(--accent-soft); border-color: var(--accent); }
.map-node .t { font-weight: 700; }
.map-node .s { font-size: 13px; color: var(--muted); }
.map-node .r { margin-left: auto; text-align: right; flex: none; }
.stars { color: var(--star); letter-spacing: 1px; font-size: 15px; white-space: nowrap; }
.stars .off { color: var(--line); }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left; min-height: 96px; position: relative; }
.tool .ti { font-size: 24px; }
.tool b { font-size: 15px; }
.tool span { font-size: 12px; color: var(--muted); }
.tool .badge { position: absolute; top: 10px; right: 10px; }
.switch { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); width: 100%; text-align: left; }
.switch .knob { flex: none; width: 50px; height: 30px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; }
.switch .knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch[aria-checked="true"] .knob { background: var(--accent); }
.switch[aria-checked="true"] .knob::after { transform: translateX(20px); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 22px 0 10px; }

/* ---------- Bosqich ---------- */
.stage-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.stage-head .big-ico { font-size: 34px; }
.dots { display: flex; gap: 6px; margin: 4px 0 14px; }
.dots i { flex: 1; height: 6px; border-radius: 6px; background: var(--line); }
.dots i.on { background: var(--primary); }
.dots i.cur { background: var(--accent); }
.instr { font-weight: 600; margin-bottom: 10px; }
.instr small { display: block; font-weight: 400; color: var(--muted); }
.part-intro { text-align: center; padding: 26px 18px; }
.part-intro .big { font-size: 46px; }

/* ---------- Drag & drop ---------- */
.pool { position: sticky; top: calc(62px + env(safe-area-inset-top)); z-index: 10; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; margin: 0 -4px 12px;
  border-radius: 16px; background: color-mix(in srgb, var(--surface-2) 94%, transparent); border: 1px dashed var(--line); max-height: 42vh; overflow-y: auto;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pool:empty { display: none; }
.dchip {
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  padding: 10px 12px; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--primary); background: var(--surface);
  font-size: 14.5px; font-weight: 600; text-align: left; line-height: 1.3; box-shadow: 0 2px 6px rgba(0,0,0,.06); max-width: 100%;
  transition: transform .12s, box-shadow .12s, opacity .15s;
}
.dchip::before { content: "⠿ "; color: var(--muted); }
.dchip.selected { background: var(--primary); color: var(--primary-ink); transform: translateY(-2px); box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 40%, transparent); }
.dchip.selected::before { color: inherit; }
.dchip.dragging { opacity: .3; }
.dnd-ghost { position: fixed; z-index: 1000; pointer-events: none; margin: 0; transform: rotate(-2deg) scale(1.04); box-shadow: 0 14px 30px rgba(0,0,0,.25); opacity: .95; }
.slots { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.slots::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: linear-gradient(var(--primary), var(--accent)); }
.slots li { position: relative; margin-bottom: 10px; }
.slots li::before { content: ""; position: absolute; left: -17px; top: 20px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.slots.plain { padding-left: 0; }
.slots.plain::before, .slots.plain li::before { display: none; }
.slot {
  display: flex; flex-direction: column; gap: 4px; width: 100%; min-height: 58px; padding: 10px 12px; text-align: left;
  border-radius: 14px; border: 2px dashed var(--line); background: var(--surface); transition: border-color .15s, background-color .15s;
}
.slot .sl { font-family: var(--mono); font-weight: 800; color: var(--primary); font-size: 15px; }
.slot.textlabel .sl { font-family: inherit; font-weight: 650; font-size: 14.5px; color: var(--text); }
.slot .sd { font-size: 14px; color: var(--muted); }
.slot.hover, .has-sel .slot:not(.filled):hover { border-color: var(--accent); background: var(--accent-soft); }
.has-sel .slot:not(.filled) { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.slot.filled { border-style: solid; border-color: var(--ok); background: var(--ok-soft); cursor: default; }
.slot.filled .sd { color: var(--text); font-weight: 600; }
.slot.filled .sd::before { content: "✓ "; color: var(--ok); font-weight: 800; }
.slot.auto { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.slot.auto .sd::before { content: "↺ "; color: var(--warn); }
.slot .nt { font-size: 12.5px; color: var(--muted); }
.bins { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bins.three { grid-template-columns: 1fr; }
.bin { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-height: 140px; padding: 10px; border-radius: 16px; border: 2px dashed var(--line); background: var(--surface); text-align: left; }
.bin .bh { font-weight: 750; font-size: 14.5px; display: flex; gap: 6px; align-items: center; }
.bin .bh .cnt { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bin.hover, .has-sel .bin:hover { border-color: var(--accent); background: var(--accent-soft); }
.has-sel .bin { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.bin .in { font-size: 13px; padding: 6px 8px; border-radius: 10px; background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.bin .in::before { content: "✓ "; color: var(--ok); font-weight: 800; }
.bin .in.auto { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.bin .in.auto::before { content: "↺ "; color: var(--warn); }
.bin .empty { border: 1.5px dashed var(--line); border-radius: 10px; height: 30px; }

/* Klaster */
.cluster-center { margin: 0 auto 6px; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; text-align: center; font-weight: 800; font-size: 18px;
  background: radial-gradient(circle, var(--accent-soft), var(--surface)); border: 3px solid var(--accent); color: var(--accent); box-shadow: var(--shadow); }
.cluster-lines { display: block; width: 100%; height: 34px; }
.bins.cluster { grid-template-columns: 1fr 1fr; }
.bins.cluster .bin:last-child { grid-column: 1 / -1; }

/* ---------- Feedback animatsiyalari ---------- */
@keyframes okflash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 70%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
.fx-ok { animation: okflash .6s ease-out; border-color: var(--ok) !important; }
.fx-bad { animation: shake .45s; border-color: var(--bad) !important; background-color: var(--bad-soft) !important; }
@media (prefers-reduced-motion: reduce) { .fx-ok, .fx-bad { animation: none; } * { transition-duration: .01ms !important; } }

.toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 900; width: min(560px, calc(100% - 24px));
  transform: translate(-50%, 140%); transition: transform .25s ease; padding: 12px 14px 12px 46px; border-radius: 16px;
  background: var(--surface); border: 1.5px solid var(--line); box-shadow: 0 12px 34px rgba(0,0,0,.2); font-size: 14.5px;
}
.toast.show { transform: translate(-50%, 0); }
.toast::before { position: absolute; left: 12px; top: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #fff; }
.toast.ok { border-color: var(--ok); } .toast.ok::before { content: "✓"; background: var(--ok); }
.toast.bad { border-color: var(--bad); } .toast.bad::before { content: "✗"; background: var(--bad); }
.toast.info { border-color: var(--primary); } .toast.info::before { content: "i"; background: var(--primary); }
.toast b { display: block; }

/* ---------- Savol (MCQ) ---------- */
.q-card { font-size: 18px; font-weight: 650; }
.opts { display: grid; gap: 10px; margin-top: 14px; }
.opt { display: flex; gap: 12px; align-items: center; width: 100%; min-height: 54px; padding: 10px 14px; text-align: left; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: 15.5px; transition: border-color .15s, background-color .15s, opacity .2s; }
.opt .k { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; background: var(--primary-soft); color: var(--primary); font-family: var(--mono); }
.opt:hover:not([disabled]) { border-color: var(--primary); }
.opt.sel { border-color: var(--primary); background: var(--primary-soft); }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); }
.opt.ok .k { background: var(--ok); color: #fff; }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); }
.opt.bad .k { background: var(--bad); color: #fff; }
.opt.gone { opacity: .25; pointer-events: none; }
.opt[disabled] { cursor: default; }
.opt .mark { margin-left: auto; font-weight: 900; font-size: 18px; }
.explain { margin-top: 14px; padding: 12px 14px; border-radius: 14px; border-left: 5px solid var(--primary); background: var(--surface-2); }
.explain.ok { border-color: var(--ok); }
.explain.bad { border-color: var(--bad); }
.explain h4 { margin: 0 0 4px; font-size: 15px; }
.timer-bar { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; margin-bottom: 12px; }
.timer-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--primary)); transform-origin: left; }
.qmeta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; gap: 8px; }

/* ---------- Ha / Yo'q ---------- */
.yn-wrap { position: relative; height: 250px; margin: 6px 0 14px; }
.yn-card { position: absolute; inset: 0; display: grid; place-items: center; padding: 22px; text-align: center; font-size: 19px; font-weight: 650;
  border-radius: 22px; background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow); touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform .25s, border-color .2s, background-color .2s; }
.yn-card.ok { border-color: var(--ok); background: var(--ok-soft); }
.yn-card.bad { border-color: var(--bad); background: var(--bad-soft); }
.yn-hint { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 650; }
.yn-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.yn-btns .no { border-color: var(--bad); color: var(--bad); }
.yn-btns .yes { border-color: var(--ok); color: var(--ok); }

/* ---------- Mikroskop ---------- */
.scope { position: relative; width: min(100%, 420px); margin: 0 auto 12px; aspect-ratio: 1; border-radius: 50%; padding: 10px; background: radial-gradient(circle, #2a3a40 60%, #0b1114 72%); box-shadow: inset 0 0 0 6px #111, var(--shadow); }
.scope svg { width: 100%; height: 100%; border-radius: 50%; display: block; }
.scope .obj { cursor: pointer; }
.scope .obj:focus { outline: none; }
.scope .obj:focus-visible .focusring { stroke: #ffcc00; stroke-width: 2; }
.scope-stats { display: flex; justify-content: space-around; text-align: center; margin-bottom: 10px; }
.scope-stats b { font-family: var(--mono); font-size: 22px; display: block; }

/* ---------- Epidemiya ---------- */
.epi-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.epi-top .stat b { font-size: 17px; }
.epi-grid { display: grid; gap: 4px; margin: 0 auto 10px; max-width: 460px; }
.cell { position: relative; aspect-ratio: 1; border-radius: 9px; border: 1.5px solid var(--line); background: var(--surface); font-size: 11px; padding: 2px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 1px; line-height: 1; overflow: hidden; }
.cell .d { position: absolute; bottom: 2px; right: 3px; font-family: var(--mono); font-weight: 800; font-size: 11px; }
.cell.sym { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--warn) 70%, transparent); }
.cell.det { background: color-mix(in srgb, var(--bad) 18%, var(--surface)); }
.cell.hosp { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.cell.reveal-1 { background: color-mix(in srgb, var(--bad) 25%, var(--surface)); }
.cell.reveal-2 { background: color-mix(in srgb, var(--bad) 50%, var(--surface)); }
.cell.reveal-3 { background: color-mix(in srgb, var(--bad) 80%, var(--surface)); }
.cell:active { transform: scale(.94); }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 650; text-align: center; line-height: 1.15; }
.act .ai { font-size: 22px; }
.act .ac { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.act.on { border-color: var(--accent); background: var(--accent-soft); }
.act[disabled] { opacity: .4; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin: 6px 0; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--mono); }
.chart .gridl { stroke: var(--line); stroke-width: 1; }
.log { font-size: 13px; color: var(--muted); min-height: 20px; }

/* ---------- Patogenez sahnasi ---------- */
.scene { width: 100%; max-width: 460px; display: block; margin: 0 auto 10px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.scene [data-from] { transition: opacity .6s, transform .8s; }
.scene text { fill: var(--text); font-size: 12px; font-weight: 600; }
@keyframes wig { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(2px, -2px) rotate(8deg); } }
.scene .wig { animation: wig 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.scene .pulse { animation: pulse 1.4s infinite; }
.phase-card { border-left: 5px solid var(--accent); }
.phase-card .tm { font-family: var(--mono); color: var(--accent); font-weight: 700; font-size: 14px; }
.choice-list { display: grid; gap: 8px; }
.gran svg { width: 220px; height: 220px; display: block; margin: 0 auto 8px; }
.gran circle { transition: fill .5s; }

/* ---------- Navbatchilik ---------- */
.risk { position: sticky; top: calc(62px + env(safe-area-inset-top)); z-index: 9; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; margin-bottom: 12px; box-shadow: var(--shadow); }
.risk .bar { height: 10px; border-radius: 10px; background: var(--line); overflow: hidden; margin-top: 4px; }
.risk .bar i { display: block; height: 100%; transition: width .5s, background-color .5s; }
.risk .lbl { display: flex; justify-content: space-between; font-size: 13px; font-weight: 650; }
.place { font-size: 13px; color: var(--muted); font-weight: 650; }
.opt.multi .k { border-radius: 6px; }
.opt.multi.sel .k { background: var(--primary); color: var(--primary-ink); }

/* ---------- Natija ---------- */
.result-hero { text-align: center; padding: 24px 16px; }
.result-hero .bigstars { font-size: 46px; letter-spacing: 6px; }
.result-hero .bigstars span { display: inline-block; color: var(--line); transition: color .3s, transform .3s; }
.result-hero .bigstars span.on { color: var(--star); transform: scale(1.12); }
.result-hero .pct { font-family: var(--mono); font-size: 44px; font-weight: 800; color: var(--primary); }
.learn { border: 2px solid var(--accent); background: linear-gradient(var(--accent-soft), var(--surface) 60%); }
.learn h3 { color: var(--accent); }
.learn ul { margin: 0; padding-left: 20px; }
.learn li { margin-bottom: 6px; }
.mist { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.mist:last-child { border-bottom: 0; }
.mist .q { font-weight: 650; margin-bottom: 4px; }
.mist .y { color: var(--bad); }
.mist .c { color: var(--ok); font-weight: 600; }
.mist .w { color: var(--muted); font-size: 13.5px; }

/* ---------- Final ---------- */
.ladder { display: flex; gap: 3px; margin-bottom: 10px; }
.ladder i { flex: 1; height: 10px; border-radius: 3px; background: var(--line); }
.ladder i.ok { background: var(--ok); }
.ladder i.bad { background: var(--bad); }
.ladder i.cur { background: var(--accent); }
.ladder i.safe { outline: 2px solid var(--star); outline-offset: 1px; }
.ring { position: relative; width: 52px; height: 52px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 16px; }
.lifelines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.lifelines .btn { min-height: 52px; font-size: 13px; flex-direction: column; gap: 0; padding: 6px; }
.lifelines .btn .li { font-size: 18px; }
.poll { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; height: 130px; margin-top: 10px; }
.poll div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-family: var(--mono); font-size: 12px; }
.poll i { display: block; width: 70%; background: var(--primary); border-radius: 6px 6px 0 0; transition: height .6s; }

/* ---------- Flash ---------- */
.flash-scene { perspective: 1200px; height: 280px; margin: 8px 0 14px; }
.flash-card { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; cursor: pointer; border: 0; background: none; padding: 0; }
.flash-card.flipped { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 22px; border-radius: 22px; background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow); text-align: center; font-size: 19px; font-weight: 650; }
.flash-face.back { transform: rotateY(180deg); border-color: var(--accent); font-size: 17px; font-weight: 550; }
.flash-face .ft { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.flash-face .big { font-family: var(--mono); font-size: 34px; color: var(--primary); font-weight: 800; }
.filter { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; }
.filter button { flex: none; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; }
.filter button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }

/* ---------- Sertifikat ---------- */
.cert-img { width: 100%; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); display: block; }

.foot-actions { display: grid; gap: 10px; margin-top: 16px; }
.foot-actions.two { grid-template-columns: 1fr 1fr; }
.sync { font-size: 12px; color: var(--muted); text-align: center; margin-top: 18px; }
.sync i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 5px; vertical-align: 1px; }
.sync.on i { background: var(--ok); }
.sync.off i { background: var(--warn); }

@media (min-width: 640px) {
  .bins.three { grid-template-columns: repeat(3, 1fr); }
  .bins.cluster { grid-template-columns: repeat(3, 1fr); }
  .bins.cluster .bin:last-child { grid-column: auto; }
  .tools { grid-template-columns: repeat(3, 1fr); }
  .actions { grid-template-columns: repeat(6, 1fr); }
}
