/* focusstacks.com — product layer. The catalogue layer (block styles) is
   emitted above this by build.mjs. Direction A, "Darkroom" (UI round 1.5,
   2026-09-15): a deep darkroom green ground with film grain, warm paper ink,
   one amber accent for the thing you press and one mint for anything measured;
   display serif for headings, system sans for UI, mono for numbers. */

:root {
  --bg: #0f1f18;
  --bg-deep: #0a1611;
  --bg-card: rgba(244, 239, 228, 0.06);
  --bg-card-solid: #16281f;
  --bg-input: #0c1a14;
  --ink: #f4efe4;
  --ink-soft: #c9c2b2;
  --ink-mute: #8f9a92;
  --line: rgba(244, 239, 228, 0.14);
  --line-strong: rgba(244, 239, 228, 0.42);
  --accent: #9ed8b5;
  --accent-2: #c2ebd2;
  --amber: #e8b84a;
  --amber-ink: #0f1f18;
  --danger: #ff9a8f;
  --ok: #9ed8b5;
  --display: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 12px;
  --adslot-h-D: 280px;
  --adslot-h-R: 250px;
  --adslot-h-A: 50px;
  /* The catalogue layer names two tokens this site spells differently. */
  --panel: #16281f;
  --ink-muted: #8f9a92;
  --grain: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch' seed='7'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 0.16'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

/* hidden-guard: the attribute wins over every display rule below. */
[hidden] { display: none !important; }

@layer base {
  *, *::before, *::after { box-sizing: border-box; }
  html { font-family: var(--ui); font-size: 106.25%; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; }
  /* The darkroom ground: two soft lamps and a film grain, fixed so long pages do not tile it. */
  body { background: radial-gradient(120% 70% at 85% -10%, rgba(232, 184, 74, 0.14), transparent 60%), radial-gradient(80% 60% at -10% 100%, rgba(47, 138, 95, 0.22), transparent 60%), var(--bg); }
  body::before { content: ""; position: fixed; inset: 0; background-image: var(--grain); background-size: 200px; opacity: 0.5; mix-blend-mode: overlay; pointer-events: none; z-index: 0; }
  body > * { position: relative; z-index: 1; }
  body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
  main { flex: 1 0 auto; }
  h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
  h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); }
  h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 2rem); }
  h3 { font-size: 1.2rem; }
  p { margin: 0 0 1em; }
  a { color: var(--accent); text-underline-offset: 0.15em; }
  a:hover { color: var(--accent-2); }
  code, kbd, .figure, .mono { font-family: var(--mono); font-size: 0.92em; }
  code { overflow-wrap: anywhere; }
  kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 0.35em; background: var(--bg-input); }
  img, svg, canvas { max-width: 100%; height: auto; }
  :focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
  .eyebrow { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.6em; }
  .lead { font-size: 1.15rem; color: var(--ink-soft); }
  .wrap, .wrap-narrow { width: min(100% - 2rem, 72rem); margin-inline: auto; }
  .wrap-narrow { width: min(100% - 2rem, 48rem); }
}

@layer product {
  /* ---- shell */
  .skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--amber); color: var(--amber-ink); padding: 0.6rem 1rem; border-radius: 8px; z-index: 20; }
  .skip-link:focus { top: 1rem; }
  .site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); background: rgba(15, 31, 24, 0.7); backdrop-filter: blur(8px); }
  .site-header .brand { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--display); font-size: 1.25rem; color: var(--ink); text-decoration: none; min-block-size: 44px; white-space: nowrap; }
  .site-header .brand svg { flex: none; width: 30px; height: 30px; }
  .site-header nav { display: flex; gap: 0.25rem; flex-wrap: wrap; justify-content: flex-end; }
  .site-header nav a { min-block-size: 44px; display: inline-flex; align-items: center; padding: 0 0.7rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 0.95rem; }
  .site-header nav a:hover { background: var(--bg-card); color: var(--amber); }
  footer { border-top: 1px solid var(--line); background: var(--bg-deep); padding: 2rem 1rem 1.5rem; margin-top: 3rem; display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
  footer .footer-brand { font-family: var(--display); font-size: 1.2rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-block-size: 44px; }
  footer p { color: var(--ink-soft); font-size: 0.95rem; max-width: 48ch; }
  .footer-links { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
  .footer-group { display: flex; flex-direction: column; }
  .footer-group-title { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 0.3rem; color: var(--ink-mute); }
  .footer-group a { min-block-size: 44px; display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
  .footer-group a:hover { color: var(--amber); }
  .copyright { font-size: 0.85rem; color: var(--ink-mute); }
  .staging-note { font-family: var(--mono); font-size: 0.8rem; color: var(--danger); }
  @media (min-width: 60rem) { footer { grid-template-columns: 1fr 2fr; } .copyright { grid-column: 1 / -1; } }

  /* ---- buttons */
  .button { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-block-size: 44px; padding: 0.55rem 1.1rem; border-radius: 10px; border: 1.5px solid var(--line-strong); background: transparent; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
  .button:hover { background: var(--bg-card); border-color: var(--ink); }
  .button-primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
  .button-primary:hover { background: #f2c86a; border-color: #f2c86a; }
  .button[disabled] { opacity: 0.55; cursor: default; }

  /* ---- hero: the photograph is the argument. The catalogue hero carries the copy;
     the reveal is its sibling (a real control, so it cannot live in the hero's
     aria-hidden art slot). */
  .hero-stage { display: grid; gap: 1.75rem; align-items: center; padding: 2.5rem 0 1rem; }
  .hero { display: grid; gap: 0; align-items: center; }
  .hero-copy { max-width: 40rem; }
  .hero h1 { font-size: clamp(2.2rem, 1.4rem + 3vw, 3.8rem); line-height: 1.02; font-weight: 300; }
  .hero h1 em { font-style: normal; color: var(--amber); }
  .hero-lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; }
  .privacy-note { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); margin-top: 0.8rem; }
  .hero-art { width: min(100%, 22rem); }
  .hero-art:empty { display: none; }
  @media (min-width: 52rem) { .hero-stage { grid-template-columns: 1.05fr 1fr; padding-top: 3.5rem; } }

  .reveal { margin: 0; display: grid; gap: 0.6rem; }
  .reveal-stage { --split: 50%; position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--bg-deep); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55); isolation: isolate; }
  .reveal-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
  .reveal-after img { clip-path: inset(0 0 0 var(--split)); }
  .reveal-line { position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; }
  .reveal-line::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--ink); background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%230f1f18' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 5l-4 5 4 5M13 5l4 5-4 5'/%3E%3C/svg%3E"); background-size: 20px; background-position: center; background-repeat: no-repeat; }
  .reveal-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; -webkit-appearance: none; appearance: none; background: transparent; }
  .reveal-range::-webkit-slider-thumb { -webkit-appearance: none; width: 44px; height: 100%; }
  .reveal-range::-moz-range-thumb { width: 44px; height: 100%; border: 0; }
  .reveal-stage:focus-within .reveal-line::after { outline: 3px solid var(--amber); outline-offset: 2px; }
  .reveal-tag { position: absolute; bottom: 0.8rem; font-family: var(--mono); font-size: 0.78rem; padding: 0.25rem 0.55rem; border-radius: 6px; background: rgba(15, 31, 24, 0.78); color: var(--ink); pointer-events: none; }
  .reveal-tag-left { left: 0.8rem; }
  .reveal-tag-right { right: 0.8rem; color: var(--amber); }
  .reveal figcaption { font-size: 0.85rem; color: var(--ink-mute); }
  .reveal figcaption a { color: var(--ink-soft); display: inline-block; padding-block: 0.75rem; margin-block: -0.75rem; }

  /* ---- tool */
  .tool-section { background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem; margin: 1.5rem 0 2rem; }
  .form-heading h2 { margin-bottom: 0.3em; }
  .form-heading p { color: var(--ink-soft); }
  .form-action { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; margin-top: 1rem; }
  .form-error { min-block-size: 1.5rem; margin: 0; color: var(--danger); font-size: 0.95rem; flex: 1 1 100%; }
  .file-drop { display: grid; justify-items: center; gap: 0.35rem; padding: 1.75rem 1rem; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: rgba(15, 31, 24, 0.55); text-align: center; cursor: pointer; min-block-size: 44px; }
  .file-drop:hover { border-color: var(--accent); }
  .file-drop.is-over { background: rgba(158, 216, 181, 0.12); border-color: var(--accent); }
  .file-drop input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .file-drop:focus-within { outline: 3px solid var(--amber); outline-offset: 2px; }
  .file-drop-mark svg { width: 3.2rem; height: 2.4rem; color: var(--amber); }
  .file-drop-label { font-weight: 600; }
  .file-drop-hint { font-size: 0.85rem; color: var(--ink-soft); }
  .file-drop-list { list-style: none; margin: 0; padding: 0; }
  /* The bracket as a contact sheet: sprocket rules above and below, thumbnails on black. */
  .frame-strip { list-style: none; margin: 1rem 0 0; padding: 0.75rem; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr)); background: var(--bg-deep); border-radius: 10px; border-top: 6px dotted rgba(244, 239, 228, 0.28); border-bottom: 6px dotted rgba(244, 239, 228, 0.28); }
  .frame-strip:empty { display: none; }
  .frame { display: grid; gap: 0.2rem; font-size: 0.78rem; border: 1px solid transparent; border-radius: 6px; padding: 0.3rem; background: transparent; }
  .frame[data-kind="ok"] { border-color: rgba(158, 216, 181, 0.35); }
  .frame-thumb { width: 100%; height: auto; border-radius: 3px; background: #1c1c1c; display: block; }
  .frame-name { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .frame-state { color: var(--ink-soft); }
  .frame[data-kind="ok"] .frame-state { color: var(--ok); }
  .frame[data-kind="skipped"] .frame-state, .frame[data-bad="true"] .frame-state { color: var(--danger); }
  .frame[data-kind="busy"] .frame-state { color: var(--amber); font-weight: 600; }
  .memory-estimate { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-soft); margin: 0.8rem 0 0; min-block-size: 1.5rem; }
  .memory-estimate[data-over="true"] { color: var(--danger); }
  .options { display: grid; gap: 0.4rem; margin-top: 0.8rem; }
  .option { display: flex; align-items: flex-start; gap: 0.6rem; min-block-size: 44px; font-size: 0.95rem; }
  .option input { width: 1.25rem; height: 1.25rem; margin-top: 0.7rem; accent-color: var(--accent); }
  .choice-set { border: 0; padding: 0; margin: 0 0 0.25rem; }
  .choice-set legend { font-weight: 600; margin-bottom: 0.4rem; }
  .choice-set-options { display: grid; gap: 0.25rem; }
  .choice-option { display: flex; align-items: center; gap: 0.6rem; min-block-size: 44px; cursor: pointer; }
  .choice-option input { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); }
  .field-hint { font-size: 0.85rem; color: var(--ink-soft); margin: 0.2rem 0 0.8rem; }

  /* ---- work */
  .work { margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-input); display: grid; gap: 0.8rem; }
  .progress-label { font-weight: 600; margin: 0; }
  .progress-track { block-size: 0.7rem; background: rgba(244, 239, 228, 0.12); border-radius: 999px; overflow: hidden; }
  .progress-fill { block-size: 100%; inline-size: 0; background: var(--amber); transition: inline-size 200ms linear; }
  .progress-track[data-indeterminate="true"] .progress-fill { inline-size: 30%; animation: sweep 1.2s linear infinite; }
  @keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(400%); } }
  .progress-status { margin: 0; font-family: var(--mono); font-size: 0.85rem; min-block-size: 1.5rem; }
  .frame-status { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
  @media (prefers-reduced-motion: reduce) { .progress-fill { transition: none; animation: none !important; } }

  /* ---- result */
  .result { margin-top: 1.25rem; display: grid; gap: 1rem; }
  .result-intro h2 { margin-bottom: 0.2em; }
  .inspector { display: grid; gap: 0.5rem; }
  .inspector-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .inspector-canvas { display: block; width: 100%; max-width: 100%; border-radius: 8px; border: 1px solid var(--line-strong); background: #000; cursor: grab; touch-action: none; }
  .inspector-canvas:active { cursor: grabbing; }
  .inspector-hint { font-size: 0.85rem; color: var(--ink-soft); margin: 0; }
  .receipt h3 { margin-bottom: 0.4em; }
  .check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
  .check { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0 0.5rem; font-size: 0.95rem; }
  .check-mark { font-weight: 700; color: var(--ok); }
  .check[data-ok="false"] .check-mark { color: var(--danger); }
  .check-text { font-weight: 600; }
  .check-detail { grid-column: 2; font-family: var(--mono); font-size: 0.8rem; color: var(--ink-soft); min-block-size: 1.2rem; }
  .download-shelf { border-top: 1px solid var(--line); padding-top: 1rem; }
  .download-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; max-block-size: 24rem; overflow-y: auto; }
  .download-item { display: grid; gap: 0.25rem; justify-items: start; }
  .download-file { min-block-size: 44px; }
  .download-meta { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-soft); }
  .download-empty { color: var(--ink-soft); margin: 0; }
  .result-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

  /* ---- limits, steps, method */
  .sf-limits { border-left: 4px solid var(--amber); padding: 0.5rem 1rem; margin: 1.5rem 0; background: var(--bg-card); border-radius: 0 var(--radius) var(--radius) 0; }
  .sf-limits__list li::marker { color: var(--amber); }
  .sf-limits__heading { font-size: 1.1rem; margin-bottom: 0.3em; }
  .sf-limits__list { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
  /* ---- the three beats: drawn, not told */
  .home-method { margin: 3rem 0 2rem; }
  .beats { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
  .beat { display: grid; gap: 0.5rem; align-content: start; }
  .beat svg { width: 100%; height: auto; display: block; color: var(--accent); }
  .beat h3 { margin: 0.4rem 0 0; font-size: 1.35rem; }
  .beat p { margin: 0; color: var(--ink-soft); }
  .beat-index { font-family: var(--mono); color: var(--amber); margin-right: 0.35rem; }
  .home-method-links { margin-top: 1.5rem; }
  .figure-stations { margin: 1rem 0 1.5rem; }
  .stations { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); }
  .station { display: grid; gap: 0.15rem; font-size: 0.9rem; color: var(--ink-soft); }
  .station svg { width: 100%; height: auto; display: block; color: var(--accent); margin-bottom: 0.3rem; }
  .station b { color: var(--ink); }
  .figure-dof svg { width: 100%; height: auto; display: block; color: var(--accent); }
  .figure-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--ink-soft); }
  .figure-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
  .figure-legend i { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 2px; }
  .figure-legend i.dash { width: 1.2rem; height: 0; border-top: 1.5px dashed var(--accent); border-radius: 0; }
  .figure-dof { margin: 1rem 0 1.5rem; }
  .figure-caption { font-size: 0.85rem; color: var(--ink-mute); margin: 0.4rem 0 0; }
  .steps { padding-left: 1.3rem; display: grid; gap: 0.6rem; }
  .page-head { max-width: 46rem; margin: 0.5rem 0 0; }
  .content-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin: 1rem 0; }
  .prose h2 { margin-top: 1.6em; }
  .prose ul, .prose ol { padding-left: 1.3rem; }
  .prose li { margin-bottom: 0.4em; }
  .licence { white-space: pre-wrap; font-family: var(--mono); font-size: 0.78rem; background: var(--bg-input); padding: 1rem; border-radius: 8px; overflow-x: auto; }
  .method-page h2 { margin-top: 1.4em; }
  .method-page > h2:first-child { margin-top: 0; }
  .plan { font-weight: 600; }
  .field-grid { display: grid; gap: 0.75rem 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
  .dof-result .table-wrap { margin: 0.5rem 0 1rem; }

  /* ---- related, faq, breadcrumbs, legal */
  .related-rail { margin: 2rem 0; }
  .related-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
  .related-card { display: grid; gap: 0.2rem; padding: 0.9rem 1rem; min-block-size: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-card); color: var(--ink); text-decoration: none; }
  .related-title { font-weight: 600; }
  .related-description { font-size: 0.9rem; color: var(--ink-soft); }
  .faq { margin: 2rem 0; }
  .faq-list { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), minmax(0, 1fr))); }
  .faq-item { background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
  .faq-item h3 { font-family: var(--ui); font-size: 1rem; font-weight: 600; }
  .faq-item p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
  .breadcrumbs { margin: 1rem 0 0.5rem; font-size: 0.85rem; }
  .breadcrumb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
  /* Every crumb is a 44px flex row, not only the linked ones: the current page and the
     separators sat on the text baseline while the links centred in their tap height. */
  .breadcrumb-list li { display: inline-flex; align-items: center; min-block-size: 44px; }
  .breadcrumb-list li + li::before { content: "/"; margin-right: 0.3rem; color: var(--ink-soft); }
  .breadcrumb-list a { min-block-size: 44px; display: inline-flex; align-items: center; }
  .legal-page { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin: 1rem 0; }
  .legal-page section { margin-top: 1.5rem; }
  .legal-updated { font-size: 0.85rem; color: var(--ink-soft); margin-top: 2rem; }
  .html-sitemap { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin: 1rem 0; }
  .sitemap-groups { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
  .sitemap-group ul { list-style: none; padding: 0; margin: 0; }
  .sitemap-group li { margin-bottom: 0.6rem; }
  .sitemap-group a { min-block-size: 44px; display: inline-flex; align-items: center; font-weight: 600; }
  .sitemap-group p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }

  /* ---- ads: reserved before the network answers; nothing when no unit is wired */
  .sf-adslot { display: flex; align-items: center; justify-content: center; width: min(100% - 2rem, 72rem); margin: 1.5rem auto; border-radius: 8px; background: transparent; }
  .sf-adslot-D { min-block-size: var(--adslot-h-D); }
  .sf-adslot-R { min-block-size: var(--adslot-h-R); }
  .sf-adslot-A { min-block-size: var(--adslot-h-A); }
  .sf-adslot[data-ad-unit=""] { display: none; }
  .sf-adslot[data-sf-adslot-state="house-ad-fallback"], .sf-adslot[data-sf-adslot-state="blocked-by-adblock"], .sf-adslot[data-sf-adslot-state="empty"] { display: none; }

  /* ---- consent bar: not a modal */
  .consent { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 15; display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; justify-content: space-between; padding: 0.9rem 1rem; background: var(--bg-deep); color: #f4efe4; border-top: 3px solid var(--amber); box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.45); }
  .consent-copy { margin: 0; flex: 1 1 24rem; font-size: 0.92rem; }
  .consent-copy a { color: #ffd98a; }
  .consent-actions { display: flex; gap: 0.5rem; }
  .consent .button { border-color: #f4efe4; color: #f4efe4; background: transparent; }
  .consent .button-primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
}

@layer responsive {
  @media (max-width: 40rem) {
    .tool-section, .content-card, .legal-page, .html-sitemap { padding: 1rem; }
    .site-header { padding: 0.5rem 0.75rem; }
    .site-header .brand { font-size: 1.1rem; white-space: nowrap; }
    .site-header nav { gap: 0; }
    .site-header nav a { padding: 0 0.4rem; font-size: 0.82rem; }
    /* On a phone the photograph still comes -- it is the argument -- but under
       the copy, so the headline and the button are the first paint. */
    .hero-stage { padding-top: 1.25rem; gap: 1rem; }
    .reveal-stage { border-radius: 10px; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45); }
    .reveal-tag { font-size: 0.7rem; max-inline-size: 46%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  }
  @media (max-width: 27rem) {
    /* Four destinations plus the wordmark do not fit 390px on one row; the
       mark alone names the site (the link keeps its aria-label). */
    .site-header .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .site-header .brand { min-inline-size: 44px; justify-content: center; }
    .site-header nav a { padding: 0 0.35rem; }
  }
}

@layer catalogue {
/* The field must work with no spinner affordance: Mobile Safari does not draw
   one. Removing it elsewhere keeps typing, paste and the mobile inputmode as
   the only interaction contract on every engine. */
.numeric-field { min-inline-size: 0; }
.numeric-field-control {
  min-inline-size: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}
.numeric-field input[type="number"] {
  -moz-appearance: textfield;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 44px;
  box-sizing: border-box;
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.numeric-field input[type="number"]::-webkit-inner-spin-button,
.numeric-field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.numeric-field-unit {
  min-block-size: 44px;
  display: inline-flex;
  align-items: center;
  padding-inline: .65rem;
  white-space: nowrap;
}
.numeric-field-unit:empty { display: none; }

/* WebKit will not give a <select> the height you ask for while it still owns
   the rendering. Measured on the catalogue proof page: `min-block-size: 3.4rem`
   was honoured in Chromium and Firefox and ignored in WebKit, which kept the
   native control under 44px on all eight phone descriptors -- the same class of
   defect as the date field, on the plainest control there is.
   `appearance: none` hands sizing back to CSS, and then the chevron has to be
   drawn, because removing the appearance removes the native one too. */
.select-field { position: relative; min-inline-size: 0; }
.select-field select {
  -webkit-appearance: none;
  appearance: none;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  box-sizing: border-box;
  min-block-size: 3.4rem;
  padding-inline: .85rem 2.1rem;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23888888" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
  background-repeat: no-repeat;
  background-position: right .7rem center;
  background-size: 1rem;
  text-overflow: ellipsis;
  font: inherit;
}
/* The open list is drawn by the OS in the system palette; naming both keeps it
   readable on a dark page. */
.select-field option { background: var(--panel); color: var(--ink); }

.table-wrap { max-inline-size: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
table { inline-size: 100%; border-collapse: collapse; }
caption { text-align: start; color: var(--ink-muted); padding-block-end: .5rem; }
/* Cells WRAP. `white-space: nowrap` used to be set on every cell here, which is
   right for a figure and wrong for a sentence: it clipped a prose column behind
   the wrapper's own scrollbar at 390px AND at 1280px, so widening the window did
   not reveal it. A prose column generally does not belong in a table at all --
   but when one is there, the table must not hide it. */
th, td { padding: .7rem .9rem; text-align: start; border-block-end: 1px solid var(--line); }
/* Figures must not dance as they change, and columns must not resize per row, so
   `nowrap` belongs here: scoped to the cells that carry a measurement. */
td.figure, th.figure, .table-wrap .figure { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }

}
