/* =========================================================================
   Numora — "ledger" design system
   Pale ledger paper, navy ink, blue rules, a red margin line, and
   highlighter yellow reserved for results.
   ========================================================================= */

:root {
	--paper: #e8eee5;
	--paper-2: #dde5d9;
	--sheet: #f6f9f3;
	--ink: #1c2a39;
	--ink-2: #44515e;
	--ink-3: #6b7681;
	--rule: #c9d4c6;
	--rule-blue: #3567a8;
	--rule-blue-soft: rgba(53, 103, 168, 0.14);
	--margin-red: #c2303a;
	--hi: #f1e35a;
	--hi-ink: #1c2a39;
	--ok: #2f7a55;
	--warn-bg: #fbf3d2;
	--err-bg: #f8dcdc;
	--focus: #3567a8;

	--t-moss: #2f6b4f;   --t-ochre: #a8741a; --t-plum: #6c4a7d; --t-coral: #b9533f;
	--t-sky: #2f6fa3;    --t-sage: #5b7d52;  --t-ink: #2b3d55;  --t-rust: #97502b;
	--t-teal: #1f7a7a;   --t-slate: #55606b;

	--font-display: "Bricolage Grotesque", "Avenir Next Condensed", "Arial Narrow", system-ui, sans-serif;
	--font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
	--font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

	--s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
	--wrap: 1180px;
	--measure: 68ch;
	--r-sm: 6px; --r-md: 10px;
	--margin-x: clamp(16px, 4vw, 56px);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--paper: #131d18; --paper-2: #1a2620; --sheet: #1b2721;
		--ink: #e3eadf; --ink-2: #b4c0b6; --ink-3: #8a978e;
		--rule: #2c3b33; --rule-blue: #8cb4e8; --rule-blue-soft: rgba(140, 180, 232, 0.16);
		--margin-red: #e0646c; --hi: #e2d34c; --hi-ink: #131d18; --hi-from: 84%;
		--warn-bg: #2e2b17; --err-bg: #3a1f22; --ok: #7cc7a0; --focus: #8cb4e8;
		--t-moss: #7cc7a0; --t-ochre: #e0b257; --t-plum: #c6a1d6; --t-coral: #ee9a86;
		--t-sky: #8cbbe6; --t-sage: #a7c79c; --t-ink: #a9bbd6; --t-rust: #e3a07b;
		--t-teal: #7fd0cf; --t-slate: #aab4bd;
	}
}
:root[data-theme="dark"] {
	--paper: #131d18; --paper-2: #1a2620; --sheet: #1b2721;
	--ink: #e3eadf; --ink-2: #b4c0b6; --ink-3: #8a978e;
	--rule: #2c3b33; --rule-blue: #8cb4e8; --rule-blue-soft: rgba(140, 180, 232, 0.16);
	--margin-red: #e0646c; --hi: #e2d34c; --hi-ink: #131d18; --hi-from: 84%;
	--warn-bg: #2e2b17; --err-bg: #3a1f22; --ok: #7cc7a0; --focus: #8cb4e8;
	--t-moss: #7cc7a0; --t-ochre: #e0b257; --t-plum: #c6a1d6; --t-coral: #ee9a86;
	--t-sky: #8cbbe6; --t-sage: #a7c79c; --t-ink: #a9bbd6; --t-rust: #e3a07b;
	--t-teal: #7fd0cf; --t-slate: #aab4bd;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 1.0625rem/1.6 var(--font-body);
	font-variant-numeric: tabular-nums;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--rule-blue); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 var(--s4); font-weight: 700; }
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); letter-spacing: -0.025em; font-variation-settings: "wdth" 85; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 var(--s4); }
code, kbd { font-family: var(--font-mono); font-size: 0.92em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s7) 0; }
.screen-reader-text, .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; background: var(--sheet); padding: 8px 14px; clip: auto; width: auto; height: auto; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* The ledger margin: one red rule down the left of every page */
.nm-page { position: relative; min-height: 100vh; display: flex; flex-direction: column; }
.nm-page::before {
	content: ""; position: fixed; top: 0; bottom: 0;
	left: calc(var(--margin-x) - 14px); width: 1px;
	background: var(--margin-red); opacity: 0.55; pointer-events: none; z-index: 0;
}
@media (max-width: 720px) { .nm-page::before { left: 6px; } }
.nm-main { flex: 1; position: relative; z-index: 1; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--margin-x)); margin: 0 auto; padding: 0 var(--margin-x); }
.wrap--narrow { max-width: calc(780px + 2 * var(--margin-x)); }

/* ---------- header ---------- */
.nm-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.nm-header__bar { display: flex; align-items: center; gap: var(--s5); min-height: 68px; }
.nm-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 800 1.35rem/1 var(--font-display); letter-spacing: -0.02em; }
.nm-brand svg { width: 30px; height: 30px; flex: none; }
.nm-brand img { max-height: 40px; width: auto; }
.nm-nav { margin-left: auto; }
.nm-nav ul { list-style: none; display: flex; gap: var(--s1); margin: 0; padding: 0; }
.nm-nav a { display: block; padding: 8px 12px; color: var(--ink); text-decoration: none; border-radius: var(--r-sm); font-weight: 600; font-size: 0.98rem; }
.nm-nav a:hover, .nm-nav .current-menu-item > a, .nm-nav .current_page_item > a, .nm-nav a[aria-current="page"] { background: var(--rule-blue-soft); }
.nm-header__tools { display: flex; align-items: center; gap: var(--s2); }
.nm-iconbtn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); border-radius: var(--r-sm); cursor: pointer; }
.nm-iconbtn svg { width: 18px; height: 18px; }
.nm-menu-toggle { display: none; }
@media (max-width: 900px) {
	.nm-menu-toggle { display: inline-grid; }
	.nm-nav { position: fixed; inset: 68px 0 auto 0; background: var(--paper); border-bottom: 1px solid var(--rule); padding: var(--s3) var(--margin-x) var(--s5); display: none; }
	.nm-nav.is-open { display: block; }
	.nm-nav ul { flex-direction: column; }
	.nm-nav a { padding: 12px; font-size: 1.1rem; }
	.nm-header__tools { margin-left: auto; }
}
.nm-searchbar { border-top: 1px solid var(--rule); padding: var(--s3) 0; }
.nm-searchbar[hidden] { display: none; }

/* ---------- buttons & fields ---------- */
.nm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid transparent; font: 700 1rem/1 var(--font-body); cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s; }
.nm-btn--primary { background: var(--ink); color: var(--paper); }
.nm-btn--primary:hover { background: var(--rule-blue); color: #fff; }
.nm-btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.nm-btn--ghost:hover { border-color: var(--ink-3); }
.nm-btn--sm { min-height: 36px; padding: 6px 12px; font-size: 0.92rem; }
.nm-input, .search-field, input[type="text"], input[type="email"], input[type="search"], textarea, select {
	width: 100%; min-height: 44px; padding: 10px 12px; font: 400 1rem/1.3 var(--font-body); color: var(--ink);
	background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-sm); font-variant-numeric: tabular-nums;
}
.nm-input:focus, input:focus, textarea:focus, select:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.search-form { display: flex; gap: var(--s2); }
.search-form label { flex: 1; }
.search-submit { min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-sm); background: var(--ink); color: var(--paper); font-weight: 700; cursor: pointer; }

/* ---------- masthead (home hero) ---------- */
.nm-masthead { padding: var(--s8) 0 var(--s7); position: relative; }
.nm-masthead::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: repeating-linear-gradient(to bottom, transparent 0 39px, var(--rule-blue-soft) 39px 40px); mask-image: linear-gradient(to bottom, #000 40%, transparent); }
.nm-masthead__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--s8); align-items: center; }
.nm-masthead h1 { font-size: clamp(2.6rem, 6.4vw, 5.2rem); line-height: 0.98; margin-bottom: var(--s5); max-width: 12ch; }
.nm-masthead__lede { font-size: 1.2rem; color: var(--ink-2); max-width: 46ch; margin-bottom: var(--s6); }
.nm-finder { display: flex; gap: var(--s2); max-width: 520px; }
.nm-finder input { font-size: 1.05rem; min-height: 52px; }
.nm-finder .nm-btn { min-height: 52px; }
.nm-masthead__quick { margin-top: var(--s4); font-size: 0.95rem; color: var(--ink-3); }
.nm-masthead__quick a { margin-right: var(--s3); white-space: nowrap; }
@media (max-width: 900px) { .nm-masthead__grid { grid-template-columns: 1fr; gap: var(--s7); } .nm-masthead { padding-top: var(--s7); } }

/* The adding-machine tape: the one loud object on the page */
.nm-tape { position: relative; background: #fffef8; color: #1c2a39; width: min(100%, 360px); margin-left: auto; padding: 30px 26px 34px; font-family: var(--font-mono); box-shadow: 0 1px 0 rgba(28, 42, 57, .06), 0 18px 40px -22px rgba(28, 42, 57, .45); transform: rotate(1.4deg); }
.nm-tape::before, .nm-tape::after { content: ""; position: absolute; left: 0; right: 0; height: 12px; background: radial-gradient(circle at 6px 0, transparent 6px, #fffef8 6.5px) 0 0 / 12px 12px repeat-x; }
.nm-tape::before { top: -11px; transform: scaleY(-1); }
.nm-tape::after { bottom: -11px; }
.nm-tape h2 { font: 700 1rem/1.3 var(--font-body); color: #44515e; margin: 0 0 var(--s4); }
.nm-tape__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding: 6px 0; border-bottom: 1px dashed #c9d4c6; }
.nm-tape__row label { font-size: 0.85rem; color: #6b7681; font-family: var(--font-body); }
.nm-tape__row input { width: 9ch; min-height: 32px; text-align: right; padding: 2px 6px; font: 600 1.15rem/1 var(--font-mono); background: transparent; border: 0; border-bottom: 1px solid #c9d4c6; border-radius: 0; color: #1c2a39; }
.nm-tape__row input:focus { outline: 2px solid #3567a8; }
.nm-tape__total { margin-top: var(--s4); display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid #1c2a39; padding-top: var(--s3); }
.nm-tape__total span { font-family: var(--font-body); font-size: 0.9rem; color: #44515e; }
.nm-tape__total output { font: 700 1.9rem/1 var(--font-mono); background: linear-gradient(transparent 52%, #f1e35a 52%, #f1e35a 92%, transparent 92%); padding: 0 4px; }
.nm-tape__work { margin: var(--s3) 0 0; font-size: 0.8rem; color: #6b7681; }
@media (max-width: 900px) { .nm-tape { margin: 0 auto; transform: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nm-tape { box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8); } }

/* ---------- section scaffolding ---------- */
.nm-section { padding: var(--s8) 0; }
.nm-section--tint { background: var(--paper-2); }
.nm-section__head { display: flex; align-items: end; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s6); flex-wrap: wrap; }
.nm-section__head h2 { margin: 0; }
.nm-section__head p { margin: var(--s2) 0 0; color: var(--ink-2); max-width: 56ch; }
.nm-more { font-weight: 700; white-space: nowrap; }

/* ---------- category index tabs ---------- */
.nm-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 1000px) { .nm-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .nm-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nm-tab { --tone: var(--t-ink); position: relative; display: block; padding: var(--s4) var(--s4) var(--s4) calc(var(--s4) + 6px); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-sm); text-decoration: none; color: var(--ink); min-height: 120px; }
.nm-tab::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 6px; background: var(--tone); border-radius: 0 3px 3px 0; }
.nm-tab:hover { border-color: var(--tone); }
.nm-tab__glyph { font: 700 1.5rem/1 var(--font-display); color: var(--tone); display: block; margin-bottom: var(--s3); }
.nm-tab strong { font: 700 1.1rem/1.2 var(--font-display); display: block; }
.nm-tab span.nm-tab__meta { font-size: 0.88rem; color: var(--ink-3); }
.tone-moss { --tone: var(--t-moss); } .tone-ochre { --tone: var(--t-ochre); } .tone-plum { --tone: var(--t-plum); } .tone-coral { --tone: var(--t-coral); } .tone-sky { --tone: var(--t-sky); }
.tone-sage { --tone: var(--t-sage); } .tone-ink { --tone: var(--t-ink); } .tone-rust { --tone: var(--t-rust); } .tone-teal { --tone: var(--t-teal); } .tone-slate { --tone: var(--t-slate); }

/* ---------- ledger rows (calculator lists) ---------- */
.nm-ledger { border-top: 2px solid var(--ink); }
.nm-ledger__group { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s5); padding: var(--s5) 0; border-bottom: 1px solid var(--rule); }
.nm-ledger__group[hidden] { display: none; }
.nm-ledger__label { --tone: var(--t-ink); }
.nm-ledger__label h2 { font-size: 1.35rem; margin: 0 0 var(--s1); display: flex; gap: 10px; align-items: baseline; }
.nm-ledger__label h2 a { color: inherit; text-decoration: none; }
.nm-ledger__label h2 i { font-style: normal; color: var(--tone); }
.nm-ledger__label p { margin: 0; color: var(--ink-3); font-size: 0.92rem; }
.nm-ledger__rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s5); }
@media (max-width: 860px) { .nm-ledger__group { grid-template-columns: 1fr; gap: var(--s3); } }
@media (max-width: 600px) { .nm-ledger__rows { grid-template-columns: 1fr; } }
.nm-card { position: relative; display: block; padding: var(--s3) 44px var(--s3) 0; border-bottom: 1px dashed var(--rule); text-decoration: none; color: var(--ink); }
.nm-card[hidden] { display: none; }
.nm-card strong { display: block; font-weight: 700; font-size: 1.02rem; }
.nm-card:hover strong { color: var(--rule-blue); text-decoration: underline; text-underline-offset: 3px; }
.nm-card span { display: block; font-size: 0.9rem; color: var(--ink-3); line-height: 1.4; }
.nm-fav { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: var(--r-sm); display: grid; place-items: center; }
.nm-fav svg { width: 18px; height: 18px; }
.nm-fav[aria-pressed="true"] { color: var(--t-ochre); }
.nm-fav[aria-pressed="true"] svg path { fill: currentColor; }
.nm-fav:hover { background: var(--rule-blue-soft); }
.nm-fav-shelf { margin-bottom: var(--s5); }
.nm-fav-shelf[hidden] { display: none; }
.nm-fav-shelf h2 { font-size: 1.05rem; font-family: var(--font-body); }
.nm-fav-list { display: flex; flex-wrap: wrap; gap: var(--s2); }
.nm-pill { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--sheet); border: 1px solid var(--rule); text-decoration: none; color: var(--ink); font-size: 0.92rem; font-weight: 600; }
.nm-pill:hover, .nm-pill[aria-pressed="true"], .nm-pill.is-active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.nm-finder-empty { padding: var(--s6) 0; color: var(--ink-2); }

/* ---------- page heads & breadcrumbs ---------- */
.nm-pagehead { padding: var(--s7) 0 var(--s6); }
.nm-pagehead p.nm-pagehead__lede { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; margin: 0; }
.nm-crumbs { font-size: 0.9rem; color: var(--ink-3); margin-bottom: var(--s4); }
.nm-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.nm-crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--rule); }
.nm-crumbs a { color: var(--ink-2); }
.nm-pagehead__row { display: flex; gap: var(--s4); align-items: start; justify-content: space-between; }
.nm-pagehead__row .nm-fav { position: static; transform: none; border: 1px solid var(--rule); width: auto; padding: 0 12px; height: 40px; display: inline-flex; gap: 6px; font: 600 0.9rem var(--font-body); background: var(--sheet); }

/* ---------- calculator widget ---------- */
.nm-calc { margin-bottom: var(--s8); }
.nm-calc noscript { display: block; padding: var(--s5); background: var(--warn-bg); border-radius: var(--r-sm); }
.nm-calc__grid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: var(--s5); align-items: start; }
@media (max-width: 900px) { .nm-calc__grid { grid-template-columns: 1fr; } }
.nm-panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-md); padding: var(--s5); }
.nm-panel--out { border-top: 3px solid var(--ink); position: sticky; top: 88px; }
@media (max-width: 900px) { .nm-panel--out { position: static; } }
.nm-panel__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.nm-panel__head h2 { font-size: 1.15rem; margin: 0; font-family: var(--font-body); }
.nm-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--ok); font-weight: 600; }
.nm-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.nm-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s4); }
@media (max-width: 520px) { .nm-form { grid-template-columns: 1fr; } }
.nm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nm-field--wide, .nm-group, .nm-form__actions { grid-column: 1 / -1; }
.nm-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--s3); }
.nm-label { font-weight: 700; font-size: 0.92rem; }
.nm-opt { font-weight: 400; color: var(--ink-3); }
.nm-hint { font-size: 0.8rem; color: var(--ink-3); min-height: 0; }
.nm-hint:empty { display: none; }
.nm-affix { display: flex; align-items: stretch; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet); overflow: hidden; }
.nm-affix:focus-within { outline: 2px solid var(--focus); border-color: var(--focus); }
.nm-affix .nm-input { border: 0; border-radius: 0; outline: 0; min-width: 0; flex: 1; }
.nm-affix__pre, .nm-affix__suf { display: grid; place-items: center; padding: 0 10px; color: var(--ink-3); background: var(--paper-2); font-size: 0.88rem; white-space: nowrap; }
.nm-form__actions { display: flex; gap: var(--s2); padding-top: var(--s2); }
.nm-rep__list { display: grid; gap: var(--s2); }
.nm-rep__row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) 74px minmax(0, 1.1fr) 36px; gap: 6px; align-items: center; }
@media (max-width: 600px) { .nm-rep__row { grid-template-columns: 1fr 1fr; padding-bottom: var(--s3); border-bottom: 1px dashed var(--rule); } .nm-rep__cell--name { grid-column: 1 / -1; } }
.nm-icon-btn { width: 36px; height: 36px; border: 1px solid var(--rule); background: transparent; color: var(--ink-2); border-radius: var(--r-sm); cursor: pointer; font-size: 1.2rem; }
.nm-icon-btn:hover { border-color: var(--margin-red); color: var(--margin-red); }
.nm-rep > .nm-btn { justify-self: start; margin-top: var(--s2); }

.nm-result { display: flex; flex-direction: column; gap: 6px; padding-bottom: var(--s4); border-bottom: 1px solid var(--rule); margin-bottom: var(--s4); }
.nm-result__label { font-weight: 700; color: var(--ink-2); font-size: 0.95rem; }
.nm-result__value { font: 700 clamp(2rem, 4.4vw, 2.9rem)/1.05 var(--font-display); letter-spacing: -0.02em; align-self: flex-start; padding: 0 6px; margin-left: -6px; background: linear-gradient(transparent var(--hi-from, 55%), var(--hi) var(--hi-from, 55%), var(--hi) 92%, transparent 92%); color: var(--ink); overflow-wrap: anywhere; }
.nm-result__note { color: var(--ink-2); font-size: 0.95rem; }
.nm-rows { margin: 0 0 var(--s4); }
.nm-rows > div { display: flex; justify-content: space-between; gap: var(--s4); padding: 8px 0; border-bottom: 1px dashed var(--rule); }
.nm-rows dt { color: var(--ink-2); }
.nm-rows dd { margin: 0; font-weight: 700; text-align: right; }
.nm-warn { background: var(--warn-bg); padding: var(--s3) var(--s4); border-radius: var(--r-sm); font-size: 0.92rem; }
.nm-error { background: var(--err-bg); padding: var(--s4); border-radius: var(--r-sm); font-weight: 600; }
.nm-formula { background: var(--paper); border-left: 3px solid var(--rule-blue); padding: var(--s3) var(--s4); margin: var(--s4) 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.nm-formula__tag { display: block; font-weight: 700; font-size: 0.85rem; color: var(--rule-blue); margin-bottom: 4px; }
.nm-formula code { font-size: 1rem; display: block; overflow-wrap: anywhere; }
.nm-formula ol { margin: var(--s2) 0 0; padding-left: 20px; font-size: 0.92rem; color: var(--ink-2); }
.nm-chart { margin: var(--s5) 0 var(--s4); }
.nm-chart figcaption { font-weight: 700; font-size: 0.92rem; margin-bottom: var(--s2); }
.nm-chart__svg { width: 100%; height: auto; display: block; }
.nm-grid { stroke: var(--rule); stroke-width: 1; }
.nm-axis { fill: var(--ink-3); font: 11px var(--font-body); }
.nm-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.nm-l0 { stroke: var(--rule-blue); } .nm-l1 { stroke: var(--t-ochre); stroke-dasharray: 5 4; }
.nm-fill0 { fill: var(--rule-blue-soft); }
.nm-s0 { fill: var(--rule-blue); } .nm-s1 { fill: var(--t-ochre); }
.nm-hit { fill: transparent; }
.nm-hit:hover { fill: var(--rule-blue-soft); }
.nm-legend { display: flex; gap: var(--s4); font-size: 0.85rem; color: var(--ink-2); margin-bottom: 6px; }
.nm-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.nm-k0 { background: var(--rule-blue); } .nm-k1 { background: var(--t-ochre); }
.nm-details { margin: var(--s4) 0; border: 1px solid var(--rule); border-radius: var(--r-sm); }
.nm-details > summary { cursor: pointer; padding: var(--s3) var(--s4); font-weight: 700; }
.nm-table-wrap { overflow-x: auto; padding: 0 var(--s4) var(--s3); }
.nm-table, .entry-content table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.nm-table th, .nm-table td, .entry-content th, .entry-content td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.nm-table th:first-child, .nm-table td:first-child, .entry-content th:first-child, .entry-content td:first-child { text-align: left; }
.nm-table th, .entry-content th { font-weight: 700; color: var(--ink-2); border-bottom: 2px solid var(--ink); }
.nm-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.nm-chip { min-height: 36px; padding: 6px 12px; border-radius: var(--r-sm); border: 1px solid var(--rule); background: transparent; color: var(--ink); font: 600 0.88rem var(--font-body); cursor: pointer; }
.nm-chip:hover { border-color: var(--ink); }
.nm-chip--accent { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.nm-history { margin-top: var(--s5); }
.nm-history:empty { display: none; }
.nm-history h3 { font-family: var(--font-body); font-size: 0.95rem; margin-bottom: var(--s2); }
.nm-history ul { list-style: none; margin: 0 0 var(--s2); padding: 0; }
.nm-history li { display: flex; justify-content: space-between; gap: var(--s3); padding: 6px 0; border-bottom: 1px dashed var(--rule); font-size: 0.9rem; }
.nm-history time { color: var(--ink-3); white-space: nowrap; }
.nm-linkbtn { background: none; border: 0; padding: 0; color: var(--rule-blue); font: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.nm-linkbtn--muted { color: var(--ink-3); font-size: 0.85rem; }
.nm-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; }
.nm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- calculator explainer ---------- */
.nm-explain { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s8); }
@media (max-width: 960px) { .nm-explain { grid-template-columns: 1fr; gap: var(--s6); } }
.nm-explain__body { max-width: var(--measure); }
.nm-explain__body h2 { margin-top: var(--s7); }
.nm-explain__body h2:first-child { margin-top: 0; }
.nm-steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 var(--s5); }
.nm-steps li { counter-increment: s; position: relative; padding: 0 0 var(--s3) 44px; }
.nm-steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 50%; font-weight: 700; font-size: 0.9rem; }
.nm-defs { margin: 0 0 var(--s5); }
.nm-defs dt { font-weight: 700; margin-top: var(--s3); }
.nm-defs dd { margin: 4px 0 0; color: var(--ink-2); }
.nm-faq details { border-bottom: 1px solid var(--rule); }
.nm-faq summary { cursor: pointer; padding: var(--s4) 0; font-weight: 700; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: var(--s4); }
.nm-faq summary::-webkit-details-marker { display: none; }
.nm-faq summary::after { content: "+"; font: 400 1.4rem/1 var(--font-display); color: var(--ink-3); }
.nm-faq details[open] summary::after { content: "−"; }
.nm-faq details > div { padding: 0 0 var(--s4); color: var(--ink-2); }
.nm-aside { display: flex; flex-direction: column; gap: var(--s5); }
.nm-aside__box { border-top: 2px solid var(--ink); padding-top: var(--s3); }
.nm-aside__box h2 { font-size: 1.05rem; font-family: var(--font-body); margin-bottom: var(--s2); }
.nm-aside__box ul { list-style: none; padding: 0; margin: 0; }
.nm-aside__box li { padding: 8px 0; border-bottom: 1px dashed var(--rule); }
.nm-reviewed { font-size: 0.88rem; color: var(--ink-3); }
.nm-disclaimer { font-size: 0.88rem; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: var(--s4); margin-top: var(--s6); }

/* ---------- example / takeaway / inline calc card (used in articles too) ---------- */
.nm-example { background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--rule-blue); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: var(--s4) var(--s5); margin: var(--s5) 0; }
.nm-example__tag, .nm-takeaway__tag { font-weight: 700; color: var(--rule-blue); margin-bottom: var(--s2) !important; }
.nm-example ul { margin-bottom: 0; }
.nm-example p:last-child { margin-bottom: 0; }
.nm-takeaway { margin: var(--s6) 0; padding: var(--s5); background: var(--paper-2); border-radius: var(--r-sm); }
.nm-takeaway p:last-child { margin-bottom: 0; }
.nm-takeaway__tag { color: var(--ink) !important; }
.nm-formula-inline code { display: inline-block; background: var(--sheet); border: 1px solid var(--rule); padding: 6px 12px; border-radius: var(--r-sm); font-size: 1rem; }
.nm-callout { display: flex; align-items: center; gap: var(--s4); padding: var(--s4); margin: var(--s4) 0; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet); text-decoration: none; color: var(--ink); }
.nm-callout:hover { border-color: var(--ink); }
.nm-callout__glyph { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-sm); background: color-mix(in srgb, var(--tone) 14%, transparent); color: var(--tone); font: 700 1.3rem var(--font-display); }
.nm-callout strong { display: block; }
.nm-callout span.nm-callout__d { font-size: 0.9rem; color: var(--ink-2); }
.nm-callout__go { margin-left: auto; font-weight: 700; color: var(--rule-blue); white-space: nowrap; }

/* ---------- journal (blog) ---------- */
.nm-posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6) var(--s5); }
@media (max-width: 960px) { .nm-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .nm-posts { grid-template-columns: 1fr; } }
.nm-post { display: flex; flex-direction: column; gap: var(--s3); }
.nm-post__cover { --tone: var(--t-ink); position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--r-sm); overflow: hidden; background: color-mix(in srgb, var(--tone) 12%, var(--sheet)); border: 1px solid var(--rule); }
.nm-post__cover img { width: 100%; height: 100%; object-fit: cover; }
.nm-post__cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.nm-post__cat { font-size: 0.85rem; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.nm-post h2, .nm-post h3 { font-size: 1.3rem; margin: 0; }
.nm-post h2 a, .nm-post h3 a { color: var(--ink); text-decoration: none; }
.nm-post h2 a:hover, .nm-post h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nm-post p { margin: 0; color: var(--ink-2); font-size: 0.98rem; }
.nm-post time, .nm-post .nm-post__meta { font-size: 0.85rem; color: var(--ink-3); }
.nm-post--lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s6); align-items: center; padding-bottom: var(--s6); border-bottom: 1px solid var(--rule); }
.nm-post--lead h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.nm-post--lead .nm-post__text { display: flex; flex-direction: column; gap: var(--s3); }
@media (max-width: 760px) { .nm-post--lead { grid-template-columns: 1fr; } }
.nm-catnav { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s6); }
.nm-pagination { margin-top: var(--s7); display: flex; gap: var(--s2); flex-wrap: wrap; }
.nm-pagination .page-numbers { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--rule); border-radius: var(--r-sm); text-decoration: none; color: var(--ink); font-weight: 600; }
.nm-pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* single article */
.nm-article__head { padding: var(--s7) 0 var(--s5); }
.nm-article__head h1 { max-width: 20ch; }
.nm-article__meta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); color: var(--ink-3); font-size: 0.92rem; }
.nm-article__meta a { color: var(--ink-2); }
.entry-content { max-width: var(--measure); font-size: 1.1rem; line-height: 1.7; }
.entry-content > * + h2 { margin-top: var(--s7); }
.entry-content > * + h3 { margin-top: var(--s5); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; margin: 0 0 var(--s4); }
.entry-content li { margin-bottom: 6px; }
.entry-content blockquote { margin: var(--s5) 0; padding-left: var(--s5); border-left: 3px solid var(--rule-blue); font-size: 1.15rem; color: var(--ink-2); }
.entry-content img { border-radius: var(--r-sm); }
.entry-content table { margin: var(--s4) 0 var(--s5); }
.nm-lead { font-size: 1.25rem; line-height: 1.55; color: var(--ink); }
.nm-author { display: flex; gap: var(--s4); align-items: start; padding: var(--s5) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: var(--s7) 0; max-width: var(--measure); }
.nm-author img { border-radius: 50%; flex: none; }
.nm-author h2 { font-size: 1.05rem; font-family: var(--font-body); margin-bottom: 4px; }
.nm-author p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }

/* ---------- reading room ---------- */
.nm-rr-filter { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s6); }
.nm-rr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
@media (max-width: 960px) { .nm-rr { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .nm-rr { grid-template-columns: 1fr; } }
.nm-clip { --pub: var(--t-ink); display: flex; flex-direction: column; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-sm); overflow: hidden; text-decoration: none; color: var(--ink); }
.nm-clip[hidden] { display: none; }
.nm-clip:hover { border-color: var(--pub); }
.nm-clip:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.nm-clip__img { aspect-ratio: 16 / 9; background: color-mix(in srgb, var(--pub) 14%, var(--paper-2)); overflow: hidden; }
.nm-clip__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nm-clip__body { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); flex: 1; }
.nm-clip__src { display: flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: 0.88rem; color: var(--pub); }
.nm-clip__mark { width: 24px; height: 24px; flex: none; border-radius: 4px; display: grid; place-items: center; background: var(--pub); color: #fff; font: 800 0.75rem/1 var(--font-display); }
.nm-clip h3 { font-size: 1.15rem; margin: 0; }
.nm-clip p { font-size: 0.94rem; color: var(--ink-2); margin: 0; }
.nm-clip__foot { margin-top: auto; padding-top: var(--s2); display: flex; justify-content: space-between; gap: var(--s3); font-size: 0.84rem; color: var(--ink-3); }
.nm-clip__lock { white-space: nowrap; }
.nm-rr-note { margin-top: var(--s6); font-size: 0.9rem; color: var(--ink-3); max-width: 70ch; }
.nm-rr-empty { padding: var(--s6); background: var(--sheet); border: 1px dashed var(--rule); border-radius: var(--r-sm); }

/* ---------- quick calculator ---------- */
.nm-q { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: var(--s6); align-items: start; }
@media (max-width: 860px) { .nm-q { grid-template-columns: 1fr; } }
.nm-q__pad { background: var(--ink); border-radius: var(--r-md); padding: var(--s4); }
.nm-q__screen { background: var(--sheet); border-radius: var(--r-sm); padding: var(--s4); margin-bottom: var(--s4); min-height: 112px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; text-align: right; }
.nm-q__expr { font: 600 1.8rem/1.2 var(--font-mono); overflow-wrap: anywhere; }
.nm-q__res { font: 400 1.05rem/1.4 var(--font-mono); color: var(--ink-3); min-height: 1.4em; }
.nm-q__keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.nm-q__keys button { min-height: 58px; border-radius: var(--r-sm); border: 0; font: 600 1.35rem var(--font-mono); background: color-mix(in srgb, var(--paper) 12%, var(--ink)); color: var(--paper); cursor: pointer; }
:root[data-theme="dark"] .nm-q__keys button { color: var(--paper); }
.nm-q__keys button:hover { background: color-mix(in srgb, var(--paper) 22%, var(--ink)); }
.nm-q__keys .is-op { color: var(--hi); }
.nm-q__keys .is-eq { background: var(--hi); color: var(--hi-ink); }
.nm-q__keys .is-fn { color: var(--paper-2); font-size: 1.05rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nm-q__pad { background: #0d1410; } :root:not([data-theme="light"]) .nm-q__keys button { background: #1f2c25; color: #e3eadf; } }
:root[data-theme="dark"] .nm-q__pad { background: #0d1410; }
:root[data-theme="dark"] .nm-q__keys button { background: #1f2c25; color: #e3eadf; }
.nm-q__hist ol { padding-left: 1.2em; }
.nm-q__hist li { padding: 4px 0; }

/* ---------- privacy band, footer ---------- */
.nm-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s7); align-items: center; }
@media (max-width: 860px) { .nm-band { grid-template-columns: 1fr; } }
.nm-band h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); max-width: 16ch; }
.nm-band ul { list-style: none; margin: 0; padding: 0; }
.nm-band li { padding: var(--s3) 0 var(--s3) 32px; border-bottom: 1px dashed var(--rule); position: relative; }
.nm-band li::before { content: ""; position: absolute; left: 0; top: 19px; width: 16px; height: 8px; border-left: 2.5px solid var(--ok); border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg); }
.nm-footer { position: relative; z-index: 1; border-top: 2px solid var(--ink); padding: var(--s7) 0 var(--s5); margin-top: var(--s8); font-size: 0.95rem; }
.nm-footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--s6); }
@media (max-width: 860px) { .nm-footer__grid { grid-template-columns: 1fr 1fr; } }
.nm-footer h2 { font: 700 0.95rem var(--font-body); margin-bottom: var(--s3); }
.nm-footer ul { list-style: none; padding: 0; margin: 0; }
.nm-footer li { padding: 4px 0; }
.nm-footer a { color: var(--ink-2); text-decoration: none; }
.nm-footer a:hover { color: var(--ink); text-decoration: underline; }
.nm-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s4); margin-top: var(--s7); padding-top: var(--s4); border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 0.88rem; }
.nm-adslot { margin: var(--s6) 0; text-align: center; }
.nm-adslot:empty { display: none; }

/* contact */
.nm-form-std { display: grid; gap: var(--s4); max-width: 640px; }
.nm-form-std label { font-weight: 700; display: block; margin-bottom: 6px; }
.nm-hp { position: absolute; left: -9999px; }
.nm-notice { padding: var(--s4); border-radius: var(--r-sm); margin-bottom: var(--s5); font-weight: 600; }
.nm-notice--ok { background: color-mix(in srgb, var(--ok) 15%, var(--sheet)); }
.nm-notice--err { background: var(--err-bg); }

/* WordPress core alignment classes */
.alignleft { float: left; margin: 0 var(--s5) var(--s4) 0; }
.alignright { float: right; margin: 0 0 var(--s4) var(--s5); }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { font-size: 0.88rem; color: var(--ink-3); }
.sticky, .bypostauthor, .gallery-caption { }

/* print: just the working */
@media print {
	.nm-header, .nm-footer, .nm-actions, .nm-history, .nm-form__actions, .nm-explain__aside, .nm-aside, .nm-adslot, .nm-page::before, .nm-pagehead__row .nm-fav { display: none !important; }
	body { background: #fff; color: #000; }
	.nm-panel { border: 1px solid #999; break-inside: avoid; }
	.nm-panel--out { position: static; }
	.nm-details { display: block; } .nm-details > * { display: block; }
}
