/* ============================================================
   ai45.xyz — SAT study section (sat.html)
   Notes browser, practice sessions, mistake log, progress stats.
   Builds on site.css. Dark by default like the rest of the site;
   html[data-theme="light"] gives a paper-white reading mode. The
   dock, menu overlay and page hero keep their dark palette in both.
   Borrowed from Bluebook: circled A–D bubbles, yellow highlighter
   <mark>, Mark for Review flag, split passage/question panes.
   ============================================================ */

:root {
  --s-ok: #10A37F;
  --s-no: #D96570;
  --s-rule: #6C8FE8;
  --s-tip: #10A37F;
  --s-trap: #D96570;
  --s-key: #F9982F;
  --s-mark-bg: #F6D860;
  --s-mark-ink: #171C2D;
  --s-well: rgba(0, 0, 0, 0.22);
  --s-hover: rgba(255, 255, 255, 0.06);
  --s-bar: rgba(255, 255, 255, 0.08);
  --s-accent-ink: var(--sand);
}

html[data-theme="light"] {
  color-scheme: light;
  --navy: #F5F2EC;
  --card: #FFFFFF;
  --card-2: #FBF9F5;
  --paper: #1B2030;
  --muted: rgba(27, 32, 48, 0.74);
  --faint: rgba(27, 32, 48, 0.52);
  --hairline: rgba(20, 24, 40, 0.13);
  --sand: #9A5B17;
  --s-ok: #0B7F63;
  --s-no: #C0444F;
  --s-rule: #3E63C9;
  --s-tip: #0B7F63;
  --s-trap: #C0444F;
  --s-key: #B8620F;
  --s-well: rgba(20, 24, 40, 0.04);
  --s-hover: rgba(20, 24, 40, 0.05);
  --s-bar: rgba(20, 24, 40, 0.08);
}
html[data-theme="dark"] { color-scheme: dark; }

/* chrome that stays dark in both themes */
html[data-theme="light"] .dock,
html[data-theme="light"] .overlay,
html[data-theme="light"] .page-hero {
  --paper: #EAE6DF;
  --muted: rgba(234, 230, 223, 0.62);
  --faint: rgba(234, 230, 223, 0.38);
  --hairline: rgba(255, 255, 255, 0.08);
  --sand: #EAB56F;
}
html[data-theme="light"] .chip:hover { border-color: rgba(20, 24, 40, 0.3); }
html[data-theme="light"] .chip { background: #fff; }

/* ---------- compact hero ---------- */
.page-hero--compact { min-height: 0; }
.page-hero--compact .page-hero__frame { min-height: 0; padding: 104px 64px 48px; }
.page-hero--compact .search { margin-top: 28px; }

/* ---------- tabs ---------- */
.sat-bar {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.sat-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--hairline);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.sat-tabs::-webkit-scrollbar { display: none; }

.sat-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.sat-tab:hover { color: var(--paper); }
.sat-tab.is-on { background: var(--orange); color: #171C2D; }
.sat-tab__n {
  font-family: var(--font-mono);
  font-size: 10.5px;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--s-bar);
  text-align: center;
}
.sat-tab.is-on .sat-tab__n { background: rgba(23, 28, 45, 0.18); }

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.theme-btn:hover { color: var(--paper); border-color: var(--faint); }
.theme-btn svg { width: 14px; height: 14px; }

.sat-view { margin-top: 32px; min-height: 50vh; }
.sat-loading { padding: 80px 0; text-align: center; color: var(--faint); font-size: 14px; }

/* ---------- shared bits ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--hairline);
  color: var(--paper);
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover:not(:disabled) { border-color: var(--faint); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary { background: var(--orange); border-color: transparent; color: #171C2D; }
.btn--primary:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.07); border-color: transparent; }
.btn--sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn svg { width: 15px; height: 15px; }

.panel {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 24px;
}

.eyebrow { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sand); }
.h-title { margin-top: 8px; font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.lede { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--muted); max-width: 64ch; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  border: 1px dashed var(--hairline);
  border-radius: 18px;
}
.empty-state .btn { margin-top: 18px; }

.diff { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--hairline); color: var(--muted); }
.diff--E { color: var(--s-ok); border-color: color-mix(in srgb, var(--s-ok) 45%, transparent); }
.diff--M { color: var(--s-key); border-color: color-mix(in srgb, var(--s-key) 45%, transparent); }
.diff--H { color: var(--s-no); border-color: color-mix(in srgb, var(--s-no) 45%, transparent); }

mark, .note mark { background: var(--s-mark-bg); color: var(--s-mark-ink); padding: 0 0.15em; border-radius: 3px; }

/* ============================================================
   NOTES BROWSER
   ============================================================ */

.notes { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 40px; align-items: start; }

.tree {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 12px 18px 16px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  scrollbar-width: thin;
}
.tree__toggle { display: none; }
.tree__sec + .tree__sec { margin-top: 20px; }
.tree__sec-h { padding: 0 8px 8px; }
.tree__dom { margin-top: 10px; }
.tree__dom-h { display: block; padding: 6px 8px; font-size: 13.5px; font-weight: 600; color: var(--paper); border-radius: 8px; }
.tree a { transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.tree__link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 6px 18px;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--muted);
  border-radius: 8px;
}
.tree__link--top { padding-left: 8px; }
.tree__link:hover, .tree__dom-h:hover { background: var(--s-hover); color: var(--paper); }
.tree__link.is-on, .tree__dom-h.is-on { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--paper); }
.tree__n { flex: none; font-family: var(--font-mono); font-size: 10px; color: var(--faint); }

.note-wrap { min-width: 0; max-width: 780px; }
.crumb { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.crumb a { color: var(--sand); }
.note-head { margin-bottom: 8px; }
.note-head__title { margin-top: 10px; font-size: clamp(28px, 3.4vw, 38px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
.note-head__sum { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--muted); }
.note-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.note-pager { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.note-pager a { padding: 16px 18px; border: 1px solid var(--hairline); border-radius: 14px; background: var(--card); transition: border-color 0.2s var(--ease); }
.note-pager a:hover { border-color: var(--faint); }
.note-pager a:last-child { text-align: right; }
.note-pager span { display: block; margin-top: 4px; font-size: 14.5px; font-weight: 600; }

/* search results */
.results-h { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.result { display: block; padding: 18px 20px; border: 1px solid var(--hairline); border-radius: 14px; background: var(--card); transition: border-color 0.2s var(--ease); }
.result + .result { margin-top: 10px; }
.result:hover { border-color: var(--faint); }
.result__t { font-size: 16px; font-weight: 600; }
.result__p { margin-top: 6px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

/* ---------- note body content ---------- */
.note { font-size: 15.5px; line-height: 1.72; color: var(--muted); }
.note > :first-child { margin-top: 0; }
.note h3 { margin-top: 44px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; color: var(--paper); text-wrap: balance; }
.note h4 { margin-top: 28px; font-size: 16.5px; font-weight: 600; color: var(--paper); }
.note p { margin-top: 12px; }
.note b, .note strong { color: var(--paper); font-weight: 600; }
.note ul, .note ol { margin-top: 12px; padding-left: 1.4em; }
.note li { margin-top: 6px; }
.note li::marker { color: var(--faint); }
.note code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: var(--s-well);
  border: 1px solid var(--hairline);
  color: var(--paper);
  overflow-wrap: anywhere;
}
.note sup, .note sub { line-height: 0; }

/* numbered method */
.note ol.steps { list-style: none; padding-left: 0; counter-reset: step; }
.note ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 2px 0 2px 44px;
  margin-top: 14px;
}
.note ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #171C2D;
  background: var(--sand);
}
html[data-theme="light"] .note ol.steps > li::before { color: #fff; }

/* callout boxes */
.note .box {
  --box-c: var(--s-key);
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--box-c) 32%, transparent);
  border-left: 3px solid var(--box-c);
  background: color-mix(in srgb, var(--box-c) 8%, transparent);
}
.note .box.rule { --box-c: var(--s-rule); }
.note .box.tip  { --box-c: var(--s-tip); }
.note .box.trap { --box-c: var(--s-trap); }
.note .box.key  { --box-c: var(--s-key); }
.note .box > :first-child { margin-top: 0; }
.note .box-t,
.note .box:not(:has(> .box-t))::before {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--box-c);
}
.note .box.rule:not(:has(> .box-t))::before { content: "Rule"; }
.note .box.tip:not(:has(> .box-t))::before { content: "Tip"; }
.note .box.trap:not(:has(> .box-t))::before { content: "Trap"; }
.note .box.key:not(:has(> .box-t))::before { content: "Key point"; }

/* tables (notes and question figures) */
.tbl-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--hairline); border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.tbl caption { caption-side: top; text-align: left; padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--paper); border-bottom: 1px solid var(--hairline); }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hairline); }
.tbl th { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sand); background: var(--s-well); white-space: nowrap; }
.tbl td { color: var(--muted); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl td:first-child { color: var(--paper); }

/* sentence demos */
.note .demo {
  position: relative;
  margin-top: 8px;
  padding: 10px 14px 10px 42px;
  border-radius: 10px;
  background: var(--s-well);
  color: var(--paper);
}
.note .demo::before {
  position: absolute;
  left: 12px;
  top: 10px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}
.note .demo.ok::before { content: "✓"; background: var(--s-ok); }
.note .demo.no::before { content: "✗"; background: var(--s-no); }
.note .demo.no { color: var(--muted); }

/* worked examples */
.note .ex {
  margin-top: 22px;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: var(--card);
}
.note .ex-h { margin-top: 0; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sand); }
.note .ex-passage {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--s-well);
  border-left: 2px solid var(--hairline);
  color: var(--paper);
  font-size: 15px;
  line-height: 1.7;
}
.note .ex-passage ul { margin-top: 8px; }
.note .ex-stem { margin-top: 14px; color: var(--paper); font-weight: 500; }
.note ol.ex-choices { list-style: none; padding-left: 0; counter-reset: choice; margin-top: 10px; }
.note ol.ex-choices > li {
  counter-increment: choice;
  position: relative;
  margin-top: 8px;
  padding: 10px 14px 10px 48px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  color: var(--paper);
}
.note ol.ex-choices > li::before {
  content: counter(choice, upper-alpha);
  position: absolute;
  left: 12px;
  top: 9px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1.5px solid var(--faint);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--paper);
}

/* details / summary (answer reveals) */
.note details { margin-top: 14px; }
.note details > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--sand);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--sand) 40%, transparent);
  transition: background-color 0.2s var(--ease);
}
.note details > summary::-webkit-details-marker { display: none; }
.note details > summary::before { content: "+"; font-size: 15px; line-height: 1; transition: transform 0.25s var(--ease); }
.note details[open] > summary::before { transform: rotate(45deg); }
.note details > summary:hover { background: color-mix(in srgb, var(--sand) 12%, transparent); }
.note details > :not(summary) { margin-top: 12px; }

mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; max-width: 100%; padding: 2px 0; }

/* ============================================================
   QUESTION BANK — section cards and topic page
   ============================================================ */

.resume-bar { display: block; margin-top: 20px; padding: 12px 18px; border-radius: 12px; background: color-mix(in srgb, var(--orange) 14%, transparent); border: 1px solid color-mix(in srgb, var(--orange) 45%, transparent); font-size: 14px; color: var(--paper); }
.resume-bar b { color: var(--orange); }

.qb-sections { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.qb-sec { display: block; padding: 24px; border-radius: 18px; background: var(--card); border: 1px solid var(--hairline); transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.qb-sec:hover { border-color: var(--faint); transform: translateY(-2px); }
.qb-sec__name { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.qb-sec__meta { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.qb-sec .bar { margin-top: 18px; }
.qb-sec__foot { margin-top: 10px; display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; color: var(--faint); }

.qb-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.qb-back:hover { color: var(--paper); }
.qb-head { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.qb-title { font-size: clamp(28px, 3.6vw, 40px); font-weight: 600; letter-spacing: -0.02em; }

.qb-chips { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.qb-chip { position: relative; }
.qb-chip__btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; background: var(--s-well); border: 1px solid var(--hairline); font-size: 14px; font-weight: 600; color: var(--paper); transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease); }
.qb-chip__btn:hover { border-color: var(--faint); }
.qb-chip.is-on .qb-chip__btn { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 12%, transparent); }
.qb-chip__caret { font-size: 14px; line-height: 0; transform: translateY(-2px); opacity: 0.7; }
.qb-menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; min-width: 220px; padding: 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--hairline); box-shadow: 0 18px 48px rgba(0,0,0,.28); }
.qb-chip.is-open .qb-menu { display: block; }
.qb-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 14px; cursor: pointer; color: var(--paper); }
.qb-opt:hover { background: var(--s-hover); }
.qb-opt input { width: 16px; height: 16px; accent-color: var(--orange); margin: 0; }
.qb-opt__n { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.qb-clear { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 8px 10px; }
.qb-clear:hover { color: var(--paper); }

.qb-all { margin-top: 22px; padding: 22px 24px; border-radius: 16px; border: 1px solid var(--hairline); background: var(--card); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.qb-all__t { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.qb-all__s { margin-top: 6px; font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.qb-all__acts { display: flex; gap: 10px; flex: none; }

.qb-cols { margin-top: 36px; display: grid; grid-template-columns: minmax(0, 1fr) 260px 110px; gap: 16px; padding: 0 0 12px; border-bottom: 1px solid var(--hairline); font-size: 14px; color: var(--muted); }
.qb-cols span:not(:first-child) { text-align: right; }
.qb-dom { padding: 26px 0 14px; border-bottom: 1px solid var(--hairline); }
.qb-dom__h { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
.qb-row { display: grid; grid-template-columns: minmax(0, 1fr) 260px 110px; gap: 16px; align-items: center; padding: 12px 0; }
.qb-row--empty { opacity: 0.45; }
.qb-check { display: inline-flex; }
.qb-check input { width: 22px; height: 22px; border-radius: 999px; accent-color: var(--orange); margin: 0; cursor: pointer; }
.qb-row__name { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.qb-row { grid-template-columns: 34px minmax(0, 1fr) 260px 110px; }
.qb-cols { grid-template-columns: 34px minmax(0, 1fr) 260px 110px; }
.qb-cols span:first-child { grid-column: 1 / 3; }
.qb-row__btn { font-size: 16.5px; font-weight: 500; color: var(--paper); text-align: left; padding: 4px 0; border-radius: 6px; }
.qb-row__btn:hover:not(:disabled) { color: var(--orange); }
.qb-row__btn:disabled { cursor: default; color: var(--muted); }
.qb-weak { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--s-no); background: color-mix(in srgb, var(--s-no) 14%, transparent); }
.qb-weak::before { content: "⚠"; font-size: 11px; }
.qb-row__note { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); opacity: 0; transition: opacity 0.2s var(--ease); }
.qb-row:hover .qb-row__note { opacity: 1; }
.qb-row__note:hover { color: var(--sand); }
.qb-row__prog { display: flex; align-items: center; gap: 14px; }
.qb-row__prog .bar { flex: 1; }
.bar__fill--blue { background: #2F9BFF; }
.qb-row__n { font-family: var(--font-mono); font-size: 13px; color: var(--muted); min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.qb-row__acc { display: flex; align-items: center; justify-content: flex-end; gap: 7px; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.qb-row__acc small { font-size: 12px; color: var(--muted); margin-left: 1px; }
.qb-row__acc i { width: 9px; height: 9px; border-radius: 999px; background: var(--faint); }
.qb-row__acc.ok i { background: var(--s-ok); } .qb-row__acc.fair i { background: #9BD03A; } .qb-row__acc.warn i { background: var(--s-key); } .qb-row__acc.bad i { background: var(--s-no); }

/* ============================================================
   BLUEBOOK VIEW — full-screen question overlay
   ============================================================ */

body.bb-open { overflow: hidden; }
.bb { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; background: var(--navy); color: var(--paper); }
.bb-serif { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; }

.bb-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--hairline); background: var(--card); flex: none; }
.bb-top__l, .bb-top__r { display: flex; align-items: center; gap: 6px; position: relative; }
.bb-top__r { justify-content: flex-end; }
.bb-top__c { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bb-link { font-size: 14.5px; font-weight: 500; color: var(--muted); padding: 8px 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; }
.bb-link:hover { color: var(--paper); background: var(--s-hover); }
.bb-timer { font-family: var(--font-mono); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.bb-timer.is-hidden { visibility: hidden; }
.bb-timer__acts { display: flex; gap: 6px; }
.bb-mini { width: 30px; height: 24px; border-radius: 999px; border: 1px solid var(--hairline); font-size: 10px; color: var(--muted); display: grid; place-items: center; }
.bb-mini--txt { width: auto; padding: 0 10px; font-size: 12px; }
.bb-mini:hover { color: var(--paper); border-color: var(--faint); }

.bb-tool { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid transparent; transition: all 0.15s var(--ease); white-space: nowrap; }
.bb-tool svg { width: 16px; height: 16px; }
.bb-tool:hover { color: var(--paper); background: var(--s-hover); }
.bb-tool.is-on { color: var(--paper); border-color: var(--paper); }
.bb-tool--hl.is-on { color: #0B5FA8; background: #CFEBFF; border-color: transparent; }
.bb-tool--flag.is-on { color: #171C2D; background: var(--sand); border-color: transparent; }
html[data-theme="light"] .bb-tool--flag.is-on { color: #fff; }
.bb-tool--abc span { font-family: var(--font-mono); letter-spacing: 0.04em; text-decoration: line-through; text-decoration-thickness: 1.5px; }

.bb-pop { position: absolute; top: calc(100% + 8px); z-index: 10; min-width: 240px; max-width: min(560px, 92vw); padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--hairline); box-shadow: 0 18px 48px rgba(0,0,0,.3); font-size: 14px; line-height: 1.6; color: var(--muted); }
.bb-pop--dirs { left: 0; }
.bb-pop--dirs p { margin-bottom: 12px; }
.bb-pop--more { right: 0; display: flex; flex-direction: column; gap: 4px; padding: 8px; }
.bb-pop--more button { text-align: left; padding: 10px 12px; border-radius: 9px; font-size: 14px; color: var(--paper); }
.bb-pop--more button:hover { background: var(--s-hover); }

.bb-body { flex: 1; min-height: 0; display: flex; }
.bb-body--split .bb-pane { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 36px 48px 48px; }
.bb-divider { width: 1px; background: var(--hairline); flex: none; }
.bb-body--single .bb-pane { flex: 1; overflow-y: auto; padding: 36px 48px 48px; }
.bb-body--single .bb-pane > * { max-width: 820px; margin-left: auto; margin-right: auto; }

.bb-passage { font-size: 19px; line-height: 1.6; color: var(--paper); }
.bb-passage p + p, .bb-passage ul, .bb-passage ol { margin-top: 14px; }
.bb-passage li { margin-top: 6px; margin-left: 1.2em; }
.bb-figure { margin-top: 20px; }
.bb-figure:first-child { margin-top: 0; }
.bb-figure svg, .bb-figure img { max-width: 100%; height: auto; }
.bb-passage .tbl-wrap, .bb-stem .tbl-wrap { margin-top: 0; }

.bb-qhead { display: flex; align-items: center; gap: 12px; padding: 0 10px 0 0; background: var(--s-well); border-radius: 10px; margin-bottom: 20px; }
.bb-num { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 10px 0 0 10px; background: var(--paper); color: var(--navy); font-weight: 700; font-size: 18px; }
.bb-qhead__sp { flex: 1; }
.bb-stem { font-size: 19px; line-height: 1.55; color: var(--paper); }
.bb-choices { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.bb-choice { display: flex; align-items: center; gap: 12px; }
.bb-choice__btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; text-align: left; padding: 13px 18px; border-radius: 10px; border: 1.5px solid var(--paper); background: var(--card); font-size: 19px; line-height: 1.45; color: var(--paper); transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.bb-choice__btn:hover:not(:disabled) { background: var(--s-hover); }
.bb-choice__btn:disabled { cursor: default; }
.bb-bubble { flex: none; width: 32px; height: 32px; border-radius: 999px; border: 1.5px solid var(--paper); display: grid; place-items: center; font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.bb-choice__txt { min-width: 0; overflow-wrap: anywhere; }
.bb-choice.is-picked .bb-choice__btn { border-color: #2F6FE4; box-shadow: inset 0 0 0 1.5px #2F6FE4; background: color-mix(in srgb, #2F6FE4 8%, var(--card)); }
.bb-choice.is-picked .bb-bubble { background: #2F6FE4; border-color: #2F6FE4; color: #fff; }
.bb-choice.is-struck .bb-choice__btn { opacity: 0.45; }
.bb-choice.is-struck .bb-choice__txt { text-decoration: line-through; text-decoration-thickness: 2px; }
.bb-choice.is-right .bb-choice__btn { border-color: var(--s-ok); box-shadow: inset 0 0 0 1.5px var(--s-ok); background: color-mix(in srgb, var(--s-ok) 12%, var(--card)); }
.bb-choice.is-right .bb-bubble { background: var(--s-ok); border-color: var(--s-ok); color: #fff; }
.bb-choice.is-wrong .bb-choice__btn { border-color: var(--s-no); box-shadow: inset 0 0 0 1.5px var(--s-no); background: color-mix(in srgb, var(--s-no) 12%, var(--card)); }
.bb-choice.is-wrong .bb-bubble { background: var(--s-no); border-color: var(--s-no); color: #fff; }
.bb-strike { display: none; flex: none; width: 36px; height: 36px; place-items: center; color: var(--paper); }
.bb-strike span { position: relative; width: 28px; height: 28px; border-radius: 999px; border: 1.5px solid currentColor; display: grid; place-items: center; font-family: var(--font-display); font-size: 13px; font-weight: 600; }
.bb-strike span::after { content: ""; position: absolute; left: -5px; right: -5px; top: 50%; height: 1.5px; background: currentColor; }
.bb-choices.is-elim .bb-strike { display: grid; }
.bb-choices.is-done .bb-strike { display: none; }
.bb-choice.is-struck .bb-strike { color: var(--muted); }

.bb-spr { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.bb-spr input { height: 54px; padding: 0 18px; border-radius: 10px; background: var(--card); border: 1.5px solid var(--paper); outline: none; font-family: var(--font-mono); font-size: 20px; color: var(--paper); }
.bb-spr input:focus { border-color: #2F6FE4; box-shadow: inset 0 0 0 1.5px #2F6FE4; }
.bb-spr input.is-right { border-color: var(--s-ok); } .bb-spr input.is-wrong { border-color: var(--s-no); }
.bb-spr__hint { font-size: 12.5px; line-height: 1.5; color: var(--faint); }

.bb-verdict { margin-top: 22px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: 10px; font-size: 15px; }
.bb-verdict.ok { background: color-mix(in srgb, var(--s-ok) 14%, transparent); color: var(--s-ok); }
.bb-verdict.no { background: color-mix(in srgb, var(--s-no) 14%, transparent); color: var(--s-no); }
.bb-verdict span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.bb-explain { margin-top: 22px; padding: 22px 24px; border-radius: 14px; border: 1px solid var(--hairline); background: var(--card); font-size: 15.5px; line-height: 1.65; color: var(--muted); }
.bb-ex__sec + .bb-ex__sec { margin-top: 20px; }
.bb-ex__sec .eyebrow { margin-bottom: 8px; }
.bb-ex__body p + p { margin-top: 10px; }
.bb-ex__body b, .bb-ex__body strong { color: var(--paper); }
.bb-ex__opt { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--hairline); }
.bb-ex__opt .bb-bubble { width: 26px; height: 26px; font-size: 12px; margin-top: 1px; }
.bb-ex__opt.is-right .bb-bubble { background: var(--s-ok); border-color: var(--s-ok); color: #fff; }
.bb-ex__opt.is-wrong .bb-bubble { background: var(--s-no); border-color: var(--s-no); color: #fff; }
.bb-ex__opt.is-right div { color: var(--paper); }
.bb-ex__tips { padding-left: 1.2em; }
.bb-ex__tips li { margin-top: 6px; }
.bb-ex__tips li::marker { color: var(--sand); }
.bb-ex__next { padding: 14px 18px; border-radius: 10px; background: color-mix(in srgb, var(--sand) 12%, transparent); border-left: 3px solid var(--sand); }
.bb-ex__next p { color: var(--paper); }
.bb-ex__official { margin-top: 20px; }
.bb-ex__official summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--sand); }
.bb-ex__official .bb-ex__body { margin-top: 10px; font-size: 14.5px; }
.bb-ex__foot { margin-top: 18px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; }
.bb-ex__foot a { color: var(--sand); font-weight: 600; }

mark.bb-hl { background: #FFE34D; color: #1B2030; border-radius: 2px; padding: 0 1px; cursor: pointer; }
.bb-tool--hl.is-on ~ * {}
.bb [data-hl-zone] { -webkit-user-select: text; user-select: text; }

.bb-bot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--hairline); background: var(--card); flex: none; }
.bb-bot__l, .bb-bot__r { position: relative; display: flex; align-items: center; gap: 10px; }
.bb-nav { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 12px; background: var(--paper); color: var(--navy); font-size: 15px; font-weight: 600; }
.bb-pop--nav { bottom: calc(100% + 10px); top: auto; left: 0; min-width: 320px; }
.bb-pop__h { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 13px; }
.bb-dots { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow-y: auto; }
.bb-dot { position: relative; width: 34px; height: 34px; border-radius: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); border: 1px dashed var(--faint); }
.bb-dot:hover { color: var(--paper); border-color: var(--paper); }
.bb-dot.is-ok { border-style: solid; background: color-mix(in srgb, var(--s-ok) 22%, transparent); border-color: var(--s-ok); color: var(--paper); }
.bb-dot.is-no { border-style: solid; background: color-mix(in srgb, var(--s-no) 22%, transparent); border-color: var(--s-no); color: var(--paper); }
.bb-dot.is-cur { outline: 2px solid var(--orange); outline-offset: 2px; }
.bb-dot.is-flag::after { content: ""; position: absolute; top: -4px; right: -4px; width: 9px; height: 9px; border-radius: 999px; background: var(--sand); border: 2px solid var(--card); }
.bb-btn { height: 46px; padding: 0 22px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--paper); border: 1px solid var(--hairline); background: var(--s-well); transition: all 0.15s var(--ease); }
.bb-btn:hover:not(:disabled) { border-color: var(--faint); }
.bb-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bb-btn.is-on { border-color: var(--sand); color: var(--sand); }
.bb-btn--primary { background: var(--orange); border-color: transparent; color: #171C2D; }
.bb-btn--primary:hover:not(:disabled) { filter: brightness(1.07); border-color: transparent; }

@media (max-width: 1100px) {
  .qb-cols, .qb-row { grid-template-columns: 34px minmax(0, 1fr) 180px 90px; }
}
@media (max-width: 820px) {
  .qb-sections { grid-template-columns: 1fr; }
  .qb-all { flex-direction: column; align-items: stretch; }
  .qb-cols { display: none; }
  .qb-row { grid-template-columns: 30px minmax(0, 1fr); row-gap: 8px; }
  .qb-row__prog { grid-column: 2; }
  .qb-row__acc { grid-column: 2; justify-content: flex-start; font-size: 14px; }
  .qb-row__note { opacity: 1; }
  .bb-body--split { flex-direction: column; overflow-y: auto; }
  .bb-body--split .bb-pane { flex: none; overflow: visible; padding: 22px 18px; }
  .bb-divider { width: auto; height: 1px; }
  .bb-body--single .bb-pane { padding: 22px 18px; }
  .bb-top { grid-template-columns: 1fr auto; padding: 8px 10px; }
  .bb-top__r { grid-column: 2; grid-row: 1; }
  .bb-top__c { grid-column: 1 / -1; grid-row: 2; flex-direction: row; gap: 10px; justify-content: center; }
  .bb-tool span { display: none; }
  .bb-tool--abc span { display: inline; }
  .bb-passage, .bb-stem, .bb-choice__btn { font-size: 17px; }
  .bb-bot { padding: 10px 12px; }
  .bb-btn { padding: 0 16px; height: 42px; font-size: 14px; }
  .bb-nav { padding: 0 14px; height: 42px; font-size: 14px; }
}

/* summary */
.summary__tiles { margin-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.summary__list { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.sumrow { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 12px; font-size: 14px; }
.sumrow__mark { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.sumrow__mark.ok { background: var(--s-ok); }
.sumrow__mark.no { background: var(--s-no); }
.sumrow__mark.skip { background: var(--s-bar); color: var(--muted); }
.sumrow__txt { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.sumrow__meta { font-family: var(--font-mono); font-size: 11px; color: var(--faint); white-space: nowrap; }

/* ============================================================
   MISTAKE LOG
   ============================================================ */

.log-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid var(--hairline); }
.seg button { padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); transition: all 0.2s var(--ease); }
.seg button.is-on { background: var(--paper); color: var(--navy); }
.log-list { display: flex; flex-direction: column; gap: 12px; }
.mist { padding: 20px 22px; border: 1px solid var(--hairline); border-radius: 16px; background: var(--card); }
.mist__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mist__stem { margin-top: 10px; font-size: 15px; line-height: 1.55; color: var(--paper); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mist__facts { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.mist__facts b { color: var(--paper); font-weight: 600; }
.mist__row { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mist__row .chip { font-size: 12.5px; padding: 5px 12px; }
.mist__note {
  margin-top: 12px;
  width: 100%;
  min-height: 44px;
  resize: vertical;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--s-well);
  border: 1px solid var(--hairline);
  outline: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--paper);
  transition: border-color 0.2s var(--ease);
}
.mist__note:focus { border-color: rgba(227, 114, 57, 0.6); }
.mist__note::placeholder { color: var(--faint); }
.mist__acts { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.flag-ico { width: 14px; height: 14px; color: var(--sand); }

/* ============================================================
   PROGRESS STATS
   ============================================================ */

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { padding: 20px; border: 1px solid var(--hairline); border-radius: 16px; background: var(--card); }
.tile__v { margin-top: 10px; font-size: 34px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.tile__h { margin-top: 8px; font-size: 12.5px; color: var(--faint); }

.stats-grid { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stats-grid > .panel--wide { grid-column: 1 / -1; }
.panel__h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel__t { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 92px; gap: 14px; align-items: center; font-size: 13.5px; }
.bar-row__l { color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row__l a:hover { color: var(--sand); }
.bar { height: 10px; border-radius: 999px; background: var(--s-bar); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; background: var(--bar-c, var(--orange)); }
.bar-row__v { text-align: right; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-row--none .bar-row__v { color: var(--faint); }
.bars__dom { margin-top: 10px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sand); }
.bars__dom:first-child { margin-top: 0; }

.weak { display: flex; flex-direction: column; gap: 8px; }
.weak__row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--s-well); font-size: 14px; }
.weak__i { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.weak__v { font-family: var(--font-mono); font-size: 12px; color: var(--s-no); }

.activity { display: flex; align-items: flex-end; gap: 3px; height: 130px; }
.activity__col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.activity__bar { width: 100%; border-radius: 3px 3px 1px 1px; background: var(--orange); min-height: 2px; }
.activity__bar.is-zero { background: var(--s-bar); }
.activity__axis { margin-top: 8px; display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--faint); }

.bank-tbl td:not(:first-child), .bank-tbl th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

.io-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {
  .page-hero--compact .page-hero__frame { padding: 96px 36px 40px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .notes { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .tree { position: static; max-height: none; overflow: visible; padding: 0; }
  .tree__toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
  }
  .tree__toggle::after { content: "+"; font-size: 18px; color: var(--sand); transition: transform 0.25s var(--ease); }
  .tree.is-open .tree__toggle::after { transform: rotate(45deg); }
  .tree__body { display: none; padding: 0 12px 16px 14px; }
  .tree.is-open .tree__body { display: block; }

  .setup { grid-template-columns: minmax(0, 1fr); }
  .setup__go { position: static; order: -1; }

  .qv--split { grid-template-columns: minmax(0, 1fr); }
  .qv--split .qv__pane { max-height: none; min-height: 0; overflow: visible; }
  .qv--split .qv__pane:first-child { border-right: none; border-bottom: 1px solid var(--hairline); }
}

@media (max-width: 640px) {
  .page-hero--compact .page-hero__frame { padding: 84px 20px 32px; }
  .sat-bar { margin-top: 24px; }
  .sat-tab { padding: 9px 13px; font-size: 13px; }
  .panel { padding: 18px; }
  .qv__pane { padding: 20px 16px 24px; }
  .sess__top { grid-template-columns: 1fr auto; padding: 10px 12px; }
  .sess__where { grid-column: 1 / -1; }
  .sess__timer { justify-self: start; }
  .sess__skill { max-width: 100%; }
  .tool-btn__lbl { display: none; }
  .sess__bot { flex-wrap: wrap; padding: 10px 12px; }
  .navstrip { order: -1; width: 100%; justify-content: flex-start; }
  .sess__nav { width: 100%; }
  .sess__nav .btn { flex: 1; }
  .choice__btn { padding: 11px 12px; gap: 12px; font-size: 15px; }
  .strike { width: 34px; }
  .summary__tiles { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile__v { font-size: 28px; }
  .bar-row { grid-template-columns: minmax(0, 1fr) 84px; gap: 6px 10px; }
  .bar-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .note-pager { grid-template-columns: 1fr; }
  .note-pager a:last-child { text-align: left; }
  .note .ex { padding: 16px; }
  .note ol.steps > li { padding-left: 38px; }
}

/* images inside extracted questions (math rendered as pictures) */
.qimg { max-width: 100%; height: auto; vertical-align: middle; }
html:not([data-theme="light"]) .qimg { filter: invert(0.92) hue-rotate(180deg); mix-blend-mode: lighten; }
html[data-theme="light"] .qimg { mix-blend-mode: multiply; }

/* ============================================================
   NOTES — visual layer: glance tiles, charts, section cards, traps
   ============================================================ */

.note { font-size: 16.5px; line-height: 1.7; }
.note--intro { margin-top: 24px; }
.note p.lead { font-size: 19px; line-height: 1.6; color: var(--paper); }
.note h4 { font-size: 17.5px; margin-top: 30px; }

.glance { margin-top: 26px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.glance--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.glance--1 { grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
.glance--stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.glance__tile { padding: 18px 18px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--hairline); min-width: 0; }
.glance__tile--sm { text-align: center; padding: 16px 12px; }
.glance__tile--ring { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.glance__big { margin-top: 8px; font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--paper); }
.glance__big small { font-size: 16px; color: var(--muted); margin-left: 2px; }
.glance__tile--sm .glance__big { margin-top: 0; font-size: 26px; }
.glance__sub { margin-top: 6px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.glance .bar { margin-top: 12px; }

.chart { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.chart__row { display: grid; grid-template-columns: minmax(0, 1fr) 2fr auto; gap: 10px; align-items: center; font-size: 12.5px; }
.chart__l { color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart__track { height: 10px; border-radius: 999px; background: var(--s-bar); overflow: hidden; }
.chart__fill { height: 100%; border-radius: 999px; background: var(--orange); transition: width 0.6s var(--ease); }
.chart__v { font-family: var(--font-mono); font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart__note { font-size: 11.5px; color: var(--faint); margin-top: 4px; }

.stack { margin-top: 12px; }
.stack__bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--s-bar); }
.stack__bar i { display: block; height: 100%; }
.stack__legend { margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.stack__legend span { display: inline-flex; align-items: center; gap: 5px; }
.stack__legend i { width: 8px; height: 8px; border-radius: 2px; }
.stack__E { background: var(--s-ok); } .stack__M { background: var(--s-key); } .stack__H { background: var(--s-no); }

.ring { width: 96px; height: 96px; border-radius: 999px; background: conic-gradient(var(--orange) calc(var(--p) * 1%), var(--s-bar) 0); display: grid; place-items: center; }
.ring__in { width: 76px; height: 76px; border-radius: 999px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring__in b { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; color: var(--paper); }
.ring__in span { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); text-align: center; max-width: 64px; line-height: 1.3; }

.note-toc { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.note-toc__chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--card); font-size: 13.5px; font-weight: 500; color: var(--paper); transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.note-toc__chip:hover { border-color: var(--faint); transform: translateY(-1px); }
.note-toc__all { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 8px 4px; }
.note-toc__all:hover { color: var(--paper); }

.nsec { margin-top: 14px; border: 1px solid var(--hairline); border-radius: 18px; background: var(--card); overflow: hidden; }
.nsec[open] { border-color: color-mix(in srgb, var(--nsec-c, var(--sand)) 40%, var(--hairline)); }
.nsec--look { --nsec-c: var(--c-gem); } .nsec--method { --nsec-c: var(--c-pplx); } .nsec--rules { --nsec-c: var(--s-rule); }
.nsec--traps { --nsec-c: var(--s-no); } .nsec--examples { --nsec-c: var(--sand); } .nsec--checklist { --nsec-c: var(--s-ok); }
.nsec__h { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 18px 22px; }
.nsec__h::-webkit-details-marker { display: none; }
.nsec__h:hover { background: var(--s-hover); }
.nsec__ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: color-mix(in srgb, var(--nsec-c, var(--sand)) 16%, transparent); flex: none; }
.nsec__t { flex: 1; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; color: var(--paper); }
.nsec__meta { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.nsec__chev { font-size: 18px; line-height: 0; color: var(--faint); transform: translateY(-3px); transition: transform 0.25s var(--ease); }
.nsec[open] .nsec__chev { transform: translateY(2px) rotate(180deg); }
.nsec__body { padding: 4px 22px 26px; border-top: 1px solid var(--hairline); }
.nsec__body > :first-child { margin-top: 18px; }
.nsec__body h4:first-child { margin-top: 18px; }
.nsec--checklist .box.key { margin-top: 18px; font-size: 17px; }
.nsec--checklist .box.key li { margin-top: 10px; }

/* method steps as cards */
.note ol.steps { display: grid; gap: 10px; }
.note ol.steps > li { margin-top: 0; padding: 14px 16px 14px 56px; border-radius: 12px; background: var(--s-well); border: 1px solid var(--hairline); }
.note ol.steps > li::before { left: 14px; top: 13px; }

/* traps as cards */
.trap-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.trap-card { position: relative; padding: 16px 16px 16px 18px; border-radius: 14px; background: color-mix(in srgb, var(--s-no) 6%, var(--card)); border: 1px solid color-mix(in srgb, var(--s-no) 25%, transparent); border-left: 3px solid var(--s-no); }
.trap-card__n { position: absolute; top: 12px; right: 14px; font-family: var(--font-mono); font-size: 10px; color: var(--faint); }
.trap-card__t { font-size: 16px; font-weight: 600; color: var(--paper); padding-right: 28px; }
.trap-card__b { margin-top: 6px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }

@media (max-width: 900px) {
  .glance, .glance--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glance--2 { grid-template-columns: minmax(0, 1fr); }
  .trap-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .nsec__h { padding: 14px 16px; gap: 10px; }
  .nsec__t { font-size: 18px; }
  .nsec__meta { display: none; }
  .nsec__body { padding: 0 16px 20px; }
  .note p.lead { font-size: 17.5px; }
  .glance__big { font-size: 26px; }
}
