/* Skeinote design tokens. The single source for both the interactive app and generated pages.
   Everything visual derives from these; components never hard-code a colour or size. */

@font-face {
  font-family: 'Fraunces Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/fraunces-latin-full-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Fraunces Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/fraunces-latin-full-italic.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Nunito Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url('/fonts/nunito-sans-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Nunito Sans Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 200 1000;
  src: url('/fonts/nunito-sans-latin-wght-italic.woff2') format('woff2-variations');
}

:root {
  /* Surfaces: linen table, paper label, oat trim */
  --linen: #F5EFE6;
  --linen-deep: #ECE3D6;
  --paper: #FFFCF7;
  --oat: #E9DFD0;
  --oat-deep: #D9CCB8;

  /* Ink: walnut, never black */
  --ink: #3B2F28;
  --ink-soft: #5E5047;
  --ink-mute: #8A7B70;
  --ink-faint: #B3A597;

  /* Accents: madder (the rust skein), ochre (caution), moss (quiet second accent) */
  /* Accent trial 2026-09-22: matched to the icon's coral (#EE5053), deepened to #C33338 so links
     and white-on-accent buttons pass 4.5:1 on paper and linen. Previous madder: #9E4A2B / #7E3A21 / #F3E4DC. */
  --madder: #C33338;
  --madder-deep: #A3282D;
  --madder-wash: #FBE4E4;
  --ochre: #B48A2F;
  --ochre-wash: #F5EBD2;
  --moss: #6B7752;
  --moss-wash: #E7EAD9;

  /* Result statuses. Deliberately no green: the site never says "compatible". */
  --status-computed-ink: var(--ink);
  --status-computed-bg: var(--oat);
  --status-caution-ink: #6E5314;
  --status-caution-bg: var(--ochre-wash);
  --status-stop-ink: var(--madder-deep);
  --status-stop-bg: var(--madder-wash);

  /* Type */
  --display: 'Fraunces Variable', 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Nunito Sans Variable', 'Nunito Sans', 'Segoe UI', system-ui, sans-serif;
  --display-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 96;

  --fs-0: 0.8125rem;   /* 13 small print, dates */
  --fs-1: 0.9375rem;   /* 15 UI, captions */
  --fs-2: 1.0625rem;   /* 17 body */
  --fs-3: 1.25rem;     /* 20 lead */
  --fs-4: 1.5rem;      /* 24 h3 */
  --fs-5: 2rem;        /* 32 h2 */
  --fs-6: 2.75rem;     /* 44 h1 */
  --fs-7: 3.75rem;     /* 60 result figure */

  --lh-tight: 1.08;
  --lh-snug: 1.25;
  --lh-body: 1.6;

  /* Space, 4px base */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;

  /* Shape. Labels are cut with rounded corners; controls are pill-ish but not bubbles. */
  --r-tag: 3px;
  --r-control: 10px;
  --r-label: 14px;

  /* Rules */
  --rule: var(--oat-deep);
  --rule-soft: var(--oat);

  /* Layout */
  --measure: 64ch;
  --content: 1080px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Skeinote components. Consumes tokens.css only. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--fs-2);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--madder); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--madder-deep); }
:focus-visible { outline: 2px solid var(--madder); outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--display); font-variation-settings: var(--display-settings); font-weight: 500; letter-spacing: -0.01em; margin: 0; color: var(--ink); }
h1 { font-size: var(--fs-6); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-5); line-height: 1.15; }
h3 { font-size: var(--fs-4); line-height: var(--lh-snug); }
p { margin: 0; }
p + p { margin-top: 1em; }
.wrap { width: min(100% - 2 * var(--gutter), var(--content)); margin-inline: auto; }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: var(--fs-0); color: var(--ink-mute); }
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* Masthead: paper strip on linen, mark plus name in Fraunces */
.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); }
.masthead-inner { width: min(100% - 2 * var(--gutter), var(--content)); margin-inline: auto; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); position: relative; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-variation-settings: var(--display-settings); font-weight: 600; font-size: 1.35rem; letter-spacing: -0.01em; }
.wordmark img { width: 28px; height: 28px; }
.wordmark:hover { color: var(--ink); }
.nav { display: flex; gap: var(--s-5); font-size: var(--fs-1); }
.nav a { color: var(--ink-soft); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current='page'] { color: var(--ink); border-bottom-color: var(--madder); }
.nav-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--rule); border-radius: var(--r-control); background: var(--paper); cursor: pointer; align-items: center; justify-content: center; flex-direction: column; gap: 4px; }
.nav-toggle span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }

/* Footer: linen deep, quiet */
.footer { background: var(--linen-deep); border-top: 1px solid var(--rule); margin-top: var(--s-8); }
.footer-inner { width: min(100% - 2 * var(--gutter), var(--content)); margin-inline: auto; padding: var(--s-6) 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-4) var(--s-6); font-size: var(--fs-1); color: var(--ink-soft); }
.footer-brand { display: flex; flex-direction: column; gap: 2px; }
.footer-brand strong { font-family: var(--display); font-variation-settings: var(--display-settings); font-weight: 600; font-size: 1.1rem; color: var(--ink); }
.footer-nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.footer-nav a { color: var(--ink-soft); text-decoration: none; }
.footer-nav a:hover { color: var(--ink); text-decoration: underline; }

/* Buttons */
.btn { font: inherit; font-family: var(--body); font-weight: 700; font-size: var(--fs-1); border-radius: var(--r-control); padding: 12px 18px; cursor: pointer; border: 1px solid transparent; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; line-height: 1.2; }
.btn-primary { background: var(--madder); color: var(--paper); }
.btn-primary:hover { background: var(--madder-deep); color: var(--paper); }
.btn-quiet { background: var(--paper); color: var(--ink); border-color: var(--rule); }
.btn-quiet:hover { border-color: var(--ink-faint); color: var(--ink); }
.btn-block { width: 100%; justify-content: center; min-height: 50px; font-size: var(--fs-2); }
.btn-text { background: none; border: 0; padding: 0; color: var(--madder); text-decoration: underline; text-underline-offset: 0.18em; font-weight: 600; cursor: pointer; font: inherit; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .field-name { font-size: var(--fs-1); font-weight: 700; color: var(--ink-soft); }
.field-hint { font-size: var(--fs-0); color: var(--ink-mute); }
.select { position: relative; }
.select select { width: 100%; appearance: none; font: inherit; font-size: var(--fs-2); color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-control); padding: 12px 40px 12px 14px; min-height: 50px; cursor: pointer; }
.select select:disabled { color: var(--ink-faint); background: var(--linen); cursor: default; }
.select::after { content: ''; position: absolute; right: 16px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--ink-mute); border-bottom: 2px solid var(--ink-mute); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.input { width: 100%; font: inherit; font-size: var(--fs-2); color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-control); padding: 12px 14px; min-height: 50px; }
.input.num { font-family: var(--display); font-variation-settings: var(--display-settings); font-size: 1.35rem; }
.quantity { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2); }
.unit-toggle { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r-control); background: var(--paper); overflow: hidden; }
.unit-toggle label { padding: 0 14px; min-height: 50px; display: inline-flex; align-items: center; font-size: var(--fs-1); font-weight: 700; color: var(--ink-mute); cursor: pointer; position: relative; }
.unit-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.unit-toggle label.is-on { background: var(--ink); color: var(--paper); }
.unit-toggle label:has(input:focus-visible) { outline: 2px solid var(--madder); outline-offset: -2px; }
.segmented-note { font-size: var(--fs-0); color: var(--ink-mute); }

/* Hero */
.hero { padding: var(--s-7) 0 var(--s-6); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: var(--s-7); align-items: start; }
.hero h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); max-width: 14ch; }
.hero h1 em { font-style: italic; font-weight: 400; }
.hero-lead { margin-top: var(--s-4); font-size: var(--fs-3); color: var(--ink-soft); max-width: 42ch; line-height: 1.5; }
.hero-note { margin-top: var(--s-5); font-size: var(--fs-1); color: var(--ink-mute); max-width: 44ch; }
.hero-note a { color: var(--ink-soft); }
.hero-photo { margin: var(--s-6) 0 0; max-width: 460px; }
.hero-photo img { border-radius: var(--r-label); aspect-ratio: 5 / 4; object-fit: cover; }
.hero-photo figcaption { margin-top: var(--s-2); font-size: var(--fs-0); color: var(--ink-mute); font-style: italic; }

/* The tool card, set like a paper band with a cut top edge */
.tool { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-label); padding: var(--s-5); position: relative; }
.tool::before { content: ''; position: absolute; left: 22px; right: 22px; top: -1px; height: 4px; background: var(--madder); border-radius: 0 0 4px 4px; }
.tool-title { font-family: var(--display); font-variation-settings: var(--display-settings); font-size: var(--fs-4); font-weight: 500; margin-bottom: var(--s-4); }
.tool-stack { display: grid; gap: var(--s-4); }
.tool-group { display: grid; gap: var(--s-3); padding: var(--s-4); background: var(--linen); border-radius: var(--r-control); }
.tool-group-title { font-size: var(--fs-1); font-weight: 800; color: var(--ink); }
.tool-arrow { justify-self: center; color: var(--ink-faint); font-family: var(--display); font-size: 1.4rem; line-height: 1; }
.tool-foot { font-size: var(--fs-0); color: var(--ink-mute); text-align: center; margin-top: var(--s-2); }

/* Result label: the memorable element. A paper label with a perforated top edge. */
.label { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-label); padding: var(--s-5) var(--s-5) var(--s-4); position: relative; margin-top: var(--s-5); }
.label::before { content: ''; position: absolute; left: 18px; right: 18px; top: 10px; border-top: 2px dashed var(--oat-deep); }
.label-head { display: flex; flex-wrap: wrap; gap: var(--s-2); padding-top: var(--s-3); margin-bottom: var(--s-4); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--r-tag); font-size: var(--fs-1); font-weight: 700; line-height: 1.2; }
.chip::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.chip-computed { background: var(--status-computed-bg); color: var(--status-computed-ink); }
.chip-caution { background: var(--status-caution-bg); color: var(--status-caution-ink); }
.chip-stop { background: var(--status-stop-bg); color: var(--status-stop-ink); }
.chip-quiet { background: var(--linen); color: var(--ink-mute); }
.equation { font-family: var(--display); font-variation-settings: var(--display-settings); font-weight: 400; font-size: clamp(1.35rem, 3vw, 1.75rem); line-height: 1.3; color: var(--ink-soft); }
.equation .final { font-weight: 700; color: var(--ink); font-size: clamp(2.5rem, 6vw, var(--fs-7)); line-height: 1; display: block; margin-top: 6px; }
.equation .final small { font-size: 0.42em; font-weight: 500; color: var(--ink-soft); margin-left: 6px; }
.equation .raw { color: var(--ink-mute); }
.label-title { font-family: var(--display); font-variation-settings: var(--display-settings); font-size: var(--fs-4); font-weight: 500; line-height: var(--lh-snug); }
.label-body { color: var(--ink-soft); margin-top: var(--s-2); max-width: 52ch; }
.label-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--rule-soft); }
.fact-col h4 { font-family: var(--body); font-size: var(--fs-1); font-weight: 800; margin-bottom: var(--s-2); }
.fact-col h4 span { font-weight: 500; color: var(--ink-mute); }
.facts { list-style: none; margin: 0; padding: 0; font-size: var(--fs-1); }
.facts li { display: flex; align-items: baseline; gap: 6px; padding: 4px 0; }
.facts .k { color: var(--ink-mute); flex: none; }
.facts .dots { flex: 1; border-bottom: 1px dotted var(--ink-faint); transform: translateY(-4px); min-width: 12px; }
.facts .v { color: var(--ink); font-weight: 600; text-align: right; }
.facts .v.missing { color: var(--ink-mute); font-weight: 500; font-style: italic; }
.label-limits { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); background: var(--linen); border-radius: var(--r-control); font-size: var(--fs-1); color: var(--ink-soft); }
.label-sources { margin-top: var(--s-4); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); font-size: var(--fs-0); color: var(--ink-mute); align-items: center; }
.label-sources a { color: var(--madder); }
.label-actions { margin-top: var(--s-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.copied { font-size: var(--fs-1); color: var(--moss); font-weight: 700; }

/* Section rhythm */
.section { padding: var(--s-7) 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-4); }
.section-head p { color: var(--ink-soft); }
.section-head a { font-size: var(--fs-1); }

/* Guide cards: a photo with a paper caption strip, not a boxed card */
.guides { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
.guide { text-decoration: none; color: inherit; display: grid; gap: var(--s-3); }
.guide img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-control); }
.guide h3 { font-size: var(--fs-3); }
.guide:hover h3 { color: var(--madder); }
.guide p { font-size: var(--fs-1); color: var(--ink-soft); }
.guide .meta { font-size: var(--fs-0); color: var(--ink-mute); }

/* Directory: rows on paper, like tags on a shelf */
.page-head { padding: var(--s-7) 0 var(--s-5); }
.page-head p { margin-top: var(--s-3); font-size: var(--fs-3); color: var(--ink-soft); max-width: 52ch; line-height: 1.5; }
.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-4) 0 var(--s-5); }
.pill { font: inherit; font-size: var(--fs-1); font-weight: 700; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink-soft); cursor: pointer; }
.pill.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.maker { margin-top: var(--s-6); }
.maker h2 { font-size: var(--fs-4); margin-bottom: var(--s-3); }
.rows { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-label); overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: 14px var(--s-5); border-top: 1px solid var(--rule-soft); text-decoration: none; color: inherit; }
.rows li:first-child .row { border-top: 0; }
.row:hover { background: var(--linen); }
.row .name { font-family: var(--display); font-variation-settings: var(--display-settings); font-size: var(--fs-3); font-weight: 500; }
.row .name small { display: block; font-family: var(--body); font-size: var(--fs-0); color: var(--ink-mute); font-weight: 500; margin-top: 2px; }
.row .cell { font-size: var(--fs-1); color: var(--ink-soft); }
.row .cell b { color: var(--ink); font-weight: 700; }
.row .date { font-size: var(--fs-0); color: var(--ink-mute); white-space: nowrap; }
.tag { display: inline-block; padding: 3px 8px; border-radius: var(--r-tag); background: var(--oat); color: var(--ink-soft); font-size: var(--fs-0); font-weight: 700; }

/* Record page */
.record-head { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-6); align-items: start; padding: var(--s-7) 0 var(--s-5); }
.record-head img { border-radius: var(--r-label); aspect-ratio: 4 / 3; object-fit: cover; }
.record-head .caption { font-size: var(--fs-0); color: var(--ink-mute); font-style: italic; margin-top: var(--s-2); }
.lines { display: grid; gap: var(--s-4); }
.line { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-label); padding: var(--s-5); position: relative; }
.line::before { content: ''; position: absolute; left: 18px; right: 18px; top: 8px; border-top: 2px dashed var(--oat-deep); }
.line h3 { padding-top: var(--s-2); }
.line .facts { margin-top: var(--s-3); max-width: 46ch; }
.line-foot { margin-top: var(--s-3); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); align-items: center; font-size: var(--fs-0); color: var(--ink-mute); }
.notice { background: var(--ochre-wash); color: var(--status-caution-ink); border-radius: var(--r-control); padding: var(--s-3) var(--s-4); font-size: var(--fs-1); }
.notice-stop { background: var(--madder-wash); color: var(--status-stop-ink); }

/* Archive */
.archive-lead { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s-6); align-items: center; text-decoration: none; color: inherit; margin-bottom: var(--s-7); }
.archive-lead img { border-radius: var(--r-label); aspect-ratio: 3 / 2; object-fit: cover; }
.archive-lead h2 { font-size: var(--fs-5); }
.archive-lead p { margin-top: var(--s-3); color: var(--ink-soft); }
.archive-lead:hover h2 { color: var(--madder); }

/* Article */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--s-7); padding-top: var(--s-7); align-items: start; }
.article-body { max-width: var(--measure); }
.crumb { font-size: var(--fs-1); color: var(--ink-mute); margin-bottom: var(--s-4); }
.crumb a { color: var(--ink-soft); text-decoration: none; }
.article h1 { font-size: clamp(2rem, 4.5vw, 3rem); max-width: 18ch; }
.dek { margin-top: var(--s-4); font-size: var(--fs-3); color: var(--ink-soft); line-height: 1.5; }
.byline { margin-top: var(--s-4); font-size: var(--fs-0); color: var(--ink-mute); }
.article figure { margin: var(--s-6) 0; }
.article figure img { border-radius: var(--r-label); }
.article figcaption { margin-top: var(--s-2); font-size: var(--fs-0); color: var(--ink-mute); font-style: italic; }
.prose { font-size: var(--fs-2); line-height: 1.7; }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 2em; font-size: var(--fs-5); }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-1); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-control); overflow: hidden; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--rule-soft); vertical-align: top; }
.prose thead th { border-top: 0; background: var(--oat); font-size: var(--fs-0); font-weight: 800; color: var(--ink-soft); }
.prose td.num, .prose th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.callout { background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--madder); border-radius: var(--r-control); padding: var(--s-4) var(--s-5); }
.callout .title { font-weight: 800; font-size: var(--fs-1); margin-bottom: 4px; }
.worked { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-label); padding: var(--s-5); position: relative; }
.worked::before { content: ''; position: absolute; left: 18px; right: 18px; top: 8px; border-top: 2px dashed var(--oat-deep); }
.worked .equation { margin-top: var(--s-2); }
.rail { position: sticky; top: var(--s-4); display: grid; gap: var(--s-4); }
.rail-card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-label); padding: var(--s-4) var(--s-5); font-size: var(--fs-1); }
.rail-card h3 { font-family: var(--body); font-size: var(--fs-1); font-weight: 800; margin-bottom: var(--s-2); }
.rail-card ol, .rail-card ul { margin: 0; padding-left: 1.2em; }
.rail-card li + li { margin-top: 6px; }
.sources { margin-top: var(--s-6); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-label); padding: var(--s-4) var(--s-5); font-size: var(--fs-1); }
.sources h2 { font-family: var(--body); font-size: var(--fs-1); font-weight: 800; margin-bottom: var(--s-2); }
.sources ul { margin: 0; padding-left: 1.2em; }
.sources .checked { margin-top: var(--s-2); color: var(--ink-mute); font-size: var(--fs-0); }
.try { margin-top: var(--s-6); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); background: var(--oat); border-radius: var(--r-label); padding: var(--s-4) var(--s-5); }
.try p { font-weight: 700; }
.related { margin-top: var(--s-6); }
.related h2 { font-size: var(--fs-4); margin-bottom: var(--s-3); }
.related-list { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.related-list a { text-decoration: none; color: inherit; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-control); padding: var(--s-4); }
.related-list a:hover { border-color: var(--ink-faint); }
.related-list .t { font-family: var(--display); font-variation-settings: var(--display-settings); font-size: var(--fs-3); }
.related-list .m { display: block; margin-top: 4px; font-size: var(--fs-0); color: var(--ink-mute); }

/* Legal shell */
.legal { max-width: var(--measure); padding-top: var(--s-7); }
.legal h1 { margin-bottom: var(--s-3); }
.legal .updated { font-size: var(--fs-0); color: var(--ink-mute); margin-bottom: var(--s-5); }
.legal h2 { font-size: var(--fs-4); margin-top: 2em; }
.legal p, .legal li { color: var(--ink-soft); }

/* Ad placement annotations. Design-only: shown with ?ads=1, never in production. */
.adnote { display: none; border: 1.5px dashed var(--ink-faint); border-radius: var(--r-control); color: var(--ink-mute); font-size: var(--fs-0); font-weight: 700; align-items: center; justify-content: center; text-align: center; padding: var(--s-2); }
body.show-ads .adnote { display: flex; }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid, .record-head, .article, .archive-lead { grid-template-columns: 1fr; }
  .rail { position: static; }
  .guides { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; }
  .row .cell:nth-child(3) { display: none; }
}
@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 10; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--rule); padding: var(--s-2) 0 var(--s-3); }
  .nav[data-open='true'] { display: flex; }
  .nav a { padding: 12px var(--gutter); font-size: var(--fs-2); border-bottom: 0; }
  .nav a[aria-current='page'] { color: var(--madder); }
  .hero { padding-top: var(--s-6); }
  .hero-grid { gap: var(--s-5); }
  .hero-grid > div:first-child { display: contents; }
  .hero-lead { margin-top: 0; }
  .hero-note { margin-top: 0; }
  .hero-photo { order: 3; max-width: none; margin-top: var(--s-5); }
  .guides { grid-template-columns: 1fr; }
  .label-facts { grid-template-columns: 1fr; gap: var(--s-4); }
  .quantity { grid-template-columns: 1fr; }
  .unit-toggle { display: flex; }
  .unit-toggle label { flex: 1; justify-content: center; }
  .row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px var(--s-4); }
  .row .cell:nth-child(2) { grid-column: 1 / -1; }
  .related-list { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
}
