/* Tradecraft — Apple-style study app. System font, system colors, grouped lists, quiet motion. */
:root {
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-2: #F5F5F7;
  --elevated: #FFFFFF;
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.08);
  --sep: rgba(60, 60, 67, 0.14);
  --sep-strong: rgba(60, 60, 67, 0.24);
  --label: #1D1D1F;
  --label-2: #5C5C61;
  --label-3: #6E6E73;
  --blue: #0066CC;
  --blue-hover: #0071E3;
  --blue-soft: rgba(0, 102, 204, 0.1);
  --green: #34C759;
  --green-text: #1F7A35;
  --green-soft: rgba(52, 199, 89, 0.12);
  --red: #FF3B30;
  --red-text: #D70015;
  --red-soft: rgba(255, 59, 48, 0.1);
  --orange: #FF9500;
  --orange-text: #C93400;
  --purple: #AF52DE;
  --teal: #30B0C7;
  --yellow-soft: rgba(255, 204, 0, 0.16);
  --sidebar: rgba(236, 236, 241, 0.78);
  --tabbar: rgba(250, 250, 252, 0.82);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.02);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-3: 0 12px 40px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
  --ring-1: #0A84FF;
  --ring-2: #30D158;
  --ring-3: #FF9F0A;
  --lvl-g: #34C759;
  --lvl-a: #FFB400;
  --lvl-r: #FF3B30;
  --lvl-off: #D1D1D6;
  --chart: #1D1D1F;
  --chart-today: #0071E3;
  --r-card: 18px;
  --r-group: 14px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --surface: #1C1C1E; --surface-2: #2C2C2E; --elevated: #2C2C2E;
    --fill: rgba(118, 118, 128, 0.24); --fill-2: rgba(118, 118, 128, 0.16);
    --sep: rgba(84, 84, 88, 0.6); --sep-strong: rgba(120, 120, 128, 0.6);
    --label: #F5F5F7; --label-2: #A1A1A6; --label-3: #98989D;
    --blue: #0A84FF; --blue-hover: #409CFF; --blue-soft: rgba(10, 132, 255, 0.16);
    --green: #30D158; --green-text: #30D158; --green-soft: rgba(48, 209, 88, 0.16);
    --red: #FF453A; --red-text: #FF6961; --red-soft: rgba(255, 69, 58, 0.16);
    --orange: #FF9F0A; --orange-text: #FF9F0A; --purple: #BF5AF2; --teal: #40C8E0; --yellow-soft: rgba(255, 214, 10, 0.14);
    --sidebar: rgba(28, 28, 30, 0.78); --tabbar: rgba(22, 22, 24, 0.82);
    --shadow-1: none; --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.4); --shadow-3: 0 12px 40px rgba(0, 0, 0, 0.5);
    --lvl-off: #48484A; --chart: #F5F5F7; --chart-today: #0A84FF;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --surface: #1C1C1E; --surface-2: #2C2C2E; --elevated: #2C2C2E;
  --fill: rgba(118, 118, 128, 0.24); --fill-2: rgba(118, 118, 128, 0.16);
  --sep: rgba(84, 84, 88, 0.6); --sep-strong: rgba(120, 120, 128, 0.6);
  --label: #F5F5F7; --label-2: #A1A1A6; --label-3: #98989D;
  --blue: #0A84FF; --blue-hover: #409CFF; --blue-soft: rgba(10, 132, 255, 0.16);
  --green: #30D158; --green-text: #30D158; --green-soft: rgba(48, 209, 88, 0.16);
  --red: #FF453A; --red-text: #FF6961; --red-soft: rgba(255, 69, 58, 0.16);
  --orange: #FF9F0A; --orange-text: #FF9F0A; --purple: #BF5AF2; --teal: #40C8E0; --yellow-soft: rgba(255, 214, 10, 0.14);
  --sidebar: rgba(28, 28, 30, 0.78); --tabbar: rgba(22, 22, 24, 0.82);
  --shadow-1: none; --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.4); --shadow-3: 0 12px 40px rgba(0, 0, 0, 0.5);
  --lvl-off: #48484A; --chart: #F5F5F7; --chart-today: #0A84FF;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--label); font: 15px/1.47 var(--font); letter-spacing: -0.009em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
main:focus { outline: none; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.muted { color: var(--label-2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pos { color: var(--green-text); }
.neg { color: var(--red-text); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── shell ───────── */
.side {
  position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; display: flex; flex-direction: column; overflow-y: auto;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 12px 18px;
  background: var(--sidebar); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border-right: 0.5px solid var(--sep);
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 2px 10px 18px; font: 700 19px/1 var(--font-display); letter-spacing: -0.02em; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(145deg, #0A84FF, #5E5CE6); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(10, 132, 255, 0.35); }
.brand .mark svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav, .lvls { display: flex; flex-direction: column; gap: 1px; }
.nav a, .lvls a, .nav button, .lvls button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none;
  padding: 6px 10px; min-height: 32px; border-radius: 8px; font-size: 14px; color: var(--label); text-decoration: none;
  transition: background-color .15s var(--ease);
}
.nav a svg { color: var(--blue); }
.nav a:hover, .lvls a:hover { background: var(--fill-2); }
.nav a[aria-current="page"], .lvls a[aria-current="page"] { background: var(--fill); font-weight: 600; }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 600; color: #fff; background: var(--red-text); border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center; }
.nav .count.soft { background: var(--fill); color: var(--label-2); }
.nav .count + .count { margin-left: 4px; }
.nav .count:empty { display: none; }
.side-label { font-size: 12px; font-weight: 600; color: var(--label-3); padding: 20px 10px 6px; }
.lvls .n { width: 16px; font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; text-align: right; flex: none; }
.lvls .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.side-foot { margin-top: auto; padding: 18px 10px 0; font-size: 12px; color: var(--label-3); line-height: 1.45; }

.tabbar { display: none; }
main { margin-left: 260px; min-height: 100vh; padding-inline: 56px; padding-block: 44px 96px; }
.page { max-width: 880px; margin: 0 auto; }
.page.wide { max-width: 1120px; }
.view-in { animation: view-in .42s var(--ease-out) both; }
@keyframes view-in { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ───────── type & headers ───────── */
.hdr { margin-bottom: 28px; }
.hdr .kicker { font-size: 13px; font-weight: 600; color: var(--label-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.hdr h1 { font: 700 34px/1.12 var(--font-display); letter-spacing: -0.022em; }
.hdr .sub { font-size: 17px; line-height: 1.47; color: var(--label-2); margin-top: 8px; max-width: 62ch; }
h2.sec { font: 700 22px/1.25 var(--font-display); letter-spacing: -0.018em; margin: 40px 0 14px; }
.sec-row { display: flex; align-items: baseline; gap: 12px; margin: 40px 0 14px; }
.sec-row h2 { font: 700 22px/1.25 var(--font-display); letter-spacing: -0.018em; }
.sec-row .aside { margin-left: auto; font-size: 14px; color: var(--label-2); }
.crumbs { display: flex; gap: 4px; align-items: center; font-size: 14px; color: var(--label-2); margin-bottom: 16px; flex-wrap: wrap; }
.crumbs a { color: var(--blue); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs .sep { color: var(--label-3); }
.row-flex { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }

/* cards & grouped lists */
.card { background: var(--surface); border-radius: var(--r-card); padding: 22px 24px; box-shadow: var(--shadow-1); }
.card.flat { box-shadow: none; }
.card h3 { font: 600 17px/1.3 var(--font-display); letter-spacing: -0.012em; margin-bottom: 4px; }
.card p { color: var(--label-2); }
.group { background: var(--surface); border-radius: var(--r-group); box-shadow: var(--shadow-1); overflow: hidden; list-style: none; margin: 0; padding: 0; }
.group > li { position: relative; }
.group > li + li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep); }
.group.icons > li + li::before { left: 58px; }
.item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 16px; text-align: left; background: none; border: 0; color: var(--label); }
button.item, a.item { transition: background-color .15s var(--ease); }
button.item:hover { background: var(--fill-2); }
button.item:active { background: var(--fill); }
.ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; color: #fff; }
.ic svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic.blue { background: var(--blue); } .ic.green { background: var(--green); } .ic.orange { background: var(--orange); } .ic.purple { background: var(--purple); } .ic.red { background: var(--red); } .ic.teal { background: var(--teal); } .ic.gray { background: #8E8E93; } .ic.indigo { background: #5E5CE6; }
.item .main { flex: 1; min-width: 0; }
.item .title { font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item .desc { font-size: 13px; color: var(--label-2); margin-top: 1px; }
.item .end { display: flex; align-items: center; gap: 10px; color: var(--label-2); font-size: 14px; flex: none; }
.chev { width: 8px; height: 13px; stroke: var(--label-3); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 18px; border-radius: 980px; border: 0;
  background: var(--fill); color: var(--blue); font-size: 15px; font-weight: 500; white-space: nowrap; letter-spacing: -0.01em;
  transition: background-color .2s var(--ease), transform .12s var(--ease), opacity .2s;
}
.btn:hover { background: color-mix(in srgb, var(--fill) 100%, var(--label) 4%); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-hover); }
.btn.plain { background: none; padding: 0 6px; }
.btn.plain:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn.lg { height: 44px; padding: 0 24px; font-size: 16px; }
.btn.sm { height: 30px; padding: 0 14px; font-size: 13px; }
.btn.danger { background: var(--red); color: #fff; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.kbd { font: 500 11px/1 var(--font); border: 1px solid currentColor; border-radius: 5px; padding: 2px 5px; opacity: .6; }

/* segmented control */
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 7px; padding: 5px 12px; font-size: 13px; font-weight: 500; color: var(--label); transition: background-color .2s var(--ease), box-shadow .2s var(--ease); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--elevated); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04); font-weight: 600; }

/* approval dots and tags */
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--lvl-off); display: block; }
.dots.l1 i:nth-child(-n+1), .dots.l2 i:nth-child(-n+2) { background: var(--lvl-g); }
.dots.l3 i:nth-child(-n+3) { background: var(--lvl-a); }
.dots.l4 i { background: var(--lvl-r); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--green-soft); color: var(--green-text); }

/* progress: thin bars and activity-style rings */
.bar { height: 4px; background: var(--fill); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--blue); border-radius: inherit; transform-origin: left; animation: bar-in .9s var(--ease-out) both; }
@keyframes bar-in { from { transform: scaleX(0); } }
.rings { display: block; flex: none; }
.rings .track { fill: none; opacity: .16; }
.rings .arc { fill: none; stroke-linecap: round; animation: ring-in 1.2s var(--ease-out) both; }
.rings .r1 { stroke: var(--ring-1); } .rings .r2 { stroke: var(--ring-2); } .rings .r3 { stroke: var(--ring-3); }
.rings .arc.r2 { animation-delay: .08s; } .rings .arc.r3 { animation-delay: .16s; }
@keyframes ring-in { from { stroke-dashoffset: var(--c); } }
.ring-legend { display: flex; flex-direction: column; gap: 12px; }
.ring-legend div { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: baseline; }
.ring-legend i { width: 10px; height: 10px; border-radius: 50%; transform: translateY(1px); }
.ring-legend .k { font-size: 14px; color: var(--label-2); }
.ring-legend .v { font: 600 17px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ring-legend .v small { font-size: 13px; font-weight: 500; color: var(--label-3); }

/* ───────── overview ───────── */
.summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: center; }
.summary .big { font: 700 44px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.summary .big small { font-size: 22px; font-weight: 600; color: var(--label-2); letter-spacing: -0.01em; margin-left: 1px; }
.streak { display: flex; gap: 22px; margin-top: 18px; padding-top: 16px; border-top: 0.5px solid var(--sep); font-size: 13px; color: var(--label-2); flex-wrap: wrap; }
.streak b { display: block; font: 600 20px/1.2 var(--font-display); color: var(--label); font-variant-numeric: tabular-nums; }
.hero-cta { display: flex; align-items: center; gap: 24px; }
.hero-cta .t { font: 700 22px/1.2 var(--font-display); letter-spacing: -0.018em; }
.hero-cta p { margin-top: 6px; }

/* ───────── level page ───────── */
.level-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--sep-strong); display: grid; place-items: center; flex: none; }
.check svg { width: 12px; height: 12px; stroke: #fff; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.done .check { background: var(--green); border-color: var(--green); }
.done .check svg { opacity: 1; }
.strat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.strat-tile { background: var(--surface); border: 0; border-radius: 16px; padding: 12px 14px 14px; text-align: left; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-1); transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out); }
.strat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.strat-tile .n { font-weight: 600; font-size: 14px; line-height: 1.3; }
.strat-tile .b { font-size: 12.5px; color: var(--label-2); }
.terms { margin: 0; }
.terms > div { padding: 12px 16px; }
.terms dt { font-weight: 600; }
.terms dd { margin: 2px 0 0; color: var(--label-2); font-size: 14px; }

/* ───────── lesson reader & figures ───────── */
.reader { max-width: 720px; margin: 0 auto; }
.reader .kicker { font-size: 14px; font-weight: 600; color: var(--blue); margin-bottom: 8px; }
.reader h1 { font: 700 40px/1.1 var(--font-display); letter-spacing: -0.025em; }
.reader .sum { color: var(--label-2); font-size: 21px; line-height: 1.38; margin: 12px 0 36px; letter-spacing: -0.012em; }
.reader p { margin: 0 0 18px; font-size: 17px; line-height: 1.6; }
.reader h3 { font: 700 22px/1.25 var(--font-display); letter-spacing: -0.016em; margin: 40px 0 12px; }
.reader ul { margin: 0 0 20px; padding-left: 22px; font-size: 17px; line-height: 1.6; }
.reader li { margin-bottom: 8px; }
.reader li::marker { color: var(--label-3); }
.reader code, .explain code { font: .9em var(--mono); background: var(--fill-2); padding: 1px 5px; border-radius: 5px; }
.blk { margin: 0 0 22px; padding: 18px 20px; border-radius: 14px; font-size: 16px; line-height: 1.58; background: var(--surface); box-shadow: var(--shadow-1); }
.blk-label { display: block; font-size: 13px; font-weight: 600; color: var(--label-2); margin-bottom: 4px; }
.blk-say { background: none; box-shadow: none; border-left: 3px solid var(--blue); border-radius: 0; padding: 4px 0 4px 18px; font-size: 18px; line-height: 1.5; color: var(--label); }
.blk-say .blk-label { color: var(--blue); }
.blk-warn { background: var(--yellow-soft); box-shadow: none; }
.blk-warn .blk-label { color: var(--orange-text); }
.blk-formula { font: 500 16px/1.5 var(--mono); text-align: center; letter-spacing: 0; background: var(--fill-2); box-shadow: none; display: flex; flex-direction: column; gap: 6px; }
.blk-formula .formula-note { margin: 4px 0 0; font: 400 13px/1.45 var(--font); letter-spacing: 0; color: var(--label-2); }
.tbl-wrap { overflow-x: auto; margin: 0 0 22px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-1); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 15px; }
.tbl th { text-align: left; font-weight: 600; font-size: 13px; color: var(--label-2); padding: 12px 16px 10px; border-bottom: 0.5px solid var(--sep); }
.tbl td { padding: 11px 16px; vertical-align: top; }
.tbl tr + tr td { border-top: 0.5px solid var(--sep); }
.lesson-terms { margin: 32px 0 0; padding: 18px 20px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); font-size: 15px; line-height: 1.7; color: var(--label-2); }
.reader-foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 36px; padding-top: 24px; border-top: 0.5px solid var(--sep); }

.fig { margin: 30px -28px; padding: 22px 24px 18px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-2); }
.fig-controls { display: flex; gap: 12px 24px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.fig-body { position: relative; }
.fig-read { font-size: 15px; line-height: 1.5; color: var(--label); margin-top: 10px; min-height: 22px; }
.fig-read b { font-weight: 600; }
.fig figcaption { font-size: 14px; line-height: 1.5; color: var(--label-2); margin-top: 10px; padding-top: 12px; border-top: 0.5px solid var(--sep); }
.f-slider { display: grid; grid-template-columns: auto 160px auto; gap: 10px; align-items: center; font-size: 14px; color: var(--label-2); }
.f-slider output { font-weight: 600; color: var(--label); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 56px; }
input[type="range"] { width: 100%; accent-color: var(--blue); }
.f-svg { width: 100%; height: auto; display: block; overflow: visible; }
.f-grid { stroke: var(--sep); stroke-width: 0.5; }
.f-axis { stroke: var(--sep-strong); stroke-width: 1; }
.f-zero { stroke: var(--label-3); stroke-width: 1; }
.f-ref { stroke: var(--sep-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.f-strongref { stroke: var(--label-2); stroke-dasharray: none; }
.f-negref { stroke: var(--red); stroke-dasharray: 4 4; }
.f-gap { stroke: var(--orange); stroke-width: 2.5; stroke-linecap: round; }
.f-tick { fill: var(--label-3); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.f-lab { fill: var(--label-2); font: 600 11.5px var(--font); }
.f-note { fill: var(--label-2); font: 500 12px var(--font); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.f-negtxt { fill: var(--red-text); }
.f-key { font: 600 13px var(--font); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.f-big { fill: var(--label); font: 700 17px var(--font-display); paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.f-on { stroke: none; }
.f-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.f-thin { stroke-width: 1.6; }
.f-dash { stroke-dasharray: 6 5; stroke-width: 2; }
.f-c1 { stroke: var(--blue); color: var(--blue); fill: var(--blue); } .f-line.f-c1, .f-line.f-c2, .f-line.f-c3, .f-line.f-c4 { fill: none; }
.f-c2 { stroke: var(--orange); color: var(--orange); fill: var(--orange); }
.f-c3 { stroke: var(--green); color: var(--green); fill: var(--green); }
.f-c4 { stroke: var(--purple); color: var(--purple); fill: var(--purple); }
text.f-c1, text.f-c2, text.f-c3, text.f-c4 { stroke: var(--surface); }
.f-muted { stroke: var(--label-3); }
.f-ghost { stroke: var(--label-3); opacity: .35; }
.f-fill { stroke: none; opacity: .14; }
.f-fill.f-soft { opacity: .08; }
.f-pos { fill: var(--green); opacity: .16; stroke: none; }
.f-neg { fill: var(--red); opacity: .12; stroke: none; }
.f-pos.f-strong { opacity: .3; } .f-neg.f-strong { opacity: .28; }
.f-zone { fill: var(--fill-2); }
.f-dot { fill: var(--blue); stroke: var(--surface); stroke-width: 2; }
.f-dot-k { fill: var(--label); stroke: var(--surface); stroke-width: 2; }
.f-mutedot { fill: var(--label-3); }
.f-negdot { fill: var(--red); }
.f-c2dot { fill: var(--orange); } .f-c1dot { fill: var(--blue); } .f-c3dot { fill: var(--green); } .f-c4dot { fill: var(--purple); }
.f-x { fill: var(--red); font: 700 16px var(--font); }
.f-ask { fill: var(--red); opacity: .14; } .f-ask-fill { fill: var(--blue); opacity: .85; }
.f-bid { fill: var(--green); opacity: .2; }
.f-px { fill: var(--label); font: 600 13px var(--font); font-variant-numeric: tabular-nums; }
.f-sz { fill: var(--label-2); font: 12px var(--font); font-variant-numeric: tabular-nums; }
.f-bar1 { fill: var(--blue); } .f-bar2 { fill: var(--orange); } .f-bar3 { fill: var(--green); }
.f-bar-soft { fill: var(--blue); opacity: .2; }
.f-bar-pos { fill: var(--green); opacity: .75; } .f-bar-neg { fill: var(--red); opacity: .7; }
.f-card { fill: var(--surface-2); stroke: var(--sep); stroke-width: 0.5; }
.f-cardt { fill: var(--label); font: 600 14px var(--font); }
.f-row { fill: var(--label-2); font: 13px var(--font); }
.f-rowhi { fill: var(--blue); font: 600 13px var(--font); }
.f-arrow { fill: none; stroke: var(--blue); stroke-width: 1.8; }
.f-arrhead { fill: var(--blue); }
.f-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: f-draw 1.1s var(--ease-out) both; }
@keyframes f-draw { from { stroke-dashoffset: 1; } }
.f-legend { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 14px; }
.f-legend span { display: inline-flex; align-items: center; gap: 7px; }
.f-legend i { width: 14px; height: 3px; border-radius: 2px; background: currentColor; display: inline-block; }
.f-legend i.f-dashkey { background: none; border-top: 2px dashed currentColor; height: 0; }
.f-hover { display: block; margin-top: 4px; color: var(--label-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.f-hover b.f-c1 { color: var(--blue); } .f-hover b.f-c2 { color: var(--orange); } .f-hover b.f-c3 { color: var(--green); }
.f-cap2 { margin-top: 8px !important; font-size: 15px !important; color: var(--label) !important; }
.f-grid4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.f-mini-t { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.f-mini p { font-size: 13px !important; line-height: 1.45 !important; color: var(--label-2); margin: 4px 0 0 !important; }
.f-ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.f-ladder li { display: grid; grid-template-columns: 56px minmax(0, 1fr) 200px; gap: 16px; align-items: center; padding: 12px 4px; }
.f-ladder li + li { border-top: 0.5px solid var(--sep); }
.f-ladder b { display: block; font-size: 15px; }
.f-ladder span:not(.dots) { font-size: 13.5px; color: var(--label-2); }
.f-ladder em { font-style: normal; font-size: 13px; font-weight: 600; text-align: right; }
.f-ladder li:nth-child(1) em, .f-ladder li:nth-child(2) em { color: var(--green-text); }
.f-ladder li:nth-child(3) em { color: var(--orange-text); } .f-ladder li:nth-child(4) em { color: var(--red-text); }
.f-quote { display: flex; flex-direction: column; gap: 20px; }
.f-quote-line { display: flex; align-items: baseline; gap: 14px; justify-content: center; font: 700 44px/1 var(--font-display); letter-spacing: -0.025em; font-variant-numeric: tabular-nums; padding: 8px 0; }
.f-quote-line .b { color: var(--green-text); } .f-quote-line .a { color: var(--red-text); }
.f-quote-line .at { font-size: 22px; color: var(--label-3); font-weight: 600; }
.f-quote-line .sz { font-size: 22px; color: var(--label-2); font-weight: 600; margin-left: 10px; }
.f-quote-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.f-quote-grid div, .f-quote-acts div { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.f-quote-grid b, .f-quote-acts b { display: block; font-size: 14px; }
.f-quote-grid span, .f-quote-acts span { font-size: 13px; color: var(--label-2); }
.f-quote-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f-quote-acts .sell b { color: var(--green-text); } .f-quote-acts .buy b { color: var(--red-text); }
.f-stack { display: flex; height: 38px; border-radius: 10px; overflow: hidden; margin-top: 14px; font-size: 12.5px; }
.f-stack span { display: flex; align-items: center; padding: 0 12px; white-space: nowrap; overflow: hidden; transition: width .5s var(--ease-out); }
.f-stack span:first-child { background: var(--blue); color: #fff; }
.f-stack span:last-child { background: var(--blue-soft); color: var(--blue); }
.f-empty { padding: 60px 20px; text-align: center; color: var(--label-2); font-size: 16px; }

/* ───────── strategy page ───────── */
.strat-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.chart-card { background: var(--surface); border-radius: var(--r-card); padding: 18px 18px 14px; box-shadow: var(--shadow-1); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--label-2); margin: 0 4px 10px; align-items: center; }
.chart-legend .sw { display: inline-block; width: 16px; border-top: 2.5px solid var(--chart); vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.chart-legend .sw.today { border-top: 2px dashed var(--chart-today); }
.chart-readout { margin-left: auto; color: var(--label); font-variant-numeric: tabular-nums; }
.sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 14px 4px 2px; border-top: 0.5px solid var(--sep); margin-top: 10px; }
.slider label { display: flex; justify-content: space-between; font-size: 13px; color: var(--label-2); margin-bottom: 6px; }
.slider label b { color: var(--label); font-weight: 600; font-variant-numeric: tabular-nums; }
.facts { margin: 0; }
.facts > div { padding: 12px 16px; }
.facts dt { font-size: 13px; color: var(--label-2); }
.facts dd { margin: 2px 0 0; font: 600 19px/1.3 var(--font-display); letter-spacing: -0.012em; font-variant-numeric: tabular-nums; }
.facts dd .f { display: block; font: 13px/1.4 var(--font); color: var(--label-2); margin-top: 2px; letter-spacing: -0.005em; }
.facts dd.text { font: 600 15px/1.4 var(--font); }
.prose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 32px; margin-top: 32px; }
.prose h3 { font: 600 15px/1.3 var(--font); margin-bottom: 4px; }
.prose p { font-size: 15px; color: var(--label-2); line-height: 1.55; }
.quote { border-left: 3px solid var(--blue); padding: 2px 0 2px 14px; font-style: italic; color: var(--label) !important; }
.legs { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.legs td { padding: 11px 16px; }
.legs tr + tr td { border-top: 0.5px solid var(--sep); }
.legs td:last-child { text-align: right; }
.greeks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-radius: var(--r-group); box-shadow: var(--shadow-1); }
.greeks > div { padding: 12px 8px; text-align: center; }
.greeks > div + div { border-left: 0.5px solid var(--sep); }
.greeks .g { font-size: 12px; color: var(--label-2); }
.greeks .n { font: 600 17px/1.3 var(--font-display); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* payoff chart (app) */
.pchart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.pchart .ax { stroke: var(--sep-strong); stroke-width: 1; }
.pchart .gridl { stroke: var(--sep); stroke-width: 0.5; }
.pchart .zero { stroke: var(--label-3); stroke-width: 1; }
.pchart .lbl, .pchart .lbl-strong { font: 11px var(--font); font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.pchart .lbl { fill: var(--label-3); }
.pchart .lbl-strong { fill: var(--label); font-weight: 600; }
.pchart .curve { fill: none; stroke: var(--chart); stroke-width: 2.25; stroke-linejoin: round; }
.pchart .curve.draw { stroke-dasharray: 1; animation: f-draw 1s var(--ease-out) both; }
.pchart .today { fill: none; stroke: var(--chart-today); stroke-width: 1.75; stroke-dasharray: 5 4; }
.pchart .gain { fill: var(--green); opacity: .14; }
.pchart .loss { fill: var(--red); opacity: .1; }
.pchart .spot { stroke: var(--sep-strong); stroke-width: 1; stroke-dasharray: 2 3; }
.pchart .be { fill: var(--surface); stroke: var(--label); stroke-width: 1.5; }
.pchart .hover-line { stroke: var(--label); stroke-width: 1; opacity: .3; }
.pchart .hover-dot { fill: var(--chart); stroke: var(--surface); stroke-width: 2; }
.pchart .hover-dot.t { fill: var(--chart-today); }
.mini .curve { stroke-width: 1.8; }

/* charts on flashcards / progress pages */
.forecast { display: flex; align-items: flex-end; gap: 6px; height: 110px; }
.forecast div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.forecast span.b { width: 100%; border-radius: 5px 5px 2px 2px; background: var(--blue); min-height: 3px; transform-origin: bottom; animation: col-in .8s var(--ease-out) both; }
.forecast span.b.z { background: var(--fill); }
.forecast em { font-style: normal; font-size: 11px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.forecast strong { font-size: 11px; font-weight: 600; color: var(--label-2); font-variant-numeric: tabular-nums; }
@keyframes col-in { from { transform: scaleY(0); } }
.stages { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--fill); }
.stages span { display: block; height: 100%; transform-origin: left; animation: bar-in 1s var(--ease-out) both; }
.st-learn { background: var(--orange); } .st-young { background: var(--teal); } .st-known { background: var(--green); }
.stage-key { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--label-2); margin-top: 10px; }
.stage-key i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

/* ───────── flashcards ───────── */
.study { max-width: 680px; margin: 0 auto; }
.study-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; font-size: 13px; color: var(--label-2); }
.study-top .bar { flex: 1; min-width: 100px; }
.fc { background: var(--surface); border-radius: 22px; padding: 30px 32px; min-height: 260px; display: flex; flex-direction: column; box-shadow: var(--shadow-3); }
.fc-meta { font-size: 13px; color: var(--label-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fc-front { font: 700 30px/1.15 var(--font-display); letter-spacing: -0.02em; margin: 30px 0 8px; text-wrap: balance; }
.fc-front.def { font: 400 20px/1.45 var(--font); letter-spacing: -0.012em; }
.fc-hint { color: var(--label-3); font-size: 15px; }
.fc-back { border-top: 0.5px solid var(--sep); margin-top: 24px; padding-top: 20px; animation: reveal .35s var(--ease-out) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } }
.fc-back .def { font-size: 18px; line-height: 1.55; }
.fc-back .ex { font-size: 15px; color: var(--label-2); margin-top: 12px; line-height: 1.5; }
.fc-back .ex b { font-weight: 600; margin-right: 5px; color: var(--label); }
.fc-back dl { margin: 14px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.fc-back dt { color: var(--label-2); }
.fc-back dd { margin: 0; }
.fc-actions { margin-top: auto; padding-top: 26px; }
.grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; animation: reveal .35s var(--ease-out) both; }
.grade { border: 0; background: var(--surface); border-radius: 14px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-weight: 600; font-size: 15px; box-shadow: var(--shadow-1); transition: transform .12s var(--ease), background-color .2s; }
.grade:hover { background: var(--fill-2); }
.grade:active { transform: scale(0.97); }
.grade small { font-size: 12px; font-weight: 500; color: var(--label-3); font-variant-numeric: tabular-nums; }
.grade.g0 { color: var(--red-text); } .grade.g1 { color: var(--orange-text); } .grade.g2 { color: var(--green-text); } .grade.g3 { color: var(--blue); }

/* ───────── quiz, drills, hot seat ───────── */
.qwrap { max-width: 720px; margin: 0 auto; }
.qhead { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.qhead .bar { flex: 1; }
.qhead .clock { font: 600 22px/1 var(--font-display); color: var(--label); min-width: 50px; text-align: right; font-variant-numeric: tabular-nums; }
.qhead .clock.low { color: var(--red-text); }
.qcard { background: var(--surface); border-radius: 22px; padding: 28px; box-shadow: var(--shadow-2); }
.context { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; font-size: 15px; line-height: 1.55; color: var(--label); white-space: pre-wrap; }
.qtext { font: 600 20px/1.35 var(--font-display); letter-spacing: -0.014em; margin: 0 0 18px; text-wrap: pretty; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) 22px; gap: 12px; align-items: center; text-align: left;
  border: 0; background: var(--surface-2); border-radius: 14px; padding: 13px 16px; font-size: 16px; line-height: 1.4;
  transition: background-color .2s var(--ease), transform .12s var(--ease), box-shadow .2s var(--ease);
}
.choice:hover:not([disabled]) { background: var(--fill); }
.choice:active:not([disabled]) { transform: scale(0.99); }
.choice .key { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--label-2); background: var(--surface); }
.choice .mk { width: 22px; height: 22px; }
.choice .mk svg { width: 22px; height: 22px; }
.choice[disabled] { cursor: default; }
.choice.correct { background: var(--green-soft); box-shadow: inset 0 0 0 1.5px var(--green); }
.choice.correct .key { background: var(--green-text); color: #fff; }
.choice.wrong { background: var(--red-soft); box-shadow: inset 0 0 0 1.5px var(--red); animation: shake .4s var(--ease); }
.choice.wrong .key { background: var(--red-text); color: #fff; }
.choice.dim { opacity: .5; }
.mk-ok circle { fill: var(--green); } .mk-ok path { stroke: #fff; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; animation: tick .35s .05s var(--ease-out) both; }
.mk-no circle { fill: var(--red); } .mk-no path { stroke: #fff; stroke-width: 2.4; fill: none; stroke-linecap: round; }
@keyframes tick { from { stroke-dashoffset: 20; } to { stroke-dashoffset: 0; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-5px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.numrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.numin { display: flex; align-items: center; background: var(--surface-2); border-radius: 12px; height: 46px; padding: 0 14px; gap: 6px; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s; }
.numin span { font-size: 16px; color: var(--label-2); }
.numin input { border: 0; background: transparent; height: 100%; padding: 0; font: 600 18px var(--font); width: 170px; outline: none; font-variant-numeric: tabular-nums; }
.numin:focus-within { box-shadow: inset 0 0 0 2px var(--blue); }
.numin.correct { background: var(--green-soft); box-shadow: inset 0 0 0 1.5px var(--green); }
.numin.wrong { background: var(--red-soft); box-shadow: inset 0 0 0 1.5px var(--red); animation: shake .4s var(--ease); }
.feedback { margin-top: 20px; padding-top: 18px; border-top: 0.5px solid var(--sep); animation: reveal .3s var(--ease-out) both; }
.verdict { font: 600 17px/1.3 var(--font-display); margin-bottom: 6px; }
.explain { font-size: 16px; line-height: 1.55; color: var(--label-2); margin: 0 0 18px; }
.qchart { margin: 0 0 18px; }
.hint { font-size: 13px; color: var(--label-3); margin-top: 14px; }
.result-top { display: flex; align-items: center; gap: 24px; margin-bottom: 8px; }
.result-top .score { font: 700 48px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.result-top .score small { font-size: 22px; color: var(--label-2); font-weight: 600; }
.miss { padding: 16px 18px; font-size: 15px; }
.miss .qq { font-weight: 600; margin-bottom: 4px; }
.miss .ctx { display: block; color: var(--label-2); font-weight: 400; margin-bottom: 2px; }
.miss .aa { color: var(--label-2); line-height: 1.5; }
.seats { display: flex; gap: 6px; align-items: center; }
.seat { width: 26px; height: 26px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--label-2); transition: background-color .3s, color .3s, transform .3s var(--ease-out); }
.seat.buzzed { background: var(--red-text); color: #fff; animation: buzz .45s var(--ease-out); }
@keyframes buzz { 0% { transform: scale(1.4); } 100% { transform: scale(1); } }

/* ───────── lab ───────── */
.lab { display: grid; grid-template-columns: minmax(340px, 410px) minmax(0, 1fr); gap: 20px; align-items: start; }
/* Guided view: advanced tools wait under "All tools". */
.lab.guided .adv, .lab.guided .vals-wrap { display: none; }
.lab-mode { margin-top: 14px; }
.guide { box-shadow: inset 0 0 0 1.5px var(--blue), var(--shadow-1); }
.guide-steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.guide-steps li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.guide-steps .gmark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--label-3); color: #fff; }
.guide-steps li.done .gmark { background: var(--green-text); color: var(--surface); box-shadow: none; }
.guide-steps li.done > span:last-child { color: var(--label-2); }
.guide-steps .btn { margin-left: 6px; vertical-align: baseline; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.leg-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; }
.leg-row + .leg-row { border-top: 0.5px solid var(--sep); }
.leg-row .x { margin-left: auto; }
select.sel { border: 0; background: var(--fill); border-radius: 8px; height: 30px; padding: 0 8px; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.leg-row select.sel { width: 72px; }
.qty { display: inline-flex; align-items: center; background: var(--fill); border-radius: 8px; overflow: hidden; }
.qty button { border: 0; background: none; width: 26px; height: 30px; color: var(--blue); font-size: 16px; }
.qty span { font-size: 13px; font-weight: 600; min-width: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.x { border: 0; background: none; color: var(--label-3); width: 28px; height: 28px; border-radius: 50%; font-size: 17px; line-height: 1; }
.x:hover { color: var(--red); background: var(--red-soft); }
.recog { padding: 14px 18px; border-radius: var(--r-group); background: var(--surface); box-shadow: var(--shadow-1); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.recog b { font-weight: 600; }

/* ───────── glossary ───────── */
.search { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.search-field { display: flex; align-items: center; gap: 8px; background: var(--fill); border-radius: 12px; height: 42px; padding: 0 12px; }
.search-field svg { width: 17px; height: 17px; stroke: var(--label-3); fill: none; stroke-width: 2; stroke-linecap: round; }
.search-field input { flex: 1; border: 0; background: none; font-size: 16px; outline: none; }
.gloss-sec h2 { font: 700 20px/1.25 var(--font-display); letter-spacing: -0.016em; margin: 34px 0 12px; display: flex; gap: 10px; align-items: baseline; }
.gloss-sec h2 .muted { font: 500 14px var(--font); margin-left: auto; }
.gloss { columns: 2; column-gap: 16px; }
.gloss-item { break-inside: avoid; padding: 13px 16px; background: var(--surface); border-radius: 14px; margin-bottom: 12px; box-shadow: var(--shadow-1); }
.gloss-item .t { font-weight: 600; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.gloss-item .t .lv { font-size: 12px; color: var(--label-3); font-weight: 500; }
.gloss-item .d { color: var(--label-2); font-size: 14px; margin-top: 3px; line-height: 1.45; }
.gloss-item .e { color: var(--label-3); font-size: 13px; margin-top: 4px; line-height: 1.45; }
.gloss-item mark { background: var(--yellow-soft); color: inherit; border-radius: 3px; }

/* ───────── progress ───────── */
.prog { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.prog th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--label-2); padding: 12px 16px 10px; }
.prog td { padding: 11px 16px; border-top: 0.5px solid var(--sep); }
.prog button { background: none; border: 0; padding: 0; text-align: left; display: inline-flex; align-items: center; gap: 10px; }
.prog button:hover { color: var(--blue); }
.activity { display: flex; align-items: flex-end; gap: 6px; height: 100px; }
.activity div { flex: 1; background: var(--blue); border-radius: 4px 4px 2px 2px; min-height: 3px; transform-origin: bottom; animation: col-in .8s var(--ease-out) both; }
.activity div.zero { background: var(--fill); }
.activity-x { display: flex; gap: 6px; font-size: 11px; color: var(--label-3); margin-top: 6px; font-variant-numeric: tabular-nums; }
.activity-x span { flex: 1; text-align: center; }
.explain-list { margin: 0; padding: 0 0 0 20px; color: var(--label-2); font-size: 15px; line-height: 1.6; }
.explain-list li { margin-bottom: 8px; }
.explain-list b { color: var(--label); font-weight: 600; }
.confirm { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; background: var(--red-soft); font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 12px); opacity: 0; pointer-events: none; background: var(--label); color: var(--surface); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 50; transition: opacity .25s var(--ease), transform .35s var(--ease-out); box-shadow: var(--shadow-3); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ───────── narrow screens ───────── */
@media (max-width: 1080px) {
  main { padding-inline: 32px; }
  .strat-top, .lab { grid-template-columns: minmax(0, 1fr); }
  .fig { margin-inline: 0; }
}
@media (max-width: 820px) {
  .side { display: none; }
  main { margin-left: 0; padding-inline: 16px; padding-block: calc(24px + env(safe-area-inset-top, 0px)) calc(100px + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--tabbar); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
    border-top: 0.5px solid var(--sep); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar a { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--label-3); padding: 4px 0; position: relative; text-decoration: none; min-height: 44px; justify-content: center; }
  .tabbar a svg { width: 24px; height: 24px; stroke-width: 1.8; }
  .tabbar a[aria-current="page"] { color: var(--blue); }
  .tabbar .count { position: absolute; top: 0; left: calc(50% + 6px); font-size: 11px; font-weight: 600; color: #fff; background: var(--red-text); border-radius: 999px; padding: 0 6px; line-height: 17px; }
  .tabbar .count:empty { display: none; }
  .hdr h1 { font-size: 30px; }
  .reader h1 { font-size: 32px; }
  .reader .sum { font-size: 19px; }
  .grid-2, .prose { grid-template-columns: minmax(0, 1fr); }
  .summary { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 20px; }
  .summary .ring-legend { width: 100%; }
  .level-top { grid-template-columns: minmax(0, 1fr); }
  .hero-cta { flex-direction: column; align-items: flex-start; }
  .sliders { grid-template-columns: 1fr; }
  .gloss { columns: 1; }
  .qcard, .fc { padding: 20px; }
  .fc-front { font-size: 26px; }
  .qtext { font-size: 18px; }
  .fig { padding: 16px 14px 14px; border-radius: 16px; }
  .f-slider { grid-template-columns: 1fr 64px; }
  .f-slider span { grid-column: 1 / -1; }
  .f-grid4 { grid-template-columns: minmax(0, 1fr); }
  .f-quote-grid { grid-template-columns: 1fr 1fr; }
  .f-quote-line { font-size: 34px; }
  .f-ladder li { grid-template-columns: 48px minmax(0, 1fr); }
  .f-ladder em { grid-column: 2; text-align: left; }
  .grades { gap: 6px; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}

/* refinements */
.terms > div + div, .facts > div + div { border-top: 0.5px solid var(--sep); }
.hero-cta > .ic { width: 52px; height: 52px; border-radius: 14px; }
.hero-cta > .ic svg { width: 28px; height: 28px; }
.hdr .kicker .ic { width: 22px; height: 22px; border-radius: 6px; }
.hdr .kicker .ic svg { width: 14px; height: 14px; }
.lvls .rings { margin-left: auto; }
.item .end svg.i { width: 17px; height: 17px; color: var(--label-3); }
.summary .details { margin-left: auto; }
.f-crossline { stroke: var(--label); stroke-width: 1; opacity: .25; }
.fig-body { touch-action: pan-y; }
/* On phones the 640-unit charts render at ~55% scale: enlarge chart text and strokes to stay legible. */
@media (max-width: 600px) {
  .f-tick, .f-sz { font-size: 18px; }
  .f-lab, .f-note, .f-row { font-size: 19px; }
  .f-key, .f-px, .f-cardt, .f-rowhi { font-size: 21px; }
  .f-big { font-size: 27px; }
  .f-line { stroke-width: 3.6; }
  .f-thin { stroke-width: 2.4; }
  .f-note, .f-key { stroke-width: 6px; }
}
@media (max-width: 1280px) { .lab { grid-template-columns: minmax(0, 1fr); } }

/* ═══════════ additions: navigation, accessibility, new components ═══════════ */
a { color: var(--blue); text-underline-offset: 3px; }
a.item, a.btn, a.strat-tile, .brand, .tb-btn, .side-search { text-decoration: none; }
a.item { color: var(--label); }
a.item:hover { background: var(--fill-2); }
a.item:active { background: var(--fill); }
.item.disabled { opacity: .5; }
.h2 { font: 700 24px/1.2 var(--font-display); letter-spacing: -0.02em; }
.h3 { font: 600 17px/1.3 var(--font-display); letter-spacing: -0.012em; margin-bottom: 6px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--blue); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; transition: top .2s; }
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }
.brand { color: var(--label); }
.side-search { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 7px 10px; border-radius: 9px; background: var(--fill); color: var(--label-2); font-size: 14px; }
.side-search:hover { background: color-mix(in srgb, var(--fill) 100%, var(--label) 5%); }
.side-search .kbd { margin-left: auto; }
.side-sub { font-size: 11.5px; color: var(--label-3); padding: 10px 10px 2px; }
.lvls .now { color: var(--blue); font-size: 9px; margin-left: 2px; }
.side-foot { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.side-foot .dot, .status-line .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; transform: translateY(-1px); display: inline-block; }
.side-foot.busy .dot, .status-line.busy .dot { background: var(--blue); animation: pulse 1.2s infinite; }
.side-foot.warn .dot, .status-line.warn .dot { background: var(--orange); }
.side-foot.bad .dot, .status-line.bad .dot { background: var(--red); }
.side-foot.bad, .status-line.bad { color: var(--red-text); }
.status-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
@keyframes pulse { 50% { opacity: .35; } }
.topbar { display: none; }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.partial { background: var(--yellow-soft); color: var(--orange-text); }
.tag.warn { background: var(--yellow-soft); color: var(--orange-text); }
.tag.plain { background: var(--fill); color: var(--label-2); }
.count-pill { background: var(--red-text); color: #fff; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; }
.note-line { margin: 12px 4px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.note-line svg.i { width: 16px; height: 16px; color: var(--label-3); }
.note-card { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.note-card p { color: var(--label-2); }
.note-card b { color: var(--label); font-weight: 600; }
.ring-card { display: flex; gap: 22px; align-items: center; }
.plainlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dots-list li { padding-left: 16px; position: relative; color: var(--label-2); }
.dots-list li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--label-3); }
details > summary { cursor: pointer; color: var(--blue); font-size: 14px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "›"; display: inline-block; margin-right: 6px; transition: transform .2s var(--ease); }
details[open] > summary::before { transform: rotate(90deg); }
.more-levels, .flag-group, .more-time { margin-top: 14px; }
.more-levels > summary, .flag-group > summary, .more-time > summary { padding: 6px 4px 10px; color: var(--label); }
.today-meter { margin: 0 0 12px; font-size: 14px; color: var(--label-2); }
.today-meter b { color: var(--label); }
.today-meter .bar { margin-top: 8px; height: 6px; }
.flag-group > summary b { font-weight: 600; }

/* overview */
.card.next { padding: 20px 22px; margin-bottom: 8px; }
.next-k { font-size: 12.5px; font-weight: 600; color: var(--blue); margin-bottom: 10px; }
.next-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.next-row > .ic { width: 46px; height: 46px; border-radius: 13px; }
.next-row > .ic svg { width: 24px; height: 24px; }
.next-main { flex: 1; min-width: 220px; }
.next-main h2 { font: 700 22px/1.2 var(--font-display); letter-spacing: -0.018em; }
.next-main p { color: var(--label-2); margin-top: 4px; }
.outcomes { margin: 8px 0 0; padding-left: 18px; color: var(--label-2); }
.outcomes li { margin: 2px 0; }

/* set-up */
.setup { display: flex; flex-direction: column; gap: 16px; }
.setup fieldset { border: 0; margin: 0; min-width: 0; }
.setup legend { padding: 0; margin-bottom: 12px; float: left; width: 100%; }
.setup legend + * { clear: both; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opt { display: block; position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; }
.opt > span { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s var(--ease), background-color .2s; height: 100%; }
.opt input:checked + span { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.opt input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; }
.opt b { font-weight: 600; }
.path-levels { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.path-levels i { font-style: normal; font-size: 11px; font-weight: 600; min-width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--surface); color: var(--label-2); }
.path-detail { margin-top: 12px; color: var(--label-2); max-width: 65ch; }
.path-detail .path-levels { margin-top: 8px; }
.path-detail .path-levels i { background: var(--surface-2); }
.seg.lg label { position: relative; }
.seg.lg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg.lg span { display: block; padding: 7px 16px; border-radius: 7px; font-size: 14px; font-weight: 500; }
.seg.lg input:checked + span { background: var(--elevated); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12); font-weight: 600; }
.seg.lg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); }
.prose-card h2 { margin-top: 18px; }
.prose-card h2:first-child { margin-top: 0; }
.prose-card p { color: var(--label-2); line-height: 1.55; }

/* lessons */
.reader .meta { margin: -24px 0 24px; }
.blk.note { background: var(--blue-soft); box-shadow: none; font-size: 15px; }
.blk.note .blk-label { color: var(--blue); }
.resume { margin: -8px 0 22px; }
.outcomes-box { margin: 0 0 30px; padding: 16px 20px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); }
.outcomes-box ul { margin: 4px 0 0; padding-left: 20px; font-size: 16px; line-height: 1.55; }
.outcomes-box li { margin: 4px 0; }
.check-block { margin-top: 36px; }
.check-block h2 { margin-bottom: 12px; }
.qcard.inline { box-shadow: var(--shadow-1); padding: 22px; }
.qcard.inline .qhead { margin-bottom: 12px; }
.check-done { padding: 18px 20px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 12px; }
.lesson-nav { max-width: 720px; margin: 28px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lesson-nav a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); text-decoration: none; color: var(--label); font-weight: 500; }
.lesson-nav a:hover { background: var(--fill-2); }
.lesson-nav .next { text-align: right; }
.term { font: inherit; color: inherit; background: none; border: 0; padding: 0; border-bottom: 1.5px dotted var(--label-3); cursor: help; border-radius: 0; }
.term:hover, .term[aria-expanded="true"] { border-bottom-color: var(--blue); color: var(--blue); }
.term-pop { position: absolute; z-index: 60; background: var(--elevated); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-3); font-size: 14.5px; line-height: 1.5; animation: reveal .2s var(--ease-out) both; }
.term-pop p { color: var(--label-2); margin: 4px 0 8px; }
.term-pop a { font-size: 13.5px; font-weight: 500; }
.fig-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fig-failed { box-shadow: none; background: var(--fill-2); color: var(--label-2); font-size: 14px; }

/* charts & facts */
.pchart .strike { stroke: var(--label-3); stroke-width: 1; stroke-dasharray: 2 4; opacity: .7; }
.pchart .lbl-k { font: 600 10.5px var(--font); fill: var(--label-2); font-variant-numeric: tabular-nums; }
.pchart .compare { fill: none; stroke: var(--orange); stroke-width: 2; stroke-dasharray: 1 0; opacity: .9; }
.chart-legend .sw.cmp { border-top: 2px solid var(--orange); }
.chart-card:focus-within { box-shadow: var(--shadow-2); }
.chart-card [role="group"]:focus-visible { outline-offset: 4px; }
.vals-wrap { margin-top: 10px; padding: 10px 4px 0; border-top: 0.5px solid var(--sep); }
.vals-wrap summary { font-size: 13px; }
table.vals { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.vals th { text-align: left; font-weight: 600; color: var(--label-2); font-size: 12px; padding: 6px 8px; }
.vals td { padding: 5px 8px; border-top: 0.5px solid var(--sep); }
.vals tr.now td { font-weight: 600; background: var(--fill-2); }
.facts .basis { display: block; font: 12.5px/1.4 var(--font); color: var(--label-3); margin-top: 2px; letter-spacing: 0; }
.facts .locked dd { color: var(--label); }
.greeks .u { font-size: 11px; color: var(--label-3); margin-top: 1px; }
.legs thead th { text-align: left; font-size: 12px; font-weight: 600; color: var(--label-2); padding: 10px 16px 6px; }
.legs thead th:last-child { text-align: right; }
.tbl-scroll { overflow-x: auto; }
h2.sec.small-sec { font-size: 17px; margin: 10px 0; }
h2.sec .muted.small { font-weight: 400; font-family: var(--font); letter-spacing: 0; }

/* flashcards */
.study-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.study-foot svg.i { width: 15px; height: 15px; }
.card-menu { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.fc-meta .tag { margin-left: 2px; }
.end-card { text-align: center; padding: 40px 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.end-card p { max-width: 52ch; }

/* questions */
.numrow { position: relative; }
.btn.sign { min-width: 44px; height: 46px; border-radius: 12px; font-size: 18px; padding: 0 12px; }
.numerr { flex-basis: 100%; color: var(--red-text); font-size: 13.5px; min-height: 0; }
.numerr:empty { display: none; }
.choice.multi .key.box { border-radius: 7px; }
.choice.on { background: var(--blue-soft); box-shadow: inset 0 0 0 1.5px var(--blue); }
.choice.on .key { background: var(--blue); color: #fff; }
.choice.missed { box-shadow: inset 0 0 0 1.5px var(--green); background: var(--surface-2); }
.whywrong { font-size: 15px; line-height: 1.5; color: var(--label); background: var(--yellow-soft); border-radius: 12px; padding: 10px 14px; margin: 6px 0 12px; }
.whywrong b { font-weight: 600; }
.summary-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 18px 0 4px; }
.summary-cols h3 { font: 600 14px var(--font); color: var(--label-2); margin-bottom: 6px; }
.summary-cols li { font-size: 15px; }
.sub-h { font: 600 15px var(--font-display); margin: 18px 0 8px; }
.group.misses > .miss + .miss { border-top: 0.5px solid var(--sep); }
.result-top h1.score { font: 700 48px/1 var(--font-display); letter-spacing: -0.03em; }
.item.nb .title { font-weight: 500; }
.item.nb .desc + .desc { margin-top: 3px; }

/* hot seat */
.seat { position: relative; }
.seat.asking { box-shadow: 0 0 0 2px var(--blue); }
.seat i { position: absolute; top: -5px; right: -5px; font-style: normal; font-size: 10px; background: var(--label); color: var(--surface); border-radius: 999px; padding: 0 4px; line-height: 14px; }
.asker { font-weight: 600; color: var(--label); }

/* lab */
.scen { padding: 16px 18px; }
.scen-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.scen-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--label-2); }
.scen-grid input, .num-in, .qty-in, .text-in { border: 0; background: var(--fill); border-radius: 8px; height: 32px; padding: 0 8px; font: 500 14px var(--font); color: var(--label); font-variant-numeric: tabular-nums; min-width: 0; }
.scen-grid input { height: 36px; font-size: 15px; }
.num-in { width: 76px; }
.num-in.sm { width: 60px; }
.qty-in { width: 40px; text-align: center; background: none; padding: 0; -moz-appearance: textfield; }
.qty-in::-webkit-inner-spin-button, .qty-in::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.text-in { flex: 1; min-width: 140px; height: 36px; }
.toggle { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 14px; cursor: pointer; }
.toggle input { accent-color: var(--blue); width: 16px; height: 16px; transform: translateY(2px); }
.toggle .muted { flex-basis: 100%; padding-left: 24px; }
.leg-f { display: inline-flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--label-3); }
.leg-lbl { font-size: 13px; color: var(--label-2); display: inline-flex; align-items: center; gap: 6px; }
.lab-mini { display: none; }
.compare-row { margin-top: -6px; }
.flat-list { box-shadow: none; background: var(--surface-2); }
.hints { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: var(--yellow-soft); color: var(--label); }
.ch-risk { margin-top: 14px; padding-top: 14px; border-top: 0.5px solid var(--sep); }
.ch-risk .qtext { font-size: 16px; }
.assumptions summary { color: var(--label); }
.assumptions ul { margin-top: 10px; }

/* glossary & search */
.gloss-item .links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.gloss-item .links .btn.plain { height: auto; padding: 0; font-size: 13px; }
.gloss-item .mentions { font-size: 13px; margin-top: 4px; }
.gloss-item .mentions a + a::before { content: ""; }

/* progress */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 16px 18px; }
.metric .k { font-size: 13px; color: var(--label-2); font-weight: 500; }
.metric .v { font: 700 30px/1.1 var(--font-display); letter-spacing: -0.02em; margin: 6px 0; font-variant-numeric: tabular-nums; }
.metric p { font-size: 12.5px; line-height: 1.45; }
.file-btn { position: relative; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; }
.text-area { width: 100%; margin: 8px 0; border: 0; border-radius: 10px; background: var(--fill); padding: 10px; font-size: 12px; color: var(--label); resize: vertical; }
.imp-prev { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.imp-prev .actions { margin-top: 8px; }
.prog a { display: inline-flex; align-items: center; gap: 10px; color: var(--label); text-decoration: none; }
.prog a:hover { color: var(--blue); }

/* errors and start-up */
.error-card { display: flex; flex-direction: column; gap: 10px; }
.error-card pre { white-space: pre-wrap; background: var(--fill-2); padding: 10px; border-radius: 8px; max-height: 240px; overflow: auto; }
.boot-fail, .boot-msg { max-width: 560px; margin: 80px auto; padding: 0 20px; font: 16px/1.5 var(--font); color: var(--label-2); }
.boot-fail h1 { font: 700 26px/1.2 var(--font-display); color: var(--label); margin-bottom: 8px; }
.boot-fail .btn { margin-top: 16px; }

/* touch targets */
@media (pointer: coarse) {
  .qty button { width: 40px; height: 40px; }
  .x { width: 40px; height: 40px; }
  .seg button { padding: 9px 14px; }
  .btn.sm { height: 36px; }
  select.sel, .num-in, .text-in { height: 40px; }
  .term { padding: 2px 0; }
}

@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .lab-right { order: -1; }
  .lab-mini { display: flex; gap: 12px; flex-wrap: wrap; padding: 0 16px 10px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .lab-mini:empty { display: none; }
}
@media (max-width: 820px) {
  .topbar { display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 25; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px 16px; background: var(--tabbar); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); border-bottom: 0.5px solid var(--sep); }
  .topbar .brand { padding: 0; font-size: 17px; }
  .topbar .brand .mark { width: 24px; height: 24px; border-radius: 7px; }
  .tb-btn { width: 44px; height: 44px; display: grid; place-items: center; color: var(--blue); border-radius: 10px; }
  main { padding-block: 20px calc(100px + env(safe-area-inset-bottom, 0px)); }
  .choice-grid { grid-template-columns: minmax(0, 1fr); }
  .scen-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ring-card { flex-direction: row; }
  .lesson-nav { grid-template-columns: 1fr; }
  .lesson-nav .next { text-align: left; }
  .next-row .btn.lg { width: 100%; }
  .card.next { padding: 18px; }
  .summary .rings { width: 120px; height: 120px; }
}
@media (max-width: 480px) {
  .metrics { grid-template-columns: minmax(0, 1fr); }
  .scen-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leg-row { gap: 6px; }
}
.ring-legend .k small { display: block; font-size: 11.5px; color: var(--label-3); line-height: 1.3; }
.ring-legend div { align-items: center; }
[tabindex="-1"]:focus { outline: none; }
mark { background: var(--yellow-soft); color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--orange) 45%, transparent); }
@media (max-width: 1180px) { .level-top { grid-template-columns: minmax(0, 1fr); } .level-top .ring-card { justify-self: start; } }
.next-row { align-items: flex-start; }
.next-row > .btn { align-self: center; }
@media (max-width: 820px) { .next-row > .ic { width: 38px; height: 38px; border-radius: 11px; } .next-main { min-width: 0; flex-basis: calc(100% - 60px); } }
.case-intro { margin-bottom: 14px; padding: 16px 20px; }
.case-intro summary { color: var(--label); }
.case-text { margin-top: 10px; font-size: 15.5px; line-height: 1.6; color: var(--label); }
.qhead > span { white-space: nowrap; }
@media (max-width: 480px) {
  .qhead { flex-wrap: wrap; gap: 8px 12px; }
  .seats { gap: 4px; }
  .seat { width: 24px; height: 24px; font-size: 10.5px; }
  .qhead .clock { font-size: 19px; min-width: 0; }
}
.hs-time { white-space: nowrap; display: inline-flex; align-items: baseline; gap: 4px; }
