:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --surface: #fdfbf6;
  --rail: #faf8f3;
  --ink: #111a34;
  --muted: #515872;
  --line: #b9bbd0;
  --line-soft: #dbdae3;
  --blue: #2146d5;
  --blue-dark: #1535ac;
  --blue-soft: #e5eaff;
  --blue-pale: #eef1ff;
  --amber: #a55a14;
  --amber-line: #d1832d;
  --amber-soft: #faedda;
  --green: #12634f;
  --green-soft: #dcefe7;
  --red: #9c2b2c;
  --red-soft: #f9e6e4;
  --display: Bahnschrift, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, monospace;
  --radius: 10px;
  --header: 72px;
  --rail-width: clamp(228px, 18.4vw, 272px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header) + 18px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); }
a { color: var(--blue-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); }
h1, h2, .display { font-family: var(--display); font-weight: 700; }
h1 { margin-bottom: 10px; font-size: clamp(40px, 4.7vw, 68px); letter-spacing: -.048em; line-height: 1.06; }
h2 { margin-bottom: 14px; font-size: clamp(24px, 2.45vw, 33px); letter-spacing: -.035em; line-height: 1.15; }
h3 { margin-bottom: 8px; font-size: 18px; line-height: 1.3; }
p:last-child { margin-bottom: 0; }
[hidden] { display: none !important; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; white-space: nowrap; clip-path: inset(50%); }
.skip-link:focus { position: fixed; left: 10px; top: 10px; z-index: 20; padding: 10px; background: white; }

.topbar {
  position: sticky; top: 0; z-index: 5; height: var(--header);
  display: flex; align-items: center; gap: 21px; padding: 0 32px;
  border-bottom: 2px solid var(--ink); background: var(--paper);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark {
  width: 43px; height: 37px; display: grid; place-items: center;
  background: #10265a; border: 1px solid #24437d; border-radius: 6px;
  color: #fff; font: 700 21px/1 var(--mono); letter-spacing: -.06em;
}
.brand-name { font: 700 34px/1 var(--display); letter-spacing: -.055em; }
.brand-subtitle { border-left: 1px solid var(--line); padding-left: 20px; font: 15px/1.3 var(--mono); white-space: nowrap; }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: clamp(5px, 1.4vw, 22px); }
.top-nav a {
  padding: 9px 17px; border-radius: 7px; color: var(--ink); text-decoration: none;
  font: 650 clamp(15px, 1.25vw, 18px)/1.2 var(--sans); white-space: nowrap;
}
.top-nav a:hover { background: var(--blue-pale); }
.top-nav a[aria-current] { background: var(--blue); color: white; }

.workspace { display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); min-height: calc(100vh - var(--header)); max-width: 1820px; margin: auto; }
.rail {
  align-self: start; position: sticky; top: var(--header); height: calc(100vh - var(--header));
  display: flex; flex-direction: column; padding: 28px 13px 20px; overflow-y: auto;
  border-right: 1px solid var(--line-soft); background: var(--rail);
}
.rail h2 { margin: 6px 9px 22px; font-size: 28px; }
.rail-list { display: grid; gap: 6px; }
.rail-link {
  display: grid; position: relative; grid-template-columns: 37px minmax(0, 1fr); gap: 11px;
  min-height: 58px; align-items: center; padding: 9px 10px; border-radius: 8px;
  text-decoration: none; color: var(--ink); border: 1px solid transparent;
}
.rail-link:hover { background: #eff0f8; }
.rail-link[aria-current] { background: #dfe5ff; border-color: #d9dffd; }
.rail-icon {
  display: grid; place-items: center; width: 36px; height: 34px;
  border: 1px solid #9399b8; border-radius: 6px; background: #f9f9fe;
  font: 700 20px/1 var(--display);
}
.rail-link[aria-current] .rail-icon { border-color: #8093e3; color: var(--blue-dark); }
.rail-name { display: block; font: 650 15px/1.24 var(--sans); }
.rail-meta { display: block; margin-top: 5px; color: var(--muted); font: 13px/1.2 var(--mono); }
.rail-link:has(.rail-check) { padding-right: 23px; }
.rail-check { position: absolute; right: 7px; top: calc(50% - .75em); color: var(--green); font-weight: 700; }
.rail-extra { margin: 19px 10px 7px; font-size: 14px; }
.rail-footer { margin: auto 7px 0; padding: 16px 0 3px; }
.rail-footer-inner { padding-top: 13px; border-top: 1px solid var(--line); }
.progress-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font: 12px/1.3 var(--mono); }
.progress-track { height: 7px; border-radius: 5px; background: #e1e0ec; overflow: hidden; }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }

.main { min-width: 0; padding: 31px clamp(20px, 2.5vw, 42px) 44px; outline: none; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.hero p { margin: 0; color: var(--muted); font-size: clamp(16px, 1.51vw, 21px); line-height: 1.4; }
.hero-meta { flex: 0 0 auto; min-width: 145px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: 17px/1.4 var(--mono); }
.hero-meta div + div { border-top: 1px solid var(--line-soft); margin-top: 5px; padding-top: 4px; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid #969ab6; margin: 0 0 27px; }
.tabs a { position: relative; padding: 10px 10px 12px; color: var(--ink); font-weight: 600; font-size: clamp(14px, 1.3vw, 17px); white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--blue-dark); }
.tabs a[aria-current] { color: var(--blue-dark); }
.tabs a[aria-current]::after { position: absolute; content: ""; inset: auto 0 -2px; height: 4px; border-radius: 1px; background: var(--blue); }

.walkthrough { display: grid; grid-template-columns: minmax(0, 2fr) minmax(265px, 1.02fr); gap: 17px; align-items: stretch; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-padding { padding: 18px 20px; }
.map-panel { display: flex; flex-direction: column; overflow: hidden; }
.ruled-title { display: flex; align-items: center; gap: 14px; }
.ruled-title::after { content: ""; flex: 1; height: 1px; background: var(--line); min-width: 12px; }
.map-title { margin: 15px 18px 9px; }
.map {
  position: relative; flex: 1; min-height: 305px; margin: 0 16px 17px; overflow: hidden; isolation: isolate;
  background: radial-gradient(circle, #bac6ee 1px, transparent 1.3px) 2px 1px / 17px 17px;
}
.map canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.node {
  position: absolute; transform: translate(-50%, -50%); width: 26%; max-width: 172px;
  min-width: 0; overflow: hidden; border: 1.5px solid var(--ink); border-radius: 8px;
  background: #f5f4fb; text-align: center; box-shadow: 0 3px 0 #181b4011;
}
.node strong { display: block; white-space: nowrap; padding: 6px 2px; border-bottom: 1px solid var(--ink); font: 700 clamp(12px, 1.28vw, 18px)/1.2 var(--mono); background: #e7e9fa; }
.node-face { display: flex; align-items: center; justify-content: center; gap: 13%; height: 52px; }
.node-face span { display: grid; place-items: center; width: clamp(23px, 3.1vw, 37px); height: 29px; border: 1.5px solid var(--ink); border-radius: 4px; font: 700 15px/1 var(--mono); }
.node-face .cpu { width: 29px; height: 26px; font-size: 10px; box-shadow: 3px 0 #bbbdd4, -3px 0 #bbbdd4; }
.map.chain .node { width: 22%; max-width: 152px; }
.pipe-label {
  position: absolute; z-index: 1; transform: translate(-50%, -50%); white-space: nowrap;
  font: 700 clamp(10px, .97vw, 14px)/1.16 var(--mono); padding: 3px 5px;
  background: var(--surface); border-radius: 3px; color: var(--blue-dark);
}
.pipe-label.result { color: var(--amber); }
.pipe-label.dim { color: #5d647a; }
.map-controls {
  border-top: 1px solid var(--line); padding: 12px 15px; display: grid; grid-template-columns: auto 1fr auto;
  gap: 10px; align-items: center; background: var(--surface);
}
.button-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.button {
  display: inline-flex; gap: 7px; min-height: 39px; align-items: center; justify-content: center;
  padding: 7px 13px; border: 1px solid #929ab6; border-radius: 7px; background: var(--surface);
  color: var(--ink); font-weight: 650; font-size: 14px; line-height: 1.25; text-decoration: none; white-space: nowrap;
}
.button:not(:disabled):hover { background: var(--blue-pale); border-color: var(--blue); color: var(--blue-dark); }
.button.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.button.primary:not(:disabled):hover { background: var(--blue-dark); color: white; }
.button.icon-only { width: 38px; padding: 5px; font-size: 20px; line-height: 1; }
.step-count { text-align: center; white-space: nowrap; font: 14px/1.3 var(--mono); }
.step-panel { padding: 16px 19px 19px; }
.step-panel > p { margin-bottom: 13px; }
.watch { margin-top: 15px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.watch strong { display: block; background: #eae9f7; padding: 6px 10px; font: 700 14px/1.25 var(--mono); }
.watch p { padding: 8px 10px; font-size: 14px; line-height: 1.52; }

.samples { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; margin-top: 16px; }
.sample-title { display: flex; justify-content: space-between; align-items: start; gap: 9px; margin-bottom: 12px; }
.sample-title h2 { margin-bottom: 0; }
.sample-value { margin: 0; padding: 11px 12px; border: 1px solid #d2d7f3; border-radius: 7px; background: #f1f1fb; color: var(--blue-dark); font: 14px/1.55 var(--mono); overflow-wrap: anywhere; white-space: pre-wrap; }
.result-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 14px; }
.result-list dt { color: var(--muted); }
.result-list dd { margin: 0; font: 650 13px/1.6 var(--mono); overflow-wrap: anywhere; }
.edit-form { margin-top: 13px; }
.edit-form label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 650; }
.edit-form input { width: 100%; padding: 8px 9px; min-height: 42px; border: 1px solid var(--line); border-radius: 6px; background: white; font-family: var(--mono); font-size: 14px; }
.edit-form .button-group { margin-top: 9px; }
.error { color: var(--red); margin-top: 8px; font-size: 14px; }
.resource-row { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 14px; align-items: center; }

pre, code { font-family: var(--mono); }
pre { margin: 0; font-size: 15px; }
.snippet { padding: 10px 11px; border: 1px solid #d2dbfa; border-radius: 7px; background: var(--blue-soft); overflow-x: auto; color: var(--blue-dark); line-height: 1.5; }
.step-panel .snippet { white-space: pre-wrap; overflow-wrap: anywhere; }
.code-toolbar { padding: 11px 15px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-bottom: 1px solid var(--line-soft); }
.code-toolbar strong { font: 700 14px/1.45 var(--mono); overflow-wrap: anywhere; }
.code-card { overflow: hidden; }
.code-source { overflow: auto; max-height: 65vh; background: #111a32; color: #edf1ff; padding: 12px 0 16px; line-height: 1.7; }
.code-line { display: block; min-width: max-content; padding-right: 20px; }
.line-number { display: inline-block; width: 50px; padding: 0 10px 0 0; margin-right: 14px; text-align: right; color: #9ba6c9; border-right: 1px solid #333e63; user-select: none; }
.syntax-comment { color: #aebadc; }
.syntax-string { color: #ffc878; }
.syntax-keyword { color: #a9baff; }
.syntax-number { color: #a5e5cf; }
.code-run { margin-top: 15px; }
.code-run h2 { margin-bottom: 9px; }
.copy-line { display: flex; justify-content: space-between; gap: 10px; align-items: start; margin-bottom: 8px; }
.copy-line pre { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.quick-grid fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.quick-grid legend { font-family: var(--display); font-size: 22px; font-weight: 700; padding: 0; margin-bottom: 12px; line-height: 1.25; }
.choices { display: grid; gap: 7px; }
.choice {
  display: flex; align-items: baseline; gap: 9px; padding: 9px 10px; text-align: left; border: 1px solid var(--line);
  border-radius: 7px; background: var(--surface); width: 100%; line-height: 1.35;
}
.choice:hover, .choice[aria-pressed="true"] { background: var(--blue-pale); border-color: #8093e3; }
.choice-letter { color: var(--blue-dark); font: 700 13px/1.35 var(--mono); }
.feedback { margin: 10px 0 0; padding: 8px 10px; border-radius: 6px; font-size: 14px; color: var(--green); background: var(--green-soft); }
.feedback.retry { color: var(--red); background: var(--red-soft); }

.section-rule { border-bottom: 3px solid var(--blue); padding-bottom: 14px; margin-bottom: 20px; }
.syllabus-layout, .exam-layout { display: grid; grid-template-columns: minmax(0, 2.07fr) minmax(240px, 1fr); gap: 18px; align-items: start; }
.syllabus-sidebar, .questions { display: grid; gap: 13px; min-width: 0; }
.syllabus-sidebar ul { margin: 0; padding-left: 20px; }
.syllabus-sidebar li + li { margin-top: 7px; }
.syllabus-sidebar li::marker { color: var(--blue); }
.flow-diagram { display: grid; text-align: center; gap: 4px; }
.flow-node { padding: 8px 6px; border: 1px solid #a5b1e9; background: var(--blue-pale); border-radius: 7px; font: 700 13px/1.35 var(--mono); }
.flow-node.highlight { background: var(--blue); color: white; }
.flow-arrow { color: var(--blue-dark); }
.prose { overflow-wrap: anywhere; }
.prose h2, .prose h3 { margin-top: 22px; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p { margin-bottom: 12px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 23px; }
.prose li + li { margin-top: 4px; }
.prose p:last-child { margin-bottom: 0; }
.prose :not(pre) > code { padding: 1px 4px; border-radius: 3px; color: #1f3071; background: #e9eafa; font-size: .9em; }
.prose pre { margin: 11px 0; padding: 11px 12px; overflow-x: auto; background: #ececf8; border: 1px solid #dcdfef; border-radius: 7px; line-height: 1.47; }
.prose .table-scroll { max-width: 100%; overflow-x: auto; margin: 10px 0 15px; border: 1px solid var(--line); border-radius: 7px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { text-align: left; padding: 8px 9px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.prose th { background: #eaeaf7; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose > :last-child { margin-bottom: 0; }
.pipe-table { margin-top: 15px; }
summary { cursor: pointer; }
.pipe-table summary, .example summary, .supplement-answer summary { font-size: 16px; font-weight: 650; }
.example { margin-top: 12px; }
.example[open] > summary { margin-bottom: 12px; }

.timer {
  display: flex; gap: 10px; align-items: center; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.timer-output { min-width: 74px; font: 700 24px/1 var(--mono); font-variant-numeric: tabular-nums; }
.timer-output.expired { color: var(--red); }
.exam-layout { margin-top: 24px; }
.exam-question { scroll-margin-top: calc(var(--header) + 8px); overflow: hidden; }
.exam-question summary {
  padding: 12px 15px; display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px 12px; align-items: center;
  list-style: none; font: 700 clamp(18px, 2vw, 27px)/1.2 var(--display);
}
.exam-question summary::-webkit-details-marker { display: none; }
.exam-question summary::after { content: "⌄"; color: var(--blue-dark); }
.exam-question[open] summary::after { transform: rotate(180deg); }
.exam-question:not([open]) summary:hover { background: var(--blue-pale); }
.exam-number { color: var(--blue-dark); font: 700 15px/1.2 var(--mono); }
.exam-meta { display: inline-block; padding: 5px 7px; border-radius: 4px; background: #eeedf7; color: var(--muted); white-space: nowrap; font: 13px/1.2 var(--sans); }
.question-body { padding: 2px 15px 15px; }
.question-body .button-group { margin-top: 13px; }
.review-active { background: var(--amber-soft); color: var(--amber); }
.answer { margin-top: 15px; padding: 11px 12px; background: #f9f3e9; border-left: 3px solid var(--amber-line); border-radius: 5px; }
.answer h3 { margin-top: 0; }
.grade { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; font-weight: 650; }
.grade select { padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.exam-overview dl { margin: 0 0 13px; }
.exam-overview dl > div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.exam-overview dd { margin: 0; color: var(--muted); font: 14px/1.55 var(--mono); }
.exam-task-links { list-style: none; margin: 14px 0 0; padding: 0; }
.exam-task-links a { display: block; padding: 4px 0; font-size: 14px; text-decoration: none; }
.exam-task-links a:hover { text-decoration: underline; }
.mode-end { padding-top: 15px; }

@media (max-width: 1060px) {
  :root { --rail-width: 207px; }
  .topbar { padding: 0 22px; }
  .rail { padding-inline: 9px; }
  .rail-link { grid-template-columns: 31px minmax(0, 1fr); gap: 8px; padding-inline: 7px; }
  .rail-icon { width: 31px; height: 31px; }
  .walkthrough { grid-template-columns: minmax(0, 1.55fr) minmax(235px, 1fr); gap: 12px; }
  .map { margin-inline: 10px; }
  .panel-padding, .step-panel { padding-inline: 14px; }
  .syllabus-layout, .exam-layout { grid-template-columns: minmax(0, 1.65fr) minmax(210px, 1fr); gap: 12px; }
}
@media (max-width: 850px) {
  :root { --header: 62px; }
  .workspace { display: block; }
  .rail { position: static; height: auto; padding: 8px 15px; overflow-y: visible; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .rail h2, .rail-footer { display: none; }
  .rail-list { display: flex; gap: 6px; overflow-x: auto; padding: 2px 3px 5px; }
  .rail-link { flex: 0 0 auto; grid-template-columns: 25px 1fr; min-height: 40px; gap: 6px; padding: 5px 7px; }
  .rail-name { font-size: 14px; }
  .rail-meta { font-size: 11px; margin-top: 3px; }
  .rail-icon { width: 25px; height: 25px; font-size: 15px; }
  .rail-extra { margin: 4px 3px 0; font-size: 12px; }
  .main { padding-top: 23px; }
  .brand-subtitle { display: none; }
  .map { min-height: 270px; }
}
@media (max-width: 620px) {
  :root { --header: 56px; }
  .topbar { padding: 0 11px; gap: 5px; }
  .brand { gap: 6px; }
  .brand-mark { width: 28px; height: 27px; font-size: 15px; }
  .brand-name { font-size: 23px; }
  .top-nav { gap: 2px; }
  .top-nav a { font-size: 13px; padding: 7px 6px; }
  .rail { padding-inline: 8px; }
  .main { padding: 18px 12px 32px; }
  h1 { font-size: clamp(35px, 9.1vw, 50px); }
  .hero { align-items: start; gap: 10px; margin-bottom: 12px; }
  .hero p { font-size: 14px; }
  .hero-meta { font-size: 12px; min-width: 59px; padding: 6px 8px; }
  .tabs { gap: 6px; margin-bottom: 17px; }
  .tabs a { font-size: 13px; padding: 8px 7px; }
  .walkthrough, .syllabus-layout, .exam-layout, .samples, .quick-grid { grid-template-columns: minmax(0, 1fr); }
  .map { min-height: 224px; margin-inline: 8px; margin-bottom: 9px; }
  .map.fan, .map.chain { min-height: 247px; }
  .node-face { height: 39px; }
  .node-face span { width: 22px; height: 22px; font-size: 12px; }
  .node-face .cpu { width: 21px; height: 20px; font-size: 8px; }
  .step-count { font-size: 12px; }
  .map-controls { padding: 8px; gap: 5px; }
  .map-controls .button-group { gap: 4px; }
  .button.icon-only { width: 32px; }
  .map-controls .button { padding-inline: 7px; font-size: 13px; min-height: 35px; }
  .map-controls .button.icon-only { font-size: 17px; }
  .panel-padding { padding: 13px; }
  .syllabus-hero, .exam-hero { flex-wrap: wrap; }
  .timer { padding: 6px 8px; }
  .timer-output { font-size: 21px; }
  .exam-question summary { grid-template-columns: auto 1fr auto; column-gap: 8px; }
  .exam-question summary .exam-meta { grid-column: 2 / 3; grid-row: 2; justify-self: start; }
  .exam-question summary::after { grid-column: 3; grid-row: 1; }
  .exam-layout { margin-top: 15px; }
  .exam-question summary { padding: 10px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* Code browsing and recall */
.library-layout { display: grid; grid-template-columns: minmax(218px, .83fr) minmax(0, 2.25fr); align-items: start; gap: 19px; }
.catalog { position: sticky; top: calc(var(--header) + 14px); }
.catalog label { display: block; margin-bottom: 6px; font-weight: 680; }
.catalog input {
  width: 100%; padding: 9px 10px; margin-bottom: 9px; border: 1px solid var(--line);
  border-radius: 7px; color: var(--ink); background: #fff; font-size: .9rem;
}
.code-index { max-height: min(65vh, 570px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.code-index section + section { margin-top: 16px; }
.code-index h3 { margin: 8px 4px 4px; color: var(--muted); font: 650 12px/1.4 var(--sans); }
.code-index ul { margin: 0; padding: 0; list-style: none; }
.code-index a { display: block; padding: 6px 8px; border-left: 3px solid transparent; border-radius: 4px; color: var(--ink); text-decoration: none; font-size: .87rem; line-height: 1.4; }
.code-index a:hover, .code-index a[aria-current] { background: var(--blue-soft); }
.code-index a[aria-current] { color: var(--blue-dark); border-left-color: var(--blue); font-weight: 700; }
.empty-search { margin: 12px 4px; color: var(--muted); font-size: .91rem; }
.library-source { min-width: 0; }
.library-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.library-heading h2 { margin: 0; }
.library-group { margin: 0 0 3px; color: var(--muted); font-size: .82rem; font-weight: 650; }
.recall-box { border-left: 4px solid var(--blue); background: #f1f3fe; }
.recall-box h2 { font-size: 23px; margin-bottom: 9px; }
.recall-box ol { margin: 0; padding-left: 23px; font-size: .95rem; }
.recall-box li::marker { color: var(--blue-dark); font-weight: 700; }
.recall-box li + li { margin-top: 5px; }
.library-actions, .above-code { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 12px 0; }
.library-actions span { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.drill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 15px; }
.drill-card .snippet { white-space: pre-wrap; overflow-wrap: anywhere; }
.drill-card p { margin-bottom: 11px; }
.drill-details, .drill-check { margin-top: 12px; }
.drill-details summary { margin-bottom: 7px; font-weight: 650; }
.drill-check { color: var(--muted); font-size: .94rem; }
@media (max-width: 940px) {
  .drill-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  :root { --header: 87px; }
  .topbar {
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 39px 40px;
    gap: 0; padding: 2px 9px; align-content: center;
  }
  .brand { justify-self: start; }
  .top-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; width: 100%; }
  .top-nav a { padding: 8px 2px; text-align: center; font-size: clamp(11px, 3.2vw, 14px); line-height: 1.14; white-space: normal; }
  .library-layout { grid-template-columns: minmax(0, 1fr); }
  .catalog { position: static; }
  .code-index { max-height: 190px; }
  .library-heading { align-items: start; }
  .library-heading .button { white-space: normal; }
}
