/* Kourashi Systems Blueprint
   Neon white on charcoal for the chrome, paper and ink for reading.
   Square corners, one 45-degree chamfer, bracket labels in mono. */

:root {
  --charcoal: #121315;
  --charcoal-2: #1B1C1F;
  --graphite: #2A2B2F;
  --on-dark: #FFFFFF;
  --muted-dark: #A0A2A8;
  --line-dark: #2E2F33;

  --paper: #F4F4F2;
  --raised: #FFFFFF;
  --sunken: #EAEAE7;
  --ink: #121315;
  --muted: #5A5C61;
  --line: #D9D9D5;
  --line-strong: #76787D;

  --ok: #1F7A4D;
  --ok-dark: #4FD18B;
  --warn: #8F5A00;
  --warn-dark: #F2B33D;
  --danger: #C42B2B;

  --display: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-press: 120ms;
  --t-ui: 200ms;
  --t-panel: 320ms;

  --pad: clamp(1.25rem, 4vw, 3rem);
  --navh: 64px;
  --chamfer: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-padding-top: calc(var(--navh) + 24px); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.dark :focus-visible, .nav :focus-visible { outline-color: var(--on-dark); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--on-dark); color: var(--charcoal); padding: 10px 14px; font-weight: 500; transition: top var(--t-ui) var(--ease); }
.skip:focus { top: 12px; }

.wrap { max-width: 1240px; margin: 0 auto; padding-inline: var(--pad); }

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.5rem); line-height: 0.98; max-width: 18ch; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1.2; }
.lede { font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.55; max-width: 60ch; }

/* Bracket label: the signature detail */
.label, .tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.dark .label, .dark .tag, .nav .label { color: var(--muted-dark); }
.tag.gap { display: block; margin-bottom: 14px; }
.label.ok { color: var(--ok); }
.label.warn { color: var(--warn); }
.dark .label.ok { color: var(--ok-dark); }
.dark .label.warn { color: var(--warn-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  font-family: var(--sans); font-size: 15px; font-weight: 500; line-height: 1;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 0;
  transition: transform var(--t-press) var(--ease), background-color var(--t-ui) var(--ease), color var(--t-ui) var(--ease), border-color var(--t-ui) var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink); color: var(--paper); clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer)); }
.dark .btn-primary, .nav .btn-primary { background: var(--on-dark); color: var(--charcoal); }
.btn-line { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.dark .btn-line { color: var(--on-dark); border-color: #74767C; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: #2A2B2F; }
  .dark .btn-primary:hover, .nav .btn-primary:hover { background: #DCDCD8; }
  .btn-line:hover { border-color: var(--ink); }
  .dark .btn-line:hover { border-color: var(--on-dark); }
}
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: var(--charcoal); color: var(--on-dark); border-bottom: 1px solid var(--line-dark); }
.nav .wrap { height: var(--navh); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; min-height: 44px; }
.brand img { height: 24px; width: auto; }
.brand .label { padding-left: 14px; border-left: 1px solid var(--line-dark); color: var(--on-dark); }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; font-weight: 500; }
.nav-links a { text-decoration: none; color: var(--muted-dark); padding: 12px 0; transition: color var(--t-press) var(--ease); }
.nav-links a[aria-current="page"] { color: var(--on-dark); }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { color: var(--on-dark); } }
.menu-btn { display: none; width: 44px; height: 44px; background: none; border: 0; color: var(--on-dark); cursor: pointer; }
@media (max-width: 760px) {
  .menu-btn { display: grid; place-items: center; }
  .nav-links { display: none; position: absolute; top: var(--navh); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--charcoal); padding: 8px var(--pad) 20px; border-bottom: 1px solid var(--line-dark); }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--line-dark); }
}

/* Thin reading progress line under the nav */
.readbar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; overflow: hidden; }
.readbar span { display: block; height: 100%; background: var(--on-dark); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Course head (dark) ---------- */
.dark { background: var(--charcoal); color: var(--on-dark); }
.course-head { padding: 48px 0 0; }
.course-head .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px 64px; align-items: end; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.crumbs a { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .crumbs a:hover { color: var(--on-dark); } }
.course-head h1 { margin-bottom: 20px; }
.course-head .lede { color: var(--muted-dark); }
.meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 24px; }
.course-art { position: relative; aspect-ratio: 1 / 1; background: var(--graphite); overflow: hidden; clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 0 100%); }
.course-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.course-art .label { position: absolute; left: 16px; bottom: 16px; background: var(--charcoal); padding: 6px 10px; }

.progress { margin-top: 32px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; max-width: 560px; }
.progress-track { height: 4px; background: var(--line-dark); overflow: hidden; }
.progress-fill { height: 100%; background: var(--on-dark); transform-origin: 0 50%; transform: scaleX(0); transition: transform 700ms var(--ease); }
.progress-num { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; }

/* Tabs with a sliding indicator */
.tabs { position: relative; display: flex; gap: 32px; margin-top: 32px; border-bottom: 1px solid var(--line-dark); grid-column: 1 / -1; }
.tab { position: relative; background: none; border: 0; padding: 16px 0; font-size: 14px; font-weight: 500; color: var(--muted-dark); cursor: pointer; transition: color var(--t-ui) var(--ease); }
.tab[aria-selected="true"] { color: var(--on-dark); }
.tab-ink { position: absolute; bottom: -1px; left: 0; height: 2px; background: var(--on-dark); transition: transform var(--t-ui) var(--ease), width var(--t-ui) var(--ease); }

@media (max-width: 900px) {
  .course-head .wrap { grid-template-columns: 1fr; }
  .course-art { display: none; }
}

/* ---------- Course body ---------- */
.course-body { padding: 48px 0 96px; }
.course-body .wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 900px) { .course-body .wrap { grid-template-columns: 1fr; gap: 32px; } }

.side { position: sticky; top: calc(var(--navh) + 32px); display: flex; flex-direction: column; gap: 28px; }
@media (max-width: 900px) { .side { position: static; order: 2; } }
.side-block { border-top: 2px solid var(--ink); padding-top: 14px; }
.side-block h2 { font-size: 18px; letter-spacing: -0.01em; margin: 8px 0 8px; }
.side-block p { font-size: 14px; line-height: 1.6; color: var(--muted); }
.side-block p + p { margin-top: 8px; }
.side-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; margin-top: 12px; }
.side-facts b { display: block; font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.panel[hidden] { display: none; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.panel-head h2 { font-size: 28px; }
.link-btn { background: none; border: 0; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; padding: 12px 0; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .link-btn:hover { color: var(--ink); } }

/* ---------- Syllabus timeline ---------- */
.syllabus { position: relative; padding-left: 56px; }
.rail { position: absolute; left: 19px; top: 20px; bottom: 36px; width: 2px; background: var(--line); }
.rail-fill { position: absolute; inset: 0; background: var(--ok); transform-origin: 50% 0; transform: scaleY(0); transition: transform 900ms var(--ease); }

.group { position: relative; }
.group + .group { margin-top: 40px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 0; text-align: left; cursor: pointer; }
.group-head h3 { font-size: 16px; font-family: var(--sans); font-weight: 500; letter-spacing: 0; }
.chev { width: 16px; height: 16px; flex: none; transition: transform var(--t-ui) var(--ease); }
.group-head[aria-expanded="false"] .chev { transform: rotate(180deg); }
.group-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--t-panel) var(--ease); }
.group-body > div { overflow: hidden; }
.group.collapsed .group-body { grid-template-rows: 0fr; }
.group-note { font-size: 14px; color: var(--muted); padding: 12px 0 4px; }
.group-node { position: absolute; left: -44px; top: 14px; width: 14px; height: 14px; background: var(--paper); border: 2px solid var(--line-strong); }

.item { position: relative; margin-top: 12px; }
.node {
  position: absolute; left: -56px; top: 50%; translate: 0 -50%;
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--line-strong); color: var(--muted);
  font-family: var(--mono); font-size: 12px; font-weight: 500;
}
.node svg { width: 18px; height: 18px; }
.item.done .node { background: var(--ok); border-color: var(--ok); color: #fff; }
.item.active .node { border-color: var(--warn); color: var(--warn); }
.item.locked .node { border-color: var(--line); color: var(--line-strong); }

.card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch;
  background: var(--raised); border: 1px solid var(--line);
  transition: border-color var(--t-ui) var(--ease), transform var(--t-press) var(--ease);
}
.item.done .card { border-left: 0; box-shadow: inset 3px 0 0 var(--ok); }
.item.active .card { box-shadow: inset 3px 0 0 var(--warn); }
.card-main { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; text-decoration: none; min-width: 0; }
.card-main h4 { font-family: var(--sans); font-size: 17px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.35; }
.card-top { display: flex; flex-wrap: wrap; gap: 6px 16px; }
a.card-main:active { transform: scale(0.995); }
.item.locked .card { background: transparent; }
.item.locked .card-main h4 { color: var(--muted); }
.card-side { display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.icon-btn { width: 56px; flex: 1; min-height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--ink); cursor: pointer; text-decoration: none; transition: background-color var(--t-ui) var(--ease); }
.icon-btn + .icon-btn { border-top: 1px solid var(--line); }
.icon-btn svg { width: 18px; height: 18px; transition: transform var(--t-ui) var(--ease); }
.icon-btn[aria-expanded="true"] svg { transform: rotate(45deg); }
.icon-btn[aria-disabled="true"] { color: var(--line-strong); cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .item:not(.locked) .card:hover { border-color: var(--line-strong); }
  .icon-btn:not([aria-disabled="true"]):hover { background: var(--sunken); }
  .item:not(.locked) a.icon-btn:hover svg { transform: translateX(3px); }
}
.card-more { grid-column: 1 / -1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-ui) var(--ease); }
.card-more > div { overflow: hidden; }
.card-more.open { grid-template-rows: 1fr; }
.card-more p { padding: 0 20px 18px; color: var(--muted); font-size: 15px; max-width: 64ch; border-top: 1px solid var(--line); padding-top: 14px; }

.finish { position: relative; margin-top: 40px; display: flex; align-items: center; gap: 16px; }
.finish .node { position: relative; left: auto; top: auto; translate: none; margin-left: -56px; width: 40px; height: 40px; }
.finish.earned .node { background: var(--ok); border-color: var(--ok); color: #fff; }
.finish p { font-size: 14px; color: var(--muted); }

/* ---------- About panel ---------- */
.about { display: flex; flex-direction: column; gap: 40px; }
.about p { color: var(--muted); max-width: 66ch; }
.about p + p { margin-top: 12px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.facts > div { padding: 16px 16px 0 0; }
.facts b { display: block; font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
@media (max-width: 620px) { .facts { grid-template-columns: 1fr; } }

/* Certificate */
.cert {
  background: var(--charcoal); color: var(--on-dark); padding: clamp(28px, 5vw, 48px);
  clip-path: polygon(0 0, calc(100% - 32px) 0, 100% 32px, 100% 100%, 0 100%);
  max-width: 640px;
}
.cert-head, .cert-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cert img { height: 28px; width: auto; margin: 40px 0 24px; }
.cert h3 { font-size: 28px; margin-bottom: 20px; }
.cert-name { font-family: var(--mono); font-size: 20px; color: var(--muted-dark); border-bottom: 1px solid var(--line-dark); padding-bottom: 12px; margin-bottom: 14px; }
.cert-line { color: var(--muted-dark); max-width: 46ch; }
.cert-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line-dark); }

/* ---------- Footer ---------- */
.footer { background: var(--charcoal); color: var(--on-dark); padding: 48px 0 32px; }
.footer .top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--line-dark); }
.footer img { height: 32px; width: auto; }
.footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 14px; }
.footer a { text-decoration: none; color: var(--muted-dark); display: inline-block; padding: 12px 0; transition: color var(--t-press) var(--ease); }
@media (hover: hover) and (pointer: fine) { .footer a:hover { color: var(--on-dark); } }
.footer .base { padding-top: 20px; font-size: 13px; color: var(--muted-dark); }

/* ---------- Lesson page ---------- */
.lesson-head { padding: 56px 0 40px; }
.lesson-head h1 { max-width: 20ch; margin: 16px 0 20px; }
.lesson-head .lede { color: var(--muted-dark); }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line-dark); }

.lesson-layout { padding: 48px 0 0; }
.lesson-layout .wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; align-items: start; }
@media (max-width: 980px) { .lesson-layout .wrap { grid-template-columns: 1fr; gap: 24px; } }

.toc { position: sticky; top: calc(var(--navh) + 32px); }
.toc-head { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--ink); padding-top: 14px; margin-bottom: 8px; }
.toc-count { font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc ol { list-style: none; }
.toc a { display: grid; grid-template-columns: 28px minmax(0, 1fr) 16px; gap: 8px; align-items: center; padding: 7px 0; font-size: 14px; line-height: 1.35; text-decoration: none; color: var(--muted); transition: color var(--t-press) var(--ease); }
.toc a .n { font-family: var(--mono); font-size: 11px; }
.toc a .chk { width: 14px; height: 14px; color: var(--ok); opacity: 0; transform: scale(0.8); transition: opacity var(--t-ui) var(--ease), transform var(--t-ui) var(--ease); }
.toc a.read .chk { opacity: 1; transform: none; }
.toc a.current { color: var(--ink); font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .toc a:hover { color: var(--ink); } }
@media (max-width: 980px) {
  .toc { position: static; }
  .toc details:not([open]) ol { display: none; }
}
.toc summary { list-style: none; cursor: pointer; }
.toc summary::-webkit-details-marker { display: none; }

.video-callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; background: var(--charcoal); color: var(--on-dark); padding: 24px 28px; margin-bottom: 56px; }
.video-callout h2, .video-callout h3 { margin: 8px 0 6px; }
.video-callout .label { display: block; }
.video-callout p { color: var(--muted-dark); font-size: 15px; max-width: 54ch; }

.content article { max-width: 72ch; padding-bottom: 56px; }
.content article + article { padding-top: 8px; }
.content article h2 { margin-bottom: 4px; }
.content article p { color: #3B3D41; margin-top: 14px; line-height: 1.75; }
.content article p:first-of-type { margin-top: 18px; }
.content b { color: var(--ink); font-weight: 600; }
.content h3, .content h4 { margin-top: 32px; }

.obj-list { list-style: none; counter-reset: obj; margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.obj-list li { counter-increment: obj; position: relative; padding-left: 40px; color: #3B3D41; line-height: 1.6; }
.obj-list li::before { content: counter(obj, decimal-leading-zero); position: absolute; left: 0; top: 1px; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink); border: 1px solid var(--ink); padding: 1px 4px; line-height: 18px; }
.bullets { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.bullets li { position: relative; padding-left: 22px; color: #3B3D41; line-height: 1.65; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 8px; height: 2px; background: var(--ink); }

.callout { background: var(--raised); border: 1px solid var(--line); padding: 16px 20px; margin-top: 22px; font-size: 15px; color: #3B3D41; line-height: 1.65; }
.callout.exam { border-color: var(--ink); background: var(--raised); position: relative; }
.callout.exam::before { content: "[ Examinable ]"; display: block; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; color: var(--ink); }

.table-scroll { overflow-x: auto; margin-top: 20px; }
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--raised); margin-top: 20px; }
.dtable th, .dtable td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; line-height: 1.5; }
.dtable th { background: var(--sunken); font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.dtable td { color: #3B3D41; }
.dtable td:first-child, .dtable td b { color: var(--ink); }
.tcap { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.6; }
.figure { margin-top: 24px; }
.figure svg { width: 100%; height: auto; background: var(--raised); border: 1px solid var(--line); }
.eq { font-family: var(--mono); font-size: 15px; text-align: center; background: var(--raised); border: 1px solid var(--line); padding: 14px 16px; margin-top: 14px; overflow-x: auto; }
.eq-num { float: right; color: var(--muted); font-size: 12px; }
.flow { display: flex; flex-direction: column; margin-top: 20px; }
.flow-box { background: var(--ink); color: var(--paper); text-align: center; padding: 12px 16px; font-weight: 500; font-size: 14px; }
.flow-box.light { background: var(--raised); color: var(--ink); border: 1px solid var(--line); }
.flow-arrow { text-align: center; color: var(--muted); font-family: var(--mono); padding: 4px 0; }
.flow-note { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.phase-grid, .chain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.chain { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .phase-grid, .chain { grid-template-columns: 1fr; } }
.phase, .chain-step { border-top: 2px solid var(--ink); padding-top: 12px; }
.phase p, .chain-step p { font-size: 14px; margin-top: 6px; }
.sources { max-width: 72ch; padding: 32px 0 56px; border-top: 1px solid var(--line); }
.sources ul { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.sources li { color: var(--muted); font-size: 14px; line-height: 1.6; padding-left: 18px; position: relative; }
.sources li::before { content: "\2014"; position: absolute; left: 0; }

/* Section blocks below the reading */
.block { padding: 56px 0; border-top: 1px solid var(--line); }
.block h2 { margin: 4px 0 10px; }
.block > .lede, .block-intro { color: var(--muted); margin-bottom: 28px; max-width: 62ch; }

/* Practice problems */
.pq { border-top: 1px solid var(--line); }
.pq:last-child { border-bottom: 1px solid var(--line); }
.pq-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; width: 100%; padding: 18px 0; background: none; border: 0; text-align: left; cursor: pointer; }
.pq-num { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.pq-text { font-weight: 500; line-height: 1.5; }
.pq-toggle { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.pq-ans { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-ui) var(--ease); }
.pq-ans > div { overflow: hidden; }
.pq.open .pq-ans { grid-template-rows: 1fr; }
.pq-ans-in { padding: 0 0 20px 76px; color: #3B3D41; line-height: 1.7; font-size: 15px; }

/* Knowledge check */
.quiz-progress { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.quiz-progress .progress-track { flex: 1; background: var(--line); }
.quiz-progress .progress-fill { background: var(--ink); transition-duration: var(--t-ui); }
.qcard { background: var(--raised); border: 1px solid var(--line); padding: 20px 22px; margin-bottom: 12px; }
.qtext { font-weight: 500; margin-top: 6px; line-height: 1.5; }
.qopts { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.qopt { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: baseline; text-align: left; background: var(--raised); border: 1px solid var(--line); padding: 12px 14px; min-height: 44px; cursor: pointer; font-size: 15px; line-height: 1.5; transition: border-color var(--t-ui) var(--ease), background-color var(--t-ui) var(--ease), transform var(--t-press) var(--ease); }
.qopt .k { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.qopt:active:not(:disabled) { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) { .qopt:hover:not(:disabled) { border-color: var(--line-strong); } }
.qopt[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.qopt.correct { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.qopt.correct .k { color: var(--ok); }
.qopt.wrong { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.qopt:disabled { cursor: default; }
.qwhy { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: #3B3D41; font-size: 14px; line-height: 1.6; }
.qwhy .label { margin-right: 8px; }
.quiz-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 20px; }
.form-error { font-size: 14px; color: var(--danger); }
.qresult { background: var(--charcoal); color: var(--on-dark); padding: 28px; margin-top: 20px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 32px; align-items: center; }
.qscore { font-family: var(--display); font-size: 56px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; grid-row: span 2; }
.qresult p { color: var(--muted-dark); }
.qresult .btns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
@media (max-width: 560px) { .qresult { grid-template-columns: 1fr; } .qscore { grid-row: auto; } }

/* Next / previous */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 0 96px; }
.pager > a, .pager > span { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--line); background: var(--raised); text-decoration: none; transition: border-color var(--t-ui) var(--ease); }
.pager .next { text-align: right; align-items: flex-end; }
.pager > span { background: transparent; color: var(--muted); }
.pager b { font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .pager a:hover { border-color: var(--line-strong); } }

/* Exam page */
.exam-body { padding: 56px 0 96px; }
.exam-body .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
@media (max-width: 900px) { .exam-body .wrap { grid-template-columns: 1fr; } }
.check-list { list-style: none; border-top: 2px solid var(--ink); margin-top: 16px; }
.check-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.check-list .t { font-weight: 500; }

/* ---------- Motion ---------- */
.enter { animation: rise var(--t-panel) var(--ease) both; }
.enter-2 { animation-delay: 60ms; }
.enter-3 { animation-delay: 120ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0ms !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 620px) {
  .dtable { display: block; overflow-x: auto; }
  .pq-head { grid-template-columns: 56px minmax(0, 1fr); }
  .pq-toggle { grid-column: 2; }
  .pq-ans-in { padding-left: 0; }
  .syllabus { padding-left: 48px; }
  .node { left: -48px; width: 36px; height: 36px; }
  .rail { left: 17px; }
  .finish .node { margin-left: -48px; width: 36px; height: 36px; }
  .group-node { left: -38px; }
  .icon-btn { width: 48px; }
}

/* ================= Hub: header tools, course tabs, dashboards ================= */
.nav-tools { display: flex; align-items: center; gap: 8px; }
.nav-staff { text-decoration: none; padding: 14px 10px; color: var(--muted-dark); }
.nav-staff[aria-current="page"] { color: var(--on-dark); }
.pop { position: relative; }
.tool-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--on-dark); cursor: pointer; text-decoration: none; transition: transform var(--t-press) var(--ease); }
.tool-btn:active { transform: scale(0.94); }
.tool-btn svg { width: 22px; height: 22px; }
.badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center; background: var(--on-dark); color: var(--charcoal); font-family: var(--mono); font-size: 11px; font-weight: 500; line-height: 1; }
.badge[hidden] { display: none; }
.user-btn { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px; background: none; border: 0; color: var(--on-dark); cursor: pointer; font-size: 14px; font-weight: 500; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; background: var(--on-dark); color: var(--charcoal); font-family: var(--mono); font-size: 12px; font-weight: 500; }
@media (max-width: 620px) { .user-name { display: none; } .brand .label { display: none; } }
.panel-pop, .hub-drop .menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 280px; background: var(--raised); color: var(--ink); border: 1px solid var(--line-strong); animation: pop var(--t-ui) var(--ease); transform-origin: top right; }
.panel-pop[hidden], .menu[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.pop-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.pop-head .label { color: var(--muted); white-space: nowrap; }
.menu a, .menu button, .menu-off { display: flex; gap: 10px; align-items: baseline; width: 100%; padding: 12px 16px; min-height: 44px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; text-decoration: none; font-size: 14px; line-height: 1.4; color: var(--ink); cursor: pointer; }
.menu > :last-child { border-bottom: 0; }
.menu .label { color: var(--muted); flex: none; }
.menu-off { color: var(--line-strong); cursor: default; }
@media (hover: hover) and (pointer: fine) { .menu a:hover, .menu button:hover { background: var(--sunken); } }

.hub { border-bottom: 1px solid var(--line-dark); }
.hub-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 20px 0 6px; }
.hub-name { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }
.hub-tabs { display: flex; gap: 28px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); }
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-tabs a { position: relative; flex: none; padding: 14px 0; font-size: 14px; font-weight: 500; color: var(--muted-dark); text-decoration: none; transition: color var(--t-press) var(--ease); }
.hub-tabs a[aria-current="page"] { color: var(--on-dark); }
.hub-tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--on-dark); }
@media (hover: hover) and (pointer: fine) { .hub-tabs a:hover { color: var(--on-dark); } }
.hub-drop { display: flex; align-items: center; flex: none; position: static; }
.hub-drop-btn { width: 32px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--muted-dark); cursor: pointer; }
.hub-drop-btn svg { width: 16px; height: 16px; transition: transform var(--t-ui) var(--ease); }
.hub-drop-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.hub .wrap { position: relative; }
.hub-drop .menu { left: var(--pad); right: auto; top: 100%; width: min(420px, calc(100vw - 2 * var(--pad))); transform-origin: top left; }

/* Page head used by hub pages */
.page-head { padding: 48px 0 40px; }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3.5rem); margin: 12px 0 14px; }
.page-head .lede { color: var(--muted-dark); }
.page-body { padding: 48px 0 96px; }
.page-body h2 { font-size: 24px; margin-bottom: 14px; }
.stack { display: flex; flex-direction: column; gap: 48px; }
.prose p { color: var(--muted); max-width: 66ch; }
.prose p + p { margin-top: 12px; }
.note { font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; background: var(--danger); margin-right: 8px; vertical-align: 1px; }

/* Dashboard */
.dash { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .dash { grid-template-columns: 1fr; } }
.dash-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.tile { background: var(--raised); border: 1px solid var(--line); padding: 24px; }
.tile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.tile-head a { text-decoration: none; }
.next-up h3 { font-size: 26px; margin: 10px 0 10px; max-width: 24ch; }
.next-up p { color: var(--muted); max-width: 60ch; }
.next-up p + p { margin-top: 20px; }
.rows { list-style: none; border-top: 1px solid var(--line); }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.rows li:last-child { border-bottom: 0; padding-bottom: 0; }
.rows a { text-decoration: none; }
.rows .t { font-weight: 500; }
.rows .label { text-align: right; flex: none; max-width: 50%; }
@media (hover: hover) and (pointer: fine) { .rows a:hover .t, .news-item a:hover h4, .table a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.news-list { list-style: none; }
.news-item { padding: 14px 0; border-top: 1px solid var(--line); }
.news-item:first-child { border-top: 0; padding-top: 0; }
.news-item a { text-decoration: none; display: block; }
.news-item h3, .news-item h4 { font-family: var(--sans); font-size: 16px; font-weight: 500; letter-spacing: -0.01em; margin: 6px 0 4px; line-height: 1.35; }
.news-item p { font-size: 14px; color: var(--muted); line-height: 1.6; white-space: pre-line; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; list-style: none; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat-row b { display: block; font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-bottom: 2px; }

/* Tables */
.table-box { overflow-x: auto; background: var(--raised); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.table th, .table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--sunken); }
.table td:first-child { font-weight: 500; }
.table .num, .table td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table a { text-decoration: none; }

/* Messages */
.msg-search { position: relative; margin-bottom: 16px; }
.msg-search svg { position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.msg-search input { width: 100%; height: 52px; padding: 0 16px 0 46px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 0; font-size: 16px; }
.msg { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); background: var(--raised); border: 1px solid var(--line); min-height: 480px; }
@media (max-width: 820px) { .msg { grid-template-columns: 1fr; } .msg-list-col { border-right: 0 !important; border-bottom: 1px solid var(--line); } }
.msg-list-col { border-right: 1px solid var(--line); min-width: 0; }
.msg-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 16px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--muted); }
#msgList { list-style: none; }
#msgList .empty { padding: 20px 16px; }
.msg-row { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 14px 16px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; transition: background-color var(--t-press) var(--ease); }
.msg-row[aria-current="true"] { background: var(--sunken); }
@media (hover: hover) and (pointer: fine) { .msg-row:hover { background: var(--paper); } }
.msg-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.msg-subj { font-size: 15px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row.unread .msg-subj { font-weight: 600; }
.msg-pane { padding: 32px; min-width: 0; }
.msg-open:focus { outline: none; }
.msg-open h2 { font-size: 28px; margin: 10px 0 16px; }
.msg-open p { color: #3B3D41; max-width: 64ch; line-height: 1.75; }
.msg-empty { height: 100%; min-height: 240px; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); font-weight: 500; text-align: center; }
.msg-empty svg { width: 32px; height: 32px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 12px 14px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 0; font-size: 16px; line-height: 1.5; }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible, .msg-search input:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form-error[hidden], .form-ok[hidden] { display: none; }
.form-ok { font-size: 14px; color: var(--ok); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

/* Sign-in */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-art { min-height: 220px; } }
.login-art { position: relative; background: var(--charcoal); color: var(--on-dark); padding: var(--pad); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; overflow: hidden; }
.login-art svg.stripes { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-art > * { position: relative; }
.login-art img { height: 28px; width: auto; }
.login-art h1 { font-size: clamp(2.2rem, 4.6vw, 4rem); max-width: 12ch; }
.login-art .lede { color: var(--muted-dark); margin-top: 16px; max-width: 40ch; }
.login-form { display: grid; place-items: center; padding: 48px var(--pad); }
.login-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 24px; }
.login-card h2 { font-size: 32px; }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); }
.seg button { position: relative; z-index: 1; min-height: 44px; background: none; border: 0; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--ink); transition: color var(--t-ui) var(--ease); }
.seg button[aria-pressed="true"] { color: var(--paper); }
.seg-ink { position: absolute; top: 0; bottom: 0; left: 0; width: 50%; background: var(--ink); transition: transform var(--t-ui) var(--ease); }
.hub-tabs .menu a { flex: initial; padding: 12px 16px; color: var(--ink); font-weight: 400; }
.hub-tabs .menu a::after { content: none; }
.hub-tabs .menu a:hover { color: var(--ink); }
.login-art img { align-self: flex-start; }
#chrome { display: contents; }

/* ---------- Interactive labs ---------- */
.lab { background: var(--charcoal); color: var(--on-dark); border: 1px solid #000; margin: 8px 0 64px; padding: 24px 24px 20px; max-width: 980px; }
.lab-head .tag { color: var(--muted-dark); }
.lab-head h3 { color: var(--on-dark); margin: 10px 0 8px; font-size: 1.35rem; }
.lab-head p { color: var(--muted-dark); font-size: 15px; line-height: 1.6; max-width: 72ch; }
.lab-stage { margin: 20px -8px 0; border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); padding: 8px 0; }
.lab-stage canvas { display: block; width: 100%; }
.lab-stage canvas:focus-visible { outline: 2px solid var(--on-dark); outline-offset: 2px; }
.lab-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px 28px; margin-top: 20px; }
.lab-ctl { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 6px 10px; }
.lab-ctl label { font-size: 13px; color: var(--muted-dark); }
.lab-ctl output { font-family: var(--mono); font-size: 13px; color: var(--on-dark); font-variant-numeric: tabular-nums; }
.lab-ctl input[type=range], .lab-ctl select { grid-column: 1 / -1; width: 100%; }
.lab-ctl select { background: var(--graphite); color: var(--on-dark); border: 1px solid var(--line-dark); font: 13px var(--sans); padding: 8px; }
.lab input[type=range] { -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; }
.lab input[type=range]::-webkit-slider-runnable-track { height: 2px; background: #4A4C52; }
.lab input[type=range]::-moz-range-track { height: 2px; background: #4A4C52; }
.lab input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; background: var(--on-dark); border: 0; transition: transform var(--t-press) var(--ease); }
.lab input[type=range]::-moz-range-thumb { width: 14px; height: 14px; background: var(--on-dark); border: 0; border-radius: 0; }
.lab input[type=range]:active::-webkit-slider-thumb { transform: scale(1.25); }
.lab input[type=range]:focus-visible { outline: 2px solid var(--on-dark); outline-offset: 2px; }
.lab-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.lab-btn, .lab-reset { font: 500 13px var(--sans); color: var(--on-dark); background: transparent; border: 1px solid #4A4C52; padding: 9px 14px; cursor: pointer; transition: transform var(--t-press) var(--ease), background var(--t-ui) var(--ease); }
.lab-btn:hover, .lab-reset:hover { background: var(--graphite); }
.lab-btn:active, .lab-reset:active { transform: scale(0.97); }
.lab-btn.primary { background: var(--on-dark); color: var(--charcoal); border-color: var(--on-dark); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); }
.lab-btn:focus-visible, .lab-reset:focus-visible { outline: 2px solid var(--on-dark); outline-offset: 2px; }
.lab-read { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); margin-top: 20px; }
.lab-read > div { background: var(--charcoal); padding: 12px 14px; }
.lab-read > div.wide { grid-column: 1 / -1; }
.lab-read dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-dark); }
.lab-read dd { margin: 4px 0 0; font-family: var(--display); font-size: 18px; font-variant-numeric: tabular-nums; color: var(--on-dark); }
.lab-read .wide dd { font-family: var(--sans); font-size: 15px; }
.lab-read .ok dd { color: var(--ok-dark); } .lab-read .warn dd { color: var(--warn-dark); } .lab-read .bad dd { color: #FF6B6B; }
.lab-note { font-size: 13px; color: var(--muted-dark); margin-top: 14px; }
.lab-try { font-size: 14px; color: #D6D7DA; margin-top: 14px; line-height: 1.6; max-width: 80ch; }
.lab-try b { color: var(--on-dark); }
.lab-reset { margin-top: 14px; font-size: 12px; padding: 6px 10px; color: var(--muted-dark); }
@media (max-width: 640px) { .lab { padding: 18px 14px; margin-left: calc(var(--pad) * -1); margin-right: calc(var(--pad) * -1); } }

/* ---------- One-at-a-time knowledge check ---------- */
.qdots { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex: 1; justify-content: flex-end; }
.qdots li { width: 22px; height: 4px; background: var(--line); transition: background-color var(--t-ui) var(--ease); }
.qdots li.now { background: var(--ink); }
.qdots li.ok { background: var(--ok); }
.qdots li.bad { background: var(--danger); }
.qsingle { padding: 28px 30px; min-height: 360px; }
.qsingle .qtext { font-size: 18px; font-weight: 500; line-height: 1.45; margin-top: 10px; }
.qsingle.enter { animation: qIn 320ms var(--ease) both; }
@keyframes qIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.qopt { grid-template-columns: 28px minmax(0, 1fr) 28px; position: relative; }
.qm { display: flex; align-items: center; justify-content: center; align-self: center; width: 28px; height: 28px; }
.qmark { width: 24px; height: 24px; fill: none; stroke-width: 2.6; stroke-linecap: square; }
.qopt.correct { background: #EEF7F1; }
.qopt.correct .qmark { stroke: var(--ok); }
.qopt.correct .qmark path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: qDraw 360ms 80ms var(--ease) forwards; }
.qopt.correct.picked { animation: qPop 420ms var(--ease); }
.qopt.correct.picked::after { content: ""; position: absolute; inset: -1px; border: 2px solid var(--ok); animation: qRing 600ms 60ms var(--ease) both; pointer-events: none; }
.qopt.wrong { background: #FBEDED; }
.qopt.wrong .k { color: var(--danger); }
.qopt.wrong .qmark { stroke: var(--danger); stroke-width: 3; }
.qopt.wrong .qmark path { stroke-dasharray: 16; stroke-dashoffset: 16; animation: qDraw 220ms var(--ease) forwards; }
.qopt.wrong .qmark path + path { animation-delay: 140ms; }
.qopt.wrong.picked { animation: qShake 380ms var(--ease); }
.qopt.correct.reveal { animation: qFadeIn 320ms 380ms var(--ease) both; }
.qopt.dim { opacity: 0.45; }
.qopt:disabled { color: var(--ink); }
@keyframes qDraw { to { stroke-dashoffset: 0; } }
@keyframes qPop { 0% { transform: scale(1); } 40% { transform: scale(1.025); } 100% { transform: scale(1); } }
@keyframes qRing { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(1.04, 1.25); } }
@keyframes qShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@keyframes qFadeIn { from { background: var(--raised); border-color: var(--line); } }
.qfeedback { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); animation: qUp 280ms 200ms var(--ease) both; }
.qfeedback p { color: #3B3D41; font-size: 15px; line-height: 1.65; margin: 8px 0 18px; max-width: 70ch; }
.label.bad { color: var(--danger); }
@keyframes qUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.qresult.enter { animation: qUp 320ms var(--ease) both; }
.qreview { margin-top: 28px; }
.qreview-item { background: var(--raised); border: 1px solid var(--line); padding: 18px 20px; margin-top: 12px; }
.qreview-item .qtext { font-weight: 500; }
.qr-line { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin-top: 8px; line-height: 1.5; }
.qr-line .qmark { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.qr-line.ok .qmark { stroke: var(--ok); } .qr-line.bad .qmark { stroke: var(--danger); }
.qr-why { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.6; }
@media (max-width: 560px) { .qsingle { padding: 20px 16px; } .qdots li { width: 12px; } }
@media (prefers-reduced-motion: reduce) {
  .qsingle.enter, .qopt.correct.picked, .qopt.correct.picked::after, .qopt.wrong.picked, .qopt.correct.reveal, .qfeedback, .qresult.enter { animation: none; }
  .qopt .qmark path { animation: none !important; stroke-dashoffset: 0 !important; }
}

/* ================= Public site, applications, dashboard, profile, exam ================= */
.btn-sm { min-height: 38px; padding: 8px 16px; font-size: 14px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.pub-links { display: flex; gap: 28px; font-size: 14px; font-weight: 500; }
.pub-links a { color: var(--muted-dark); text-decoration: none; padding: 12px 0; transition: color var(--t-press) var(--ease); }
.pub-links a:hover { color: var(--on-dark); }
.pub-tools { gap: 18px; }
.pub-signin { color: var(--on-dark); text-decoration: none; font-size: 14px; font-weight: 500; padding: 12px 4px; }
@media (max-width: 760px) { .pub-links { display: none; } }

.hero { position: relative; overflow: hidden; padding: 72px 0 80px; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 0 38%, #1A1B1E 38% 46%, transparent 46% 58%, #1A1B1E 58% 62%, transparent 62%); opacity: 0.9; pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.6rem); max-width: 14ch; margin: 18px 0 22px; }
.hero .lede { color: #C9CACE; max-width: 54ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { margin-top: 22px; display: block; }
.hero-art svg { width: 100%; height: auto; display: block; }
.hero-art .draw path { stroke-dasharray: 900; stroke-dashoffset: 900; animation: heroDraw 1600ms 200ms var(--ease) forwards; }
@keyframes heroDraw { to { stroke-dashoffset: 0; } }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { max-width: 420px; } .hero { padding: 48px 0 56px; } }
@media (prefers-reduced-motion: reduce) { .hero-art .draw path { animation: none; stroke-dashoffset: 0; } }

.pub-sec { padding: 80px 0; }
.pub-sec.alt { background: var(--raised); border-block: 1px solid var(--line); }
.pub-sec h2, .pub-cta h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); max-width: 22ch; margin: 12px 0 0; }
.pub-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
@media (max-width: 860px) { .pub-two { grid-template-columns: 1fr; gap: 24px; } .pub-sec { padding: 56px 0; } }
.pub-prose p { color: #3B3D41; line-height: 1.75; margin-bottom: 16px; max-width: 62ch; }
.pub-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 28px; }
.pub-facts div { background: var(--paper); padding: 16px; }
.pub-facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pub-facts dd { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 0; }
@media (max-width: 520px) { .pub-facts { grid-template-columns: repeat(2, 1fr); } }
.pub-syllabus { list-style: none; margin-top: 36px; border-top: 2px solid var(--ink); }
.pub-syllabus li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--line); }
.pub-syllabus h3 { font-size: 1.15rem; }
.pub-syllabus p { color: var(--muted); font-size: 15px; margin-top: 4px; max-width: 70ch; }
@media (max-width: 620px) { .pub-syllabus li { grid-template-columns: 48px minmax(0, 1fr); } .pub-syllabus li > .label:last-child { grid-column: 2; } }
.pub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 36px; }
.pub-card { background: var(--paper); padding: 28px 24px; }
.pub-card svg { width: 44px; height: 44px; fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-linecap: square; margin-bottom: 18px; }
.pub-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.pub-card p { color: var(--muted); font-size: 15px; line-height: 1.6; }
@media (max-width: 860px) { .pub-grid { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 520px) { .pub-grid { grid-template-columns: 1fr; } }
.pub-steps { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; margin-top: 36px; }
.pub-steps li { border-top: 2px solid var(--ink); padding-top: 14px; }
.pub-steps h3 { font-size: 1.1rem; margin: 8px 0 6px; }
.pub-steps p { color: var(--muted); font-size: 14px; line-height: 1.6; }
@media (max-width: 900px) { .pub-steps { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 480px) { .pub-steps { grid-template-columns: 1fr; } }
.pub-list { margin: 4px 0 24px 18px; color: #3B3D41; line-height: 1.8; }
.pub-faq { border-top: 1px solid var(--line); padding: 14px 0; }
.pub-faq:last-child { border-bottom: 1px solid var(--line); }
.pub-faq summary { cursor: pointer; font-weight: 500; }
.pub-faq p { margin: 10px 0 0; color: var(--muted); }
.pub-cta { padding: 72px 0; }
.pub-cta .lede { color: var(--muted-dark); margin-top: 12px; }

.apply-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .apply-grid { grid-template-columns: 1fr; } }
.apply-side { display: flex; flex-direction: column; gap: 24px; }
.apply-form { gap: 28px; padding: 32px; }
.apply-form fieldset { border: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.apply-form legend { font-family: var(--display); font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; padding: 0 0 6px; display: flex; gap: 12px; align-items: baseline; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 620px) { .field-row, .field-row.three { grid-template-columns: 1fr; } .apply-form { padding: 20px; } }
.field select { width: 100%; min-height: 48px; padding: 12px 14px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 0; font-size: 16px; }
.field select:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.hint { font-size: 13px; color: var(--muted); }
.opt { font-weight: 400; color: var(--muted); }
.check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 15px; line-height: 1.5; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); }
.apply-done p { margin-top: 12px; color: #3B3D41; } .apply-done h2 { margin-top: 10px; }
.status-line { margin-top: 16px; font-size: 15px; line-height: 1.7; }
.rows.plain { border-top: 0; }
.login-alt { font-size: 14px; color: var(--muted); }
.form-error a { color: inherit; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: 6px; align-items: baseline; border: 1px solid var(--line-strong); padding: 5px 10px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; }
.dark .chip { border-color: #4A4C52; color: var(--muted-dark); } .dark .chip b { color: var(--on-dark); }
.chip-solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.feat { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 24px; align-items: center; background: var(--raised); border: 1px solid var(--line); padding: 28px; transition: border-color var(--t-ui) var(--ease); }
.feat:hover { border-color: var(--line-strong); }
.feat h2 { font-size: 1.5rem; margin: 8px 0 6px; }
.feat p { color: var(--muted); font-size: 15px; margin-bottom: 18px; max-width: 46ch; }
.feat-art { width: 112px; height: 112px; color: var(--ink); justify-self: end; }
.feat-lead { background: var(--charcoal); color: var(--on-dark); border-color: var(--charcoal); }
.feat-lead p, .feat-lead .label { color: var(--muted-dark); } .feat-lead .feat-art { color: var(--on-dark); }
.feat-lead .btn-primary { background: var(--on-dark); color: var(--charcoal); }
@media (max-width: 560px) { .feat { grid-template-columns: 1fr; } .feat-art { display: none; } }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--ink); stroke-width: 8; transition: stroke-dashoffset 700ms var(--ease); }
.ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-in b { font-family: var(--display); font-size: 28px; letter-spacing: -0.02em; }
.ring-initials { width: 84px; height: 84px; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-family: var(--display); font-size: 30px; font-weight: 600; }
.prog-box { display: flex; gap: 24px; align-items: center; }
.stat-col { display: flex; flex-direction: column; gap: 10px; }
.stat-col b { font-family: var(--display); font-size: 20px; margin-right: 8px; font-variant-numeric: tabular-nums; }
.week { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 110px; }
.week li { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.week .bar { flex: 1; width: 100%; background: var(--sunken); display: flex; align-items: flex-end; }
.week .bar i { display: block; width: 100%; background: var(--ink); }

.prof-top { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: stretch; }
@media (max-width: 820px) { .prof-top { grid-template-columns: 1fr; } }
.prof-card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.prof-card h2 { margin: 6px 0 0; font-size: 22px; }
.prof-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); width: 100%; margin: 8px 0; }
.prof-mini div { background: var(--raised); padding: 10px 4px; }
.prof-mini dt, .prof-info dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.prof-mini dd { margin: 2px 0 0; font-family: var(--display); font-weight: 600; font-size: 18px; }
.prof-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.prof-info dd { margin: 4px 0 0; font-size: 16px; overflow-wrap: anywhere; }
@media (max-width: 560px) { .prof-info { grid-template-columns: 1fr; } }
.prof-sub { font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0; margin: 22px 0 8px; }
.prof-block { margin-top: 40px; }
.chips-pick { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips-pick legend { font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { display: inline-block; border: 1px solid var(--line-strong); padding: 8px 12px; font-size: 14px; cursor: pointer; transition: background var(--t-ui) var(--ease), color var(--t-ui) var(--ease); }
.chip-check input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-check input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.badges { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.badge-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; background: var(--raised); border: 1px solid var(--line); padding: 14px; color: var(--muted); }
.badge-item b { display: block; font-weight: 500; }
.badge-mark { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line-strong); }
.badge-mark svg { width: 20px; height: 20px; }
.badge-item.earned { color: var(--ink); border-color: var(--ink); }
.badge-item.earned .badge-mark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.badge-item.earned .label { color: var(--ok); }
.heat-scroll { overflow-x: auto; }
.heat { min-width: 760px; }
.heat-months, .heat-grid { display: grid; grid-template-columns: repeat(53, 1fr); gap: 3px; }
.heat-months span { font-family: var(--mono); font-size: 10px; color: var(--muted); white-space: nowrap; overflow: visible; height: 16px; }
.heat-col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat-col i, .heat-key i { display: block; aspect-ratio: 1; background: var(--sunken); }
.heat-key { display: flex; align-items: center; gap: 5px; justify-content: center; margin-top: 14px; }
.heat-key i { width: 12px; }
.heat i.off { background: transparent; }
.heat i.l1, .heat-key i.l1 { background: #C4C5C1; } .heat i.l2, .heat-key i.l2 { background: #8E9094; } .heat i.l3, .heat-key i.l3 { background: #4A4C52; } .heat i.l4, .heat-key i.l4 { background: var(--ink); }
.stat-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) { .stat-row.four { grid-template-columns: repeat(2, 1fr); } }
.labs-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; align-items: start; }

.app-list { list-style: none; }
.app-item { padding: 16px 0; border-top: 1px solid var(--line); }
.app-item:first-child { border-top: 0; padding-top: 0; }
.app-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.app-item details { margin-top: 10px; font-size: 14px; } .app-item summary { cursor: pointer; color: var(--muted); }
.app-why { margin-top: 10px; line-height: 1.6; white-space: pre-line; }
.app-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-top: 12px; }
.app-dl dt { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); } .app-dl dd { margin: 0; }
.app-actions { display: flex; gap: 8px; margin-top: 12px; }
.log { list-style: none; font-family: var(--mono); font-size: 11px; line-height: 1.7; color: var(--muted); margin-top: 6px; }

/* ---------- Exam environment ---------- */
.exam-mode { background: #E9E9E6; }
.ex-banner { background: var(--charcoal); color: var(--on-dark); text-align: center; font-size: 13px; padding: 7px 12px; font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.ex-banner.practice { background: var(--danger); } .ex-banner.review { background: #1F7A4D; }
.ex-head { position: sticky; top: 0; z-index: 40; background: var(--charcoal); color: var(--on-dark); display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 var(--pad); height: 56px; border-bottom: 1px solid var(--line-dark); }
.ex-brand { display: flex; align-items: center; gap: 14px; } .ex-brand img { height: 22px; width: auto; } .ex-brand .label { color: var(--on-dark); border-left: 1px solid var(--line-dark); padding-left: 14px; }
.ex-tools { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.ex-timer { font-family: var(--mono); font-size: 20px; font-variant-numeric: tabular-nums; padding: 4px 12px; border: 1px solid #4A4C52; }
.ex-timer.low { color: #FF6B6B; border-color: #FF6B6B; }
.ex-strikes { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-dark); } .ex-strikes.hot { color: var(--warn-dark); }
.ex-user { color: var(--muted-dark); } @media (max-width: 700px) { .ex-user, .ex-brand .label { display: none; } }
.ex-title { background: var(--graphite); color: var(--on-dark); padding: 26px 0; }
.ex-title h1 { font-size: clamp(1.4rem, 3vw, 2.1rem); }
.ex-wrap { max-width: 1280px; margin: 0 auto; padding-inline: var(--pad); }
.ex-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; padding: 20px 0 80px; }
@media (max-width: 900px) { .ex-layout { grid-template-columns: 1fr; } }
.ex-nav { position: sticky; top: 76px; background: var(--raised); border: 1px solid var(--line); padding: 16px; max-height: calc(100vh - 96px); overflow-y: auto; }
@media (max-width: 900px) { .ex-nav { position: static; max-height: none; } }
.ex-nav h2 { font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0; background: var(--sunken); margin: -16px -16px 12px; padding: 12px 16px; }
.ex-nav h3 { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0; margin: 14px 0 8px; line-height: 1.35; }
.ex-tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-tile { width: 30px; height: 30px; font: 500 12px var(--mono); background: var(--raised); border: 1px solid var(--line-strong); cursor: pointer; position: relative; }
.ex-tile.att, .ex-key i.att { background: #BFE5D0; border-color: #1F7A4D; } .ex-tile.unsure, .ex-key i.unsure { background: #F7D58B; border-color: #8F5A00; }
.ex-tile.right, .ex-key i.right { background: #1F7A4D; color: #fff; border-color: #1F7A4D; } .ex-tile.wrong, .ex-key i.wrong { background: var(--danger); color: #fff; border-color: var(--danger); }
.ex-tile.cur { outline: 2px solid var(--ink); outline-offset: 1px; }
.ex-key { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 4px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.ex-key span { display: flex; align-items: center; gap: 8px; } .ex-key i { width: 12px; height: 12px; border: 1px solid var(--line-strong); display: block; }
.ex-q { display: grid; grid-template-columns: 92px minmax(0, 1fr); background-color: var(--raised); background-image: var(--wm); border: 1px solid var(--line); margin-bottom: 14px; -webkit-user-select: none; user-select: none; }
.ex-gut { border-right: 2px dashed var(--ink); padding: 18px 10px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 24px; }
.ex-qn { text-align: center; } .ex-qn b { font-family: var(--display); font-size: 34px; line-height: 1; display: block; } .ex-qn span { font-size: 11px; color: var(--muted); }
.ex-unsure { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; } .ex-unsure input { width: 16px; height: 16px; accent-color: var(--warn); }
.ex-body { position: relative; padding: 22px 76px 16px 24px; min-width: 0; }
.ex-marks { position: absolute; right: 16px; top: 16px; text-align: center; font-size: 11px; color: var(--muted); }
.ex-marks b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 13px; margin: 0 auto 3px; }
.ex-text { font-size: 16px; line-height: 1.6; max-width: 74ch; }
.ex-info h2 { font-size: 1.15rem; margin-bottom: 8px; } .ex-info .ex-gut { justify-content: center; }
.ex-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; max-width: 78ch; }
.ex-opt { display: grid; grid-template-columns: 20px 22px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 11px 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.86); cursor: pointer; font-size: 15px; line-height: 1.5; }
.ex-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ex-opt input { accent-color: var(--ink); } .ex-opt .k { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.ex-opt.right { border-color: var(--ok); background: #EEF7F1; } .ex-opt.wrong { border-color: var(--danger); background: #FBEDED; }
.ex-numrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; font-size: 15px; }
.ex-num-in { width: 150px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-strong); background: #fff; font: 16px var(--mono); -webkit-user-select: text; user-select: text; }
.ex-num-in:focus-visible { outline: 2px solid var(--ink); }
.ex-num-in.right { border-color: var(--ok); background: #EEF7F1; } .ex-num-in.wrong { border-color: var(--danger); background: #FBEDED; }
.ex-unit { font-family: var(--mono); font-size: 14px; } .ex-verdict { font-size: 13px; font-weight: 600; } .ex-verdict.right { color: var(--ok); } .ex-verdict.wrong { color: var(--danger); }
.ex-foot { display: flex; justify-content: flex-end; gap: 20px; margin-top: 18px; }
.ex-link { background: none; border: 0; padding: 8px 0; font: 500 13px var(--sans); color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ex-notes { margin-top: 8px; background: #FAF6E3; border: 1px solid #E5DDB5; padding: 12px; } .ex-notes label { font-size: 13px; display: block; margin-bottom: 6px; }
.ex-notes textarea { width: 100%; min-height: 80px; border: 1px solid var(--line-strong); padding: 8px; font: 14px var(--sans); background: #fff; -webkit-user-select: text; user-select: text; }
.ex-why { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.6; } .ex-why p { margin-top: 6px; color: #3B3D41; max-width: 74ch; }
.ex-pager { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px; }
.ex-intro { max-width: 860px; padding: 24px 0 80px; display: flex; flex-direction: column; gap: 16px; }
.ex-card { background: var(--raised); border: 1px solid var(--line); padding: 28px; } .ex-card h2 { margin: 8px 0 14px; } .ex-card h3 { font-size: 1rem; margin: 22px 0 8px; }
.ex-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.ex-facts div { background: var(--raised); padding: 12px; } .ex-facts dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); } .ex-facts dd { margin: 2px 0 0; font-family: var(--display); font-size: 22px; font-weight: 600; }
@media (max-width: 560px) { .ex-facts { grid-template-columns: repeat(2, 1fr); } .ex-q { grid-template-columns: 62px minmax(0, 1fr); } .ex-body { padding: 18px 56px 14px 14px; } }
.ex-rules { margin: 0 0 0 18px; line-height: 1.75; color: #3B3D41; font-size: 15px; } .ex-card form { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.ex-result { display: flex; gap: 24px; align-items: center; background: var(--charcoal); color: var(--on-dark); padding: 24px 28px; margin-top: 20px; }
.ex-result p { color: var(--muted-dark); margin-top: 6px; font-size: 15px; } .ex-result .label.ok { color: var(--ok-dark); } .ex-result .label.warn { color: var(--warn-dark); }
.ex-score b { font-family: var(--display); font-size: 56px; line-height: 1; } .ex-score span { color: var(--muted-dark); margin-left: 6px; }
.ex-modal { position: fixed; inset: 0; z-index: 90; background: rgba(18,19,21,0.86); display: grid; place-items: center; padding: 20px; }
.ex-modal-box { background: var(--raised); max-width: 480px; padding: 28px; border-top: 4px solid var(--danger); animation: pop var(--t-ui) var(--ease); } .ex-modal-box h2 { margin: 10px 0; } .ex-modal-box p { color: #3B3D41; margin-bottom: 20px; line-height: 1.6; }
@media print { .exam-mode * { display: none !important; } .exam-mode::after { content: "Printing is turned off during an exam."; } }
.ex-title h1 { max-width: none; }
.pub-signin { white-space: nowrap; }
.labs-index .tile-head { flex-direction: column; gap: 4px; }

/* ================= Motion system (html.m is set unless reduced motion is on) ================= */
html.m body { animation: pageIn 280ms var(--ease) both; }
@keyframes pageIn { from { opacity: 0; } }
html.m [data-m] { transition: opacity 560ms var(--ease) var(--d, 0ms), transform 640ms var(--ease) var(--d, 0ms), clip-path 720ms var(--ease) var(--d, 0ms), filter 560ms var(--ease) var(--d, 0ms); will-change: transform, opacity; }
html.m [data-m="up"] { opacity: 0; transform: translateY(26px); }
html.m [data-m="fade"] { opacity: 0; }
html.m [data-m="left"] { opacity: 0; transform: translateX(-30px); }
html.m [data-m="side-l"] { opacity: 0; transform: translateX(-44px); }
html.m [data-m="side-r"] { opacity: 0; transform: translateX(44px); }
html.m [data-m="scale"] { opacity: 0; transform: scale(0.9); }
html.m [data-m="pop"] { opacity: 0; transform: scale(0.82); transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }
html.m [data-m="flip"] { opacity: 0; transform: perspective(700px) rotateX(-75deg); transform-origin: 50% 0; }
html.m [data-m="wipe"] { clip-path: inset(0 100% 0 0); }
html.m [data-m="rule"] { clip-path: inset(0 100% 0 0); transform: translateX(-12px); }
html.m [data-m="step"] { clip-path: inset(0 100% 0 0); }
html.m [data-m="shutter"] { clip-path: inset(0 0 100% 0); transform: translateY(18px); }
html.m [data-m="slide"] { opacity: 0; transform: translateX(-18px); box-shadow: -4px 0 0 var(--ink); }
html.m [data-m="focus"] { opacity: 0; transform: scale(0.96); filter: blur(6px); }
html.m [data-m="heat"] { opacity: 0; transform: translateY(8px); }
html.m [data-m="bar"] .bar i { transform: scaleY(0); }
html.m .week .bar i { transform-origin: 50% 100%; transition: transform 700ms var(--ease) var(--d, 0ms); }
html.m [data-m].in { opacity: 1; transform: none; clip-path: inset(0 0 0 0); filter: none; box-shadow: none; }
html.m [data-m="bar"].in .bar i { transform: none; }

/* Headline words rise from a mask */
html.m h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
html.m h1 .w > span { display: inline-block; animation: wordUp 720ms var(--ease) both; }
@keyframes wordUp { from { transform: translateY(105%) rotate(4deg); } }

/* Icons draw their own outlines */
html.m .sd { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 900ms var(--ease); }
html.m .sd.on { stroke-dashoffset: 0; }
.done-mark { width: 64px; height: 64px; fill: none; stroke: var(--ok); stroke-width: 3; stroke-linecap: square; margin-bottom: 14px; }

/* Hero: floating drawing, marching dimension lines, a sweep of light */
.hero::before { transform: translateX(var(--sx, 0px)); transition: transform 300ms linear; }
html.m .hero-art { transition: transform 120ms linear; }
html.m .hero-art svg { animation: heroFloat 7s ease-in-out infinite; }
@keyframes heroFloat { 50% { transform: translateY(-10px); } }
html.m .hero-art svg g[stroke-dasharray] { animation: march 1.6s linear infinite; }
@keyframes march { to { stroke-dashoffset: -16; } }
html.m .hero-art { position: relative; }
html.m .hero-art::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent); animation: scan 5.5s 1.8s var(--ease) infinite; opacity: 0; }
@keyframes scan { 0% { top: 4%; opacity: 0; } 12% { opacity: 1; } 70% { top: 96%; opacity: 1; } 80%, 100% { top: 96%; opacity: 0; } }
html.m .hero-art circle { transform-origin: 280px 155px; animation: ping 2.4s ease-out infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: 1; } 70% { transform: scale(2.2); opacity: 0; } 100% { transform: scale(2.2); opacity: 0; } }
html.m .login-art svg.stripes { animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate3d(-2%, -1%, 0) scale(1.06); } to { transform: translate3d(2%, 1%, 0) scale(1.06); } }

/* Ticker band */
.ticker { background: var(--ink); color: var(--muted-dark); overflow: hidden; border-top: 1px solid var(--line-dark); }
.ticker-run { display: flex; gap: 40px; width: max-content; padding: 12px 0; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
html.m .ticker-run { animation: ticker 46s linear infinite; }
.ticker:hover .ticker-run { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
.scrollbar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--on-dark); transform-origin: 0 50%; transform: scaleX(0); }

/* Hover and press: each control answers differently */
.btn { position: relative; overflow: hidden; }
html.m .btn-primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(128,128,128,0.35), transparent); transform: skewX(-20deg); }
@media (hover: hover) and (pointer: fine) {
  html.m .btn-primary:hover::after { animation: sheen 700ms var(--ease); }
  html.m .btn-line { background-image: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(128,128,128,0.22), transparent 62%); background-size: 0 0; background-repeat: no-repeat; background-position: var(--mx, 50%) var(--my, 50%); transition: background-size 380ms var(--ease), transform var(--t-press) var(--ease), border-color var(--t-ui) var(--ease); }
  html.m .btn-line:hover { background-size: 260% 260%; }
  .pub-links a, .footer a { background: linear-gradient(currentColor, currentColor) 0 calc(100% - 8px) / 0 1px no-repeat; transition: background-size 260ms var(--ease), color var(--t-press) var(--ease); }
  .pub-links a:hover, .footer a:hover { background-size: 100% 1px; }
  .pub-card { position: relative; transition: transform 260ms var(--ease), background-color 260ms var(--ease); }
  .pub-card::before, .pub-card::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--ink); opacity: 0; transition: opacity 200ms var(--ease), transform 260ms var(--ease); }
  .pub-card::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; transform: translate(6px, 6px); }
  .pub-card::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; transform: translate(-6px, -6px); }
  .pub-card:hover { background: var(--raised); }
  .pub-card:hover::before, .pub-card:hover::after { opacity: 1; transform: none; }
  .pub-card:hover svg { animation: nod 520ms var(--ease); }
  .pub-syllabus li { transition: padding-left 260ms var(--ease), background-color 260ms var(--ease); }
  .pub-syllabus li:hover { padding-left: 14px; background: var(--paper); }
  .feat { transition: border-color var(--t-ui) var(--ease), transform 260ms var(--ease), box-shadow 260ms var(--ease); }
  .feat:hover { transform: translateY(-3px); box-shadow: 6px 6px 0 var(--line); }
  .feat-lead:hover { box-shadow: 6px 6px 0 var(--line-strong); }
  .feat .feat-art { transition: transform 420ms var(--ease); }
  .feat:hover .feat-art { transform: rotate(-6deg) scale(1.06); }
  .badge-item.earned:hover .badge-mark { animation: spinY 700ms var(--ease); }
  .heat-col i { transition: transform 120ms var(--ease); } .heat-col i:hover { transform: scale(1.7); }
  .pub-steps li { transition: transform 260ms var(--ease); } .pub-steps li:hover { transform: translateY(-6px); }
  .ring:hover svg { animation: spinZ 900ms var(--ease); }
  .ex-tile, .chip-check span { transition: transform var(--t-press) var(--ease); }
}
@keyframes sheen { to { left: 130%; } }
@keyframes nod { 30% { transform: rotate(-8deg) scale(1.08); } 60% { transform: rotate(5deg); } }
@keyframes spinY { to { transform: rotateY(360deg); } }
@keyframes spinZ { to { transform: rotate(360deg); } }
html.m .dot { animation: blink 1.8s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
html.m .badge:not([hidden]) { animation: badgeIn 460ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes badgeIn { from { transform: scale(0); } }
html.m details[open] > :not(summary) { animation: qUp 260ms var(--ease) both; }
html.m .pub-faq summary::marker { transition: color 200ms; }

/* Multi-step application */
.stepper { margin-bottom: 16px; }
.stepper-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; margin-bottom: 12px; }
.stepper .progress-track { background: var(--line); }
#stepNav { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
#stepNav button { display: flex; gap: 8px; align-items: baseline; background: var(--raised); border: 1px solid var(--line); padding: 8px 10px; font-size: 13px; cursor: pointer; color: var(--muted); transition: background var(--t-ui) var(--ease), color var(--t-ui) var(--ease), border-color var(--t-ui) var(--ease), transform var(--t-press) var(--ease); }
#stepNav button:active { transform: scale(0.97); }
#stepNav button.done { color: var(--ink); border-color: var(--line-strong); } #stepNav button.done .label { color: var(--ok); }
#stepNav button[aria-current="step"] { background: var(--ink); color: var(--paper); border-color: var(--ink); } #stepNav button[aria-current="step"] .label { color: var(--muted-dark); }
@media (max-width: 620px) { #stepNav .sn { display: none; } }
.step { display: flex; flex-direction: column; gap: 16px; } .step[hidden] { display: none; }
.step h2 { font-size: 1.6rem; margin: 6px 0 0; outline: 0; } .step-intro { font-size: 15px; margin-bottom: 6px; }
html.m .step.from-r { animation: stepR 380ms var(--ease) both; } html.m .step.from-l { animation: stepL 380ms var(--ease) both; }
@keyframes stepR { from { opacity: 0; transform: translateX(36px); } } @keyframes stepL { from { opacity: 0; transform: translateX(-36px); } }
.step-actions { justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 20px; } .step-actions [hidden] { display: none; }
.field-err { font-size: 13px; color: var(--danger); } html.m .field-err { animation: qShake 340ms var(--ease); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.check .field-err { grid-column: 2; }
.count { font-family: var(--mono); font-size: 11px; text-align: right; }
.rev-sec { border-top: 1px solid var(--line); padding: 16px 0; } .rev-sec h3 { margin: 0; font-size: 1.05rem; } .rev-sec .tile-head { margin-bottom: 8px; align-items: center; }
.rev-sec .app-dl dd { white-space: pre-line; overflow-wrap: anywhere; font-size: 14px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
html.m .apply-done.show { animation: qUp 420ms var(--ease) both; }
.field input, .field textarea, .field select { transition: border-color var(--t-ui) var(--ease), box-shadow var(--t-ui) var(--ease); }
.field input:focus, .field textarea:focus, .field select:focus { box-shadow: 4px 4px 0 var(--line); }

/* ===== Generated concept media ===== */
.media-fig { margin: 28px 0 4px; position: relative; }
.media-fig img, .media-fig video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #121315; border: 1px solid var(--line); }
.media-fig figcaption { font-size: 14px; line-height: 1.6; color: #3B3D41; margin-top: 12px; max-width: 72ch; }
.media-num { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted); margin-right: 6px; }
.media-badge { position: absolute; top: 12px; left: 12px; font-family: var(--mono); font-size: 11px; color: #F4F4F2; background: rgba(18,19,21,.72); border: 1px solid rgba(244,244,242,.25); padding: 4px 8px; pointer-events: none; }

/* Grid children may shrink below their content width (stops sideways scroll on phones). */
.lesson-layout .wrap > * { min-width: 0; }

/* =================================================================
   Tools: search, glossary, notes, calendar, workbook, grades,
   assignments, formula sheet, build list, certificate, analytics, KS-01
   ================================================================= */
.mono { font-family: var(--mono); letter-spacing: 0.02em; }
.no-scroll { overflow: hidden; }
.an-h { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin-top: 8px; }
.warn-t { color: var(--warn); } .bad-t { color: var(--danger); font-weight: 600; }
.callout-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.callout-row h2 { font-family: var(--display); font-size: 22px; margin: 4px 0 6px; }

/* ---- Search ---- */
.search-btn { display: inline-flex; align-items: center; gap: 8px; width: auto !important; padding: 0 10px; border: 1px solid #3A3B40; }
.search-btn .search-hint { font-size: 13px; color: var(--muted-dark); }
.search-btn kbd, .search-foot kbd { font-family: var(--mono); font-size: 11px; border: 1px solid #4A4C52; padding: 1px 5px; color: var(--muted-dark); }
@media (max-width: 720px) { .search-btn .search-hint, .search-btn kbd { display: none; } .search-btn { border: 0; padding: 0; } }
.search-dlg { position: fixed; inset: 0; z-index: 90; background: rgba(18,19,21,.62); display: flex; justify-content: center; align-items: flex-start; padding: 9vh 16px 16px; }
.search-dlg[hidden] { display: none; }
.search-box { background: var(--raised); width: min(720px, 100%); max-height: 78vh; display: flex; flex-direction: column; border: 1px solid var(--ink); box-shadow: 10px 10px 0 rgba(0,0,0,.25); }
html.m .search-dlg:not([hidden]) .search-box { animation: srch-in 180ms var(--ease); }
@keyframes srch-in { from { opacity: 0; transform: translateY(-8px) scale(.985); } }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.search-field svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.search-field input { flex: 1; min-width: 0; border: 0; padding: 18px 0; font-size: 18px; background: none; outline: none; }
.search-close { font-size: 13px; color: var(--muted); padding: 8px; }
.search-close:hover { color: var(--ink); }
.search-count { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 10px 16px; }
.search-list { list-style: none; overflow-y: auto; padding: 0 8px 8px; }
.search-hit { display: block; padding: 12px 10px; text-decoration: none; border-left: 2px solid transparent; }
.search-hit b { display: block; font-weight: 500; margin: 4px 0 3px; }
.search-hit[aria-current="true"], .search-hit:hover { background: var(--sunken); border-left-color: var(--ink); }
.search-snip { font-size: 14px; color: var(--muted); line-height: 1.55; }
.search-snip mark { background: #E3E3DE; color: var(--ink); font-weight: 600; padding: 0 1px; }
.search-eq { display: block; font-family: var(--mono); font-size: 14px; }
.search-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 10px 16px; border-top: 1px solid var(--line); }
.search-foot kbd { color: var(--muted); border-color: var(--line-strong); }

/* ---- Glossary terms in lessons ---- */
.gl { font: inherit; color: inherit; padding: 0; background: none; border: 0; border-bottom: 1px dashed var(--line-strong); cursor: help; text-align: inherit; }
.gl:hover, .gl:focus-visible, .gl[aria-describedby] { border-bottom-style: solid; border-bottom-color: var(--ink); }
.gl:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.gl-tip { position: absolute; z-index: 80; background: var(--charcoal); color: var(--on-dark); padding: 14px 16px; font-size: 14px; line-height: 1.55; box-shadow: 6px 6px 0 rgba(0,0,0,.18); }
.gl-tip b { display: block; font-family: var(--display); font-size: 15px; margin-bottom: 4px; }
.gl-tip span { display: block; color: #D6D7DA; }
.gl-tip a { display: inline-block; margin-top: 8px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-dark); }
.gl-tip a:hover { color: var(--on-dark); }
html.m .gl-tip:not([hidden]) { animation: srch-in 140ms var(--ease); }

/* ---- Notes and bookmarks on paragraphs ---- */
.pn { position: relative; }
.pn-btn { position: absolute; top: 2px; right: -44px; width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); opacity: 0; transition: opacity var(--t-ui) var(--ease), color var(--t-ui) var(--ease); }
.pn-btn svg { width: 18px; height: 18px; }
.pn:hover .pn-btn, .pn-btn:focus-visible, .pn-btn[aria-expanded="true"], .pn.has-mark .pn-btn, .pn.has-note .pn-btn { opacity: 1; }
.pn.has-mark .pn-btn, .pn.has-note .pn-btn, .pn-btn[aria-expanded="true"] { color: var(--ink); }
.pn.has-mark .pn-btn svg path:first-child { fill: currentColor; }
.pn.has-mark::before { content: ""; position: absolute; left: -16px; top: 4px; bottom: 4px; width: 3px; background: var(--ink); }
.pn-btn:hover { color: var(--ink); }
@media (max-width: 1100px) { .pn { padding-right: 34px; } .pn-btn { right: 0; } .pn.has-mark::before { left: -10px; } }
@media (hover: none) { .pn-btn { opacity: .55; } }
.pn-flash { animation: pn-flash 2.2s var(--ease); }
@keyframes pn-flash { 0%, 40% { background: #E6E6E1; box-shadow: 0 0 0 8px #E6E6E1; } 100% { background: transparent; box-shadow: 0 0 0 8px transparent; } }
.pnote { border: 1px solid var(--ink); background: var(--raised); padding: 16px; margin: 6px 0 18px; display: grid; gap: 10px; }
.pnote-l { font-size: 14px; font-weight: 500; }
.pnote textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); font: inherit; font-size: 15px; resize: vertical; }
.pnote .form-actions { margin-top: 0; align-items: center; }
.pnote-view { border-left: 3px solid var(--ink); background: var(--sunken); padding: 10px 14px; margin: -4px 0 18px; }
.pnote-view p { font-size: 14px; color: #3B3D41; margin-top: 4px; }
.note-list { list-style: none; }
.note-list li + li { border-top: 1px solid var(--line); }
.note-list a { display: block; padding: 14px 0; text-decoration: none; }
.note-list a:hover q { color: var(--ink); }
.note-list q { display: block; font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.55; quotes: none; }
.note-list p { margin-top: 6px; font-size: 15px; }
.note-list .ok { color: var(--ok); }

/* ---- Calendar and upcoming ---- */
.ev-list { list-style: none; }
.ev { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; padding-top: 0; }
.ev-date { text-align: center; border: 1px solid var(--ink); padding: 4px 0; }
.ev-date b { display: block; font-family: var(--display); font-size: 20px; line-height: 1.1; }
.ev-date span { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.ev-body h3 { font-size: 15px; font-weight: 500; margin-top: 4px; }
.ev-body h3 a { text-decoration: none; } .ev-body h3 a:hover { text-decoration: underline; }
.ev-body p { font-size: 14px; color: var(--muted); margin-top: 2px; }
.ev .link-btn { font-size: 13px; white-space: nowrap; }
@media (max-width: 560px) { .ev { grid-template-columns: 52px minmax(0, 1fr); } .ev .link-btn { grid-column: 2; justify-self: start; } }
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-head h2 { font-family: var(--display); font-size: 24px; }
.cal-head div { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-dow, .cal-grid { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.cal-dow li { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 6px 4px; }
.cal-grid { background: var(--line); border: 1px solid var(--line); }
.cal-grid li { background: var(--raised); min-height: 84px; padding: 6px; overflow: hidden; }
.cal-grid .cal-pad { background: var(--paper); }
.cal-n { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.cal-day.today .cal-n { background: var(--ink); color: var(--paper); padding: 1px 5px; }
.cal-ev { display: block; font-size: 11px; line-height: 1.3; margin-top: 4px; padding: 2px 4px; border-left: 2px solid var(--ink); background: var(--sunken); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.ok { border-left-color: var(--ok); } .cal-ev.warn { border-left-color: var(--warn); } .cal-ev.bad { border-left-color: var(--danger); }
.cal-sub { font-size: 16px; font-weight: 600; margin: 24px 0 12px; }
@media (max-width: 640px) { .cal-grid li { min-height: 52px; padding: 3px; } .cal-ev { font-size: 0; height: 6px; padding: 0; border-left-width: 0; background: var(--ink); } .cal-ev.ok { background: var(--ok); } .cal-ev.warn { background: var(--warn); } .cal-ev.bad { background: var(--danger); } }

/* ---- Grade weighting and bars ---- */
.weights { list-style: none; display: grid; gap: 18px; }
.w-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; font-size: 14px; }
.w-top b { font-size: 16px; font-weight: 500; }
.w-bar { height: 8px; background: var(--sunken); margin: 8px 0 6px; overflow: hidden; }
.w-bar span { display: block; height: 100%; background: var(--ink); transform-origin: left; transition: transform 700ms var(--ease); }

/* ---- Assignments ---- */
.assign > p { color: #3B3D41; max-width: 72ch; }
.assign .chips { margin: 14px 0; }
.chip-link { text-decoration: none; } .chip-link:hover { border-color: var(--ink); }
.assign-form { margin-top: 14px; display: grid; gap: 14px; max-width: 640px; }
.assign-form textarea { min-height: 72px; }
.feedback { border-left: 3px solid var(--ok); background: var(--sunken); padding: 12px 16px; margin: 14px 0; }
.feedback p { margin-top: 6px; }
.adm-a + .adm-a { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.adm-a h3 { font-size: 16px; font-weight: 600; }
.due-in { margin-top: 8px; min-height: 38px; padding: 6px 10px; border: 1px solid var(--line-strong); }
.sub { display: grid; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.sub a { word-break: break-all; font-size: 14px; }
.mark-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.mark-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; }
.mark-form input { width: 90px; min-height: 38px; padding: 6px 8px; border: 1px solid var(--line-strong); }
.mark-form textarea { width: min(320px, 70vw); padding: 6px 8px; border: 1px solid var(--line-strong); font: inherit; font-size: 14px; }
.adm-new { margin-top: 18px; } .adm-new form { margin-top: 14px; display: grid; gap: 14px; }
.code-line { font-family: var(--mono); font-size: 11px; background: var(--sunken); padding: 8px; margin-top: 6px; white-space: pre-wrap; word-break: break-all; user-select: all; }
.btn-on-dark { color: var(--on-dark); }

/* ---- Workbook ---- */
.wb-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .wb-layout { grid-template-columns: 1fr; } }
.wb-sticky { position: sticky; top: 88px; }
.wb-sec h2 { font-family: var(--display); font-size: 20px; letter-spacing: -0.01em; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.wb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.wb-grid .field.wide { grid-column: 1 / -1; }
.wb-grid .field textarea { min-height: 72px; }
.unit { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 400; }
.wb-read { margin-top: 0; }
.wb-read > div { padding: 10px 12px; }
.wb-read dd { font-size: 16px; }

/* ---- Lab: workbook link ---- */
.lab-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 14px; }
.lab-foot .lab-reset { margin-top: 0; border: 1px solid #3A3B40; }
.lab-foot .lab-reset:hover { color: var(--on-dark); border-color: var(--on-dark); }
.lab-wbnote { font-family: var(--mono); font-size: 11px; color: var(--ok-dark); letter-spacing: .03em; }

/* ---- Formula sheet ---- */
.fs-group + .fs-group { margin-top: 36px; }
.fs-group h2 { font-family: var(--display); font-size: 18px; font-weight: 600; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 16px; }
.fs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.fs-item { border: 1px solid var(--line); background: var(--raised); padding: 14px 16px; break-inside: avoid; }
.fs-name { font-size: 13px; font-weight: 500; color: var(--muted); }
.fs-n { font-family: var(--mono); color: var(--ink); }
.fs-eq { font-family: var(--mono); font-size: 16px; margin: 8px 0; color: var(--ink); overflow-x: auto; }
.fs-vars { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fs-vars td { padding: 3px 6px 3px 0; vertical-align: top; color: #3B3D41; border-top: 1px solid var(--sunken); }
.fs-vars td:first-child { font-family: var(--mono); white-space: nowrap; color: var(--ink); width: 1%; }
.fs-vars .u { font-family: var(--mono); text-align: right; white-space: nowrap; color: var(--muted); }
.fs-const { max-width: 640px; background: var(--raised); border: 1px solid var(--line); }
.fs-const td { padding: 8px 10px; }

/* ---- Glossary page ---- */
.gl-filter { max-width: 420px; margin-bottom: 24px; }
.gl-list { border-top: 2px solid var(--ink); }
.gl-row { display: grid; grid-template-columns: minmax(160px, 260px) minmax(0, 1fr); gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.gl-row dt { font-family: var(--display); font-weight: 600; font-size: 17px; }
.gl-row dd { margin: 0; color: #3B3D41; line-height: 1.6; }
.gl-row dd a { margin-left: 6px; text-decoration: none; }
@media (max-width: 640px) { .gl-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---- Resources and build ---- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.res-card { text-decoration: none; display: block; transition: border-color var(--t-ui) var(--ease), transform var(--t-ui) var(--ease); }
.res-card:hover { border-color: var(--ink); }
.res-card h2, .res-grid h3 { font-family: var(--display); font-size: 20px; margin: 6px 0 8px; letter-spacing: -0.01em; }
.res-card p, .res-grid p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.build-t { min-width: 0; }
.build-t td:first-child { width: 48px; }
.build-t input { width: 20px; height: 20px; accent-color: var(--ink); }
.build-t tr:has(input:checked) td { color: var(--muted); }
.build-t tr:has(input:checked) label { text-decoration: line-through; }

/* ---- Certificate ---- */
.cert-state h2 { font-family: var(--display); font-size: 24px; margin: 6px 0 8px; }
.cert-state p { max-width: 70ch; color: #3B3D41; }
.cert-wrap { margin-top: 24px; overflow-x: auto; }
.cert-page { position: relative; width: 297mm; height: 210mm; background: #fff; color: #121315; overflow: hidden; margin: 0 auto; box-shadow: 0 1px 0 var(--line), 12px 12px 0 rgba(18,19,21,.08); font-family: var(--sans); }
.cert-waves { position: absolute; inset: 0; width: 100%; height: 100%; }
.cert-logo { position: absolute; left: 19mm; top: 16mm; width: 62mm; height: auto; }
.cert-brand { position: absolute; right: 19mm; top: 26mm; display: flex; align-items: center; gap: 3mm; }
.cert-brand svg { width: 8mm; height: 8mm; }
.cert-brand span { font-family: var(--display); font-weight: 600; font-size: 5.4mm; letter-spacing: .14em; }
.cert-title { position: absolute; left: 0; right: 0; top: 50mm; max-width: none; margin: 0; text-align: center; font-family: var(--display); font-weight: 300; font-size: 20mm; letter-spacing: .06em; line-height: 1; color: #121315; }
.cert-body { position: absolute; left: 50%; top: 92mm; transform: translateX(-50%); width: 160mm; text-align: center; }
.cert-lead { font-size: 6.4mm; font-weight: 300; letter-spacing: .02em; color: #2A2B2F; }
.cert-who { max-width: none; font-family: var(--display); font-weight: 500; font-size: 8.4mm; letter-spacing: .05em; margin: 3mm 0 3mm; }
.cert-what { font-family: var(--display); font-weight: 500; font-size: 6.6mm; margin-top: 3mm; }
.cert-code-line { font-size: 6.2mm; margin-top: 1.5mm; }
.cert-rule { height: 0.3mm; background: #121315; margin: 7mm auto 3mm; width: 150mm; }
.cert-date { font-size: 4.6mm; color: #2A2B2F; }
.cert-seal { position: absolute; right: 22mm; top: 92mm; width: 60mm; height: 60mm; }
.cert-seal > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.seal-mark { position: absolute; left: 50%; top: 19%; width: 15%; transform: translateX(-50%); }
.seal-mark svg { display: block; width: 100%; height: auto; }
.seal-top { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-family: var(--display); font-weight: 600; font-size: 4.4mm; letter-spacing: .16em; padding-left: .16em; color: #121315; }
.seal-band { position: absolute; left: 0; right: 0; top: 63%; text-align: center; font-family: var(--display); font-weight: 600; font-size: 3.3mm; line-height: 1.3; letter-spacing: .12em; padding-left: .12em; color: #fff; }
.cert-sign { position: absolute; right: 19mm; bottom: 13mm; display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: 3.7mm; line-height: 1.45; color: #2A2B2F; }
.cert-sign img { max-width: 60mm; max-height: 18mm; margin-bottom: 1mm; }
.cert-sign b { color: #121315; font-weight: 600; }
.cert-verify { position: absolute; left: 19mm; bottom: 13mm; display: flex; align-items: flex-end; gap: 3mm; font-family: var(--mono); font-size: 3.6mm; color: #2A2B2F; }
.cert-qr { display: block; width: 17mm; height: 17mm; }
.cert-qr svg { width: 100%; height: 100%; display: block; }
.cert-stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-family: var(--display); font-weight: 600; font-size: 34mm; letter-spacing: .2em; color: rgba(18,19,21,.06); pointer-events: none; }
.cert-locked { filter: grayscale(1); opacity: .55; pointer-events: none; user-select: none; }
.cert-mini, .cert-fit { overflow: hidden; position: relative; }
.cert-mini { border: 1px solid var(--line); }
.cert-mini .cert-page, .cert-fit .cert-page { position: absolute; left: 0; top: 0; transform-origin: 0 0; transform: scale(var(--cs, .5)); }
.cert-mini .cert-page { box-shadow: none; }
.cert-fit { max-width: 297mm; margin: 0 auto; }

/* ---- Verify ---- */
.verify-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .verify-wrap { grid-template-columns: 1fr; } }
.verify { border: 1px solid var(--line); border-left-width: 4px; background: var(--raised); padding: 24px; }
.verify.ok { border-left-color: var(--ok); } .verify.warn { border-left-color: var(--warn); } .verify.bad { border-left-color: var(--danger); }
.verify h2 { font-family: var(--display); font-size: 26px; margin: 6px 0; }
#verifyOut:focus { outline: none; }

/* ---- Analytics ---- */
.miss-list { list-style: none; counter-reset: miss; display: grid; gap: 16px; }
.miss-list li { counter-increment: miss; }
.miss-list .w-bar span { background: var(--danger); }

/* ---- Exam: formula sheet ---- */
.ex-fs-btn { margin-right: 14px; }
.ex-sheet { position: fixed; inset: 0; z-index: 120; background: rgba(18,19,21,.6); display: flex; justify-content: center; padding: 4vh 16px; }
.ex-sheet-box { background: var(--paper); width: min(1100px, 100%); max-height: 92vh; overflow-y: auto; border: 1px solid var(--ink); }
.ex-sheet-head { position: sticky; top: 0; background: var(--paper); display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); z-index: 1; }
.ex-sheet-head h2 { font-family: var(--display); font-size: 20px; }
.ex-sheet .fs { padding: 20px; }

/* ---- KS-01 page ---- */
.ks-hero { position: relative; min-height: min(86vh, 760px); display: flex; align-items: flex-end; overflow: hidden; background: var(--charcoal); }
.ks-hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ks-hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,19,21,.88) 0%, rgba(18,19,21,.5) 45%, rgba(18,19,21,0) 75%), linear-gradient(0deg, rgba(18,19,21,.9), rgba(18,19,21,0) 45%); }
.ks-hero-copy { position: relative; padding-block: 120px 72px; max-width: 1240px; width: 100%; }
.ks-hero-copy h1 { font-family: var(--display); font-size: clamp(36px, 5.6vw, 72px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; max-width: 14ch; margin: 12px 0 18px; }
.ks-hero-copy .lede { max-width: 56ch; color: #D6D7DA; }
.ks-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.ks-specs { border-top: 2px solid var(--ink); }
.ks-specs > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ks-specs dt { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 3px; }
.ks-specs dd { margin: 0; font-size: 16px; }
.ks-specs .tbc { color: var(--muted); font-style: italic; }
.ks-h2 { font-family: var(--display); font-size: clamp(26px, 3.4vw, 40px); letter-spacing: -0.02em; margin: 8px 0 28px; max-width: 26ch; }
.ks-fig img { width: 100%; height: auto; display: block; border: 1px solid #2E2F33; background: #121315; }
.ks-fig figcaption { font-size: 13px; color: var(--muted-dark); margin-top: 10px; }
.ks-steps { list-style: none; counter-reset: ks; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.ks-steps li { counter-increment: ks; background: var(--raised); padding: 20px; }
.ks-steps li::before { content: "[ " counter(ks, decimal-leading-zero) " ]"; display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.ks-steps b { display: block; font-family: var(--display); font-size: 18px; margin-bottom: 6px; }
.ks-steps span { font-size: 14px; color: var(--muted); line-height: 1.6; }
.wait-form { display: grid; gap: 16px; }
.wait-done h3 { font-family: var(--display); font-size: 22px; margin: 6px 0; }
.wait-done:focus { outline: none; }

/* ---- Print: certificate, formula sheet, workbook, build list ---- */
@media print {
  @page { margin: 12mm; }
  .nav, .hub, .footer, .skip, .no-print, .page-head, #chrome, .search-dlg, .wb-side .form-actions, .callout-row .form-actions, .lab-foot { display: none !important; }
  body { background: #fff; }
  .page-body { padding: 0 !important; }
  .tile { border-color: #bbb; break-inside: avoid; }
  body[data-page="certificate"] .cert-wrap { margin: 0; overflow: visible; }
  body[data-page="certificate"] .cert-page { box-shadow: none; margin: 0; }
  body[data-page="certificate"] .cert-state { display: none; }
  .fs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .fs-item { padding: 8px 10px; }
  .fs-eq { font-size: 13px; margin: 4px 0; }
  .fs-group + .fs-group { margin-top: 14px; }
  .wb-layout { grid-template-columns: 1fr; }
  .wb-sticky { position: static; }
  .build-t input { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border: 1px solid #000; }
  .build-t input:checked { background: #000; }
}
body[data-page="certificate"] { }
@media print { body[data-page="certificate"] { margin: 0; } }
@media print {
  body[data-page="certificate"] .cert-fit { height: auto !important; overflow: visible; max-width: none; }
  body[data-page="certificate"] .cert-fit .cert-page { position: relative; transform: none; }
  body[data-page="certificate"] .cert-locked { display: none; }
}

/* Entrance animations slide some cards sideways; never let that create a sideways scroll. */
main { overflow-x: clip; }

.video-callout h2 { font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1.2; }

.tile-head .label { white-space: nowrap; }
@media (max-width: 560px) { .tile-head { flex-wrap: wrap; } }

/* --- 15 Nov polish --- */
.course-art.course-plan { background: transparent; clip-path: none; aspect-ratio: 560 / 460; }
.course-art.course-plan svg { position: static; }
.course-art.course-plan .label { position: static; display: block; margin-top: 10px; background: none; padding: 0; }
.pub-faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.pub-faq summary::-webkit-details-marker { display: none; }
.pub-faq summary::after { content: "+"; font-family: var(--mono, "IBM Plex Mono", monospace); font-size: 18px; line-height: 1; color: var(--muted); transition: transform 200ms var(--ease); }
.pub-faq[open] summary::after { transform: rotate(45deg); }
.ks-fig video { width: 100%; height: auto; display: block; border: 1px solid #2E2F33; background: #121315; }
img.ks-hero-media { object-position: 100% 50%; }
@media (max-width: 800px) { img.ks-hero-media { object-position: 75% 30%; opacity: .45; } }
/* Dashboard: one lead card, then a compact two-column grid instead of eight stacked cards. */
#dashCards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#dashCards .feat-lead { grid-column: 1 / -1; }
#dashCards .feat:not(.feat-lead) { grid-template-columns: 1fr; gap: 0; padding: 22px; align-items: start; align-content: start; position: relative; }
#dashCards .feat:not(.feat-lead) .feat-art { order: -1; width: 36px; height: 36px; justify-self: start; margin-bottom: 14px; }
#dashCards .feat:not(.feat-lead) h2 { font-size: 1.125rem; margin: 6px 0 4px; }
#dashCards .feat:not(.feat-lead) p { font-size: 14px; margin-bottom: 14px; }
#dashCards .feat:not(.feat-lead) .btn { justify-self: start; min-height: 0; padding: 0; border: 0; background: none; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; clip-path: none; }
#dashCards .feat:not(.feat-lead) .btn::after { content: ""; position: absolute; inset: 0; }
#dashCards .feat:not(.feat-lead) .btn:focus-visible { outline: none; }
#dashCards .feat:not(.feat-lead):focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 640px) { #dashCards { grid-template-columns: 1fr; } }

/* Legal pages */
.legal-date { margin-top: 20px; font-size: 14px; color: var(--muted-dark); }
.legal-grid { display: grid; grid-template-columns: 220px minmax(0, 680px); gap: 64px; align-items: start; }
.legal-toc { position: sticky; top: calc(var(--navh) + 32px); border-top: 2px solid var(--ink); padding-top: 14px; }
.legal-toc-h { font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; }
.legal-toc li a { display: block; padding: 6px 0; font-size: 14px; color: var(--muted); text-decoration: none; transition: color var(--t-ui) var(--ease); }
.legal-toc li a:hover, .legal-toc li a:focus-visible { color: var(--ink); }
.legal-also { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.legal-also a { color: var(--ink); }
.legal { font-size: 16px; line-height: 1.7; }
.legal-summary { background: var(--raised, #fff); border: 1px solid var(--line); border-left: 3px solid var(--ink); padding: 24px 28px; margin-bottom: 48px; }
.legal-summary h2 { font-size: 18px; margin: 0 0 12px; }
.legal-summary ul { margin: 0 0 12px; padding-left: 20px; }
.legal-summary li { margin: 6px 0; }
.legal-summary p { margin: 0; font-size: 14px; color: var(--muted); }
.legal-sec { padding-top: 8px; margin-bottom: 40px; scroll-margin-top: calc(var(--navh) + 24px); }
.legal-sec h2 { font-size: 22px; line-height: 1.3; margin: 0 0 14px; }
.legal-sec p { margin: 0 0 14px; max-width: 68ch; }
.legal-sec ul { margin: 0 0 16px; padding-left: 20px; max-width: 68ch; }
.legal-sec li { margin: 6px 0; }
.legal a { color: var(--ink); text-underline-offset: 3px; }
.legal-dl { margin: 0 0 18px; border-top: 1px solid var(--line); }
.legal-dl > div { display: grid; grid-template-columns: 190px 1fr; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.legal-dl dt { font-weight: 600; font-size: 15px; }
.legal-dl dd { margin: 0; color: var(--ink); }
.form-note { font-size: 13px; line-height: 1.55; color: var(--muted); margin-top: 12px; }
.form-note a { color: inherit; }
.dark .form-note { color: var(--muted-dark); }
@media (max-width: 900px) {
  .legal-grid { grid-template-columns: 1fr; gap: 32px; }
  .legal-toc { position: static; }
  .legal-toc ol { columns: 2; column-gap: 24px; }
}
@media (max-width: 560px) {
  .legal-toc ol { columns: 1; }
  .legal-dl > div { grid-template-columns: 1fr; gap: 4px; }
  .legal-summary { padding: 20px; }
}
