/* Tempo Calculator — "Studio Transport". One stylesheet, no framework. Tokens: koray/design-system.md */

@font-face { font-family: "Manrope"; src: url("/fonts/manrope-latin.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  --bg: #FAF8F4;
  --surface: #FFFFFF;
  --surface-2: #F3F0E9;
  --ink: #16161A;
  --muted: #5A5A63;
  --line: #8A8A93;
  --hair: #E7E3DA;
  --accent: #E8590C;
  --accent-text: #B3470A;
  --hl: #FFF1E8;
  --inverse-bg: #16161A;
  --inverse-ink: #FAF8F4;
  --inverse-muted: #C9C6BE;
  --ok: #1B7A43;
  --error: #B42318;
  --btn-primary-bg: #16161A;
  --btn-primary-ink: #FAF8F4;
  --btn-accent-bg: #E8590C;
  --btn-accent-ink: #16161A;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --radius: 10px;
  --gutter: 16px;
  --max: 1200px;
  --read: 720px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111114; --surface: #1A1A1F; --surface-2: #222228; --ink: #EDEBE6; --muted: #A5A5AF; --line: #6E6E78;
    --hair: #2C2C33; --accent: #FF7A33; --accent-text: #FF8C4D; --hl: #2B1E16; --inverse-bg: #EDEBE6; --inverse-ink: #111114;
    --inverse-muted: #45454D; --ok: #4ACB84; --error: #FF6B5E; --btn-primary-bg: #FF7A33; --btn-primary-ink: #111114;
    --btn-accent-bg: #FF7A33; --btn-accent-ink: #111114; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111114; --surface: #1A1A1F; --surface-2: #222228; --ink: #EDEBE6; --muted: #A5A5AF; --line: #6E6E78;
  --hair: #2C2C33; --accent: #FF7A33; --accent-text: #FF8C4D; --hl: #2B1E16; --inverse-bg: #EDEBE6; --inverse-ink: #111114;
  --inverse-muted: #45454D; --ok: #4ACB84; --error: #FF6B5E; --btn-primary-bg: #FF7A33; --btn-primary-ink: #111114;
  --btn-accent-bg: #FF7A33; --btn-accent-ink: #111114; color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { max-width: 100%; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 700; }
h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0; }
.mono, code, kbd { font-family: var(--mono); font-variant-numeric: tabular-nums; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 0.9em; }
code { font-size: 0.92em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link { position: absolute; left: var(--s4); top: -60px; background: var(--inverse-bg); color: var(--inverse-ink); padding: var(--s3) var(--s4); border-radius: var(--radius); z-index: 100; }
.skip-link:focus { top: var(--s3); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--hair); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: var(--s4); flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: center; font: 600 18px/1 var(--mono); color: var(--ink); text-decoration: none; letter-spacing: -0.02em; margin: 0; }
.wordmark__dot { width: 8px; height: 8px; margin: 0 5px; border-radius: 50%; background: var(--accent); display: inline-block; }
.wordmark:hover { color: var(--ink); }
.nav-toggle { display: none; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); font: 700 15px var(--font); cursor: pointer; }
.site-nav { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--line); }
.site-nav a[aria-current] { border-bottom-color: var(--accent); }
.theme-toggle { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-sun { display: block; } :root:not([data-theme="light"]) .icon-moon { display: none; } }

@media (max-width: 859px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; width: 100%; padding: var(--s2) 0 var(--s4); flex-direction: column; align-items: stretch; }
  .js .site-nav[data-open] { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; width: 100%; }
  .site-nav li { border-top: 1px solid var(--hair); }
  .site-nav a { width: 100%; min-height: 48px; }
  .theme-toggle { align-self: flex-start; }
}

/* ---------- breadcrumbs ---------- */
.breadcrumbs ol { list-style: none; margin: 0; padding: var(--s4) 0 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); font-size: 14px; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: var(--s2); color: var(--line); }
.breadcrumbs a { color: var(--muted); display: inline-block; padding: 4px 0; }
.breadcrumbs a:hover { color: var(--ink); }

/* ---------- page head + beat line ---------- */
.main { padding-bottom: var(--s8); }
.page-head { display: flex; flex-direction: column; gap: var(--s4); padding-top: var(--s5); padding-bottom: var(--s5); }
.page-head--article { padding-left: 0; padding-right: 0; }
.kicker { font: 600 14px var(--mono); color: var(--accent-text); }
.lede { font-size: 19px; line-height: 1.6; max-width: 780px; }
.beatline { position: relative; height: 18px; width: 100%; max-width: 780px; }
.beatline__rule { position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: var(--ink); }
.beatline__tick { position: absolute; top: 4px; width: 2px; height: 10px; margin-left: -1px; background: var(--ink); }
.beatline__tick--bar { top: 0; height: 18px; }
.beatline__marker { position: absolute; top: 3px; left: 0; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--accent); animation: travel var(--bar-dur, 2s) linear infinite; }
@keyframes travel { from { left: 0%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .beatline__marker { animation: none; left: 0; } }

/* ---------- buttons, fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s5); border-radius: var(--radius); border: 1px solid transparent; font: 700 16px var(--font); text-decoration: none; cursor: pointer; text-align: center; }
.btn--primary { background: var(--btn-primary-bg); color: var(--btn-primary-ink); }
.btn--primary:hover { color: var(--btn-primary-ink); opacity: 0.92; }
.btn--accent { background: var(--btn-accent-bg); color: var(--btn-accent-ink); }
.btn--accent:hover { color: var(--btn-accent-ink); opacity: 0.92; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--xl { min-height: 64px; font-size: 18px; width: 100%; }
.btn--tap { min-height: 64px; width: 100%; background: var(--btn-primary-bg); color: var(--btn-primary-ink); font-size: 18px; }
.btn--tap .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.btn--tap.is-hit .dot { transform: scale(1.6); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.js [data-nojs-submit] { display: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field__hint { font-weight: 400; color: var(--muted); }
.field__help { font-size: 14px; color: var(--muted); }
.field__help--error { color: var(--error); font-weight: 600; }
.field__help--error::before { content: "⚠ "; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.field--check { flex-direction: row; align-items: center; gap: var(--s3); min-height: 44px; }
.field--check input { width: 22px; height: 22px; accent-color: var(--accent); }
.field--hp { position: absolute; left: -9999px; }
input[type="number"], input[type="text"], input[type="email"], select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px; font: 400 17px var(--font); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
input.mono, select.mono { font-family: var(--mono); }
textarea { padding: 12px 14px; line-height: 1.5; resize: vertical; }
input[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.input-xl { font-size: 22px; min-height: 56px; }
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }
input[type="file"] { font: 400 16px var(--font); max-width: 100%; }

/* ---------- panels + tool ---------- */
.panel { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); }
.tool { display: grid; gap: var(--s5); margin-bottom: var(--s6); }
.tool__controls { padding: var(--s5) var(--s4); display: flex; flex-direction: column; gap: var(--s4); align-self: start; }
.tool__results { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.tool__title { font-size: 20px; font-weight: 700; line-height: 1.25; }
.tool--secondary .tool__controls { background: var(--surface-2); }
.readout { display: flex; align-items: baseline; gap: var(--s3); margin: 0; }
.readout__num { font-size: clamp(64px, 16vw, 104px); line-height: 1; font-weight: 600; letter-spacing: -0.04em; }
.readout__unit { font-size: 20px; color: var(--muted); }
.steppers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.stepper { min-height: 48px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 16px; cursor: pointer; }
.stepper:hover { background: var(--inverse-bg); color: var(--inverse-ink); }
.privacy-line { display: flex; gap: var(--s2); align-items: flex-start; font-size: 14px; color: var(--muted); }
.privacy-line svg { flex: none; margin-top: 3px; }
.result-sentence { font-size: 18px; line-height: 1.55; }
.formula { font-size: 15px; background: var(--inverse-bg); color: var(--inverse-ink); padding: var(--s3) var(--s4); border-radius: var(--radius); overflow-wrap: anywhere; }
.big-result { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s1); }
.big-result__label, .stat__label { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.big-result__value { font-size: clamp(44px, 10vw, 72px); line-height: 1.05; font-weight: 600; letter-spacing: -0.03em; }
.big-result__sub, .stat__unit { color: var(--muted); font-size: 14px; }
.unit { font-size: 0.4em; color: var(--muted); letter-spacing: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.stat { padding: var(--s4); display: flex; flex-direction: column; gap: 2px; }
.stat__value { font-size: clamp(26px, 6vw, 34px); font-weight: 600; line-height: 1.15; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data { width: 100%; border-collapse: collapse; font-size: 15px; }
.data caption { text-align: left; padding: var(--s3) var(--s4); font: 700 15px var(--font); border-bottom: 1px solid var(--hair); }
.data th, .data td { padding: 11px var(--s3); border-bottom: 1px solid var(--hair); text-align: right; white-space: nowrap; }
.data thead th { font: 600 13px var(--font); color: var(--muted); }
.data th[scope="row"], .data thead th:first-child { text-align: left; font-family: var(--font); font-weight: 600; }
.data tbody tr:last-child th, .data tbody tr:last-child td { border-bottom: 0; }
.data .is-hl th, .data .is-hl td { background: var(--hl); }
.data td:not(.mono) { font-family: inherit; }
.data.mono td { font-family: var(--mono); }
.table-foot { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding: var(--s3) var(--s4); background: var(--surface-2); border-top: 1px solid var(--hair); font-size: 15px; border-radius: 0 0 var(--radius) var(--radius); }
.table-foot--muted { color: var(--muted); font-size: 14px; }
.copy { font: inherit; color: inherit; background: none; border: 0; padding: 6px 4px; min-height: 36px; cursor: pointer; border-radius: 6px; }
.copy:hover { background: var(--surface-2); }
.copy.is-copied { background: var(--hl); }

/* send chips */
.send { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.send__label { font-weight: 600; font-size: 15px; margin-right: var(--s1); }
.send ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s4); border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: 15px; text-decoration: none; }
.chip:hover { border-color: var(--ink); }

/* metronome */
.metro { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.metro__sig { font-size: 28px; font-weight: 600; }
.metro__beats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.metro__beat { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font: 600 15px var(--mono); }
.metro__beat.is-accent { border-color: var(--ink); }
.metro__beat.is-group { border-style: dashed; }
.metro__beat.is-on { background: var(--accent); border-color: var(--accent); color: var(--btn-accent-ink); }
.icon-stop { display: none; }
[aria-pressed="true"] .icon-stop { display: block; }
[aria-pressed="true"] .icon-play { display: none; }

/* bpm finder */
.tool--finder { grid-template-columns: 1fr; }
.finder-tap, .finder-file { padding: var(--s5) var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.tap-pad { width: 100%; min-height: 220px; border-radius: var(--radius); border: 0; background: var(--inverse-bg); color: var(--inverse-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); cursor: pointer; touch-action: manipulation; }
.tap-pad__bpm { font-size: clamp(56px, 14vw, 88px); font-weight: 600; line-height: 1; }
.tap-pad__label { font: 700 16px var(--font); text-transform: uppercase; letter-spacing: 0.12em; color: var(--inverse-muted); }
.tap-pad.is-hit { outline: 4px solid var(--accent); outline-offset: -4px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); margin: 0; }
.mini-stats div { background: var(--surface-2); border-radius: var(--radius); padding: var(--s3); }
.mini-stats dt { font-size: 13px; color: var(--muted); }
.mini-stats dd { margin: 0; font-size: 20px; font-weight: 600; }
.download { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.download audio { width: 100%; }

/* ---------- prose ---------- */
.prose > * + * { margin-top: var(--s4); }
.prose section { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s7); }
.prose section > * { margin: 0; }
.prose h3 { margin-top: var(--s3); }
.prose ul, .prose ol { padding-left: 22px; margin: 0; }
.prose li + li { margin-top: 6px; }
.prose blockquote { margin: 0; padding: var(--s3) var(--s4); border-left: 3px solid var(--accent); background: var(--surface); }
.prose .table-wrap { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); }
.prose table:not(.data) { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose table:not(.data) caption { text-align: left; padding: var(--s3) var(--s4); font-weight: 700; border-bottom: 1px solid var(--hair); }
.prose table:not(.data) th, .prose table:not(.data) td { padding: 11px var(--s3); border-bottom: 1px solid var(--hair); text-align: left; vertical-align: top; }
.prose table:not(.data) thead th { font-size: 13px; color: var(--muted); }
.prose table:not(.data) tbody tr:last-child > * { border-bottom: 0; }
.prose .formula { font-family: var(--mono); }
.note { padding: var(--s3) var(--s4); background: var(--surface-2); border-radius: var(--radius); font-size: 16px; }
.steps { counter-reset: step; list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: var(--s4); }
.steps > li { counter-increment: step; position: relative; padding: var(--s4) var(--s4) var(--s4) 64px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); margin: 0 !important; }
.steps > li::before { content: counter(step); position: absolute; left: var(--s4); top: var(--s4); width: 32px; height: 32px; border-radius: 50%; background: var(--inverse-bg); color: var(--inverse-ink); font: 600 15px/32px var(--mono); text-align: center; }
.steps > li h3 { margin: 0 0 6px; }
details { border-top: 1px solid var(--hair); padding: var(--s4) 0; }
details:last-of-type { border-bottom: 1px solid var(--hair); }
summary { cursor: pointer; font-weight: 700; font-size: 18px; list-style-position: outside; }
details > p { margin-top: var(--s2); }
.range-bar { position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); min-width: 120px; }
.range-bar > span { position: absolute; top: 0; height: 10px; border-radius: 999px; background: var(--accent); }
.link-list { list-style: none; padding: 0 !important; }
.link-list li { border-top: 1px solid var(--hair); }
.link-list a { display: block; padding: var(--s3) 0; font-weight: 600; }

/* answer box */
.answer { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s2); font-size: 18px; }
.answer__label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* article grid + rail */
.article-grid { display: grid; gap: var(--s6); }
.article { min-width: 0; max-width: var(--read); }
.rail { display: flex; flex-direction: column; gap: var(--s5); }
/* Below the two-column breakpoint the rail would sit after the article, where a page index is no use. */
@media (max-width: 1023px) { .rail { display: none; } }
.toc { border-left: 2px solid var(--ink); padding-left: var(--s4); }
.toc__h { font-weight: 700; margin-bottom: var(--s2); }
.toc ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.toc a { display: block; padding: 6px 0; font-size: 15px; }
.mini-tool { background: var(--inverse-bg); color: var(--inverse-ink); border-radius: var(--radius); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.mini-tool__label { font-size: 14px; color: var(--inverse-muted); }
.mini-tool__bpm { font-size: 48px; font-weight: 600; line-height: 1; }
.mini-tool__bpm .unit { color: var(--inverse-muted); }
.mini-tool__link { color: var(--inverse-ink); font-weight: 600; }
.mini-tool__link:hover { color: var(--inverse-muted); }

/* byline */
.byline { display: flex; gap: var(--s3); align-items: center; border-top: 1px solid var(--hair); margin-top: var(--s7); padding-top: var(--s4); font-size: 15px; }
.byline p { display: flex; flex-direction: column; gap: 2px; }
.byline__meta { color: var(--muted); }
.byline__avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--inverse-bg); color: var(--inverse-ink); display: inline-flex; align-items: center; justify-content: center; font: 600 15px var(--mono); }
.byline__avatar--lg { width: 72px; height: 72px; font-size: 22px; }

/* cards + indexes */
.related { margin-top: var(--s7); display: flex; flex-direction: column; gap: var(--s4); }
.card-grid { list-style: none; margin: 0; padding: 0 !important; display: grid; gap: var(--s3); }
.card-grid > li { margin: 0 !important; }
.card { height: 100%; display: flex; flex-direction: column; gap: 6px; padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.card:hover { border-color: var(--ink); color: var(--ink); }
.card__kicker { font: 600 13px var(--mono); color: var(--accent-text); }
.card__title { font-size: 19px; font-weight: 700; line-height: 1.3; }
.card__text { font-size: 15px; color: var(--muted); }
.filter { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pill { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 15px var(--font); cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--inverse-bg); color: var(--inverse-ink); border-color: var(--inverse-bg); }
.filter__status { font-size: 15px; color: var(--muted); margin: var(--s3) 0; }
.index-group { display: grid; gap: var(--s4); padding: var(--s6) 0; border-top: 2px solid var(--ink); }
.index-group__head p { color: var(--muted); margin-top: 6px; }
.index-list { list-style: none; margin: 0; padding: 0 !important; display: grid; gap: 0 var(--s5); }
.index-list li { border-top: 1px solid var(--hair); margin: 0 !important; }
.index-list a { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) 0; text-decoration: none; color: var(--ink); }
.index-list a:hover .index-list__title { color: var(--accent-text); }
.index-list__title { font-weight: 700; }
.index-list__text { font-size: 15px; color: var(--muted); }
.author-card { display: flex; gap: var(--s5); align-items: flex-start; padding: var(--s5); background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); margin-top: var(--s5) !important; }
.author-card > div { display: flex; flex-direction: column; gap: var(--s3); }
.author-card__role { color: var(--muted); font-weight: 600; }
.page-head--plain { padding-left: 0; padding-right: 0; }
.updated { color: var(--muted); font-size: 15px; }

/* forms + notices */
.form { display: flex; flex-direction: column; gap: var(--s4); max-width: 560px; }
.form__trust { font-size: 14px; color: var(--muted); }
.notice { padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--surface-2); }
.notice--ok { border-left: 4px solid var(--ok); }
.notice--error { border-left: 4px solid var(--error); }

/* ads (only rendered when enabled) */
.ad-slot { margin: var(--s6) auto; text-align: center; }
.ad-slot--wide { min-height: 120px; }
.ad-slot--rail { min-height: 280px; }
.ad-slot__label { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s1); }

/* reference section on tools */
.reference { margin: var(--s6) 0; display: flex; flex-direction: column; gap: var(--s3); }

/* ---------- footer ---------- */
.site-footer { background: var(--inverse-bg); color: var(--inverse-ink); padding: var(--s7) 0 var(--s5); margin-top: var(--s8); }
.site-footer a { color: var(--inverse-ink); }
.site-footer a:hover { color: var(--inverse-muted); }
.site-footer__grid { display: grid; gap: var(--s6); }
.site-footer__brand p:last-child { color: var(--inverse-muted); margin-top: var(--s3); font-size: 15px; max-width: 320px; }
.wordmark--footer { color: var(--inverse-ink); }
.site-footer__h { font-weight: 700; margin-bottom: var(--s2); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a { display: inline-block; padding: 6px 0; font-size: 15px; }
.site-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--inverse-muted); font-size: 14px; color: var(--inverse-muted); }
.site-footer__legal ul { display: flex; flex-wrap: wrap; gap: 0 var(--s4); }

/* ---------- breakpoints ---------- */
@media (min-width: 560px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  :root { --gutter: 24px; }
  .tool { grid-template-columns: minmax(300px, 5fr) 7fr; align-items: start; }
  .tool--finder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index-group { grid-template-columns: 4fr 8fr; }
  .index-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { padding-top: var(--s6); }
  .data { font-size: 16px; }
  .data th, .data td { padding: 12px var(--s4); }
}
@media (min-width: 860px) {
  .site-header__inner { min-height: 64px; flex-wrap: nowrap; }
  .wordmark { font-size: 20px; }
}
@media (min-width: 1024px) {
  :root { --gutter: 32px; }
  .article-grid { grid-template-columns: minmax(0, 8fr) minmax(280px, 4fr); gap: var(--s7); }
  .rail { position: sticky; top: 88px; align-self: start; padding-top: var(--s6); }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-footer__grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
  .tool__controls { padding: var(--s6); }
}

@media print {
  .site-header, .site-footer, .rail, .send, .ad-slot, .beatline, .btn, .steppers { display: none !important; }
  body { background: #fff; color: #000; }
}

/* small-screen table density */
.prose td.mono, .data td { white-space: nowrap; }
@media (max-width: 559px) {
  .data { font-size: 14px; }
  .data th, .data td { padding: 10px 8px; }
  .data caption { padding: 10px 8px; }
  .col-hz { display: none; }
  .prose table:not(.data) th, .prose table:not(.data) td { padding: 10px 8px; font-size: 15px; }
}

/* quick calculator on guides and hubs */
.mini-calc { background: var(--inverse-bg); color: var(--inverse-ink); border-radius: var(--radius); padding: var(--s5) var(--s4); display: flex; flex-direction: column; gap: var(--s4); margin: var(--s2) 0 0; }
.mini-calc__label { font-size: 14px; color: var(--inverse-muted); font-weight: 600; }
.mini-calc__row { display: grid; gap: var(--s4); }
.mini-calc .field label { color: var(--inverse-ink); }
.mini-calc input { background: var(--inverse-ink); color: var(--inverse-bg); border-color: var(--inverse-muted); font-size: 22px; min-height: 52px; }
.mini-calc__out { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.mini-calc__out div { border: 1px solid var(--inverse-muted); border-radius: var(--radius); padding: var(--s2) var(--s3); }
.mini-calc__out dt { font-size: 13px; color: var(--inverse-muted); }
.mini-calc__out dd { margin: 0; font-size: 17px; font-weight: 600; white-space: nowrap; }
.mini-calc__actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.mini-calc .btn--primary { background: var(--accent); color: #16161A; }
.mini-calc .btn--ghost { color: var(--inverse-ink); border-color: var(--inverse-muted); }
.mini-calc .btn--ghost:hover { color: var(--inverse-ink); border-color: var(--inverse-ink); }
.container--mini .mini-calc { max-width: 780px; }
@media (min-width: 768px) {
  .mini-calc__row { grid-template-columns: 200px 1fr; align-items: end; }
  .mini-calc__out { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
