/* ==========================================================================
   MLM Sifu
   Look: corporate and calm. White pages, navy structure, one blue accent,
   a colour per topic. The abacus stays as the brand mark.
   Structure: tokens -> base -> layout -> components -> prose -> tools -> pages.
   Single-class selectors throughout; no !important.
   ========================================================================== */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/plex-sans-latin-wght.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/plex-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/plex-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */

:root {
  /* surfaces and text: ByteStraits' slate neutrals */
  --paper: #ffffff;
  --paper-2: #f8fafc;
  --paper-3: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  /* brand: the ByteStraits greens, as in bytestraits.my's style.css */
  --brand-dark: #01614e;   /* primary-dark and theme colour: hero, header button, footer, headings */
  --brand-dark-2: #064e3b; /* primary-800: hero gradient end, hover on dark */
  --brand: #01614e;        /* links, labels and buttons (7.5:1 on white) */
  --brand-deep: #064e3b;   /* hover */
  --brand-soft: #f0fef9;   /* primary-50: tinted panels */
  --brand-tint: #ddfcf3;   /* primary-100: highlighted rows */
  --accent: #00d084;       /* primary-500, the ByteStraits emerald: bars and borders only, never text on white */
  --on-dark: #f8fafc;
  --on-dark-2: #d4ebe3;
  --brand-on-dark: #4ae8b5; /* primary-400: labels on the dark green */
  --rule-on-dark: rgba(255, 255, 255, 0.16);

  /* status */
  --warn: #b42318;
  --warn-deep: #912018;
  --warn-soft: #fdeceb;

  /* one colour per topic */
  --jade: #0f6f66;
  --jade-soft: #e5f3f1;
  --seal: #334155;
  --seal-soft: #f1f5f9;
  --indigo: #4a3fa3;
  --indigo-soft: #eeecfa;
  --ochre: #8f5410;
  --ochre-soft: #faf0df;

  --tone: var(--brand);
  --tone-soft: var(--brand-soft);
  --link: var(--brand);

  /* type */
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-body);
  --font-code: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;

  --text-xs: 0.78rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-md: 1.1875rem;
  --text-lg: 1.3rem;
  --text-xl: clamp(1.5rem, 1.25rem + 1.1vw, 2rem);
  --text-2xl: clamp(1.9rem, 1.35rem + 2.4vw, 2.9rem);
  --text-3xl: clamp(2.2rem, 1.45rem + 3.3vw, 3.6rem);

  /* space */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 28px rgba(1, 97, 78, 0.12);
  --measure: 43rem;
}

[data-tone="jade"] { --tone: var(--jade); --tone-soft: var(--jade-soft); }
[data-tone="seal"] { --tone: var(--seal); --tone-soft: var(--seal-soft); }
[data-tone="indigo"] { --tone: var(--indigo); --tone-soft: var(--indigo-soft); }
[data-tone="ochre"] { --tone: var(--ochre); --tone-soft: var(--ochre-soft); }

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--s5);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  overflow-wrap: break-word;
}

img, svg, video { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.018em;
  color: var(--brand-dark);
  text-wrap: balance;
}
h1 { font-size: var(--text-2xl); line-height: 1.1; letter-spacing: -0.025em; }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

p, ul, ol, dl, figure, blockquote { margin: 0; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--brand-deep); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 2px; }

::selection { background: var(--brand-soft); color: var(--ink); }

abbr { text-decoration: none; }

.container { width: min(100% - 2rem, 74rem); margin-inline: auto; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--s4);
  top: -4rem;
  z-index: 10;
  padding: var(--s3) var(--s4);
  background: var(--brand-dark);
  color: var(--on-dark);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--s3); color: var(--on-dark); }

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tone);
  margin-bottom: var(--s3);
}

.lede { font-size: var(--text-md); line-height: 1.55; color: var(--ink-2); max-width: 40rem; }

.ms { font-size: 0.86em; color: var(--ink-3); font-weight: 400; font-style: italic; }

/* a plain divider under page headers */
.bead-rule { height: 1px; background: var(--line); }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  min-height: 2.75rem;
  background: var(--brand);
  color: #fff;
  font: 600 1rem/1.3 var(--font-body);
  text-decoration: none;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; box-shadow: var(--shadow-md); }
.btn:active { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { background: var(--card); color: var(--brand-dark); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--paper-2); color: var(--brand-dark); border-color: var(--ink-3); }
.btn-ghost:active { background: var(--paper-3); border-color: var(--ink-3); }
.btn-small { padding: 0.45rem 0.85rem; min-height: 2.75rem; font-size: var(--text-sm); }
.btn[disabled] { background: var(--paper-3); color: var(--ink-3); border-color: var(--line-strong); box-shadow: none; cursor: not-allowed; }

/* ---------- header ---------- */

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }

.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s5); padding-block: var(--s3); }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--brand-dark); text-decoration: none; }
.brand:hover { color: var(--brand-dark); }
.seal-bg { fill: var(--brand-dark); }
.seal-fg { fill: #ffffff; }
.wm { display: inline-flex; align-items: baseline; gap: 0.3rem; line-height: 1; font-size: 1.35rem; letter-spacing: -0.02em; }
.wm-mlm { font-weight: 700; }
.wm-sifu { font-weight: 400; }

.site-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: block;
  padding: 0.55rem 0.7rem;
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.site-nav a:hover { background: var(--paper-2); color: var(--brand-dark); }
.site-nav a[aria-current="page"] { color: var(--brand-dark); font-weight: 600; box-shadow: inset 0 -2px 0 var(--brand); border-radius: 0; }
.site-nav .nav-cta { margin-inline-start: var(--s2); padding-inline: 1rem; background: var(--brand-dark); color: #fff; font-weight: 600; }
.site-nav .nav-cta:hover { background: var(--brand-dark-2); color: #fff; }
.site-nav .nav-cta[aria-current="page"] { color: #fff; box-shadow: none; border-radius: var(--radius-sm); }

.nav-toggle { display: none; }

@media (max-width: 65.99rem) {
  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    min-height: 2.75rem;
    padding: 0.5rem 0.85rem;
    background: var(--card);
    color: var(--brand-dark);
    font: 600 0.95rem/1 var(--font-body);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
  }
  .nav-toggle-bars { width: 1.1rem; height: 0.75rem; border-block: 2px solid currentColor; position: relative; }
  .nav-toggle-bars::after { content: ""; position: absolute; inset-inline: 0; top: calc(50% - 1px); border-top: 2px solid currentColor; }
  .site-nav { flex-basis: 100%; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; border-top: 1px solid var(--line); padding-top: var(--s2); }
  .site-nav a { padding: 0.8rem 0.25rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brand); padding-inline-start: 0.85rem; }
  .site-nav .nav-cta { margin: var(--s3) 0 var(--s2); text-align: center; border-bottom: 0; border-radius: var(--radius-sm); }
  .site-nav .nav-cta[aria-current="page"] { padding-inline-start: 1rem; }
}

/* ---------- sections ---------- */

.section { padding-block: var(--s8); }
.section-tint { background: var(--paper-2); }
.section-ink { background: var(--brand-dark); color: var(--on-dark); --tone: var(--brand-on-dark); --link: var(--on-dark); }
.section-ink h2, .section-ink h3 { color: #fff; }
.section-ink :focus-visible { outline-color: var(--on-dark); }
.section-ink a:hover { color: #fff; }

.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s3) var(--s5); margin-bottom: var(--s6); }
.more { font-weight: 600; white-space: nowrap; }
.more::after { content: " \2192"; }
.sub-h { margin-block: var(--s7) var(--s5); }
.empty { padding: var(--s5); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-2); background: var(--paper-2); }

/* ---------- hero ---------- */

.hero { background: radial-gradient(circle at 82% 18%, rgba(0, 208, 132, 0.22), transparent 42%), linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-dark-2) 100%); color: var(--on-dark); --tone: var(--brand-on-dark); }
.hero-grid { display: grid; gap: var(--s7); padding-block: var(--s8); align-items: center; }
.hero h1 { font-size: var(--text-3xl); line-height: 1.08; color: #fff; max-width: 17ch; }
.hero .lede { margin-top: var(--s5); color: var(--on-dark-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s6); }
.hero :focus-visible { outline-color: #fff; }
.hero .btn { background: #fff; color: var(--brand-dark); border-color: #fff; }
.hero .btn:hover { background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand-dark); }
.hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.55); box-shadow: none; }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; color: #fff; }
.hero .bead-rule { display: none; }
/* phones: the two hero buttons as one even, full-width stack */
@media (max-width: 29.99rem) {
  .hero-actions { gap: var(--s3); }
  .hero-actions .btn { flex: 1 1 100%; text-align: center; }
}

@media (min-width: 60rem) {
  .hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: var(--s8); }
}

/* the illustration card in the hero */
.ledger {
  padding: var(--s5);
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 48px rgba(0, 40, 31, 0.35);
}
.ledger figcaption { font-weight: 650; font-size: 1.15rem; line-height: 1.3; color: var(--brand-dark); padding-bottom: var(--s3); border-bottom: 1px solid var(--line-strong); }
.ledger-no { display: block; font-size: var(--text-xs); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand); margin-bottom: var(--s1); }
.ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s4); padding-block: 0.6rem; border-bottom: 1px solid var(--line); }
.ledger-row dt { font-size: 0.98rem; line-height: 1.35; }
.ledger-row dt em { display: block; font-style: normal; font-size: var(--text-xs); font-weight: 600; color: var(--brand); }
.ledger-row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ledger-row::after { content: ""; grid-column: 1 / -1; height: 6px; margin-top: 0.4rem; width: calc(var(--v) * 2%); background: var(--line-strong); border-radius: 3px; }
.ledger-key::after { background: var(--accent); }
.ledger-key dt, .ledger-key dd { font-weight: 650; }
.ledger-total { border-bottom: 0; }
.ledger-total dt, .ledger-total dd { font-weight: 650; }
.ledger-total::after { background: var(--brand-dark); }
.ledger-foot { margin-top: var(--s3); font-size: var(--text-sm); line-height: 1.5; color: var(--ink-2); }

/* ---------- topic cards on the home page ---------- */

.paths { display: grid; gap: var(--s5); margin: var(--s6) 0 0; padding: 0; list-style: none; }
@media (min-width: 44rem) { .paths { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72rem) { .paths { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.path-link {
  display: grid;
  align-content: start;
  gap: var(--s2);
  height: 100%;
  padding: var(--s5);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-top: 3px solid var(--tone);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 150ms ease, border-color 150ms ease;
}
.path-link:hover { color: var(--ink); box-shadow: var(--shadow-md); border-color: var(--line-strong); border-top-color: var(--tone); }
.path-name { font-size: 1.2rem; font-weight: 650; line-height: 1.25; letter-spacing: -0.015em; color: var(--brand-dark); }
.path-ms { display: block; margin-top: 0.15rem; font-size: var(--text-sm); font-style: italic; font-weight: 400; letter-spacing: 0; color: var(--ink-3); }
.path-say { font-size: var(--text-sm); font-weight: 600; color: var(--tone); }
.path-blurb { color: var(--ink-2); font-size: 0.97rem; line-height: 1.55; }
.path-count { margin-top: var(--s2); font-size: var(--text-sm); font-weight: 600; color: var(--brand); }
.path-count::after { content: " \2192"; }
/* one column (phones): name, audience and count are enough; the topic page carries the description */
@media (max-width: 43.99rem) {
  .paths { gap: var(--s3); }
  .path-link { gap: var(--s1); padding: var(--s4) var(--s5); }
  .path-blurb { display: none; }
}

/* ---------- cards ---------- */

.cards { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 150ms ease, border-color 150ms ease;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card:focus-within { box-shadow: var(--shadow-md); }

.card-art { display: flex; justify-content: center; padding: var(--s4); background: var(--tone-soft); border-bottom: 1px solid var(--line); }
.card-art .abacus { height: 4.5rem; width: auto; }
.card-body { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s5); flex: 1; }
.card-title { font-size: 1.2rem; line-height: 1.3; }
.card-title a { color: var(--brand-dark); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-title a:hover { color: var(--brand); }
.card-dek { color: var(--ink-2); font-size: 0.97rem; line-height: 1.55; }
.card-meta { margin-top: auto; padding-top: var(--s2); font-size: var(--text-sm); color: var(--ink-3); }

.tag { font-size: var(--text-xs); font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--tone); }
.tag a { position: relative; z-index: 1; color: inherit; text-decoration: none; }
.tag a:hover { text-decoration: underline; }
.tag-tool { color: var(--brand); }

.card-tool { border-top: 3px solid var(--brand-dark); }
.cards-tools { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }

.feature { margin-bottom: var(--s5); }
@media (min-width: 52rem) {
  .feature .card { flex-direction: row; }
  .feature .card-art { flex: 0 0 34%; align-items: center; border-bottom: 0; border-inline-end: 1px solid var(--line); }
  .feature .card-art .abacus { height: 7rem; }
  .feature .card-body { padding: var(--s6); justify-content: center; }
  .feature .card-title { font-size: var(--text-xl); line-height: 1.2; }
  .feature .card-dek { font-size: var(--text-base); }
  .feature .card-meta { margin-top: var(--s2); }
}

/* ---------- abacus artwork ---------- */

.ab-frame { fill: var(--card); stroke: var(--brand-dark); stroke-width: 2; }
.ab-rod { stroke: var(--line-strong); stroke-width: 1.5; }
.ab-beam { fill: var(--brand-dark); }
.ab-bead { fill: var(--paper-3); stroke: var(--line-strong); stroke-width: 1; }
.ab-bead.is-on { fill: var(--tone); stroke: var(--tone); }

/* ---------- glossary teaser ---------- */

.kamus-grid { display: grid; gap: var(--s6); align-items: start; }
.kamus-grid p + p { margin-top: var(--s4); }
.kamus-grid h2 { margin-bottom: var(--s4); }
@media (min-width: 56rem) { .kamus-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--s8); } }
.kamus-list { display: grid; gap: 0; border-top: 1px solid var(--line-strong); }
.kamus-item { padding-block: var(--s4); border-bottom: 1px solid var(--line); }
.kamus-item dt { font-weight: 650; font-size: 1.1rem; }
.kamus-item dt a { color: var(--brand-dark); text-decoration: none; }
.kamus-item dt a:hover { color: var(--brand); text-decoration: underline; }
.kamus-item dd { margin: var(--s1) 0 0; color: var(--ink-2); font-size: 0.97rem; }

/* ---------- editorial standards ---------- */

.how-grid { display: grid; gap: var(--s6); }
.promises { display: grid; gap: var(--s5); margin: 0; padding: 0; list-style: none; counter-reset: promise; }
.promises li { counter-increment: promise; padding-top: var(--s4); border-top: 1px solid var(--rule-on-dark); }
.promises li::before { content: "0" counter(promise); font-size: var(--text-sm); font-weight: 650; letter-spacing: 0.08em; color: var(--brand-on-dark); }
.promises h3 { margin-block: var(--s2); font-size: 1.25rem; }
.promises p { color: var(--on-dark-2); font-size: 1rem; }
.how-foot { color: var(--on-dark-2); font-size: var(--text-sm); }
@media (min-width: 52rem) { .promises { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); } }

/* ---------- page head (listings, static pages, tools) ---------- */

.page-head { background: var(--paper-2); }
.page-head > .container { padding-block: var(--s6) var(--s7); }
.page-head h1 { max-width: 24ch; }
.page-head .lede { margin-top: var(--s4); }
.page-head .post-meta { margin-top: var(--s5); }

.breadcrumb { margin-bottom: var(--s5); font-size: var(--text-sm); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--s1) 0; margin: 0; padding: 0; list-style: none; }
.breadcrumb li + li::before { content: "/"; margin-inline: 0.55em; color: var(--line-strong); }
.breadcrumb a { color: var(--ink-2); display: inline-block; padding-block: 0.35rem; }
.breadcrumb [aria-current] { color: var(--ink-3); display: inline-block; padding-block: 0.35rem; }

.chips { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s5) 0 0; padding: 0; list-style: none; }
.chips a {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--card);
  color: var(--brand-dark);
  font-weight: 600;
  font-size: 0.97rem;
  text-decoration: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.chips a:hover { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand); }

/* ---------- archive ---------- */

.archive { display: grid; gap: var(--s7); }
.archive-group h2 { padding-bottom: var(--s3); border-bottom: 2px solid var(--tone); }
.archive-group h2 a { color: var(--brand-dark); text-decoration: none; }
.archive-group h2 a:hover { color: var(--tone); }
.archive-list { margin: 0; padding: 0; list-style: none; }
.archive-list li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s1) var(--s5); padding-block: var(--s4); border-bottom: 1px solid var(--line); }
.archive-list a { font-weight: 600; font-size: 1.1rem; line-height: 1.35; color: var(--brand-dark); text-decoration: none; max-width: 46rem; }
.archive-list a:hover { color: var(--brand); text-decoration: underline; }
.archive-meta { font-size: var(--text-sm); color: var(--ink-3); white-space: nowrap; }

/* ---------- article ---------- */

.post-head { background: var(--paper-2); border-bottom: 1px solid var(--line); }
.post-head-grid { display: grid; gap: var(--s6); padding-block: var(--s6) var(--s7); align-items: end; }
.post-head h1 { max-width: 26ch; }
.dek { margin-top: var(--s4); font-size: var(--text-md); line-height: 1.5; color: var(--ink-2); max-width: 42rem; }

.post-meta { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); margin-top: var(--s5); font-size: var(--text-sm); color: var(--ink-3); }
.post-meta a { color: var(--ink-2); }

.post-abacus { display: none; }
.post-abacus .abacus { width: 100%; height: auto; }
.post-abacus figcaption { margin-top: var(--s2); font-size: var(--text-xs); line-height: 1.45; color: var(--ink-3); }
@media (min-width: 56rem) {
  .post-head-grid { grid-template-columns: minmax(0, 1fr) 12.5rem; gap: var(--s7); }
  .post-abacus { display: block; }
}

.post-layout { display: grid; gap: var(--s5); padding-block: var(--s6) var(--s8); }
.post-main { min-width: 0; }

/* the "facts checked" badge */
.stamp {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.5rem;
  padding: 0.45rem 0.85rem;
  font-size: var(--text-sm);
  line-height: 1.3;
  color: var(--ink-2);
  background: var(--jade-soft);
  border: 1px solid #b9dcd6;
  border-radius: 999px;
}
.stamp-label { font-weight: 650; color: var(--jade); }
.stamp-label::before { content: "\2713\00a0"; }
.stamp time { font-variant-numeric: tabular-nums; }

.toc ol { margin: 0; padding: 0; list-style: none; }
.toc a { display: block; padding: 0.35rem 0 0.35rem var(--s3); color: var(--ink-2); font-size: var(--text-sm); line-height: 1.4; text-decoration: none; border-inline-start: 2px solid var(--line); }
.toc a:hover { color: var(--brand-dark); border-color: var(--line-strong); }
.toc a.is-active { color: var(--brand-dark); font-weight: 600; border-color: var(--brand); }
.toc ol ol a { padding-inline-start: var(--s5); font-size: 0.82rem; }
.toc-h { margin-bottom: var(--s3); font-size: var(--text-xs); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.toc-desktop { display: none; }
.toc-mobile { margin-bottom: var(--s6); background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); }
.toc-mobile summary { padding: 0.8rem var(--s4); font-weight: 600; color: var(--brand-dark); cursor: pointer; }
.toc-mobile nav { padding: 0 var(--s4) var(--s4); }
.toc-mobile a { padding-block: 0.6rem; }

@media (min-width: 66rem) {
  .post-layout { grid-template-columns: minmax(0, var(--measure)) 16rem; justify-content: space-between; gap: var(--s7); }
  .post-aside { grid-column: 2; grid-row: 1; }
  .post-main { grid-column: 1; grid-row: 1; }
  .post-aside { position: sticky; top: var(--s5); align-self: start; max-height: calc(100dvh - 3rem); overflow-y: auto; padding: 4px 4px var(--s4) 0; display: flex; flex-direction: column; gap: var(--s6); align-items: flex-start; }
  .toc-desktop { display: block; width: 100%; }
  .toc-mobile { display: none; }
}

/* ---------- prose: everything an article body may contain ---------- */

.prose { font-size: 1.09rem; line-height: 1.72; max-width: var(--measure); }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { margin-top: 2.4em; padding-top: 1em; border-top: 1px solid var(--line); scroll-margin-top: var(--s5); }
.prose h3 { margin-top: 1.9em; scroll-margin-top: var(--s5); }
.prose h4 { margin-top: 1.6em; font-size: 1.05rem; font-weight: 650; letter-spacing: 0; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.7em; }
.prose strong { font-weight: 650; }
.prose ul, .prose ol { padding-inline-start: 1.35em; }
.prose li + li { margin-top: 0.45em; }
.prose li > ul, .prose li > ol { margin-top: 0.45em; }
.prose ul > li::marker { color: var(--brand); }
.prose ol > li::marker { font-size: 0.92em; font-weight: 600; color: var(--ink-3); }
.prose code, .prose kbd { font-family: var(--font-code); font-size: 0.86em; padding: 0.1em 0.35em; background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; }
.prose hr { height: 1px; border: 0; background: var(--line-strong); max-width: 6rem; margin-inline: auto; }
.prose-page { margin-inline: 0; }

.cite { font-size: 0.72em; font-weight: 600; line-height: 0; }
.cite a { padding: 0.3em 0.15em; text-decoration: none; }
.cite a:hover { text-decoration: underline; }

/* key points box at the top of every article */
.takeaways { padding: var(--s5); background: var(--brand-soft); border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); border-radius: var(--radius); }
.prose .takeaways h2 { margin: 0; padding: 0; border: 0; font-size: var(--text-xs); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tone); }
.takeaways ul { margin-top: var(--s3); font-size: 1.03rem; line-height: 1.55; }
.prose .takeaways li::marker { color: var(--tone); }

/* callouts:  <aside class="note note-sifu|note-warn|note-law"><p class="note-title">…</p><p>…</p></aside> */
.note { padding: var(--s4) var(--s5); background: var(--paper-2); border: 1px solid var(--line); border-inline-start: 4px solid var(--ink-3); border-radius: var(--radius); font-size: 1.02rem; line-height: 1.6; }
.note > * + * { margin-top: 0.6em; }
.note-title { font-size: var(--text-xs); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.note-sifu { border-inline-start-color: var(--jade); background: var(--jade-soft); }
.note-sifu .note-title { color: var(--jade); }
.note-warn { border-inline-start-color: var(--warn); background: var(--warn-soft); }
.note-warn .note-title { color: var(--warn-deep); }
.note-law { border-inline-start-color: var(--indigo); background: var(--indigo-soft); }
.note-law .note-title { color: var(--indigo); }

/* quoting a statute or a regulator:  <blockquote class="statute"><p>…</p><footer>Section …</footer></blockquote> */
.statute { padding: var(--s4) var(--s5); background: var(--paper-2); border: 1px solid var(--line); border-inline-start: 4px solid var(--brand-dark); border-radius: var(--radius); font-size: 1.06rem; line-height: 1.6; color: var(--ink); }
.statute > * + * { margin-top: 0.6em; }
.statute footer { font-size: var(--text-sm); color: var(--ink-3); }
.statute footer::before { content: "\2014\00a0"; }

/* worked example:  <section class="worked"><h3>…</h3> … </section> */
.worked { padding: var(--s5); background: var(--card); border: 1px solid var(--line-strong); border-top: 3px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.worked::before { content: "Worked example"; display: block; font-size: var(--text-xs); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand); }
.worked > * + * { margin-top: 1em; }
.prose .worked h3 { margin-top: var(--s2); font-size: 1.25rem; }
.worked .table-wrap { margin-inline: 0; }

/* formula line:  <p class="formula">Payout ratio = commissions paid &divide; commissionable sales</p> */
.formula { padding: var(--s3) var(--s4); background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: var(--font-code); font-size: 0.93rem; line-height: 1.6; overflow-x: auto; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.table-wrap:focus-visible { outline-offset: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.96rem; line-height: 1.45; }
caption { caption-side: top; padding: var(--s3) var(--s4); text-align: start; font-size: var(--text-sm); font-weight: 600; color: var(--brand-dark); border-bottom: 1px solid var(--line); background: var(--card); }
th, td { padding: 0.65rem var(--s4); text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font-size: var(--text-xs); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); background: var(--paper-2); border-bottom: 1px solid var(--line-strong); white-space: nowrap; vertical-align: bottom; }
@media (max-width: 40rem) {
  /* let column headings wrap on phones so small tables fit without sideways scrolling */
  thead th { white-space: normal; }
  th, td { padding-inline: var(--s3); }
}
tbody th { font-weight: 600; color: var(--brand-dark); }
tbody tr:last-child > * { border-bottom: 0; }
tfoot td, tfoot th, tr.row-total > * { font-weight: 650; border-top: 1px solid var(--line-strong); border-bottom: 0; background: var(--paper-2); }
.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
thead .num { text-align: end; }
tr.row-key > * { background: var(--brand-tint); }

/* numbered steps:  <ol class="steps"><li><h3>…</h3><p>…</p></li></ol> */
.prose .steps { padding: 0; list-style: none; counter-reset: step; }
.steps > li { position: relative; padding: 0 0 var(--s5) 3.25rem; counter-increment: step; }
.prose .steps > li + li { margin-top: 0; }
.steps > li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 0; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; background: var(--brand-soft); color: var(--brand); font-weight: 650; font-size: 0.95rem; border: 1px solid #b7f7e5; border-radius: 50%; }
.steps > li::after { content: ""; position: absolute; inset-inline-start: calc(1.05rem - 1px); top: 2.4rem; bottom: 0.3rem; border-inline-start: 2px solid var(--line); }
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.prose .steps h3 { margin-top: 0; padding-top: 0.2rem; font-size: 1.15rem; }
.steps > li > * + * { margin-top: 0.5em; }

/* checklist:  <ul class="checklist"><li>…</li></ul> */
.prose .checklist { padding: 0; list-style: none; }
.checklist > li { position: relative; padding-inline-start: 2rem; }
.checklist > li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.32em; width: 1.1rem; height: 1.1rem; background: var(--card); border: 1.5px solid var(--ink-3); border-radius: 4px; }

/* headline figures:  <ul class="stats"><li><b>RM100,000</b><span>what it means</span></li></ul> */
.prose .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: var(--s4); padding: 0; list-style: none; }
.prose .stats > li { margin: 0; padding: var(--s4); background: var(--paper-2); border: 1px solid var(--line); border-top: 3px solid var(--tone); border-radius: var(--radius); }
.stats b { display: block; font-weight: 700; font-size: 1.75rem; line-height: 1.1; letter-spacing: -0.02em; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.stats span { display: block; margin-top: var(--s2); font-size: var(--text-sm); line-height: 1.4; color: var(--ink-2); }

/* horizontal bars:  <dl class="bars"><div style="--v:43"><dt>Label</dt><dd>43%</dd></div></dl>  (--v is 0 to 100) */
.bars { display: grid; gap: var(--s3); padding: var(--s4) var(--s5); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.bars > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s4); font-size: 0.96rem; }
.bars dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.bars > div::after { content: ""; grid-column: 1 / -1; height: 8px; margin-top: 0.3rem; width: calc(var(--v) * 1%); min-width: 2px; background: var(--tone); border-radius: 4px; }
.bars > .is-muted::after { background: var(--line-strong); }
.bars > .is-over::after { background: var(--warn); }

/* side-by-side comparison:  <div class="compare"><div>…</div><div>…</div></div> */
.compare { display: grid; gap: var(--s4); }
.compare > div { padding: var(--s4) var(--s5); background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--brand-dark); border-radius: var(--radius); font-size: 1.02rem; line-height: 1.6; }
.compare > div > * + * { margin-top: 0.6em; }
.prose .compare h3 { margin-top: 0; font-size: 1.15rem; }
@media (min-width: 40rem) { .compare { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* diagrams:  <figure class="diagram"><svg …>…</svg><figcaption>…</figcaption></figure> */
.diagram { padding: var(--s4); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.diagram svg { width: 100%; height: auto; }
.diagram figcaption { margin-top: var(--s3); font-size: var(--text-sm); line-height: 1.5; color: var(--ink-2); }
.d-line { fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.d-node { fill: var(--paper-2); stroke: var(--brand-dark); stroke-width: 1.5; }
.d-accent { fill: var(--tone); stroke: var(--tone); stroke-width: 1.5; }
.d-muted { fill: var(--paper-3); stroke: var(--line-strong); stroke-width: 1.5; }
.d-text { font-family: var(--font-body); font-size: 12px; font-weight: 500; fill: var(--ink); }
.d-text-inv { font-family: var(--font-body); font-size: 12px; font-weight: 600; fill: #fff; }
.d-label { font-family: var(--font-body); font-size: 13px; font-weight: 600; fill: var(--ink); }

/* pointer to a calculator:  <p class="tool-link"><a href="/tools/…/">…</a></p> */
.tool-link { padding: var(--s4) var(--s5); background: var(--brand-dark); color: var(--on-dark); border-radius: var(--radius); font-size: 1.02rem; }
.tool-link::before { content: "Calculator"; display: block; font-size: var(--text-xs); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand-on-dark); }
.tool-link a { color: #fff; font-weight: 600; }
.tool-link a:hover { color: var(--brand-soft); }
.tool-link a:focus-visible { outline-color: #fff; }

.faq-item + .faq-item { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.prose .faq-item h3 { margin-top: 0; font-size: 1.15rem; }
.faq-item > * + * { margin-top: 0.6em; }

.sources { font-size: 0.94rem; line-height: 1.55; }
.sources-note { color: var(--ink-2); }
.sources ol { margin-top: var(--s4); }
.sources li { padding-inline-start: 0.25em; scroll-margin-top: var(--s5); }
.sources li:target { background: var(--brand-soft); outline: 6px solid var(--brand-soft); }
.sources cite { font-style: normal; font-weight: 500; }
.src-note { color: var(--ink-2); }

.endnote { max-width: var(--measure); margin-top: var(--s7); padding: var(--s5); background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.94rem; line-height: 1.55; color: var(--ink-2); }
.endnote > * + * { margin-top: 0.7em; }
.endnote strong { color: var(--brand-dark); }

.related h2 { margin-bottom: var(--s6); }
.other-topics h2 { font-size: var(--text-lg); }

/* ---------- tools ---------- */

.tool-layout { padding-block: var(--s6) var(--s8); }
.tool-layout > * + * { margin-top: var(--s6); }
.tool-layout > .prose { margin-top: var(--s7); }

.tool { display: grid; gap: var(--s5); align-items: start; }
@media (min-width: 58rem) { .tool { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: var(--s6); } }

.tool-form { display: grid; gap: var(--s5); padding: var(--s5); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.tool-form fieldset { display: grid; gap: var(--s4); min-width: 0; margin: 0; padding: 0; border: 0; }
.tool-form legend { padding: 0; margin-bottom: var(--s2); font-weight: 650; font-size: 1.15rem; color: var(--brand-dark); }
.field { display: grid; gap: 0.3rem; min-width: 0; align-content: start; }
.field-row { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); align-items: start; }
.field label, .field-label { font-size: 0.94rem; font-weight: 600; line-height: 1.35; color: var(--ink); }
.hint { font-size: var(--text-sm); line-height: 1.45; color: var(--ink-2); }

.field input, .field select, .input-table input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.7rem;
  background: var(--card);
  color: var(--ink);
  font: 500 1rem/1.3 var(--font-code);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.field select { font-family: var(--font-body); }
.field input:hover, .field select:hover, .input-table input:hover { border-color: var(--ink-3); }
.field input:focus-visible, .field select:focus-visible, .input-table input:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.field input[aria-invalid="true"], .input-table input[aria-invalid="true"] { border-color: var(--warn); background: var(--warn-soft); }

/* editable grids inside a calculator (weeks, levels) */
.input-table { font-size: 0.95rem; }
.input-table th, .input-table td { padding: 0.35rem 0.5rem; vertical-align: middle; }
.input-table tbody th { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
.input-table input { min-width: 5.5rem; text-align: end; }
.tool-form .table-wrap { background: transparent; }

/* list of dates the user has added */
.pill-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.pill-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); font-size: var(--text-sm); font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--line); }
.pill-list li.hint { padding-block: 0.6rem; border-bottom: 0; }
.tool-actions input { flex: 1 1 10rem; min-width: 0; }
.tool-result .table-wrap { max-height: 22rem; overflow-y: auto; }
.tool-result .bars { padding: var(--s3) var(--s4); }
.field input:disabled, .field select:disabled { background: var(--paper-3); color: var(--ink-3); cursor: not-allowed; }

.affix { display: flex; align-items: stretch; }
.affix > span { display: grid; place-items: center; padding-inline: 0.7rem; white-space: nowrap; background: var(--paper-2); font-size: 0.9rem; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line-strong); }
.affix > span:first-child { border-inline-end: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.affix > span:last-child { border-inline-start: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.affix > span:first-child + input { border-start-start-radius: 0; border-end-start-radius: 0; }
.affix > input:not(:last-child) { border-start-end-radius: 0; border-end-end-radius: 0; }
.affix > input { min-width: 0; }

.field-error { font-size: var(--text-sm); font-weight: 600; color: var(--warn-deep); }
.field-error:empty { display: none; }
.field-error::before { content: "Check this: "; }

.check { display: flex; align-items: flex-start; gap: var(--s3); min-height: 2.75rem; padding-block: 0.4rem; font-size: 0.98rem; line-height: 1.4; cursor: pointer; }
.check input { flex: none; width: 1.3rem; height: 1.3rem; margin: 0.1rem 0 0; accent-color: var(--brand); }

.tool-actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.btn-link { min-height: 2.75rem; padding: 0.4rem 0.2rem; background: none; border: 0; color: var(--link); font: 600 0.95rem/1.3 var(--font-body); text-decoration: underline; cursor: pointer; }
.btn-link:hover { color: var(--brand-deep); }

.tool-result { display: grid; gap: var(--s4); padding: var(--s5); background: var(--card); border: 1px solid var(--line-strong); border-top: 3px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow-md); }
@media (min-width: 58rem) { .tool-result { position: sticky; top: var(--s5); } }
.tool-result h2 { font-size: var(--text-xs); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand); }
.result-big { font-weight: 700; font-size: clamp(2.1rem, 1.6rem + 2.2vw, 3rem); line-height: 1.05; letter-spacing: -0.03em; color: var(--brand-dark); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result-label { font-size: var(--text-sm); color: var(--ink-2); }
.result-rows { display: grid; margin: 0; border-top: 1px solid var(--line-strong); }
.result-rows > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.15rem var(--s4); padding-block: 0.55rem; border-bottom: 1px solid var(--line); font-size: 0.96rem; }
.result-rows dt { flex: 1 1 9rem; line-height: 1.35; }
.result-rows dd { margin: 0 0 0 auto; font-weight: 600; font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; }
.result-rows > .row-total { border-bottom: 0; font-weight: 650; color: var(--brand-dark); }
.result-empty { color: var(--ink-2); font-size: 0.98rem; }

/* verdicts always carry a word, never colour alone */
.verdict { padding: var(--s3) var(--s4); border: 1px solid var(--line); border-inline-start: 4px solid var(--ink-3); border-radius: var(--radius-sm); background: var(--paper-2); font-size: 0.97rem; line-height: 1.5; }
.verdict strong { display: block; font-size: var(--text-xs); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.verdict.is-ok { border-inline-start-color: var(--jade); background: var(--jade-soft); }
.verdict.is-ok strong { color: var(--jade); }
.verdict.is-warn { border-inline-start-color: var(--ochre); background: var(--ochre-soft); }
.verdict.is-warn strong { color: var(--ochre); }
.verdict.is-bad { border-inline-start-color: var(--warn); background: var(--warn-soft); }
.verdict.is-bad strong { color: var(--warn-deep); }

/* ---------- glossary ---------- */

.az ul { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s5) 0 0; padding: 0; list-style: none; }
.az a { display: grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; background: var(--card); color: var(--brand-dark); font-weight: 600; text-decoration: none; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.az a:hover { background: var(--brand-dark); color: #fff; border-color: var(--brand-dark); }

.glossary { display: grid; gap: var(--s7); max-width: var(--measure); }
.letter h2 { font-size: var(--text-2xl); color: var(--brand); padding-bottom: var(--s2); border-bottom: 1px solid var(--line-strong); scroll-margin-top: var(--s5); }
.term { padding-block: var(--s5); border-bottom: 1px solid var(--line); scroll-margin-top: var(--s5); }
.term:target { background: var(--brand-soft); outline: 0.75rem solid var(--brand-soft); }
.term dt { font-weight: 650; font-size: 1.25rem; line-height: 1.3; color: var(--brand-dark); }
.term dt abbr { font-size: 0.78rem; font-weight: 650; padding: 0.1em 0.45em; background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; vertical-align: 0.15em; }
.term dd { margin: var(--s2) 0 0; max-width: var(--measure); line-height: 1.65; }
.term dd > * + * { margin-top: 0.7em; }
.term-see { font-size: var(--text-sm); color: var(--ink-2); }

/* ---------- 404 ---------- */

.notfound-art { margin-bottom: var(--s5); }
.notfound-art .abacus { height: 6rem; width: auto; }
.notfound .lede { margin-top: var(--s4); }

/* ---------- footer ---------- */

.site-footer { background: var(--brand-dark); color: var(--on-dark-2); font-size: 0.96rem; --link: var(--on-dark); }
.site-footer .bead-rule { display: none; }
.site-footer :focus-visible { outline-color: var(--on-dark); }
.footer-grid { display: grid; gap: var(--s6); padding-block: var(--s7) var(--s6); }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--s7); } }
.brand-footer, .brand-footer:hover { color: #fff; }
.site-footer .seal-bg { fill: #ffffff; }
.site-footer .seal-fg { fill: var(--brand-dark); }
.footer-motto { margin-top: var(--s4); font-size: 1.05rem; line-height: 1.45; color: var(--on-dark); }
.footer-motto span { color: var(--brand-on-dark); font-style: italic; }
.footer-disclosure { margin-top: var(--s4); max-width: 30rem; font-size: var(--text-sm); line-height: 1.55; }
.footer-h { margin-bottom: var(--s3); font-size: var(--text-xs); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-dark-2); }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li a { display: inline-block; padding-block: 0.4rem; color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-base { display: grid; gap: var(--s2); padding-block: var(--s5); border-top: 1px solid var(--rule-on-dark); font-size: var(--text-sm); line-height: 1.5; }

/* ---------- motion and print ---------- */

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

@media print {
  .site-header, .site-footer, .post-aside, .toc-mobile, .related, .skip-link, .hero-actions, .post-abacus { display: none; }
  body { background: #fff; font-size: 11pt; }
  .hero { background: none; color: #000; }
  .hero h1 { color: #000; }
  .post-head, .page-head { background: none; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; word-break: break-all; }
  .worked, .tool-result, .ledger, .card { box-shadow: none; }
  .table-wrap { overflow: visible; }
  h2, h3 { break-after: avoid; }
  table, .worked, .note { break-inside: avoid; }
}
