/* Moneywise: money decisions, with the math shown.
   Material: cotton paper, navy ink, ledger green, a gold coin, red ink for money going out.
   Craft: one calculator per page with a big answer; 3x5 index cards for the ideas (tap to turn over);
   a two-colour printing-calculator tape for the math, folded away until you ask for it. */

/* ------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --paper: #f3eee3;
  --paper-deep: #e9e2d2;
  --sheet: #fbf8f1;
  --card: #fffef9;
  --tape: #fffdf7;
  --ink: #0f2148;
  --navy: #011d48;
  --navy-2: #0a2a5e;
  --ink-2: #3e4a66;
  --muted: #5f6678;
  --rule: #cbc2ae;
  --rule-2: #ddd5c3;
  --grid: #e3dccb;
  --green: #0fcf67;
  --green-ink: #0b7343;
  --teal: #057777;
  --gold: #f3c863;
  --gold-ink: #7d5806;
  --red-ink: #a8361f;
  --mark: #fff0a8;
  --series-1: #1fa866;
  --series-2: #b8432a;
  --series-3: #3a6bd4;
  --series-4: #c7900f;
  --series-5: #00968c;
  --display: "Besley", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "Courier Prime", "Courier New", ui-monospace, monospace;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 44px);
  --top-h: 64px;
  --radius: 8px;
  --lift: 0 1px 0 rgba(1, 29, 72, 0.04), 0 24px 48px -36px rgba(1, 29, 72, 0.45);
}

/* ------------------------------------------------ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 90px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  font-feature-settings: "kern";
  background-image: radial-gradient(rgba(1, 29, 72, 0.035) 0.6px, transparent 0.7px);
  background-size: 5px 5px;
  overflow-x: hidden;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration-color: var(--series-1);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--navy);
  text-decoration-color: var(--navy);
}
:focus-visible {
  outline: 3px solid var(--series-3);
  outline-offset: 2px;
  border-radius: 2px;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--navy);
}
p {
  margin: 0 0 1em;
}
b,
strong {
  font-weight: 700;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
summary {
  cursor: pointer;
}
summary::-webkit-details-marker {
  display: none;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 10px 14px;
}
.skip:focus {
  left: 8px;
}
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.micro {
  font: 700 11.5px/1.3 var(--sans);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}
.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------ header: logo, seven topics, the glossary */
.mw-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(243, 238, 227, 0.94);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--rule);
}
.mw-top-row {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  min-height: var(--top-h);
}
.mw-brand {
  flex: 0 0 auto;
  display: block;
  padding: 6px 0;
}
.mw-brand img {
  width: 164px;
  height: auto;
}
.mw-tabs {
  display: flex;
  gap: 2px;
  margin-left: auto;
  align-self: stretch;
  align-items: flex-end;
}
.mw-tabs a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px 12px 11px;
  margin-bottom: -1px;
  font: 600 14.5px/1 var(--sans);
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}
.mw-tabs a:hover {
  color: var(--navy);
  background: rgba(251, 248, 241, 0.7);
  border-color: var(--rule-2);
}
.mw-tabs a[aria-current="page"] {
  color: var(--navy);
  background: var(--sheet);
  border-color: var(--rule);
}
.mw-tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: -1px;
  height: 3px;
  background: var(--series-1);
  border-radius: 0 0 2px 2px;
}
.mw-gloss {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--navy);
  border-radius: 999px;
  font: 600 14px/1 var(--sans);
  color: var(--navy);
  text-decoration: none;
  background: var(--sheet);
}
.mw-gloss:hover,
.mw-gloss[aria-current="page"] {
  background: var(--navy);
  color: #fff;
}
.mw-gloss svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* ------------------------------------------------ footer */
.mw-foot {
  margin-top: clamp(64px, 9vw, 120px);
  background: var(--navy);
  color: #d9dfec;
}
.mw-foot .wrap {
  padding-top: 30px;
  padding-bottom: 30px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px 36px;
  align-items: center;
}
.mw-foot img {
  width: 140px;
  height: auto;
}
.mw-foot nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 22px;
  font: 600 14px/1.4 var(--sans);
}
.mw-foot nav a {
  color: #f6f1e4;
  text-decoration-color: rgba(15, 207, 103, 0.7);
}
.mw-foot nav a:hover {
  color: #fff;
  text-decoration-color: var(--green);
}
.mw-foot .disclaim {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13.5px;
  color: #b9c2d6;
}

/* ------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border: 1px solid var(--navy);
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  font: 700 15px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(1, 29, 72, 0.25);
}
.btn:hover {
  background: var(--navy-2);
  color: #fff;
}
.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--green);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s;
}
.btn:hover svg {
  transform: translateX(3px);
}
.btn.ghost {
  background: transparent;
  color: var(--navy);
  box-shadow: none;
}
.btn.ghost:hover {
  background: var(--sheet);
}

/* ------------------------------------------------ home */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  padding-top: clamp(32px, 5vw, 72px);
  padding-bottom: clamp(20px, 3vw, 40px);
}
.hero h1 {
  font: 800 clamp(44px, 6vw, 88px)/0.95 var(--display);
  letter-spacing: -0.025em;
  color: var(--navy);
}
.hero h1 em {
  display: block;
  font-style: italic;
  font-weight: 500;
  color: var(--teal);
}
.hero .lede {
  max-width: 30em;
  text-wrap: balance;
  margin: 22px 0 28px;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.45;
  color: var(--ink-2);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-art {
  position: relative;
  aspect-ratio: 1;
  max-width: 460px;
  width: 100%;
  justify-self: end;
}
.guilloche {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.guilloche path {
  fill: none;
  stroke-width: 0.55;
  vector-effect: non-scaling-stroke;
}
.guilloche .g1 {
  stroke: rgba(1, 29, 72, 0.55);
}
.guilloche .g2 {
  stroke: rgba(5, 119, 119, 0.55);
}
.guilloche .g3 {
  stroke: rgba(31, 168, 102, 0.65);
}
.guilloche .ring {
  fill: none;
  stroke: rgba(1, 29, 72, 0.35);
  stroke-width: 0.8;
}
.guilloche .ring-text {
  font: 700 10.5px var(--sans);
  letter-spacing: 0.32em;
  fill: var(--navy);
}
.coin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 27%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    circle at 36% 30%,
    #fde580 0 18%,
    #f6d06c 38%,
    #e7b443 70%,
    #c9922a 100%
  );
  box-shadow:
    inset 0 0 0 5px rgba(249, 216, 111, 0.9),
    inset 0 0 0 6px rgba(158, 107, 18, 0.35),
    0 14px 30px -12px rgba(120, 80, 10, 0.55);
}
@media (prefers-reduced-motion: no-preference) {
  .guilloche .spin {
    transform-origin: 250px 250px;
    animation: spin 140s linear infinite;
  }
  .guilloche .spin-r {
    transform-origin: 250px 250px;
    animation: spin 200s linear infinite reverse;
  }
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
}

.home-topics {
  margin-top: clamp(20px, 3.5vw, 44px);
}
/* home: the seven topics, each carrying today's number */
.topics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topic-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  min-height: 200px;
  padding: 20px 20px 18px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    border-color 0.2s;
}
.topic-card:hover {
  transform: translateY(-3px);
  border-color: var(--navy);
  color: inherit;
  box-shadow: 0 22px 40px -30px rgba(1, 29, 72, 0.6);
}
.topic-card h3 {
  font: 800 25px/1.1 var(--display);
  letter-spacing: -0.01em;
}
.topic-card p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.4;
  color: var(--ink-2);
}
.tc-stat {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
}
.tc-stat b {
  display: block;
  font: 600 27px/1.1 var(--sans);
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.tc-stat small {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
}
.topic-card.alt {
  background: var(--navy);
  border-color: var(--navy);
}
.topic-card.alt h3,
.topic-card.alt .tc-stat b {
  color: #fff;
}
.topic-card.alt p,
.topic-card.alt .tc-stat small {
  color: #c9d3e6;
}
.topic-card.alt .tc-stat {
  border-top-color: rgba(255, 255, 255, 0.25);
}
.proof-line {
  position: relative;
  margin: 28px 0 0;
  padding-left: 34px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}
.proof-line::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2f3e8;
  color: var(--green-ink);
  font-weight: 700;
}

/* ------------------------------------------------ topic page: title, then one calculator, then cards */
.t-head {
  max-width: 900px;
  padding: clamp(28px, 4vw, 52px) 0 clamp(18px, 2.4vw, 28px);
}
.t-head h1 {
  font: 800 clamp(40px, 5.4vw, 70px)/0.98 var(--display);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.t-sub {
  margin: 12px 0 0;
  max-width: 46ch;
  text-wrap: balance;
  font-size: clamp(18px, 1.8vw, 23px);
  line-height: 1.4;
  color: var(--ink-2);
}
.t-chip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 18px 0 0;
  padding: 7px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--sheet);
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink-2);
}
.t-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--series-1);
  box-shadow: 0 0 0 3px rgba(31, 168, 102, 0.18);
}
.t-chip b {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.t-chip small {
  font: 400 12px/1 var(--mono);
  color: var(--muted);
}
.t-sec {
  margin-top: clamp(52px, 7vw, 88px);
}
.t-sec > h2,
.sec-title {
  margin-bottom: 18px;
  font: 800 clamp(26px, 2.8vw, 36px)/1.1 var(--display);
  letter-spacing: -0.015em;
}

/* ------------------------------------------------ calculators */
.tool {
  position: relative;
  padding: clamp(18px, 2.4vw, 30px);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--lift);
}
.tool[hidden] {
  display: none;
}
.tool + .tool {
  margin-top: 18px;
}
.tool-intro {
  margin: 0 0 18px;
  max-width: 70ch;
  font-size: 15.5px;
  color: var(--ink-2);
}
.tool-grid {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: clamp(22px, 3vw, 44px);
  align-items: start;
}
.tool.math-on .tool-grid {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(240px, 280px);
}
.tape-slot[hidden] {
  display: none;
}

/* inputs: a label, a value you can type, a slider */
.fields {
  display: grid;
  gap: 16px;
}
.fields.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.fields.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}
.fields.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.box {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.box.wide {
  grid-column: 1 / -1;
}
.box label,
.box .box-label {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font: 600 13.5px/1.3 var(--sans);
  color: var(--ink-2);
}
.box .hint {
  font-weight: 400;
  font-size: 12.5px;
  color: var(--muted);
}
.box .live-tag {
  margin-left: auto;
  padding-left: 6px;
  font: 700 10px/1.3 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-ink);
  white-space: nowrap;
}
.box-input {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 5px;
  padding: 7px 11px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.box-input:focus-within {
  border-color: var(--series-3);
  box-shadow: 0 0 0 3px rgba(58, 107, 212, 0.15);
}
.box-input .unit {
  font: 400 18px/1 var(--mono);
  color: var(--muted);
}
.box input[type="text"],
.box select {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: 400 20px/1.3 var(--mono);
  color: var(--ink);
  appearance: none;
}
.box input:focus,
.box select:focus {
  outline: none;
}
.box select {
  padding-right: 18px;
  cursor: pointer;
  font: 600 16px/1.4 var(--sans);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23011d48' stroke-width='1.6'/%3E%3C/svg%3E")
    no-repeat right 2px center;
}
.box input[type="range"] {
  width: 100%;
  height: 18px;
  margin: 8px 0 0;
  accent-color: var(--navy);
  cursor: pointer;
}
.box.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.box.check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--navy);
}
.box.check label {
  font: 500 14.5px/1.35 var(--sans);
  color: var(--ink);
}
.fields.two .box input[type="text"],
.fields.cols-2 .box input[type="text"],
.fields.cols-3 .box input[type="text"] {
  font-size: 17px;
}
.fields.two .box > label,
.fields.two .box > .box-label {
  flex-wrap: wrap;
  align-items: flex-end;
  align-content: flex-end;
  min-height: 2.6em;
  row-gap: 0;
}
.fields.two .box .hint {
  flex-basis: 100%;
  order: 2;
}
.fields.two .box-input,
.fields.cols-2 .box-input,
.fields.cols-3 .box-input {
  padding: 6px 9px;
}
.box-group-title {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--rule);
  font: 700 11.5px/1.3 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
}
.box-group-title:first-child {
  margin-top: 0;
}
.seg {
  display: flex;
  margin-top: 6px;
  border: 1px solid var(--navy);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.seg button {
  flex: 1;
  padding: 8px 4px;
  border: 0;
  border-left: 1px solid var(--navy);
  background: transparent;
  font: 600 13.5px/1 var(--sans);
  color: var(--navy);
  cursor: pointer;
}
.seg button:first-child {
  border-left: 0;
}
.seg button[aria-pressed="true"] {
  background: var(--navy);
  color: #fff;
}
.boxes-foot {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.more-opts {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
}
.more-opts summary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 600 14.5px/1.3 var(--sans);
  color: var(--navy);
}
.more-opts summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--navy);
  border-radius: 50%;
  font: 600 15px/1 var(--sans);
}
.more-opts[open] summary::before {
  content: "\2212";
}
.more-opts .fields {
  margin-top: 14px;
}

/* results: one big answer, two supporting numbers, one sentence, one chart */
.results {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.figs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}
.fig {
  min-width: 0;
}
.fig .micro {
  display: block;
  margin-bottom: 4px;
}
.fig b {
  display: block;
  font: 600 clamp(22px, 2vw, 28px)/1.1 var(--sans);
  color: var(--navy);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.fig small {
  display: block;
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--muted);
}
.fig.big,
.fig.span {
  grid-column: 1 / -1;
}
.fig.big {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.fig.big b {
  font: 800 clamp(46px, 5.4vw, 70px)/1 var(--display);
  letter-spacing: -0.025em;
  white-space: normal;
}
.fig.big small {
  font-size: 15px;
  color: var(--ink-2);
}
.fig.bad b {
  color: var(--red-ink);
}
.fig.good b {
  color: var(--green-ink);
}
.fig-more {
  grid-column: 1 / -1;
}
.fig-more summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 13.5px/1.4 var(--sans);
  color: var(--ink-2);
}
.fig-more summary::after {
  content: "+";
  font-weight: 700;
  color: var(--navy);
}
.fig-more[open] summary::after {
  content: "\2212";
}
.figs-extra {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin-top: 12px;
}
.figs-extra .fig b {
  font-size: 21px;
}
.verdict {
  margin: 0;
  padding: 12px 15px;
  border-left: 3px solid var(--series-1);
  border-radius: 0 6px 6px 0;
  background: #eef7f1;
  font-size: 15.5px;
  line-height: 1.5;
}
.verdict.warn {
  border-left-color: var(--series-2);
  background: #fbeee9;
}
.verdict.info {
  border-left-color: var(--series-3);
  background: #eef2fb;
}
.verdict b {
  color: var(--navy);
}
.math-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px 9px 12px;
  border: 1px dashed var(--navy);
  border-radius: 999px;
  background: transparent;
  font: 600 14px/1 var(--sans);
  color: var(--navy);
  cursor: pointer;
}
.math-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}
.math-btn:hover,
.math-btn[aria-expanded="true"] {
  background: var(--tape);
  border-style: solid;
}
.tool-wide {
  margin-top: 22px;
  display: grid;
  gap: 16px;
}

/* ------------------------------------------------ the tape (signature): printed only when asked */
.tape-wrap {
  position: relative;
  min-width: 0;
}
.tape-wrap .micro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 12px;
}
.tape {
  position: relative;
  margin: 10px 0 12px;
  padding: 16px 14px 18px;
  background: var(--tape);
  font: 400 14px/1.5 var(--mono);
  color: #1d2433;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 18px 30px -22px rgba(1, 29, 72, 0.55),
    2px 0 0 rgba(0, 0, 0, 0.03),
    -2px 0 0 rgba(0, 0, 0, 0.03);
  background-image: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.025),
    transparent 6%,
    transparent 94%,
    rgba(0, 0, 0, 0.025)
  );
}
.tape::before,
.tape::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 9px;
  background:
    linear-gradient(-45deg, var(--tape) 6px, transparent 0) 0 0 / 12px 9px repeat-x,
    linear-gradient(45deg, var(--tape) 6px, transparent 0) 0 0 / 12px 9px repeat-x;
}
.tape::before {
  top: -8px;
  transform: scaleY(-1);
}
.tape::after {
  bottom: -8px;
}
.tape-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed #c9c3b4;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: #7c7766;
}
.tape ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.t-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  gap: 6px;
  align-items: baseline;
  min-height: 1.5em;
}
.t-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 10.5px/1.5 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a8572;
}
.t-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.t-op {
  text-align: center;
  color: #6a6555;
}
.t-line.neg .t-num,
.t-line.neg .t-op {
  color: var(--red-ink);
}
.t-line.total {
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid #3a3f4d;
  font-weight: 700;
}
.t-line.total .t-label {
  color: #3a3f4d;
}
.t-line.sub {
  font-weight: 700;
}
.t-line.t-note {
  grid-template-columns: 1fr;
  font: italic 400 12.5px/1.45 var(--mono);
  color: #6f6a5a;
  padding: 2px 0;
}
.t-line.gap {
  min-height: 0.7em;
}
.t-line.fresh .t-num {
  animation: print 0.5s ease-out both;
}
@keyframes print {
  0% {
    opacity: 0.1;
    transform: translateY(3px);
    filter: blur(0.6px);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
.tape-actions {
  display: flex;
  gap: 8px;
}
.tape-actions button {
  padding: 7px 10px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--sheet);
  font: 600 12px/1 var(--sans);
  color: var(--ink-2);
  cursor: pointer;
}
.tape-actions button:hover {
  border-color: var(--navy);
  color: var(--navy);
}

/* ------------------------------------------------ charts */
.chart {
  position: relative;
  margin: 0;
  padding: 14px 14px 10px;
  background: #fff;
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  min-width: 0;
}
.chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  margin-bottom: 8px;
}
.chart-head h4 {
  font: 700 15px/1.3 var(--sans);
  color: var(--navy);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink-2);
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--c);
}
.legend i.line {
  height: 3px;
  width: 16px;
  border-radius: 2px;
}
.legend i.dash {
  height: 0;
  width: 16px;
  border-top: 2px dashed var(--c);
  background: none;
}
.chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: pan-y;
}
.chart svg:focus-visible {
  outline: 3px solid var(--series-3);
  outline-offset: 4px;
}
.chart .grid line {
  stroke: var(--grid);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.chart .axis text {
  font: 400 11px var(--sans);
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chart .axis line.base {
  stroke: #b9b09c;
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.chart .series path.line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .series path.area {
  stroke: none;
}
.chart .marker {
  stroke: #fff;
  stroke-width: 2;
}
.chart .ann line {
  stroke: var(--ink-2);
  stroke-width: 1;
}
.chart .ann text {
  font: 600 11px var(--sans);
  fill: var(--ink-2);
}
.chart .ann .tag {
  fill: #fff;
  stroke: var(--rule);
}
.chart .cross {
  stroke: var(--ink-2);
  stroke-width: 1;
  pointer-events: none;
}
.chart .hit {
  fill: transparent;
  cursor: crosshair;
}
.chart rect.bar {
  transition: opacity 0.15s;
}
.chart rect.bar:hover,
.chart rect.bar.on {
  opacity: 0.82;
}
.chart .label {
  font: 600 11.5px var(--sans);
  fill: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.chart .label.in {
  fill: #fff;
}
.tip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  max-width: 260px;
  padding: 9px 11px;
  background: #fff;
  border: 1px solid var(--navy);
  border-radius: 4px;
  box-shadow: 0 10px 24px -14px rgba(1, 29, 72, 0.6);
  font-size: 13px;
  pointer-events: none;
}
.tip .tip-title {
  margin-bottom: 5px;
  font: 700 11px/1.3 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.tip .tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
}
.tip .tip-row i {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: var(--c);
  flex: 0 0 auto;
}
.tip .tip-row b {
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.tip .tip-row span {
  color: var(--ink-2);
}
.chart-table {
  margin-top: 6px;
  font-size: 13px;
}
.chart-table summary {
  width: max-content;
  font: 600 12.5px/1.6 var(--sans);
  color: var(--ink-2);
}
.chart-table .tw {
  max-height: 280px;
  overflow: auto;
  margin-top: 6px;
  border: 1px solid var(--rule-2);
}
.chart-table table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.chart-table th,
.chart-table td {
  padding: 5px 9px;
  border-bottom: 1px solid var(--rule-2);
  text-align: right;
  white-space: nowrap;
}
.chart-table th:first-child,
.chart-table td:first-child {
  text-align: left;
}
.chart-table thead th {
  position: sticky;
  top: 0;
  background: var(--sheet);
  font-weight: 700;
  color: var(--navy);
}

/* ------------------------------------------------ flashcards: 3x5 index cards, tap to turn over */
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cards li {
  display: flex;
}
.fc {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 212px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  perspective: 1400px;
  transition: transform 0.2s;
}
.fc:hover {
  transform: translateY(-3px);
}
.fc:focus-visible {
  outline: 3px solid var(--series-3);
  outline-offset: 4px;
  border-radius: 4px;
}
.fc-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 20px 14px;
  background-color: var(--card);
  border: 1px solid #ece6d6;
  border-radius: 3px;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 16px 30px -22px rgba(1, 29, 72, 0.6);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.55s cubic-bezier(0.3, 0.7, 0.2, 1);
  line-height: 26px;
}
.fc-front {
  background-image:
    linear-gradient(#e7a3a3, #e7a3a3),
    repeating-linear-gradient(var(--card) 0 25px, #d3e0f0 25px 26px);
  background-size:
    100% 1.5px,
    100% 100%;
  background-position:
    0 78px,
    0 79px;
  background-repeat: no-repeat;
}
.fc-back {
  transform: rotateY(180deg);
  background-image: repeating-linear-gradient(var(--card) 0 25px, #e1e9f4 25px 26px);
  background-position: 0 13px;
}
.fc[aria-pressed="true"] .fc-front {
  transform: rotateY(-180deg);
}
.fc[aria-pressed="true"] .fc-back {
  transform: rotateY(0deg);
}
.fc-tag {
  position: absolute;
  top: 14px;
  left: 20px;
  font: 700 11px/1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.fc-big {
  display: flex;
  align-items: flex-end;
  height: 78px;
  padding-bottom: 9px;
  font: 800 clamp(30px, 2.7vw, 40px)/1 var(--display);
  letter-spacing: -0.02em;
  color: var(--navy);
  white-space: nowrap;
}
.fc-line {
  padding-top: 1px;
  font-size: 16.5px;
  color: var(--ink);
  text-wrap: pretty;
}
.fc-text {
  padding-top: 13px;
  font-size: 15.5px;
  color: var(--ink);
  text-wrap: pretty;
}
.fc-turn {
  margin-top: auto;
  padding-top: 8px;
  align-self: flex-end;
  font: 600 13px/1 var(--sans);
  color: var(--teal);
}
.fc-front .fc-turn::after {
  content: " \21BB";
}
.fc-back .fc-turn::before {
  content: "\21BA  ";
}

/* ------------------------------------------------ costly mistakes: the cost on the right, the fix one tap away */
.slips {
  max-width: 900px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.slips li {
  border-bottom: 1px solid var(--rule);
}
.slips summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 4px;
  list-style: none;
}
.slips summary::before {
  content: "\2715";
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f7e4dd;
  color: var(--red-ink);
  font: 700 12px/1 var(--sans);
}
.slips summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 18px;
  text-align: center;
  font: 500 22px/1 var(--sans);
  color: var(--navy);
}
.slips details[open] summary::after {
  content: "\2212";
}
.slip-t {
  flex: 1 1 auto;
  font: 600 17px/1.35 var(--sans);
  color: var(--navy);
}
.slip-cost {
  flex: 0 0 auto;
  font: 700 17px/1 var(--mono);
  color: var(--red-ink);
  white-space: nowrap;
}
.slip-fix {
  margin: 0 4px 16px 44px;
  padding: 11px 15px;
  border-radius: 6px;
  background: #eef7f1;
  font-size: 15.5px;
  line-height: 1.5;
}
.slip-fix b {
  display: block;
  margin-bottom: 2px;
  font: 700 11px/1.3 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-ink);
}

/* ------------------------------------------------ more calculators, opened on demand */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 190px;
  padding: 12px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--sheet);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.chip b {
  font: 700 15.5px/1.2 var(--sans);
  color: var(--navy);
}
.chip small {
  font-size: 13px;
  line-height: 1.3;
  color: var(--muted);
}
.chip:hover {
  border-color: var(--navy);
}
.chip[aria-expanded="true"] {
  background: var(--navy);
  border-color: var(--navy);
}
.chip[aria-expanded="true"] b {
  color: #fff;
}
.chip[aria-expanded="true"] small {
  color: #c9d3e6;
}

/* ------------------------------------------------ folded details: worked example, sources */
.t-folds {
  margin-top: clamp(52px, 7vw, 88px);
  border-top: 2px solid var(--navy);
}
.fold {
  border-bottom: 1px solid var(--rule);
}
.fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 4px;
  list-style: none;
  font: 700 18px/1.3 var(--sans);
  color: var(--navy);
}
.fold > summary::after {
  content: "+";
  font: 400 28px/1 var(--sans);
  color: var(--navy);
}
.fold[open] > summary::after {
  content: "\2212";
}
.fold-body {
  padding: 0 0 26px;
}
.fold-body > p:first-child {
  max-width: 70ch;
  color: var(--ink-2);
}
.fold-more {
  margin: 12px 0 0;
  font-size: 14.5px;
  font-weight: 600;
}
.src-list {
  margin: 0;
  padding-left: 22px;
  font-size: 14.5px;
  color: var(--ink-2);
}
.src-list li {
  margin-bottom: 6px;
}
.src-list a {
  color: var(--ink);
}

/* worked example: numbered lines, the way a tax form adds things up */
.lines {
  width: 100%;
  border-collapse: collapse;
  background: var(--sheet);
  border: 1px solid var(--rule);
  font-size: 15.5px;
}
.lines td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule-2);
  vertical-align: baseline;
}
.lines tr:last-child td {
  border-bottom: 0;
}
.lines .ln {
  width: 44px;
  text-align: center;
  font: 700 13px/1 var(--sans);
  color: var(--navy);
  border-right: 1px solid var(--rule-2);
}
.lines .desc small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}
.lines .op {
  width: 34%;
  color: var(--ink-2);
  font-size: 14px;
}
.lines .op code {
  font: 400 13.5px var(--mono);
  color: var(--ink-2);
}
.lines .amt {
  width: 170px;
  text-align: right;
  font: 400 17px/1.2 var(--mono);
  white-space: nowrap;
  border-left: 1px solid var(--rule-2);
  background: #fff;
}
.lines .amt.neg {
  color: var(--red-ink);
}
.lines tr.total td {
  border-top: 1px solid var(--navy);
  font-weight: 700;
}
.lines tr.total .amt {
  font-weight: 700;
  box-shadow:
    inset 0 -4px 0 #fff,
    inset 0 -5px 0 var(--navy),
    inset 0 -7px 0 #fff,
    inset 0 -8px 0 var(--navy);
}
.lines tr.section td {
  background: var(--paper-deep);
  font: 700 11.5px/1.3 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 7px 12px;
}

.two-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
table caption.micro {
  caption-side: top;
  text-align: left;
  padding: 0 0 8px;
}
@media (max-width: 760px) {
  .two-tables {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------ glossary: dotted words in text, and the index card they open */
.term {
  color: inherit;
  text-decoration: underline dotted var(--teal);
  text-decoration-thickness: 1.6px;
  text-underline-offset: 4px;
  cursor: help;
}
.term:hover,
.term[aria-expanded="true"] {
  color: var(--navy);
  text-decoration-style: solid;
  text-decoration-color: var(--series-1);
}
.card-pop {
  position: absolute;
  z-index: 60;
  width: min(340px, calc(100vw - 24px));
  padding: 0 16px 14px;
  background: var(--card);
  border-radius: 2px;
  box-shadow:
    0 18px 40px -18px rgba(1, 29, 72, 0.6),
    0 0 0 1px rgba(1, 29, 72, 0.12);
  background-image:
    linear-gradient(#e7a3a3, #e7a3a3),
    repeating-linear-gradient(var(--card) 0 23px, #c9d9ee 23px 24px);
  background-size:
    100% 1.5px,
    100% 100%;
  background-position:
    0 40px,
    0 41px;
  background-repeat: no-repeat, no-repeat;
  font-size: 14.5px;
  line-height: 24px;
  color: var(--ink);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.14s,
    transform 0.14s;
  pointer-events: none;
}
.card-pop.on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.card-pop h4 {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 1px;
  font: 700 18px/1.1 var(--display);
  color: var(--navy);
}
.card-pop h4 small {
  font: 400 11px/1 var(--mono);
  color: var(--muted);
}
.card-pop p {
  margin: 0;
}
.card-pop .seen {
  color: var(--ink-2);
  font-size: 13.5px;
}
.card-pop .seen b {
  font: 700 10.5px/1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red-ink);
  margin-right: 4px;
}
.card-pop a {
  font: 600 13px/24px var(--sans);
}

/* glossary page */
.gl-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin-bottom: 22px;
}
.gl-search {
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--navy);
  background: #fff;
  border-radius: 6px;
}
.gl-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: 400 18px/1.2 var(--mono);
}
.gl-search svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--navy);
  stroke-width: 2;
}
.gl-filter {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--navy);
  border-radius: 6px;
  overflow: hidden;
  background: var(--sheet);
}
.gl-filter button {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 9px 11px;
  border: 0;
  border-left: 1px solid var(--rule);
  background: transparent;
  font: 600 13.5px/1 var(--sans);
  color: var(--navy);
  cursor: pointer;
}
.gl-filter button:first-child {
  border-left: 0;
}
.gl-filter button small {
  font: 400 11px/1 var(--mono);
  color: var(--muted);
}
.gl-filter button[aria-pressed="true"] {
  background: var(--navy);
  color: #fff;
}
.gl-filter button[aria-pressed="true"] small {
  color: #cfd6e4;
}
.gl-letters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin-bottom: 18px;
}
.gl-letters a,
.gl-letters span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font: 700 13px/1 var(--sans);
  border-radius: 4px;
}
.gl-letters a {
  color: var(--navy);
  text-decoration: none;
}
.gl-letters a:hover {
  background: var(--navy);
  color: #fff;
}
.gl-letters span,
.gl-letters a.off {
  color: var(--rule);
  pointer-events: none;
}
.gl-count {
  margin: 0 0 0 auto;
  font: 400 13px/1 var(--mono);
  color: var(--muted);
}
.gl-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.gl-card {
  position: relative;
  padding: 0 18px 16px;
  background: var(--card);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 10px 22px -18px rgba(1, 29, 72, 0.5);
  border: 1px solid #ece6d6;
  background-image:
    linear-gradient(#e7a3a3, #e7a3a3),
    repeating-linear-gradient(var(--card) 0 25px, #d3e0f0 25px 26px);
  background-size:
    100% 1.5px,
    100% 100%;
  background-position:
    0 46px,
    0 47px;
  background-repeat: no-repeat;
  line-height: 26px;
  scroll-margin-top: 100px;
}
.gl-card:target {
  box-shadow:
    0 0 0 3px var(--series-1),
    0 10px 22px -18px rgba(1, 29, 72, 0.5);
}
.gl-card h3 {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 1px;
  font: 700 20px/1.1 var(--display);
  color: var(--navy);
}
.gl-card h3 small {
  font: 400 11px/1 var(--mono);
  color: var(--muted);
  white-space: nowrap;
}
.gl-card p {
  margin: 0;
  font-size: 15px;
}
.gl-card .seen {
  font-size: 14px;
  color: var(--ink-2);
}
.gl-card .seen b,
.gl-card .ex b {
  font: 700 10.5px/1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red-ink);
  margin-right: 5px;
}
.gl-card .ex {
  font-size: 14px;
  color: var(--ink-2);
}
.gl-card .ex b {
  color: var(--teal);
}
.gl-card a.more {
  font: 600 13px/26px var(--sans);
}
.gl-card[hidden],
.gl-letter[hidden] {
  display: none;
}
/* letter headings are the manila divider tabs of a card file */
.gl-letter {
  grid-column: 1 / -1;
  display: flex;
  margin: 26px 0 -4px;
  border-bottom: 2px solid var(--navy);
  scroll-margin-top: 110px;
}
.gl-letter:first-child {
  margin-top: 0;
}
.gl-letter span {
  min-width: 64px;
  padding: 9px 18px 7px;
  text-align: center;
  background: #e9dbb8;
  border: 1px solid var(--navy);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  font: 800 26px/1 var(--display);
  color: var(--navy);
  box-shadow: inset 0 -6px 10px -8px rgba(125, 88, 6, 0.45);
}
.gl-empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}
.gl-empty button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--navy);
  text-decoration: underline;
  cursor: pointer;
}

/* ------------------------------------------------ sources page */
.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}
.jump a {
  padding: 7px 13px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--sheet);
  font: 600 14px/1 var(--sans);
  color: var(--navy);
  text-decoration: none;
}
.jump a:hover {
  border-color: var(--navy);
}
.s-note {
  max-width: 72ch;
  margin: 18px 0 0;
  padding: 12px 15px;
  border-left: 3px solid var(--series-4);
  border-radius: 0 6px 6px 0;
  background: #fff7d6;
  font-size: 15px;
}
.s-sec {
  margin-top: clamp(40px, 6vw, 72px);
}
.s-sec > p {
  max-width: 72ch;
  color: var(--ink-2);
}
.src-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--sheet);
  border: 1px solid var(--rule);
  font-size: 14.5px;
}
.src-table th,
.src-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule-2);
  text-align: left;
  vertical-align: top;
}
.src-table thead th {
  background: var(--navy);
  color: #fff;
  font: 700 11.5px/1.3 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.src-table td.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.src-table code {
  font: 400 13.5px var(--mono);
}
.src-table td small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.src-table td a {
  overflow-wrap: anywhere;
}
.src-table td a:has(code),
.src-table td.d {
  white-space: nowrap;
  overflow-wrap: normal;
}
.src-table.every td:first-child {
  white-space: nowrap;
}
.table-scroll {
  overflow-x: auto;
  margin: 0 0 22px;
  -webkit-overflow-scrolling: touch;
}
.table-scroll .src-table {
  min-width: 640px;
}
.cites {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.cites span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.tests {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tests li {
  break-inside: avoid;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dotted var(--rule);
  font-size: 14.5px;
}
.tests li::before {
  content: "\2713";
  color: var(--green-ink);
  font-weight: 700;
}
.tests li.fail::before {
  content: "\2715";
  color: var(--red-ink);
}
.tests b {
  font-weight: 600;
  color: var(--navy);
}
.checks-h {
  margin: 30px 0 12px;
  font: 700 21px/1.2 var(--display);
  color: var(--navy);
}
.check-groups {
  columns: 3 300px;
  column-gap: 34px;
}
.check-groups h3 {
  margin: 0 0 4px;
  padding-top: 14px;
  font: 700 12px/1.3 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  break-after: avoid;
}
.check-groups h3 span {
  font: 400 11px/1 var(--mono);
  letter-spacing: 0;
  color: var(--muted);
}
.fine-run {
  margin-top: 18px;
  font-size: 14px;
  color: var(--ink-2);
}
.fine-run code {
  font: 400 13.5px var(--mono);
  background: var(--sheet);
  padding: 2px 6px;
  border: 1px solid var(--rule-2);
}
.method {
  max-width: 75ch;
}
.method li {
  margin-bottom: 8px;
}
.method h3 {
  margin: 26px 0 8px;
  font: 700 21px/1.2 var(--display);
  color: var(--navy);
}
.method h3:first-child {
  margin-top: 0;
}
.defs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0;
  margin: 22px 0;
  border-top: 2px solid var(--navy);
}
.defs div {
  padding: 14px 18px 14px 0;
  border-bottom: 1px solid var(--rule);
}
.defs dt {
  font: 700 16px/1.3 var(--sans);
  color: var(--navy);
  margin-bottom: 4px;
}
.defs dd {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-2);
}
/* how live numbers travel: source, then the Worker, then the page */
.pipes {
  display: grid;
  gap: 12px;
  margin: 24px 0 28px;
}
.pipe {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px minmax(0, 1fr) 118px minmax(0, 1fr);
  align-items: stretch;
}
.pnode {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  background: var(--sheet);
  border: 1px solid var(--navy);
  border-radius: 6px;
}
.pnode small {
  font: 700 10.5px/1.3 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pnode b {
  font: 600 22px/1.15 var(--sans);
  color: var(--navy);
}
.pnode span {
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink-2);
}
.pnode.src {
  background: var(--navy);
}
.pnode.src small {
  color: #9fb0cd;
}
.pnode.src b {
  color: #fff;
}
.pnode.src span {
  color: #d5dcea;
}
.pnode.out {
  border-width: 2px;
}
.parrow {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.parrow::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 10px;
  top: 50%;
  border-top: 2px solid var(--navy);
}
.parrow::after {
  content: "";
  position: absolute;
  right: 4px;
  top: calc(50% - 6px);
  border: 6px solid transparent;
  border-left: 8px solid var(--navy);
  border-right: 0;
}
.parrow span {
  position: relative;
  z-index: 1;
  max-width: 100%;
  padding: 2px 6px;
  background: var(--paper);
  font: 400 11.5px/1.25 var(--mono);
  color: var(--ink-2);
  text-align: center;
}

/* ------------------------------------------------ credit: the race, and the statement's warning box */
.race {
  margin-top: 20px;
  padding: 18px 18px 12px;
  background: #fff;
  border: 1px solid var(--rule-2);
  border-radius: 6px;
}
.race[hidden] {
  display: none;
}
.race-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 20px;
  margin-bottom: 14px;
}
.race-head .micro {
  margin: 0 0 4px;
}
.race-note {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-2);
}
.race-ctl {
  display: flex;
  align-items: center;
  gap: 14px;
}
.race-clock {
  font: 700 15px/1 var(--mono);
  color: var(--navy);
  min-width: 80px;
  text-align: right;
}
.lanes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 34px;
}
.lane header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 2px solid var(--c);
}
.lane header b {
  font: 800 19px/1.1 var(--display);
  color: var(--navy);
}
.lane header small {
  font-size: 13px;
  color: var(--muted);
}
.lane-sum {
  flex: 1 1 100%;
  font: 400 12.5px/1.3 var(--mono);
  color: var(--ink-2);
}
.row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  height: 38px;
}
.rname {
  font: 600 13.5px/1.2 var(--sans);
  color: var(--ink);
}
.rtrack {
  position: relative;
  height: 18px;
  margin-right: 112px;
  background: repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 10%);
}
.rbar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--c);
  border-radius: 0 4px 4px 0;
  transition: width 0.08s linear;
}
.row.done .rbar {
  opacity: 0.85;
}
.rtrack .stamp {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) rotate(-4deg);
  padding: 3px 6px 2px;
  border: 2px solid var(--green-ink);
  border-radius: 3px;
  color: var(--green-ink);
  background: #fff;
  font: 700 10.5px/1.1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: stampin 0.25s ease-out;
}
@keyframes stampin {
  from {
    transform: translateY(-50%) rotate(-4deg) scale(1.6);
    opacity: 0;
  }
}
.race-axis {
  display: none;
}
.warnbox {
  border: 2px solid var(--ink);
  background: #fff;
  font-size: 14px;
}
.warnbox h5 {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 2px solid var(--ink);
  font: 700 14px/1.35 var(--sans);
  color: var(--ink);
}
.warnbox table {
  width: 100%;
  border-collapse: collapse;
}
.warnbox th,
.warnbox td {
  padding: 8px 12px;
  border-top: 1px solid var(--ink);
  text-align: left;
  vertical-align: top;
}
.warnbox thead th {
  border-top: 0;
  font-size: 12.5px;
  font-weight: 700;
}
.warnbox td.n {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.warnbox tr.save td {
  font-weight: 700;
  color: var(--green-ink);
}

/* ------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .tool.math-on .tool-grid {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  }
  .tool.math-on .tape-slot {
    grid-column: 2;
    max-width: 460px;
  }
  .mw-tabs a {
    padding: 10px 9px 11px;
    font-size: 14px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 999px) {
  :root {
    --top-h: 58px;
  }
  .mw-top-row {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding-top: 8px;
  }
  .mw-brand img {
    width: 146px;
  }
  .mw-gloss {
    margin-left: auto;
  }
  .mw-tabs {
    order: 3;
    flex: 1 1 100%;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 90%, transparent);
  }
  .mw-tabs::-webkit-scrollbar {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-art {
    max-width: 280px;
    justify-self: center;
    order: -1;
    margin-bottom: -10px;
  }
  .lanes {
    grid-template-columns: 1fr;
  }
  .mw-foot .wrap {
    grid-template-columns: 1fr;
  }
  .mw-foot nav {
    justify-content: flex-start;
  }
}
@media (max-width: 760px) {
  body {
    font-size: 16px;
  }
  .mw-top {
    position: relative;
  }
  html {
    scroll-padding-top: 16px;
  }
  .hero-art {
    max-width: 200px;
  }
  .tool-grid,
  .tool.math-on .tool-grid {
    grid-template-columns: 1fr;
  }
  .tool.math-on .tape-slot {
    grid-column: auto;
    max-width: none;
  }
  .lines .op {
    display: none;
  }
  .lines .amt {
    width: auto;
  }
  .pipe {
    grid-template-columns: 1fr;
  }
  .parrow {
    min-height: 46px;
  }
  .parrow::before {
    left: 50%;
    right: auto;
    top: 4px;
    bottom: 10px;
    border-top: 0;
    border-left: 2px solid var(--navy);
  }
  .parrow::after {
    left: calc(50% - 5px);
    right: auto;
    top: auto;
    bottom: 2px;
    border: 6px solid transparent;
    border-top: 8px solid var(--navy);
    border-bottom: 0;
  }
  .chip {
    min-width: 0;
    flex: 1 1 160px;
  }
}
@media (max-width: 640px) {
  .tool {
    padding: 16px 14px;
    border-radius: 6px;
  }
  /* cards become a row you swipe through */
  .cards {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 82%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin: 0 calc(var(--gutter) * -1);
    padding: 4px var(--gutter) 14px;
    scroll-padding-left: var(--gutter);
  }
  .cards::-webkit-scrollbar {
    display: none;
  }
  .cards li {
    scroll-snap-align: start;
  }
  .topics {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .topic-card {
    min-height: 0;
    padding: 16px 14px 14px;
  }
  .topic-card h3 {
    font-size: 20px;
  }
  .topic-card p {
    font-size: 13.5px;
  }
  .tc-stat b {
    font-size: 22px;
  }
  .slip-fix {
    margin-left: 4px;
  }
  .gl-list {
    grid-template-columns: 1fr;
  }
  .gl-filter button {
    flex: 1 1 auto;
    justify-content: center;
    padding: 9px 8px;
  }
  .gl-letters a,
  .gl-letters span {
    width: 26px;
  }
  .gl-count {
    flex-basis: 100%;
    margin: 8px 0 0;
  }
  /* tables marked .stack become one block per row; data-label carries the column heading */
  .src-table.stack,
  .src-table.stack tbody,
  .src-table.stack tr,
  .src-table.stack td {
    display: block;
    width: auto;
  }
  .src-table.stack thead {
    display: none;
  }
  .src-table.stack tr {
    padding: 10px 14px 12px;
    border-bottom: 1px solid var(--rule-2);
  }
  .src-table.stack td {
    padding: 3px 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }
  .src-table.stack td:first-child {
    font-weight: 700;
    color: var(--navy);
  }
  .src-table.stack td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font: 700 10.5px/1.5 var(--sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
}
@media (max-width: 420px) {
  .figs,
  .figs-extra {
    grid-template-columns: 1fr;
  }
  .fig.big b {
    font-size: 46px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .fc-face,
  .fc[aria-pressed="true"] .fc-front,
  .fc[aria-pressed="true"] .fc-back {
    transform: none;
  }
  .fc-back,
  .fc[aria-pressed="true"] .fc-front {
    visibility: hidden;
  }
  .fc[aria-pressed="true"] .fc-back {
    visibility: visible;
  }
}
@media print {
  .mw-top,
  .mw-foot,
  .chips,
  .math-btn,
  .tape-actions,
  .chart-table summary {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .tool {
    border: 0;
    padding: 0;
    box-shadow: none;
  }
  .tape-slot[hidden],
  .fold:not([open]) > .fold-body {
    display: block !important;
  }
}
