/* השכלה פיננסית: the printed annual. Sand paper, one cobalt, a few flat print blocks. */
:root {
  --bg: #e6dbc7;
  --surface: #ddd0b9;
  --ink: #062b8a;
  --muted: #2f4e98;
  --accent: #062b8a;
  --accent-ink: #e6dbc7;
  --field-ink: #e6dbc7;
  --m: clamp(20px, 3.3vw, 48px);          /* the one pair of outer margins */
  --axis: 42vw;                            /* the column line, measured from the start (right) edge */
  --gap: clamp(120px, 14vw, 200px);        /* between sections */
  --display: 'Frank Ruhl Libre', 'Times New Roman', serif;
  --text: 'Assistant', system-ui, sans-serif;
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(3.2rem, 6.6vw, 6.5rem);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0a1a4a; --surface: #102358; --ink: #e6dbc7; --muted: #c9bda6; --accent: #e6dbc7; --accent-ink: #0a1a4a; }
}
:root[data-theme="dark"] { --bg: #0a1a4a; --surface: #102358; --ink: #e6dbc7; --muted: #c9bda6; --accent: #e6dbc7; --accent-ink: #0a1a4a; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--step-body)/1.6 var(--text); letter-spacing: .01em; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--bg); }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -.02em; line-height: 1.05; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
.skip { position: absolute; inset-inline-start: var(--m); top: -60px; background: var(--ink); color: var(--bg); padding: 10px 16px; z-index: 10; }
.skip:focus { top: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Bar: wordmark at the start margin, links on the axis, one action at the end margin. */
.bar { display: flex; align-items: center; padding: 28px var(--m); position: relative; z-index: 2; }
.wordmark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font: 400 1.25rem/1 var(--display); }
.wordmark b { font-weight: 700; }
.mark { color: var(--accent); --mark-ink: var(--accent-ink); flex: none; }
.bar-links { position: absolute; inset-inline-start: var(--axis); display: flex; gap: 28px; }
.bar-links a { text-decoration: none; }
.bar-links a:hover { text-decoration: underline; }
.bar .btn { margin-inline-start: auto; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; background: var(--accent); color: var(--accent-ink); font: 600 1rem/1 var(--text); text-decoration: none; border: 0; border-radius: 0; cursor: pointer; transition: transform .2s var(--ease-out), background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
@media (max-width: 760px) {
  .bar-links { display: none; }
  .bar .btn { min-height: 44px; padding: 0 14px; font-size: .9375rem; }
}

/* Shared article furniture */
.on-axis { margin-inline-start: var(--axis); margin-inline-end: var(--m); }
.side { position: absolute; inset-inline-start: var(--m); width: calc(var(--axis) - var(--m) * 2.5); }
.prose { max-width: 66ch; }
.prose h2 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.6rem); margin: 2.4em 0 .6em; }
.prose h3 { font-size: var(--step-lead); margin: 1.8em 0 .5em; }
.prose ul, .prose ol { padding-inline-start: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.8em 0; padding: 22px 26px; background: var(--surface); font-size: var(--step-lead); line-height: 1.45; }
.prose blockquote p:last-child { margin: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.6em 0; font-size: .95em; display: block; overflow-x: auto; }
.prose th { text-align: start; font-weight: 600; background: var(--ink); color: var(--bg); padding: 10px 14px; }
.prose td { padding: 10px 14px; vertical-align: top; }
.prose tr:nth-child(even) td { background: var(--surface); }
.prose em:last-child { color: var(--muted); }
.prose hr { border: 0; height: 48px; }
.meta { color: var(--muted); font-size: var(--step-small); }
figure { margin: 0; }
figcaption { font-size: var(--step-small); color: var(--muted); margin-top: 10px; }
figcaption a { color: inherit; }
.photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }

/* Template: report */
.masthead { height: 38vh; min-height: 240px; overflow: hidden; } /* topic pages only */
.masthead .photo, .masthead img { height: 100%; }
/* Picture beside the headline, never above it: the first screen shows the title and the start of the text. */
.post-head { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; padding: 48px var(--m) 0; }
.post-head h1 { font-size: clamp(2.1rem, 1.2rem + 2.8vw, 4rem); max-width: 18ch; }
.post-photo { margin: 0; }
.post-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.report-head { padding-top: 56px; position: relative; }
.report-head h1 { font-size: clamp(2.4rem, 1.4rem + 3.6vw, 5rem); max-width: 18ch; }
.standfirst { font-size: var(--step-lead); line-height: 1.45; max-width: 40ch; margin-top: 28px; }
.article-body { position: relative; padding-bottom: var(--gap); margin-top: 56px; }
.toc { position: sticky; top: 24px; float: inline-start; margin-inline-start: calc(var(--m) - var(--axis)); width: calc(var(--axis) - var(--m) * 2.5); font-size: var(--step-small); }
.toc b { display: block; font: 500 1.25rem/1.2 var(--display); margin-bottom: 14px; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 8px; }
.toc a { text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--ink); text-decoration: underline; }

/* Template: figure. A band of colour carrying one number, the picture beside it. */
.figure-page { background: var(--field); color: var(--field-ink); padding: 48px var(--m); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; --ink: var(--field-ink); }
.figure-page h1 { font-size: clamp(2rem, 1.2rem + 2.4vw, 3.6rem); max-width: 20ch; }
.figure-num { font: 500 clamp(3.6rem, 9vw, 9rem)/.9 var(--display); letter-spacing: -.04em; direction: ltr; text-align: right; margin: 28px 0 0; }
.figure-page + .report-head { padding-top: 32px; }
.figure-page ~ .article-body { margin-top: 40px; }
.figure-note { max-width: 44ch; font-size: var(--step-lead); line-height: 1.4; margin-top: 20px; }

/* Template: ledger (glossary). Letters become a large index on the side. */
.ledger-head { padding: 72px var(--m) 0; }
.ledger-head h1 { font-size: var(--step-display); max-width: 14ch; }
.ledger-head .standfirst { margin-inline-start: calc(var(--axis) - var(--m)); }
.letters { display: flex; flex-wrap: wrap; gap: 6px 4px; margin: 64px var(--m) 0; }
.letters a { display: grid; place-items: center; width: 48px; height: 48px; background: var(--surface); font: 500 1.4rem/1 var(--display); text-decoration: none; transition: background .15s, color .15s; }
.letters a:hover, .letters a:focus-visible { background: var(--ink); color: var(--bg); }
.ledger { padding: 64px var(--m) var(--gap); }
.ledger h2 { font-size: clamp(4rem, 9vw, 8rem); line-height: .9; margin: 80px 0 24px; color: var(--ink); scroll-margin-top: 24px; }
.ledger h2 + p, .ledger p { break-inside: avoid; }
.ledger .terms { columns: 2 34ch; column-gap: 64px; }
.ledger blockquote { margin: 0 0 40px; max-width: 60ch; font-size: var(--step-lead); }

/* Footer: the name returns at full width, cropped at its foot. */
.foot { background: var(--ink); color: var(--bg); padding: 0 var(--m) 40px; overflow: hidden; margin-top: 0; }
.foot a { color: var(--bg); }
.foot-name { font: 700 clamp(6rem, 30vw, 30rem)/.78 var(--display); letter-spacing: -.04em; margin: 0 0 0; padding-top: 56px; white-space: nowrap; }
.foot-row { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; margin-top: 72px; }
.foot-places { display: grid; gap: 10px; align-content: start; }
.foot-places a { font: 500 clamp(1.5rem, 2.4vw, 2.2rem)/1.2 var(--display); text-decoration: none; }
.foot-places a:hover { text-decoration: underline; }
.foot-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.foot-links ul { list-style: none; margin: 0; padding: 0; }
.foot-links li { margin-bottom: 10px; font-size: .9375rem; }
.foot-legal { display: flex; justify-content: space-between; gap: 24px; margin-top: 96px; font-size: var(--step-small); }
.foot-legal p { margin: 0; max-width: 70ch; }
@media (max-width: 760px) {
  .foot-row { grid-template-columns: 1fr; }
  .foot-links { grid-template-columns: 1fr 1fr; }
  .foot-legal { flex-direction: column; }
}

/* Phone: the axis collapses to the margin, side notes go inline. */
@media (max-width: 900px) {
  :root { --axis: var(--m); }
  .side, .toc { position: static; width: auto; float: none; margin: 0 0 32px; }
  .ledger-head .standfirst { margin-inline-start: 0; }
  /* Phone: text first, then a short picture strip, so the opening paragraph stays near the top. */
  .post-head, .figure-page { grid-template-columns: 1fr; padding-block: 32px; gap: 24px; }
  .post-photo img { aspect-ratio: 16 / 7; }
}

/* Motion: masked headline lines, staggered entrances, all removed under reduced motion. */
.mask { display: block; overflow: hidden; padding-bottom: .08em; }
.mask > span { display: block; animation: rise .9s var(--ease-out) both; }
.mask:nth-child(2) > span { animation-delay: .11s; }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: calc(var(--i, 0) * 75ms); }
.js .reveal.in { opacity: 1; transform: none; }
.drift img { animation: drift 24s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.1) translateX(-2%); } }
@media (prefers-reduced-motion: reduce) {
  .mask > span, .drift img { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}

.ledger h2 { column-span: all; }

/* Topic map */
.map-head { padding: 72px var(--m) 0; }
.map-head h1 { font-size: var(--step-display); max-width: 14ch; letter-spacing: -.04em; }
.map-head p { margin-inline-start: calc(var(--axis) - var(--m)); max-width: 46ch; font-size: var(--step-lead); margin-top: 28px; }
.legend { display: flex; flex-wrap: wrap; gap: 24px; margin: 48px var(--m) 0; font-size: var(--step-small); }
.legend span::before, .dot { content: ''; display: inline-block; width: 12px; height: 12px; margin-inline-end: 8px; vertical-align: -1px; }
.lv-high, .legend .high::before { background: var(--ink); }
.lv-mid, .legend .mid::before { background: var(--muted); opacity: .75; }
.lv-adv, .legend .adv::before { background: var(--surface-strong, #c9b998); }
.map { list-style: none; margin: 64px 0 var(--gap); padding: 0 var(--m); }
.map > li > a { display: grid; grid-template-columns: calc(var(--axis) - var(--m)) 1fr; gap: 24px; align-items: center; padding: 22px 0; text-decoration: none; transition: background .2s; }
.map > li:nth-child(even) > a { background: var(--surface); margin: 0 calc(var(--m) * -1); padding-inline: var(--m); }
.map > li > a:hover .map-name { text-decoration: underline; }
.map-name { font: 500 clamp(1.375rem, 2vw, 2rem)/1.15 var(--display); }
.map-name-wrap { display: block; }
.map-name-wrap small { display: block; font: 400 1rem/1.4 var(--text); color: var(--muted); margin-top: 6px; }
.squares { display: flex; flex-wrap: wrap; gap: 4px; }
.squares i { width: 14px; height: 14px; display: block; }
.squares i + i.gap { margin-inline-start: 12px; }
@media (max-width: 900px) { .map > li > a { grid-template-columns: 1fr; } }

/* Topic hub */
.hub-field { background: var(--field); color: var(--field-ink); padding: 72px var(--m) 96px; --ink: var(--field-ink); }
.hub-field h1 { font-size: var(--step-display); max-width: 16ch; letter-spacing: -.04em; }
.hub-field p { margin-inline-start: calc(var(--axis) - var(--m)); max-width: 46ch; font-size: var(--step-lead); margin-top: 28px; }
.hub-field a { color: var(--field-ink); font-weight: 600; }
.hub-posts { padding: 96px var(--m) 0; }
.hub-posts h2, .hub-subs > h2 { font-size: var(--step-head); }
.hub-posts ul { list-style: none; padding: 0; margin: 40px 0 0; }
.hub-posts li a { display: block; padding: 14px 0; font: 500 clamp(1.375rem, 2.2vw, 2rem)/1.2 var(--display); text-decoration: none; }
.hub-posts li a:hover { text-decoration: underline; }
.hub-posts li span { display: block; font: 400 1rem/1.5 var(--text); color: var(--muted); margin-top: 4px; }
.hub-subs { padding: var(--gap) var(--m); }
.sub { display: grid; grid-template-columns: calc(var(--axis) - var(--m)) 1fr; gap: 24px; margin-top: 72px; }
.sub h3 { font-size: clamp(1.5rem, 2.2vw, 2.2rem); }
.sub ul { list-style: none; margin: 0; padding: 0; }
.sub li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; }
.sub li .dot { flex: none; }
@media (max-width: 900px) { .sub { grid-template-columns: 1fr; } .hub-field p, .map-head p { margin-inline-start: 0; } }

/* Plain text pages */
.page { padding: 72px var(--m) var(--gap); }
.page h1 { font-size: var(--step-head); max-width: 20ch; }
.page .prose { margin-inline-start: calc(var(--axis) - var(--m)); margin-top: 48px; }
@media (max-width: 900px) { .page .prose { margin-inline-start: 0; } }

/* Consent: a plain bar at the foot of the screen. It floats, so it may carry a shadow. */
.consent { position: fixed; inset-inline: var(--m); bottom: 16px; z-index: 20; background: var(--bg); color: var(--ink); padding: 20px 24px; display: flex; gap: 24px; align-items: center; justify-content: space-between; box-shadow: 0 8px 32px rgba(6, 43, 138, .25); }
.consent[hidden] { display: none; }
.consent p { margin: 0; max-width: 70ch; font-size: .9375rem; }
.consent div { display: flex; gap: 10px; flex: none; }
.btn-quiet { background: var(--surface); color: var(--ink); }
@media (max-width: 760px) { .consent { flex-direction: column; align-items: stretch; } }

/* ───────── Styles. html[data-style] swaps tokens, faces and photo treatment; the layout stays. ───────── */
:root { --f1: #062b8a; --f2: #1d4a3c; --f3: #16181f; --f4: #7a5410; --display-weight: 500; --photo-filter: grayscale(1) contrast(1.05); --surface-strong: #c9b998; }
h1, h2, h3, .calc-num, .figure-num, .foot-name, .chapter-title { font-weight: var(--display-weight); }
.photo img { filter: var(--photo-filter); }

/* Fresh: off-white paper, near-black ink, money green, colour photographs, heavy Heebo. */
[data-style="fresh"] {
  --bg: #f5f5f0; --surface: #e8e9e2; --surface-strong: #c8cbbf; --ink: #0f1720; --muted: #46525e;
  --accent: #0a7d55; --accent-ink: #ffffff; --field-ink: #ffffff;
  --f1: #0a7d55; --f2: #0f1720; --f3: #1f4fd1; --f4: #0b5563;
  --display: 'Heebo', system-ui, sans-serif; --text: 'Heebo', system-ui, sans-serif;
  --display-weight: 800; --photo-filter: none;
}
[data-style="fresh"] h1, [data-style="fresh"] h2, [data-style="fresh"] .calc-num, [data-style="fresh"] .figure-num { letter-spacing: -.035em; }
[data-style="fresh"] .wordmark b { font-weight: 800; }

/* Electric: the whole page is one cobalt field; white type, one yellow action. */
[data-style="electric"] {
  --bg: #0034eb; --surface: #002bc4; --surface-strong: #001a80; --ink: #ffffff; --muted: #c5d0ff;
  --accent: #e9e34a; --accent-ink: #111111; --field-ink: #ffffff;
  --f1: #001a80; --f2: #111111; --f3: #002bc4; --f4: #0d0d3a;
  --display: 'Rubik', system-ui, sans-serif; --text: 'Rubik', system-ui, sans-serif;
  --display-weight: 800; --photo-filter: grayscale(1) contrast(1.1);
}
[data-style="electric"] .photo { background: #0034eb; }
[data-style="electric"] .photo img { mix-blend-mode: luminosity; opacity: .9; }
[data-style="electric"] .calc { background: #111111; --accent-ink: #ffffff; }
[data-style="electric"] .calc .btn, [data-style="electric"] .calc input[type=range] { accent-color: #e9e34a; }
[data-style="electric"] .foot { background: #111111; }
[data-style="electric"] .mark { color: #e9e34a; --mark-ink: #111111; }

/* Poster: bone ground, post-office red fields, mustard and slate frames, the heaviest type. */
[data-style="poster"] {
  --bg: #ece7dc; --surface: #ddd6c7; --surface-strong: #b9ae99; --ink: #2a1110; --muted: #5e4640;
  --accent: #dc1928; --accent-ink: #ffffff; --field-ink: #ffffff;
  --f1: #dc1928; --f2: #4a6f84; --f3: #952625; --f4: #2a1110;
  --display: 'Rubik', system-ui, sans-serif; --text: 'Rubik', system-ui, sans-serif;
  --display-weight: 900; --photo-filter: contrast(1.1) saturate(1.15);
}
[data-style="poster"] h1, [data-style="poster"] .hero-title { letter-spacing: -.045em; line-height: .88; }
[data-style="poster"] .hero-title { font-size: clamp(3.2rem, 7.4vw, 7.6rem); }
[data-style="poster"] .hero { overflow-x: clip; }
[data-style="poster"] .hero-band { transform: rotate(-2deg) scale(1.04); }
[data-style="poster"] .calc { background: #dc1928; }
[data-style="poster"] .foot { background: #dc1928; }

/* Style switcher (preview pages only) */
.style-bar { position: fixed; inset-inline-end: var(--m); bottom: 16px; z-index: 30; display: flex; gap: 4px; background: var(--ink); padding: 6px; }
.style-bar a { color: var(--bg); padding: 8px 12px; font-size: .875rem; text-decoration: none; }
.style-bar a[aria-current] { background: var(--bg); color: var(--ink); }

/* New home sections */
.paths { padding: var(--gap) var(--m) 0; }
.paths h2, .checks h2, .latest h2 { font-size: var(--step-head); max-width: 18ch; }
.paths-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 56px; }
.path { padding: 32px 28px 36px; background: var(--surface); }
.path:nth-child(2) { background: var(--f1); color: var(--field-ink); }
.path:nth-child(3) { background: var(--surface-strong); }
.path:nth-child(4) { background: var(--f2); color: var(--field-ink); }
.path h3 { font-size: clamp(1.375rem, 1.8vw, 1.875rem); margin-bottom: 8px; }
.path p { font-size: 1rem; margin-bottom: 20px; }
.path ul { list-style: none; padding: 0; margin: 0; }
.path li { margin-bottom: 10px; font-weight: 600; }
.path a { color: inherit; }
.checks { padding: var(--gap) var(--m) 0; display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; }
.checks .lead { font-size: var(--step-lead); line-height: 1.4; margin-top: 24px; max-width: 32ch; }
.checks ol { margin: 0; padding: 0; list-style: none; counter-reset: c; }
.checks li { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; padding: 22px 0; }
.checks li + li { margin-top: 4px; }
.checks li:nth-child(odd) { background: var(--surface); margin-inline: -24px; padding-inline: 24px; }
.checks b { font: var(--display-weight) 1.375rem/1.2 var(--display); }
.checks .time { color: var(--muted); font-size: .9375rem; white-space: nowrap; }
.checks li p { grid-column: 1 / -1; margin: 0; }
.term { margin-top: var(--gap); background: var(--f3); color: var(--field-ink); padding: 120px var(--m); display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: end; }
.term h2 { font-size: clamp(2.6rem, 6vw, 6rem); line-height: .95; }
.term p { font-size: var(--step-lead); line-height: 1.45; max-width: 40ch; margin: 0 0 16px; }
.term a { color: var(--field-ink); font-weight: 600; }
.latest { padding: var(--gap) var(--m) 0; }
.latest ul { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; }
.latest li a { display: block; padding: 20px 0; text-decoration: none; }
.latest li b { display: block; font: var(--display-weight) clamp(1.25rem, 1.6vw, 1.6rem)/1.25 var(--display); }
.latest li span { display: block; color: var(--muted); font-size: 1rem; margin-top: 6px; }
.latest li a:hover b { text-decoration: underline; }
@media (max-width: 900px) {
  .paths-grid { grid-template-columns: 1fr 1fr; }
  .checks, .term { grid-template-columns: 1fr; gap: 32px; }
  .latest ul { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .paths-grid { grid-template-columns: 1fr; } }

/* ───────── Post templates (src/data/templates.ts): head variants + body modifiers ───────── */
:root { --alert: #8f1d14; }
[data-style="fresh"] { --alert: #b42318; }
[data-style="electric"] { --alert: #111111; }
[data-style="poster"] { --alert: #952625; }
.num { font: var(--display-weight) clamp(2.6rem, 1.6rem + 4vw, 6rem)/.95 var(--display); letter-spacing: -.04em; direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chips a { display: inline-block; padding: 8px 14px; background: var(--surface); text-decoration: none; font-size: var(--step-small); line-height: 1.3; }
.chips a:hover { background: var(--ink); color: var(--bg); }
.prose .chips-nav { margin-bottom: 40px; }
.prose .chips li { margin: 0; }
/* Phone TOC: one closed line, so the text starts on the first screen. */
.toc-m { display: none; margin-bottom: 28px; background: var(--surface); }
.toc-m summary { padding: 12px 16px; font-weight: 600; cursor: pointer; min-height: 44px; }
.toc-m ol { margin: 0; padding: 0 16px 12px; list-style: none; }
.toc-m li { margin: 0; }
.toc-m a { display: block; padding: 8px 0; text-decoration: none; }
@media (max-width: 900px) { .article-body .toc, .prose .chips-nav { display: none; } .toc-m { display: block; } }

/* Heads */
.head-compact { padding-top: 48px; margin-inline: var(--axis) var(--m); max-width: 66ch; }
.head-compact h1 { font-size: clamp(1.9rem, 1.2rem + 2vw, 3.2rem); max-width: 22ch; }
.inline-photo { margin: 32px 0 40px; }
.inline-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.head-plain { padding: 56px var(--m) 0; }
.head-plain h1 { font-size: clamp(2.4rem, 1.4rem + 4vw, 5.6rem); max-width: 16ch; }
.head-plain .on-axis-in { margin-inline-start: calc(var(--axis) - var(--m)); }

.head-split, .head-calc, .head-case, .head-list { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; padding: 48px var(--m) 0; }
.head-split h1, .head-calc h1, .head-case h1, .head-list h1, .head-steps h1 { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.8rem); max-width: 18ch; }
.split-num { display: grid; gap: 14px; margin: 0; padding-top: 20px; border-top: 1px solid var(--surface-strong); }
.split-num .num { color: var(--accent); font-size: clamp(3rem, 2rem + 5vw, 7.5rem); }
.split-num .note, .readout .note { font-size: var(--step-body); line-height: 1.45; max-width: 36ch; }
.readout { display: grid; gap: 12px; background: var(--ink); color: var(--bg); padding: clamp(24px, 3vw, 40px); }
.readout b { font-size: var(--step-small); font-weight: 600; letter-spacing: .04em; }
.readout .num { padding-bottom: 12px; border-bottom: 1px solid currentColor; }
.case-box { border: 2px solid var(--ink); padding: 0 0 24px; }
.case-box img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; margin-bottom: 20px; }
.case-box b, .case-box p { display: block; padding-inline: 24px; }
.case-box b { font-size: var(--step-small); letter-spacing: .04em; margin-bottom: 8px; }
.case-box p { margin: 0; font-size: var(--step-body); line-height: 1.5; }
.head-list { align-items: start; }
.head-list nav b { display: block; font: var(--display-weight) 1.25rem/1.2 var(--display); margin-bottom: 14px; }
.head-list ol, .head-list ul { list-style: none; margin: 0; padding: 0; }
.head-list li { border-top: 1px solid var(--surface-strong); }
.head-list li a { display: block; padding: 10px 0; text-decoration: none; line-height: 1.35; }
.head-list li a:hover { text-decoration: underline; }
.qlist ol { counter-reset: q; }
.qlist li a { display: grid; grid-template-columns: 2.4em 1fr; }
.qlist li a::before { counter-increment: q; content: counter(q, decimal-leading-zero); color: var(--accent); font-weight: 600; }
.checkbox-list { background: var(--surface); padding: 24px 28px; }
.checkbox-list li a { display: flex; gap: 14px; align-items: baseline; }
.checkbox-list li a::before { content: ''; flex: none; width: 14px; height: 14px; border: 2px solid var(--ink); transform: translateY(2px); }

.head-vs { padding: 48px var(--m) 0; }
.head-vs h1 { font-size: clamp(2rem, 1.2rem + 2.4vw, 3.6rem); max-width: 24ch; }
.vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); margin: 32px 0 0; font: var(--display-weight) clamp(1.3rem, .9rem + 2vw, 2.6rem)/1.1 var(--display); }
.vs span { padding: clamp(18px, 2.4vw, 36px); background: var(--surface); }
.vs span:last-child { background: var(--field); color: var(--field-ink); }
.vs i { font-style: normal; align-self: center; padding: 0 clamp(12px, 2vw, 28px); font-size: .6em; color: var(--muted); }
.vs-foot .standfirst { max-width: 60ch; }
.vs-foot > div { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; }
.vs-foot .meta { margin: 0; }
.vs-link { font-weight: 600; }

.head-tl { padding: 48px var(--m) 0; }
.head-tl h1 { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.8rem); max-width: 22ch; }
.head-tl .standfirst { max-width: 60ch; }
.tl { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); border-top: 2px solid var(--ink); counter-reset: tl; }
.tl li { position: relative; padding: 22px 0 0 16px; counter-increment: tl; }
.tl li::before { content: ''; position: absolute; inset-inline-start: 0; top: -9px; width: 16px; height: 16px; background: var(--accent); }
.tl a { text-decoration: none; display: block; font-size: var(--step-small); line-height: 1.35; }
.tl a::before { content: counter(tl, decimal-leading-zero); display: block; color: var(--accent); font-weight: 600; }
.tl a:hover { text-decoration: underline; }

.head-steps { display: grid; grid-template-columns: auto minmax(0, 1.35fr) minmax(0, .8fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: 48px var(--m) 0; }
.steps-count { display: grid; justify-items: center; gap: 6px; margin: 0; padding: 20px 24px; background: var(--accent); color: var(--accent-ink); font-size: var(--step-small); font-weight: 600; }
.steps-count .num { font-size: clamp(3rem, 2rem + 4vw, 6rem); }

.head-alert { background: var(--alert); color: #fff; --ink: #fff; --muted: #fff; padding: 40px var(--m) 44px; }
.head-alert a { color: #fff; }
.head-alert h1 { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.8rem); max-width: 22ch; }
.head-alert .standfirst { max-width: 60ch; margin: 20px 0 24px; }
.alert-label { display: inline-block; margin: 0 0 18px; padding: 6px 12px; border: 2px solid #fff; font-weight: 600; font-size: var(--step-small); }
.head-alert .chips { margin-bottom: 20px; }
.head-alert .chips a { background: transparent; border: 1px solid #fff; }
.head-alert .chips a:hover { background: #fff; color: var(--alert); }

.head-strip { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: end; padding: 48px var(--m) 0; }
.head-strip h1 { font-size: clamp(2.1rem, 1.2rem + 3vw, 4.4rem); max-width: 16ch; }
.head-strip .standfirst { margin-top: 0; }
.strip-photo { margin: 32px var(--m) 0; }
.strip-photo img { width: 100%; aspect-ratio: 6 / 1; object-fit: cover; object-position: 50% 30%; }

/* Bodies */
.article-body.solo { margin-inline: var(--m); }
.solo .prose { margin-inline: auto; }
.b-narrow .prose { max-width: 58ch; font-size: 1.06em; }
.b-wide .prose { max-width: 84ch; }
.b-lead .prose > p:first-child, .b-qa .prose h2 + p { font-size: var(--step-lead); line-height: 1.5; }
.b-count .prose, .b-count .toc ol { counter-reset: h; }
.b-count .prose h2::before { counter-increment: h; content: counter(h, decimal-leading-zero); display: block; font-size: .45em; color: var(--accent); margin-bottom: .4em; letter-spacing: 0; }
.b-count .toc li { counter-increment: h; display: grid; grid-template-columns: 2.2em 1fr; }
.b-count .toc li::before { content: counter(h, decimal-leading-zero); color: var(--accent); font-weight: 600; }
.b-qa .prose h2 { padding-top: .8em; border-top: 3px solid var(--ink); }
.b-qa .prose h2 + p { font-weight: 600; }
.b-ex .prose p.ex { background: var(--surface); padding: 20px 24px; }
.b-ex .prose p.ex::before { content: 'דוגמה עם מספרים'; display: block; font-size: var(--step-small); font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.b-steps .prose > ol { list-style: none; counter-reset: s; padding: 0; margin: 1.6em 0; border-inline-start: 2px solid var(--ink); }
.b-steps .prose > ol > li { counter-increment: s; position: relative; padding-inline-start: 64px; margin-bottom: 1.1em; min-height: 40px; }
.b-steps .prose > ol > li::before { content: counter(s); position: absolute; inset-inline-start: -1px; top: 0; width: 44px; height: 40px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font: var(--display-weight) 1.25rem/1 var(--display); }
.b-checks .prose > ul { list-style: none; padding: 0; }
.b-checks .prose > ul > li { display: flex; gap: 14px; }
.b-checks .prose > ul > li::before { content: ''; flex: none; width: 14px; height: 14px; border: 2px solid var(--ink); margin-top: .45em; }
.b-timeline .prose { border-inline-start: 2px solid var(--surface-strong); padding-inline-start: clamp(24px, 3vw, 40px); }
.b-timeline .prose h2 { position: relative; }
.b-timeline .prose h2::before { content: ''; position: absolute; inset-inline-start: calc(-1 * clamp(24px, 3vw, 40px) - 9px); top: .25em; width: 16px; height: 16px; background: var(--accent); }
.b-cards .prose table { display: block; overflow: visible; }
.b-cards .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.b-cards .prose tbody { display: grid; gap: 12px; }
.b-cards .prose tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 8px 24px; padding: 18px 20px; background: var(--surface); border-top: 3px solid var(--ink); }
.b-cards .prose tr td { background: none; padding: 0; }
.b-cards .prose td:first-child { grid-column: 1 / -1; font: var(--display-weight) 1.25rem/1.25 var(--display); }
.b-cards .prose td:not(:first-child)::before { content: attr(data-label); display: block; font-size: var(--step-small); color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.b-cols .prose { max-width: 80ch; }
@media (min-width: 901px) {
  .b-cols .prose > ul:has(> li:nth-child(4)) { columns: 2; column-gap: 40px; }
  .b-cols .prose > ul li { break-inside: avoid; }
}

@media (max-width: 900px) {
  .head-compact { padding-top: 32px; }
  .article-body { margin-top: 32px; }
  .head-plain .on-axis-in { margin-inline-start: 0; }
  .head-split, .head-calc, .head-case, .head-list, .head-strip, .vs-foot { grid-template-columns: 1fr; padding-top: 32px; gap: 24px; }
  .head-vs, .head-tl, .head-plain { padding-top: 32px; }
  .vs-foot { padding-top: 0; }
  .split-num { grid-template-columns: auto 1fr; align-items: center; gap: 16px; padding-top: 14px; }
  .split-num .num { font-size: clamp(2.2rem, 9vw, 3.4rem); }
  .readout { grid-template-columns: auto 1fr; align-items: center; padding: 18px 20px; gap: 8px 16px; }
  .readout b { grid-column: 1 / -1; }
  .readout .num { font-size: clamp(2rem, 8vw, 3rem); border: 0; padding: 0; }
  .readout .note, .split-num .note { font-size: .9375rem; }
  .case-box img { display: none; }
  .case-box { padding-top: 18px; }
  /* Long head lists: show the first three on a phone; every entry is still an h2 in the text. */
  .head-list li:nth-child(n+4), .tl li:nth-child(n+5), .head-alert .chips li:nth-child(n+4) { display: none; }
  .head-list nav { padding: 16px 18px; background: var(--surface); }
  .tl { display: block; margin-top: 24px; border-top: 0; border-inline-start: 2px solid var(--ink); }
  .tl li { padding: 0 0 12px; padding-inline-start: 20px; }
  .tl li::before { inset-inline-start: -9px; top: .15em; }
  .tl a::before { display: inline; content: counter(tl, decimal-leading-zero) '  '; }
  .head-steps { grid-template-columns: 1fr; padding-top: 32px; gap: 20px; }
  .steps-count { display: flex; justify-self: start; align-items: baseline; gap: 10px; padding: 8px 14px; }
  .steps-count .num { font-size: 2rem; }
  .figure-page .post-photo { display: none; }
  .head-alert { padding-block: 28px 32px; }
  .strip-photo img { aspect-ratio: 3 / 1; }
  .vs { font-size: clamp(1.05rem, 4.6vw, 1.4rem); margin-top: 24px; }
  .vs span { padding: 14px; }
  .b-steps .prose > ol > li { padding-inline-start: 56px; }
  .b-cards .prose tr { grid-template-columns: 1fr; }
}

/* Calculators: the form on sand at the start, the answer printed in a cobalt block beside it. */
.calc-page, .calc-index { padding: 56px var(--m) var(--gap); }
.calc-page h1 { font-size: var(--step-head); max-width: 20ch; }
.calc-index h1 { font-size: var(--step-display); max-width: 14ch; }
.calc-page .lead, .calc-index .lead { font-size: var(--step-lead); max-width: 40ch; margin-top: 24px; }
.crumbs { font-size: var(--step-small); color: var(--muted); margin-bottom: 20px; }
.cp-grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 5vw, 80px); margin-top: 48px; align-items: start; }
.cp-form fieldset { border: 0; margin: 0 0 36px; padding: 0; display: grid; gap: 26px; }
.cp-form legend { font: 500 1.5rem/1.2 var(--display); padding: 0 0 16px; }
.cp-form label { display: grid; gap: 8px; font-weight: 600; }
.cp-in { display: flex; align-items: baseline; gap: 10px; border-bottom: 2px solid var(--ink); }
.cp-in input, .cp-form select { flex: 1; min-width: 0; background: transparent; color: var(--ink); border: 0; font: 500 clamp(1.5rem, 1.2rem + 1vw, 2rem)/1.3 var(--display); padding: 6px 0; direction: ltr; text-align: right; -moz-appearance: textfield; }
.cp-in input::-webkit-inner-spin-button { opacity: .4; }
.cp-in input:focus { outline: none; }
.cp-in:focus-within { border-bottom-width: 4px; margin-bottom: -2px; }
.cp-in i { font-style: normal; color: var(--muted); font-weight: 500; }
.cp-form select { direction: rtl; text-align: start; font-size: 1.25rem; border-bottom: 2px solid var(--ink); cursor: pointer; }
.cp-form select option { background: var(--bg); }
.cp-out { position: sticky; top: 24px; background: var(--accent); color: var(--accent-ink); padding: clamp(28px, 4vw, 56px); --ink: var(--accent-ink); }
.cp-label { font-weight: 600; margin: 0; }
.cp-num { font: 500 clamp(3rem, 7.5vw, 6.5rem)/1 var(--display); letter-spacing: -.035em; margin: 8px 0 32px; direction: ltr; text-align: right; overflow-wrap: anywhere; }
.cp-out dl { margin: 0; }
.cp-out dl div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.cp-out dd { margin: 0; font: 500 1.25rem/1.3 var(--display); white-space: nowrap; direction: ltr; }
.cp-tip { margin: 24px 0 0; padding: 16px 18px; background: color-mix(in srgb, var(--accent-ink) 14%, transparent); }
.cp-share { margin-top: 24px; background: none; border: 0; padding: 0; color: inherit; font: 600 1rem var(--text); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; min-height: 44px; }
.cp-table { margin-top: 96px; overflow-x: auto; }
.cp-table h2, .cp-how h2, .cp-related h2 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.75rem); margin-bottom: 28px; }
.cp-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cp-table th, .cp-table td { padding: 10px 12px; text-align: start; border-bottom: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); white-space: nowrap; }
.cp-table td:not(:first-child) { direction: ltr; text-align: right; }
.cp-how { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 5vw, 80px); margin-top: var(--gap); }
.cp-how .prose { max-width: 62ch; }
.cp-related { margin-top: var(--gap); }
.cp-related ul, .ci-group ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.cp-related a, .ci-group a { display: grid; gap: 8px; align-content: start; height: 100%; padding: 24px; background: var(--surface); text-decoration: none; transition: transform .2s var(--ease-out), background .2s; }
.cp-related a:hover, .ci-group a:hover { transform: translateY(-3px); }
.cp-related b, .ci-group b { font: 500 1.5rem/1.15 var(--display); }
.cp-related span, .ci-group span { color: var(--muted); }
.ci-group { margin-top: 96px; }
.ci-group h2 { display: flex; align-items: baseline; gap: 20px; font-size: clamp(2rem, 1.4rem + 2.4vw, 3.5rem); margin-bottom: 32px; }
.ci-group h2 span { font-size: .5em; color: var(--muted); }
.ci-group em { font: 500 1.75rem/1 var(--display); font-style: normal; margin-top: 12px; direction: ltr; text-align: right; }
.ci-group li:first-child a { background: var(--accent); color: var(--accent-ink); }
.ci-group li:first-child span { color: inherit; opacity: .85; }
@media (max-width: 900px) {
  .cp-grid, .cp-how { grid-template-columns: 1fr; }
  .cp-out { position: static; }
  .cp-grid { margin-top: 40px; }
}

/* Calculator embedded in a post, links to calculators, lead form. */
.prose .cp-widget { margin: 40px 0; }
.cp-compact { background: var(--surface); padding: clamp(20px, 3vw, 32px); }
.cp-compact .cp-title { font: 500 1.5rem/1.2 var(--display); margin: 0 0 20px; }
.cp-compact .cp-grid { grid-template-columns: 1fr; margin-top: 0; gap: 28px; }
.cp-compact .cp-form fieldset { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 20px; margin-bottom: 0; }
.cp-compact .cp-form label > span:first-child { font-size: .9375rem; }
.cp-compact .cp-in input { font-size: 1.375rem; }
.cp-compact .cp-out { position: static; }
.cp-compact .cp-num { font-size: clamp(2.5rem, 6vw, 4rem); }
.prose .cp-out dl, .prose .cp-out dd { margin: 0; }
.post-calcs { margin-top: 64px; }
.post-calcs h2 { margin-bottom: 20px; }
.post-calcs ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.post-calcs a { display: grid; gap: 6px; height: 100%; padding: 18px 20px; background: var(--surface); text-decoration: none; }
.post-calcs b { font: 500 1.25rem/1.2 var(--display); }
.post-calcs span { color: var(--muted); font-size: .9375rem; line-height: 1.45; }
.lead-box { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(28px, 4vw, 64px); margin-top: 72px; padding: clamp(24px, 4vw, 48px); border: 2px solid var(--ink); }
.prose .lead-box { grid-template-columns: 1fr; }
.lead-box h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); margin-bottom: 16px; }
.lead-dev { background: var(--surface); padding: 10px 14px; font-size: var(--step-small); }
.lead-form { display: grid; gap: 18px; }
.lead-form label { display: grid; gap: 6px; font-weight: 600; }
.lead-form input:not([type=checkbox]), .lead-form select { font: 500 1.125rem var(--text); padding: 12px 14px; background: var(--bg); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; min-height: 48px; }
.lead-form .check { grid-template-columns: 24px 1fr; align-items: start; font-weight: 400; font-size: .9375rem; }
.lead-form .check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--ink); }
.lead-form .hp { position: absolute; inset-inline-start: -9999px; }
.lead-form .btn { justify-self: start; }
.lead-done { font-weight: 600; }
@media (max-width: 900px) { .lead-box { grid-template-columns: 1fr; } }
.cp-form label, .cp-in { min-width: 0; }
.cp-in input { width: 100%; }

/* /embed/: pick, preview, copy. */
.embed-pick { display: flex; flex-wrap: wrap; gap: 24px; margin: 40px 0; }
.embed-pick label { display: grid; gap: 8px; font-weight: 600; }
.embed-pick select { font: 500 1.125rem var(--text); padding: 10px 12px; min-height: 48px; background: var(--surface); color: var(--ink); border: 0; border-bottom: 2px solid var(--ink); }
.embed-pick input[type=color] { width: 64px; height: 48px; border: 0; padding: 0; background: none; }
.embed-grid { display: grid; grid-template-columns: 3fr 2fr; gap: clamp(28px, 4vw, 64px); align-items: start; }
.embed-grid h2 { margin: 0 0 16px; }
.embed-preview { width: 100%; height: 900px; border: 2px solid var(--ink); background: var(--bg); }
.embed-code { width: 100%; box-sizing: border-box; font: .875rem/1.5 ui-monospace, Consolas, monospace; padding: 14px; background: var(--surface); color: var(--ink); border: 0; resize: vertical; margin-bottom: 16px; }
@media (max-width: 860px) { .embed-grid { grid-template-columns: 1fr; } }
