/*
Theme Name: keepcalc
Description: Card-catalogue theme for keepcalculator.com (keepcalc-build-2026-11-03). Every calculator is an index card filed in one of ten drawers. No ads, no ad slots.
Version: 1.0.1
*/
@font-face { font-family: "Newsreader"; src: url(assets/fonts/newsreader-latin-wght.woff2) format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url(assets/fonts/courier-prime-latin-700.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------------------------------------------------------------- tokens */
:root {
  --bg: #e9ecf0;          /* library steel */
  --surface: #f6f7f9;
  --card: #fffdf8;        /* index card stock */
  --drawer: #efe7d8;      /* oak-buff drawer front */
  --drawer-2: #e6dcc8;
  --line: #c9d0da;
  --line-2: #dfe3ea;
  --rule: #b9cde6;        /* card ruling, decorative only */
  --ink: #18223a;
  --ink-2: #33405c;
  --muted: #4f5a72;
  --accent: #2a4b9b;      /* ink blue: links, buttons */
  --accent-2: #1f3a7c;
  --on-accent: #ffffff;
  --signal: #b0302a;      /* card red: header rule, the answer underline, errors */
  --brass: #7a581e;       /* drawer plates and pulls, decorative */
  --band: #1b2a4a;        /* ink band */
  --on-band: #eef1f7;
  --on-band-2: #c3cbe0;
  --shadow: 0 1px 0 rgba(24, 34, 58, .06), 0 6px 18px -8px rgba(24, 34, 58, .28);
  --radius: 6px;
  --f-text: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-mono: "Courier Prime", "Courier New", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f131b; --surface: #161c27; --card: #1b2230; --drawer: #222a37; --drawer-2: #2a3342;
    --line: #34405a; --line-2: #283246; --rule: #2b3f5e;
    --ink: #e9edf4; --ink-2: #c8cfdd; --muted: #a3adc2;
    --accent: #9db7ff; --accent-2: #b9cbff; --on-accent: #0d1424; --signal: #ff8b7e; --brass: #d2b06e;
    --band: #19233a; --on-band: #eef1f7; --on-band-2: #c3cbe0;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 20px -10px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f131b; --surface: #161c27; --card: #1b2230; --drawer: #222a37; --drawer-2: #2a3342;
  --line: #34405a; --line-2: #283246; --rule: #2b3f5e;
  --ink: #e9edf4; --ink-2: #c8cfdd; --muted: #a3adc2;
  --accent: #9db7ff; --accent-2: #b9cbff; --on-accent: #0d1424; --signal: #ff8b7e; --brass: #d2b06e;
  --band: #19233a; --on-band: #eef1f7; --on-band-2: #c3cbe0;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 20px -10px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.6 var(--f-text); overflow-wrap: break-word; }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-2); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--f-text); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(30px, 4.2vw, 46px); }
h2 { font-size: clamp(23px, 2.4vw, 29px); }
h3 { font-size: 20px; }
p, ul, ol, dl { margin: 0 0 1em; }
.mono { font-family: var(--f-mono); font-weight: 700; letter-spacing: 0; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap > * { min-width: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); color: var(--ink); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
.small, small { font-size: .84em; }
code { font-family: var(--f-mono); font-size: .92em; }
.kicker { font: 700 13px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.kicker .dot { display: inline-block; width: 10px; height: 10px; background: var(--signal); border-radius: 2px; margin-right: 8px; vertical-align: -1px; }
.lede { font-size: 20px; line-height: 1.5; color: var(--ink-2); max-width: 36em; }
.meta { color: var(--muted); font-size: 15px; }
.cta { font-weight: 600; text-decoration: none; white-space: nowrap; }
.cta:hover { text-decoration: underline; }
.page-pad { padding-top: 18px; padding-bottom: 56px; }

/* ---------------------------------------------------------------- buttons + controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 20px; border-radius: var(--radius);
  font: 700 16px/1 var(--f-text); cursor: pointer; border: 1.5px solid transparent; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-2); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn:disabled { opacity: .6; cursor: progress; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .filter > label, .conv-tabs > label { font: 700 13px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.ctl { position: relative; display: flex; align-items: stretch; min-width: 0; }
.ctl input, .ctl select, .ctl textarea { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); font: 400 18px/1.3 var(--f-text); }
.ctl textarea { min-height: 84px; resize: vertical; font-family: var(--f-mono); font-weight: 700; font-size: 16px; }
.ctl input:focus, .ctl select:focus, .ctl textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 0; }
.ctl.has-unit input { padding-right: 4.6em; font-family: var(--f-mono); font-weight: 700; }
.ctl .unit { position: absolute; right: 1.5px; top: 1.5px; bottom: 1.5px; display: flex; align-items: center; padding: 0 10px; max-width: 45%;
  background: var(--surface); border-left: 1px solid var(--line); border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0;
  font: 700 13px/1.1 var(--f-mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.hint { font-size: 14px; color: var(--muted); margin: 0; }
.err { font-size: 14px; color: var(--signal); margin: 0; font-weight: 600; }
.field.invalid .ctl input, .field.invalid .ctl textarea { border-color: var(--signal); }

/* ---------------------------------------------------------------- header */
.site-head { background: var(--card); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.site-head::after { content: ""; display: block; height: 3px; background: var(--signal); opacity: .9; }
.head-row { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand:hover { color: var(--ink); }
.wordmark { font: 500 24px/1 var(--f-text); letter-spacing: -.02em; }
.wordmark b { font-weight: 800; color: var(--accent); }
.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 10px 12px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 16px; border-radius: 4px; }
.main-nav a:hover { color: var(--ink); background: var(--surface); }
.main-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--signal); border-radius: 0; }
.head-tools { display: flex; gap: 6px; align-items: center; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; justify-content: center; padding: 0 10px; background: transparent;
  border: 1.5px solid var(--line); border-radius: var(--radius); color: var(--ink); cursor: pointer; font: 600 15px/1 var(--f-text); }
.icon-btn:hover { border-color: var(--ink-2); }
.menu-toggle { display: none; }
.head-search { display: none; border-top: 1px solid var(--line-2); padding: 12px 0; background: var(--card); }
.head-search.open { display: block; }

/* ---------------------------------------------------------------- search */
form.search { position: relative; max-width: 640px; }
form.search > label { display: block; margin-bottom: 8px; font: 700 13px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); font: 400 18px/1.2 var(--f-text); }
.search-row input:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 0; }
.search-big .search-row input { min-height: 60px; font-size: 20px; border-width: 2px; border-color: var(--ink-2); }
.search-big .search-row .btn { min-height: 60px; padding: 0 26px; font-size: 18px; }
.sugg { position: absolute; left: 0; right: 0; top: 100%; margin-top: 6px; background: var(--card); border: 1.5px solid var(--ink-2); border-radius: var(--radius);
  box-shadow: var(--shadow); z-index: 30; max-height: 380px; overflow: auto; }
.sugg a, .sugg p { display: block; padding: 10px 14px; margin: 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.sugg a[aria-selected="true"], .sugg a:hover { background: var(--surface); box-shadow: inset 3px 0 0 var(--signal); }
.sugg .s-all { color: var(--accent); font-weight: 700; }
.sugg .s-load { color: var(--muted); }

/* ---------------------------------------------------------------- index card (shared) */
.icard { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); padding: 0 22px 18px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, color-mix(in srgb, var(--rule) 55%, transparent) 31px 32px);
  background-position: 0 64px; background-repeat: no-repeat; background-size: 100% calc(100% - 64px); }
.icard-tab { position: absolute; right: 22px; top: -30px; margin: 0; height: 30px; display: flex; align-items: center; padding: 0 14px; background: var(--card);
  border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; font: 700 12px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); }
.icard-head { display: flex; flex-direction: column; gap: 2px; padding: 14px 0 10px; border-bottom: 2px solid var(--signal); margin: 0 -22px 0; padding-left: 22px; padding-right: 22px; }
.icard-head h2 { font-size: 21px; margin: 0; }
.icard-head h2 a { color: var(--ink); text-decoration: none; }
.icard-head h2 a:hover { text-decoration: underline; }
.icard-no { font-size: 12px; color: var(--muted); letter-spacing: .05em; }
.icard-foot { margin: 12px 0 0; font-size: 16px; }

/* ---------------------------------------------------------------- calculator */
.calc { margin: 0; }
.calc-display { padding: 16px 0 6px; }
.calc-answer { display: flex; flex-direction: column; gap: 4px; }
.calc-k { font: 700 13px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.calc-v { font: 700 clamp(40px, 5vw, 56px)/1.05 var(--f-mono); color: var(--ink); letter-spacing: -.02em; display: inline-block; align-self: flex-start;
  padding-bottom: 4px; border-bottom: 4px double var(--signal); overflow-wrap: anywhere; }
.calc-v output { font: inherit; }
.calc-u { font-size: .42em; color: var(--ink-2); letter-spacing: 0; }
.calc-compact .calc-v { font-size: clamp(38px, 4.4vw, 50px); }
.calc-msg { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid var(--signal); background: var(--surface); font-size: 15px; }
.calc.is-err .calc-v { color: var(--muted); }
.calc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; margin: 16px 0 4px; border-top: 1px solid var(--line); }
.tile { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.tile dt { font-size: 14px; color: var(--muted); line-height: 1.3; }
.tile dd { margin: 2px 0 0; font: 700 21px/1.2 var(--f-mono); color: var(--ink); overflow-wrap: anywhere; }
.tile .tile-u { font-size: 13px; color: var(--muted); }
.tile dd.tile-c { font: 400 12px/1.2 var(--f-text); color: var(--muted); text-transform: none; }
.tile-in dd:not(.tile-c) { color: var(--ink-2); font-size: 18px; }
.calc-form { padding-top: 10px; }
.calc-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 16px; }
.field-wide { grid-column: 1 / -1; }
.calc-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.calc-chart { margin: 20px 0 0; padding-top: 14px; border-top: 1px dashed var(--line); }
.calc-chart.off { display: none; }
.calc-chart figcaption { font-weight: 700; margin-bottom: 6px; }
.calc-chart svg { display: block; width: 100%; height: auto; }
.calc-chart .gl { stroke: var(--line-2); stroke-width: 1; }
.calc-chart .ax { stroke: var(--ink-2); stroke-width: 1.2; }
.calc-chart .ln { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.calc-chart .pt { fill: var(--signal); stroke: var(--card); stroke-width: 2; }
.calc-chart text { fill: var(--muted); font: 700 11px var(--f-mono); }
.calc-chart .src { font-size: 14px; color: var(--muted); margin: 6px 0; }
.calc-chart details summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 15px; }
.chart-skel { height: 180px; background: linear-gradient(90deg, var(--surface), var(--line-2), var(--surface)); border-radius: 4px; opacity: .5; }
.calc-off { padding: 16px 18px; border: 1.5px dashed var(--signal); border-radius: var(--radius); background: var(--card); }
.kc-blocked .calc { display: none; }

/* ---------------------------------------------------------------- home: hero */
.hero { padding: 48px 0 56px; border-bottom: 1px solid var(--line); background:
  linear-gradient(to bottom, transparent, transparent), radial-gradient(1200px 380px at 85% 0%, color-mix(in srgb, var(--rule) 40%, transparent), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.hero-copy h1 { font-size: clamp(34px, 4.6vw, 54px); max-width: 12em; }
.hero-copy .lede { margin-bottom: 26px; }
.proof { display: flex; flex-wrap: wrap; gap: 0; margin: 28px 0 0; border-top: 1px solid var(--line); }
.proof > div { padding: 12px 22px 0 0; margin-right: 22px; border-right: 1px solid var(--line); }
.proof > div:last-child { border-right: 0; }
.proof dt { font-size: 14px; color: var(--muted); }
.proof dd { margin: 0; font-size: 24px; color: var(--ink); }
.hero-card { position: relative; padding-top: 34px; }
.card-stack span { position: absolute; left: 14px; right: 14px; top: 46px; bottom: -10px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; transform: rotate(2.2deg); opacity: .9; }
.card-stack span + span { left: 26px; right: 2px; top: 52px; bottom: -18px; transform: rotate(-1.4deg); opacity: .7; }
.hero-card .icard { z-index: 1; }

/* ---------------------------------------------------------------- bands */
.band { padding: 56px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.sec-head h2 { margin: 0; }
.band-cabinet { background: var(--surface); border-bottom: 1px solid var(--line); }
.cabinet { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; padding: 14px; background: var(--drawer-2); border-radius: 8px;
  border: 1px solid var(--line); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25); }
.drawer { position: relative; display: flex; flex-direction: column; background: var(--drawer); border: 1px solid var(--line); border-radius: 4px; padding: 14px 14px 12px;
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--drawer-2) 60%, transparent), 0 2px 0 rgba(24, 34, 58, .08); transition: transform .15s ease; min-width: 0; }
.drawer:hover { transform: translateY(-3px); }
.drawer-no { position: absolute; left: 12px; top: 8px; margin: 0; font-size: 12px; color: var(--muted); }
.drawer-plate { margin: 14px auto 0; width: 100%; max-width: 210px; padding: 8px 10px; background: var(--card); border: 2px solid var(--brass); border-radius: 3px;
  text-align: center; box-shadow: inset 0 0 0 2px var(--card), inset 0 0 0 3px color-mix(in srgb, var(--brass) 40%, transparent); }
.drawer-plate .drawer-h { font-size: 17px; margin: 0; line-height: 1.2; }
.drawer-plate a { color: var(--ink); text-decoration: none; }
.drawer-plate a:hover { color: var(--accent); text-decoration: underline; }
.drawer-pull { display: block; width: 56px; height: 9px; margin: 10px auto 12px; border-radius: 5px; background: var(--brass); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25); }
.drawer-glyph { margin: 0 0 4px; font-size: 14px; color: var(--accent); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-d { font-size: 15px; line-height: 1.4; color: var(--ink-2); margin: 0 0 10px; }
.drawer-s { list-style: none; margin: 0 0 10px; padding: 0; border-top: 1px dashed var(--line); }
.drawer-s li { display: flex; flex-direction: column; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 15px; line-height: 1.3; }
.drawer-s .mono { font-size: 13px; color: var(--signal); }
.drawer-n { margin: auto 0 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 15px; color: var(--muted); }
.drawer-img { width: 100%; height: 150px; object-fit: cover; object-position: top; border-radius: 3px; margin-bottom: 10px; border: 1px solid var(--line); }
.cabinet:not(.cabinet-home) { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.ranked { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow);
  border-top: 3px solid var(--signal); }
.ranked li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.ranked li:last-child { border-bottom: 0; }
.rk { color: var(--muted); font-size: 15px; }
.rk-t { display: flex; flex-direction: column; min-width: 0; }
.rk-t a { font-weight: 600; color: var(--ink); text-decoration: none; }
.rk-t a:hover { color: var(--accent); text-decoration: underline; }
.rk-c { font-size: 14px; color: var(--muted); }
.rk-n { color: var(--signal); font-size: 16px; text-align: right; white-space: nowrap; }
.newest h2 { font-size: 22px; }
.newest ul { list-style: none; padding: 0; margin: 0 0 22px; }
.newest li { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px solid var(--line); }
.newest time { font-size: 14px; color: var(--muted); }
.conv-promo { display: flex; flex-direction: column; gap: 4px; padding: 18px; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: 4px; }
.conv-promo:hover { color: var(--ink); border-color: var(--accent); }
.conv-promo .mono { color: var(--accent); font-size: 15px; }
.conv-promo strong { font-size: 20px; }
.conv-promo span:last-child { color: var(--ink-2); font-size: 15px; }

.band-ink { background: var(--band); color: var(--on-band); }
.band-ink h2 { color: var(--on-band); }
.band-ink .cta { color: var(--on-band); text-decoration: underline; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid rgba(255, 255, 255, .22); }
.steps li { display: flex; flex-direction: column; gap: 6px; padding: 18px 22px 0 0; }
.steps li + li { padding-left: 22px; border-left: 1px solid rgba(255, 255, 255, .16); }
.steps .mono { color: #ffb4aa; font-size: 15px; }
.steps strong { font-size: 19px; }
.steps span:last-child { color: var(--on-band-2); font-size: 16px; }

/* ---------------------------------------------------------------- footer */
.site-foot { background: var(--card); border-top: 1px solid var(--line); padding: 0 0 24px; }
.foot-rail { height: 3px; background: var(--signal); opacity: .9; margin-bottom: 40px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot-brand p { color: var(--ink-2); font-size: 16px; max-width: 26em; margin-top: 12px; }
.foot-col h2 { font: 700 13px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 10px; }
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { padding: 4px 0; font-size: 16px; }
.foot-col a { color: var(--ink); text-decoration: none; }
.foot-col a:hover { color: var(--accent); text-decoration: underline; }
.foot-base { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.foot-base p { font-size: 14px; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------- breadcrumbs + entry */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0 0 18px; padding: 0; font-size: 15px; }
.crumbs li { color: var(--muted); }
.crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--line); }
.crumbs a { color: var(--ink-2); }
.drawer-tab { display: inline-flex; margin: 0 0 12px; }
.drawer-tab a, .drawer-tab > span { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; background: var(--drawer); border: 1px solid var(--line); border-bottom: 2px solid var(--brass);
  border-radius: 5px 5px 0 0; font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; }
.drawer-tab .mono { font-size: 13px; color: var(--muted); }
.entry-head h1 { font-size: clamp(28px, 3.2vw, 38px); max-width: 26em; }
.entry-head { margin-bottom: 26px; }
.entry-grid { display: grid; grid-template-columns: minmax(0, 500px) minmax(0, 1fr); gap: 48px; align-items: start; }
.calc-col { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
.icard-main { padding-top: 6px; background-position: 0 0; background-size: 100% 100%; border-top: 3px solid var(--signal); }
.card-details { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 6px 18px; }
.card-details > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.card-details > div:last-child { border-bottom: 0; }
.card-details dt { color: var(--muted); font: 700 12px/1.6 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; }
.card-details dd { margin: 0; }
.entry { min-width: 0; }
.entry-body { max-width: 40em; }
.entry-body h2 { margin-top: 1.6em; padding-top: .4em; border-top: 1px solid var(--line); font-size: 25px; }
.entry-body h3 { margin-top: 1.4em; }
.entry-body ol, .entry-body ul { padding-left: 1.3em; }
.entry-body li { margin-bottom: .35em; }
.entry-body table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: 16px; display: block; overflow-x: auto; }
.entry-body th, .entry-body td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.entry-body img { border-radius: 4px; }
.formula-used { margin: 24px 0; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 0 16px; max-width: 40em; }
.formula-used summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.kc-spec-src { white-space: pre-wrap; overflow-x: auto; font: 700 14px/1.6 var(--f-mono); background: var(--surface); padding: 12px; border-radius: 4px; margin: 0 0 10px; }
pre.kc-spec { white-space: pre-wrap; font: 700 14px/1.6 var(--f-mono); background: var(--surface); padding: 12px; border-radius: 4px; }
.sources { font-size: 15px; color: var(--muted); max-width: 40em; }
.rel-cards { margin-top: 32px; max-width: 40em; }
.rel-cards h2 { font-size: 22px; }
.rel-cards ul, .rel { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.rel-cards li, .rel li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-top: 2px solid var(--signal); border-radius: 3px; font-size: 16px; }
.rel-cards .mono, .rel .mono { font-size: 14px; color: var(--signal); }

/* ---------------------------------------------------------------- hub */
.hub-head { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 40px; align-items: start; padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.hub-head h1 { font-size: clamp(30px, 3.8vw, 44px); }
.hub-img { width: 220px; height: auto; border-radius: 4px; border: 1px solid var(--line); box-shadow: var(--shadow); transform: rotate(1.5deg); }
.glyph-s { font-size: 18px !important; }
.hub-top h2, .hub-all h2 { font-size: 24px; }
.top-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 36px; }
.top-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--signal); border-radius: 4px;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.top-card:hover { color: var(--ink); border-color: var(--accent); }
.top-no { font-size: 12px; color: var(--muted); }
.top-t { font-size: 19px; font-weight: 700; line-height: 1.25; }
.top-k { font-size: 14px; color: var(--muted); margin-top: 6px; }
.top-n { font-size: 26px; color: var(--ink); border-bottom: 3px double var(--signal); align-self: flex-start; }
.top-n small { font-size: 14px; color: var(--muted); }
.top-x { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.filter { display: flex; flex-direction: column; gap: 6px; min-width: min(320px, 100%); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--card); }
table.list, table.conv-all { width: 100%; border-collapse: collapse; font-size: 16px; }
table.list th, table.conv-all th { text-align: left; font: 700 12px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 14px; border-bottom: 2px solid var(--signal); background: var(--card); }
table.list td, table.conv-all td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list a { font-weight: 600; }
.r { text-align: right !important; }
.num { font-family: var(--f-mono); font-weight: 700; color: var(--signal); white-space: nowrap; }
.num small { color: var(--muted); }
.empty { color: var(--muted); padding: 14px 0; }
.nav-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.page-numbers { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); text-decoration: none; }
.page-numbers.current { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ---------------------------------------------------------------- pages, A-Z, converter, forms */
.page-h { font-size: clamp(30px, 3.6vw, 42px); }
.page-art { max-width: 46em; }
.page-art.page-wide { max-width: none; }
.az-letters ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 26px; }
.az-letters a, .az-off { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 10px; font: 700 17px/1 var(--f-mono);
  background: var(--drawer); border: 1px solid var(--line); border-radius: 6px 6px 0 0; border-bottom: 2px solid var(--brass); color: var(--ink); text-decoration: none; }
.az-letters a:hover { background: var(--card); }
.az-letters a[aria-current="page"] { background: var(--card); border-bottom-color: var(--signal); color: var(--signal); }
.az-off { opacity: .45; }
.az-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.az-head h2 { margin: 0; font-size: 34px; }
.az-head h2 small { font: 400 16px var(--f-text); color: var(--muted); }
.conv { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--signal); border-radius: 4px; padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 28px; }
.conv-tabs { display: flex; flex-direction: column; gap: 6px; max-width: 320px; margin-bottom: 16px; }
.conv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto minmax(0, 1.4fr); gap: 14px; align-items: end; }
.conv-swap { min-height: 46px; }
.conv-out { margin: 22px 0 18px; }
.conv .tablewrap { margin-top: 8px; }
.conv-all caption { text-align: left; padding: 10px 14px; font-weight: 700; color: var(--ink-2); }
.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 40em; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--signal); border-radius: 4px; padding: 20px; }
.contact-form .calc-actions { grid-column: 1 / -1; margin: 0; }
.opt { text-transform: none; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.hp { position: absolute; left: -9999px; }
.form-status { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--surface); }
.form-status.bad { border-left-color: var(--signal); }
.search-page { margin: 18px 0 28px; }
.empty-box { padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; max-width: 44em; }
.inline-links { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 0; }
.rel-wide { max-width: 60em; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .cabinet-home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .main-nav a { padding: 10px 8px; font-size: 15px; }
}
@media (max-width: 960px) {
  .hero-grid, .two-col, .entry-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .calc-col { position: static; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li:nth-child(3) { padding-left: 0; border-left: 0; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-toggle { display: inline-flex; }
  .main-nav { position: absolute; left: 0; right: 0; top: 100%; display: none; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 8px 16px 14px; }
  .main-nav a { padding: 12px 6px; font-size: 18px; border-bottom: 1px solid var(--line-2); }
  .main-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--signal); padding-left: 14px; }
  .head-tools { margin-left: auto; }
  .site-head { position: relative; }
  .hub-head { grid-template-columns: minmax(0, 1fr) 150px; gap: 20px; }
  .hub-img { width: 150px; }
  .top-grid { grid-template-columns: minmax(0, 1fr); }
  .conv-row { grid-template-columns: minmax(0, 1fr); }
  .conv-swap { justify-self: start; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .head-row { min-height: 60px; gap: 10px; }
  .wordmark { font-size: 21px; }
  .brand .mark { width: 28px; height: 28px; }
  .menu-toggle span { display: none; }
  .hero { padding: 26px 0 40px; }
  .hero-copy h1 { font-size: 34px; }
  .lede { font-size: 18px; }
  .search-big .search-row input { min-height: 56px; font-size: 18px; }
  .search-big .search-row .btn { min-height: 56px; padding: 0 16px; }
  .proof dd { font-size: 20px; }
  .proof > div { padding-right: 14px; margin-right: 14px; }
  .hero-card { padding-top: 32px; }
  .icard { padding: 0 16px 14px; }
  .icard-head { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .icard-tab { right: 16px; }
  .band { padding: 40px 0; }
  .cabinet-home { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px; }
  .cabinet-home .drawer { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; }
  .cabinet-home .drawer:hover { transform: none; }
  .cabinet-home .drawer-no { position: static; font-size: 13px; }
  .cabinet-home .drawer-plate { margin: 0; max-width: none; text-align: left; padding: 6px 10px; }
  .cabinet-home .drawer-plate .drawer-h { font-size: 16px; }
  .cabinet-home .drawer-pull, .cabinet-home .drawer-glyph, .cabinet-home .drawer-d, .cabinet-home .drawer-s { display: none; }
  .cabinet-home .drawer-n { margin: 0; flex-direction: column; align-items: flex-end; gap: 0; font-size: 13px; }
  .ranked li { grid-template-columns: 30px minmax(0, 1fr); padding: 10px 14px; }
  .rk-n { grid-column: 2; text-align: left; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li, .steps li + li { padding: 14px 0 0; border-left: 0; }
  .foot-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .foot-brand { grid-column: 1 / -1; }
  .hub-head { grid-template-columns: minmax(0, 1fr); }
  .hub-img { display: none; }
  .calc-fields { grid-template-columns: minmax(0, 1fr); }
  .contact-form { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  table.list .hide-s { display: none; }
  .card-details > div { grid-template-columns: 84px minmax(0, 1fr); }
  .entry-head h1 { font-size: 28px; }
  .calc-v { font-size: 40px; }
}
@media (max-width: 380px) {
  .hero-copy h1 { font-size: 30px; }
  .hero-copy .lede { font-size: 17px; margin-bottom: 18px; }
  .proof { margin-top: 18px; }
  .hero { padding-top: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-head, .site-foot, .calc-form, .calc-chart, .rel-cards { display: none; } body { background: #fff; } }
.pin { margin: 28px 0; max-width: 40em; display: flex; gap: 16px; align-items: flex-end; }
.pin img { width: 180px; height: auto; border-radius: 4px; border: 1px solid var(--line); box-shadow: var(--shadow); transform: rotate(-1.2deg); }
.pin figcaption { font-size: 14px; color: var(--muted); max-width: 18em; }
.page-wide .entry-body { max-width: none; }
.entry-body table.list, .entry-body table.conv-all { display: table; margin: 0; }
.entry-body table.list td, .entry-body table.list th, .entry-body table.conv-all td, .entry-body table.conv-all th { border-left: 0; border-right: 0; border-top: 0; }

/* tap targets >= 44px on phones (critic R1 F4); keep each element's display */
.cta { display: inline-flex; align-items: center; min-height: 44px; }
summary { min-height: 44px; display: list-item; padding-top: 10px; padding-bottom: 10px; }
.brand { min-height: 44px; }
