:root {
  --bg: #f5f5ef; --surface: #fffefa; --field: #fbfbf7; --text: #23322a; --muted: #58685d; --line: #d8e0d7;
  --brand: #135c45; --brand-ink: #fffefa; --brand-soft: #eaf2ec; --marker: #b58c52;
  --ok: #176747; --ok-soft: #e6f2e9; --warn: #994a24; --warn-soft: #fbede4; --gold: #765718; --gold-soft: #f5eedc;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif; --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px; --radius: var(--r-sm);
  --shadow: 0 1px 2px rgba(28, 55, 38, .05);
  --shadow-2: 0 1px 2px rgba(20,40,30,.05), 0 8px 20px -10px rgba(20,40,30,.18);
  --shadow-3: 0 1px 0 rgba(255,255,255,.7) inset, 0 1px 2px rgba(20,40,30,.06), 0 6px 12px -2px rgba(20,40,30,.08), 0 18px 36px -8px rgba(20,40,30,.18);
  --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #1a1917; --surface: #22211e; --field: #2a2925; --text: #ebe6dc; --muted: #a9a297; --line: #3a3833;
    --brand: #9cc4a6; --brand-ink: #1a1917; --brand-soft: #2c2f29; --marker: #c9a467;
    --ok: #a6c9a9; --ok-soft: #29302a; --warn: #e3a07c; --warn-soft: #3a2c25; --gold: #d8bc82; --gold-soft: #35301f;
    --shadow: none; --shadow-2: 0 10px 24px -12px rgba(0,0,0,.6); --shadow-3: 0 1px 0 rgba(255,255,255,.05) inset, 0 18px 36px -8px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
    --bg: #1a1917; --surface: #22211e; --field: #2a2925; --text: #ebe6dc; --muted: #a9a297; --line: #3a3833;
    --brand: #9cc4a6; --brand-ink: #1a1917; --brand-soft: #2c2f29; --marker: #c9a467;
    --ok: #a6c9a9; --ok-soft: #29302a; --warn: #e3a07c; --warn-soft: #3a2c25; --gold: #d8bc82; --gold-soft: #35301f;
    --shadow: none; --shadow-2: 0 10px 24px -12px rgba(0,0,0,.6); --shadow-3: 0 1px 0 rgba(255,255,255,.05) inset, 0 18px 36px -8px rgba(0,0,0,.6);
  color-scheme: dark;
}
:root[data-theme=light] { color-scheme: light; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font-body); -webkit-font-smoothing: antialiased; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: var(--r-sm); background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.skip:focus { top: 12px; }
::selection { background: var(--brand-soft); }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; }
.wrap { max-width: 900px; margin: 0 auto; padding: 0 24px; }
main.wrap { padding-bottom: 72px; }

/* Header */
.site-head { background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; max-width: 1160px; height: 66px; }
.logo { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; text-decoration: none; color: var(--text); }
.logo img { display: block; flex-shrink: 0; width: 40px; height: 40px; }
:root[data-theme=dark] .logo img { filter: brightness(0) invert(1); opacity: .85; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .logo img { filter: brightness(0) invert(1); opacity: .85; } }
.logo .wordmark { display: flex; flex-direction: column; line-height: 1; }
.logo .wordmark strong { color: var(--brand); font-size: 22px; font-weight: 800; letter-spacing: -.035em; }
.logo .wordmark small { color: var(--text); font: 700 10px/1.15 "IBM Plex Sans", system-ui, sans-serif; letter-spacing: .16em; margin-top: 3px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: var(--r-pill); font-weight: 600; padding: 6px 16px; cursor: pointer; padding: 6px 12px; font: inherit; height: 40px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.head-tools { display: flex; gap: 8px; margin-left: 16px; }
.theme-toggle { display: grid; place-items: center; width: 40px; height: 40px; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 50%; cursor: pointer; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon, :root[data-theme=dark] .theme-toggle .sun { display: none; }
:root[data-theme=dark] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .theme-toggle .sun { display: none; } :root:not([data-theme]) .theme-toggle .moon { display: block; } }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.nav a:hover, .nav a[aria-current] { color: var(--brand); }
.nav a { padding: 7px 12px; border-radius: var(--r-pill); transition: background .15s, color .15s; }
.nav a:hover { background: var(--brand-soft); }
.nav a[aria-current] { background: var(--brand-soft); }
@media (max-width: 950px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 66px; left: 0; right: 0; background: var(--surface); box-shadow: var(--shadow-2); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px; }
  .nav a { padding: 13px 12px; border-radius: var(--r-sm); border-bottom: 0; }
  .nav a:last-child { border: 0; }
  .nav-open .nav { display: flex; }
  .nav a[aria-current] { text-decoration: none; }
}

/* Content */
.crumbs { font-size: 13px; color: var(--muted); margin: 24px 0 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em; text-wrap: balance; }
h1 { font-size: clamp(34px, 6vw, 52px); line-height: 1.05; margin: 26px 0 12px; }
h2 { font-size: clamp(25px, 3vw, 30px); line-height: 1.2; margin: 48px 0 14px; }
h3 { font-size: 19px; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; margin: 26px 0 10px; }
.lead { color: var(--muted); font-size: 18px; line-height: 1.55; margin: 0 0 24px; max-width: 68ch; }
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); }
th { background: var(--brand-soft); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text); }
td:first-child { font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); margin: 0 0 8px; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--brand-soft) 35%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; }
.quick-guides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.quick-guides h3 { margin-top: 8px; }
.quick-guides table { font-size: 14px; }
.quick-guides th, .quick-guides td { padding: 8px; }
.quick-guides .fine { margin-bottom: 0; }
.formula { background: var(--brand-soft); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; font-family: var(--font-display); font-size: 19px; font-weight: 600; text-align: center; overflow-x: auto; }
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 0; list-style: none; }
.links a { display: block; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 40px 16px 16px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s var(--ease), box-shadow .15s; text-decoration: none; color: var(--text); font-weight: 600; }
.links a::after { content: "→"; position: absolute; right: 16px; top: 16px; color: var(--brand); transition: transform .15s var(--ease); }
.links a:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.links a:hover::after { transform: translateX(3px); }
.links a small { display: block; color: var(--muted); font-weight: 400; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0; margin: 8px 0; transition: border-color .15s; }
details[open] { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 18px; font-weight: 600; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: 0 0 9px; width: 9px; height: 9px; border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(45deg) translateY(-3px); transition: transform .2s var(--ease); }
details[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
details > p { margin: 0; padding: 0 18px 16px; color: var(--muted); }
.breakdown { padding: 0; }
.notice { background: var(--warn-soft); color: var(--text); border-left: 4px solid var(--warn); padding: 12px 14px; border-radius: 8px; font-size: 15px; }

/* Calculator */
.calc { padding: 20px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--bg));
  box-shadow: var(--shadow-3); }
.calc .sem, .calc .result { border-radius: var(--r-md); box-shadow: var(--shadow-2); background: var(--surface); }
.calc label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.calc label.chk { flex-direction: row; align-items: center; gap: 8px; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-height: 44px; width: 100%; }
input[type=checkbox] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--brand); justify-self: center; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input, select, textarea { transition: border-color .15s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
input.bad, textarea.bad { border-color: var(--warn); }
.calc-bar { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.subject-options { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, auto); gap: 12px 16px; align-items: end; margin-bottom: 16px; }
.subject-options .units-control { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); color: var(--text); cursor: pointer; }
.subject-options .units-control input { flex: 0 0 22px; margin: 0; }
.subject-options .units-control span { display: flex; flex-direction: column; line-height: 1.3; }
.subject-options .units-control strong { font-size: 14px; }
.subject-options .units-control small { color: var(--muted); font-size: 11px; font-weight: 400; }
.format-controls { grid-column: 1 / -1; display: flex; align-items: end; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--brand-soft); }
.format-title { align-self: center; margin-right: auto; color: var(--muted); font-size: 13px; font-weight: 700; }
.format-controls label { min-width: 125px; }
.format-controls select { min-height: 40px; padding: 6px 10px; background: var(--surface); }
.sem { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 16px; margin-bottom: 12px; }
.sem-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sem-name { font-weight: 700; border-color: transparent; background: transparent; padding-left: 0; }
.sem-gwa { white-space: nowrap; font-weight: 700; color: var(--brand); }
.rows-head, .row { display: grid; grid-template-columns: 1fr 70px 96px 44px 36px; gap: 8px; align-items: center; }
.rows-head.nounits, .row.nounits { grid-template-columns: 1fr 96px 44px 36px; }
.row.nounits .units-field, .rows-head.nounits span:nth-child(2) { display: none; }
.rows-head.cum, .row.cum { grid-template-columns: 1fr 70px 96px 36px; }
.rows-head { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 0 2px 4px; }
.row { margin-bottom: 8px; position: relative; }
.row-field { min-width: 0; }
.row-field span { display: none; }
.row-field input { min-width: 0; }
.row .include-field { align-items: center; justify-content: center; }
.row .hint { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: -4px; }
.row .hint:empty { display: none; }
.icon { background: none; border: 0; color: var(--muted); font-size: 16px; width: 36px; height: 44px; cursor: pointer; border-radius: 8px; }
.icon:hover { background: var(--bg); color: var(--text); }
.btn { font: inherit; font-size: 15px; font-weight: 600; background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); border-radius: var(--r-pill); padding-inline: 18px; transition: background .15s, filter .15s, transform .1s; padding: 10px 14px; min-height: 44px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn:hover { filter: brightness(.94); }
.btn:active { transform: translateY(1px); }
.btn.ghost:hover { background: var(--brand-soft); filter: none; }
.btn.sm { min-height: 40px; padding: 6px 12px; font-size: 14px; }
.btn.danger { color: var(--warn); }
.calc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.paste-box { display: grid; gap: 8px; margin-bottom: 12px; }
.paste-box label { font-size: 14px; }
.result { background: var(--brand-soft); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; margin-top: 14px; }
.res-main { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.res-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--brand); }
.res-num { display: inline-block; padding: 0 .12em; margin: 2px 0; color: var(--text); font: 700 clamp(48px, 9vw, 68px)/1.08 var(--font-body); font-variant-numeric: tabular-nums; background: linear-gradient(transparent 72%, color-mix(in srgb, var(--marker) 30%, transparent) 72%, color-mix(in srgb, var(--marker) 30%, transparent) 92%, transparent 92%); }
.res-sub { color: var(--muted); font-size: 14px; }
.badges { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; list-style: none; padding: 0; margin: 14px 0 0; }
.badges li { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); }
.badges .ok, .badges .warn, .badges .gold { border-color: transparent; }
.badges .ok { background: var(--ok-soft); color: var(--ok); }
.badges .warn { background: var(--warn-soft); color: var(--warn); }
.badges .gold { background: var(--gold-soft); color: var(--gold); }
.warn-text { color: var(--warn); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; z-index: 50; white-space: nowrap; }

@media (max-width: 600px) {
  .calc { padding: 14px; }
  .calc-bar { grid-template-columns: 1fr 1fr; }
  .calc-bar label:first-child { grid-column: 1 / -1; }
  .subject-options { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .format-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .format-title { grid-column: 1 / -1; }
  .format-controls label { min-width: 0; }
  .sem { padding: 12px; }
  /* One line per subject on phones, like a grade slip: labels sit once in the header row. */
  .rows-head:not(.cum), .row:not(.cum) { grid-template-columns: minmax(0, 1fr) 50px 66px 26px 26px; gap: 6px; }
  .rows-head.nounits, .row.nounits { grid-template-columns: minmax(0, 1fr) 76px 26px 26px; }
  .rows-head:not(.cum) { font-size: 10px; }
  .rows-head span:nth-child(4) { text-align: center; }
  .row:not(.cum) { padding: 0; border: 0; margin-bottom: 6px; }
  .row:not(.cum) input:not([type=checkbox]) { padding: 9px 8px; }
  .row:not(.cum) .icon { width: 26px; }
  .row:not(.cum) input[type=checkbox] { width: 20px; height: 20px; min-height: 20px; }
  .row.cum { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .row.cum .row-field span { display: block; margin-bottom: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
  .row.cum .subject-field { grid-column: 1 / 3; }
  .row.cum [data-a=del] { grid-column: 3; grid-row: 1; align-self: end; }
  .row [data-k=u]::placeholder { color: var(--muted); }
  .grid2 { grid-template-columns: 1fr; }
  .quick-guides { grid-template-columns: 1fr; }
  .calc-actions .btn { flex: 1 1 40%; }
}

.site-foot { border-top: 1px solid var(--line); background: var(--brand-soft); padding: 44px 0 32px; font-size: 14px; color: var(--muted); }
.site-foot .wrap { max-width: 1160px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; margin-bottom: 28px; }
.foot-grid p { font-size: 14px; }
.foot-col h2 { margin: 0 0 10px; font: 700 12px var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--text); }
.foot-col a { display: block; padding: 4px 0; color: var(--muted); text-decoration: none; }
.foot-col a:hover { color: var(--brand); text-decoration: underline; }
.foot-base { padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
.site-foot .footer-logo { margin-bottom: 16px; }
.site-foot a { color: var(--text); }
.site-foot p { margin: 0; max-width: 74ch; }
@media print { .site-head, .site-foot, .calc-actions, .calc-bar, .subject-options { display: none; } }
[hidden] { display: none !important; }

/* Plex has clear, tabular digits: 1 vs 7, 0 vs O. */
.res-num, input, td, .sem-gwa, .formula { font-variant-numeric: tabular-nums lining-nums; }
.res-num { font-weight: 700; letter-spacing: -.01em; }

/* Short answer under the H1. Written to be quoted as-is. */
.answer { position: relative; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); padding: 30px 20px 16px; margin: 0 0 24px; border-radius: var(--r-md); box-shadow: var(--shadow); }
.answer::before { content: "Quick answer"; position: absolute; top: 10px; left: 20px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.answer p { margin: 0; }
caption { caption-side: top; text-align: left; font-size: 13px; color: var(--muted); padding: 8px 12px; background: var(--surface); }

.calc-bar.one { grid-template-columns: 1fr; margin: 12px 0 0; }

.logo { font-family: var(--font-display); }
.breakdown { margin-top: 14px; text-align: left; }
.breakdown summary { cursor: pointer; font-weight: 600; text-align: left; }
.breakdown table { font-variant-numeric: tabular-nums; }
.breakdown td + td, .breakdown th + th { text-align: right; }
.breakdown .bd-sem th { text-align: left; background: var(--surface); }
.calc + .answer { margin-top: 20px; }
@media (max-width: 640px) { .lead { font-size: 16px; margin-bottom: 14px; } }
@media (max-width: 640px) { .wrap { padding: 0 16px; } h1 { margin-top: 22px; } h2 { margin-top: 38px; } }


.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* Calculator, simplified: a scale strip and Settings on top, then the rows, then the result. */
.calc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.scale-strip { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--muted); }
.scale-strip b { color: var(--brand); font-variant-numeric: tabular-nums; }
.scale-strip span { font-weight: 700; color: var(--text); }
.scale-strip i { width: 4px; height: 4px; border-radius: 50%; background: var(--line); }
.settings-toggle { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font: 600 14px var(--font-body); cursor: pointer; }
.settings-toggle svg { width: 16px; height: 16px; color: var(--brand); }
.settings-toggle[aria-expanded=true] { border-color: var(--brand); background: var(--brand-soft); }
.subject-options { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--field); }
.calc .sem { border: 0; box-shadow: none; background: transparent; padding: 0; }
.calc .sem + .sem { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); border-radius: 0; }
.sem-head { margin-bottom: 4px; }
.sem-name { font-size: 15px; }
.sem-gwa { font-size: 15px; }
.calc-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 12px; }
.calc-links button { background: none; border: 0; padding: 6px 2px; color: var(--muted); font: 600 13px var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.calc-links button:hover { color: var(--brand); }
.calc-links .danger:hover { color: var(--warn); }
.theme-toggle:focus-visible, .nav-toggle:focus-visible { outline-offset: 2px; }
@media (max-width: 600px) {
  .calc-top { align-items: flex-start; }

}

/* School walkthroughs remain readable at narrow widths and inherit both themes. */
.walkthrough { display: grid; gap: 1rem; padding-left: 1.5rem; }
.walkthrough li { padding: .75rem; border: 1px solid var(--line); border-radius: var(--r-md); }
.walkthrough strong { display: block; margin-bottom: .35rem; }
.school-policy { margin: 1rem 0; }
.honors-status { margin-top: 1rem; }
.grade-check { margin: 1rem 0; }
.grade-check > label, .grade-check > .grade-result { display: block; padding: 0 18px; }
.grade-check > .grade-result { padding-bottom: 6px; }

/* Ledger pass (Dec 2026): ruled lines and ink instead of floating cards. Squarer corners, no pills,
   sentence-case labels, shadows kept only on the calculator. */
:root { --r-sm: 4px; --r-md: 6px; --r-lg: 8px; --r-pill: 6px; }
.card, .table-scroll, details, .answer { box-shadow: none; }
th { text-transform: none; letter-spacing: 0; font-size: 14px; }
.rows-head { text-transform: none; letter-spacing: 0; font-size: 13px; }
.row.cum .row-field span { text-transform: none; letter-spacing: 0; font-size: 12px; }
.res-label { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; }
.foot-col h2 { font: 700 16px var(--font-display); letter-spacing: -.01em; text-transform: none; }
.nav a { border-radius: var(--r-sm); }
.theme-toggle { border-radius: var(--r-md); }
.toast { border-radius: var(--r-md); }

/* Answer box as a margin note: a brand rule and an italic lead-in, no card. */
.answer { background: transparent; border: 0; border-left: 3px solid var(--brand); border-radius: 0; padding: 2px 0 2px 18px; }
.answer::before { position: static; display: block; content: "In short"; margin-bottom: 4px; font: italic 600 15px var(--font-display); letter-spacing: 0; text-transform: none; color: var(--brand); }

/* Calculator: one solid raised sheet, rows ruled like a class record. */
.calc { background: var(--surface); border-color: color-mix(in srgb, var(--text) 18%, var(--line)); box-shadow: var(--shadow-2); }
.calc .result { box-shadow: none; border-color: transparent; border-top: 2px solid var(--brand); border-radius: 0; }
.rows-head { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.badges li { border-radius: var(--r-sm); }

/* Related tools: a plain ruled list in two columns. */
.links { gap: 0 28px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: 1px solid var(--line); }
.links li { border-bottom: 1px solid var(--line); }
.links a { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 12px 28px 12px 0; transition: color .15s; }
.links a::after { right: 0; top: 12px; transition: none; }
.links a:hover { transform: none; box-shadow: none; color: var(--brand); }
.links a:hover::after { transform: none; }

/* Worked example on the home page: a ruled sheet, not a slideshow. */
.sheet { margin: 36px 0 8px; padding: 0; }
.sheet figcaption { font: 700 19px/1.3 var(--font-display); letter-spacing: -.015em; margin-bottom: 10px; }
.sheet table { border: 1px solid var(--line); border-radius: var(--r-md); }
.sheet td:not(:first-child), .sheet th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.sheet .w { width: 30%; }
.sheet-bar { display: block; margin-left: auto; width: var(--w); height: 8px; background: var(--brand); border-radius: 1px; }
.sheet tfoot td { font-weight: 700; border-top: 2px solid var(--text); border-bottom: 0; background: var(--surface); }
.sheet-sum { margin: 12px 0 0; font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.sheet-sum strong { font-size: 26px; padding: 0 .12em; background: linear-gradient(transparent 70%, color-mix(in srgb, var(--marker) 30%, transparent) 70%); }
@media (max-width: 600px) { .sheet .w { display: none; } .sheet th, .sheet td { padding: 9px 8px; } }
