/* Shared premium treatment for the archive beyond each concept's homepage. */
body[data-design] {
  background: var(--bg);
  color: var(--ink);
  font-family: Manrope, 'Avenir Next', sans-serif;
}

/* The original archive has ambient gradients and a third typeface. Premium
   pages use solid surfaces and only Space Grotesk plus Manrope. */
body[data-design]::before { display: none; background: none; }
body[data-design] * { font-family: Manrope, 'Avenir Next', sans-serif !important; }
body[data-design] :is(h1, h2, h3, h4, .brand, .door b, .entry-copy b,
  .stackcard strong, .counts b, .study-count strong, .palette-copy strong) {
  font-family: 'Space Grotesk', sans-serif !important;
}
body[data-design] :is(.story-stage, .story-shade, .stackcard) {
  background-image: none;
}
body[data-design] :is(.story-stage, .story-shade) { background-color: var(--bg); }
body[data-design] .stackcard { background: var(--surface); }
body[data-design] :is(.stackcard .chem-mark, .door .chem-mark,
  .stack-title .chem-mark) { display: none; }
body[data-design] :is(.reveal-ready, .reveal-ready.is-visible) {
  opacity: 1;
  transform: none;
  transition: none;
}

body[data-design] :focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}
body[data-design] :is(a, button, input) { -webkit-tap-highlight-color: transparent; }
body[data-design] a { text-underline-offset: .2em; }
body[data-design] :is(article, .prose, .narrow) a:not(.btn):hover { text-decoration: underline; }
body[data-design] .skip-link {
  color: var(--on-accent);
  background: var(--blue);
  border: 1px solid var(--blue);
  z-index: 1000;
}

/* Navigation keeps every archive route reachable without covering content. */
body[data-design] .top {
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
  backdrop-filter: none;
  box-shadow: none;
}
body[data-design] .brand { color: var(--ink); letter-spacing: -.045em; }
body[data-design] .brand span {
  border-radius: 3px;
  box-shadow: none;
  font-weight: 700;
}
body[data-design] .top nav { scrollbar-width: thin; }
body[data-design] .top nav a {
  border-radius: 3px;
  color: var(--muted);
  white-space: nowrap;
}
body[data-design] .top nav a:is(:hover, .on) {
  color: var(--ink);
  background: var(--blue-soft);
}
body[data-design] .top nav a:focus-visible { outline-offset: -2px; }

/* Working surfaces: quiet borders, solid panels, legible states. */
body[data-design] :is(.hsearch input, .search input, .filterq) {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
  backdrop-filter: none;
}
body[data-design] :is(.hsearch input, .search input, .filterq):focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-soft);
}
body[data-design] :is(.results, .dbwrap, .tree-shell, .sheet,
  .spec-card, .buybox, .catalog-summary, .callout) {
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: none;
}
body[data-design] :is(.results, .tree-shell, .sheet, .spec-card, .buybox,
  .catalog-summary, .callout, .dbwrap) { border-radius: 4px; }
body[data-design] :is(.results a:hover, .results a.on, .palette-option.on,
  table.db tr:hover td) {
  color: var(--ink);
  background: var(--blue-soft);
}
body[data-design] :is(.btn, .filters button.on) {
  color: var(--on-accent);
  background: var(--blue);
  border-color: var(--blue);
  border-radius: 3px;
}
body[data-design] :is(.btn:hover, .filters button.on:hover) {
  color: var(--on-accent);
  background: var(--blue-deep);
}
body[data-design] :is(.filters button, .chip, .rel a, .back-to-top) {
  border-radius: 3px;
  background: var(--surface);
}
body[data-design] .filters button { min-height: 42px; }
body[data-design] :is(table.db th, .col > .kicker, .treebar,
  .palette-footer, .jump) { background: var(--surface-raised); }
body[data-design] :is(table.db td, table.db th) { border-bottom-color: var(--line); }
/* hover and selection read apart (review round 1: a hovered row had the selected row's fill) */
body[data-design] .tree-row:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
}
body[data-design] .tree-row:hover > button em { color: var(--muted); }
body[data-design] .tree-row.on { border-color: var(--line-strong); background: var(--blue-soft); }
body[data-design] .tree-row:is(:hover, .on) > button { color: var(--ink); }
body[data-design] .tree-row > button { min-height: 44px; }
@media (pointer: coarse) { body[data-design] .col:last-child .tree-row > button { min-height: 54px; } }
body[data-design] .tree-open { border-radius: 3px; }
body[data-design] .tree-open:focus-visible { outline-offset: 2px; }
@supports selector(:has(*)) {
  body[data-design] .tree-row:has(> button:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
  body[data-design] .tree-row > button:focus-visible { outline: 0; }
}
body[data-design] .treebar { border-top-color: var(--line-strong); }

/* Editorial pages retain the source material and research map, with a calmer
   hierarchy that reads well against all three palettes. */
body[data-design] :is(.wrap, .compound) { padding-top: clamp(32px, 5vw, 72px); }
body[data-design] :is(.wrap, .compound) > h1 {
  max-width: 18ch;
  text-wrap: balance;
}
body[data-design] .compound .sheet { padding: clamp(24px, 4vw, 52px); }
body[data-design] .compound .head { gap: clamp(24px, 4vw, 60px); }
body[data-design] .compound .head h1 { line-height: 1.02; }
body[data-design] .crumb { color: var(--dim); }
body[data-design] .crumb a { color: var(--muted); }
body[data-design] .pills li {
  background: var(--blue-soft);
  color: var(--ink);
  border-color: var(--blue);
  border-radius: 0;
}
body[data-design] .struct {
  /* A pale paper plate makes verified structures legible in dark editions. */
  background: #f1f3ee;
  color: #17242b;
  border-color: #becac7;
  border-radius: 3px;
}
body[data-design] .struct :is(figcaption, .structure-label) { color: #425b60; }
body[data-design] .struct .structure-label { border-color: #cbd6d2; }
body[data-design] .study-count { color: var(--blue-deep); }
body[data-design] .evidence-segments i { background: var(--surface-raised); }
body[data-design] .jump { border-color: var(--line-strong); }
body[data-design] .jump a.on { color: var(--ink); background: var(--blue-soft); }
body[data-design] article p,
body[data-design] .prose p,
body[data-design] .narrow section p { color: var(--muted); line-height: 1.85; }
body[data-design] article h2 { color: var(--ink); }
body[data-design] #risks {
  background: var(--surface-raised);
  border-color: var(--line-strong);
  border-radius: 3px;
}
body[data-design] .spec dt { color: var(--dim); }
body[data-design] .spec dd { color: var(--ink); }
body[data-design] .references li { border-left-color: var(--line-strong); }
/* Dosing entries: the pills' square accent edge and the risk panel's raised surface in every palette. */
body[data-design] #dosing .dose-entry {
  background: var(--surface-raised);
  border-color: var(--line-strong);
  border-left-color: var(--blue);
  border-radius: 0 3px 3px 0;
}
body[data-design] #dosing :is(.dosing-group h3, .dose-amount) { color: var(--blue-deep); }
body[data-design] #dosing :is(.dose-context, .dose-spec dt, .dose-source, .dose-label, .dosing-fine) { color: var(--dim); }
body[data-design] #dosing :is(.dose-title, .dose-spec dd) { color: var(--ink); }
body[data-design] #dosing .dose-note { color: var(--muted); line-height: 1.7; }
body[data-design] #dosing .dose-source { border-top-color: var(--line); }
/* Tier C, reported practice (AMENDMENT 4): the dashed accent edge and the tagged kicker in every
   palette — the entry keeps the design's own surface, radius and type. */
body[data-design] #dosing .dose-entry.dose-reported { border-left-style: dashed; }
body[data-design] #dosing .dose-tier { border-color: var(--blue); color: var(--blue-deep); }
/* Highlighted figure (owner request 2026-10-11): the design's square radius and its palette's
   accent tokens — nothing else changes between the four designs. */
body[data-design] #dosing .dose-highlight {
  background: var(--blue-soft);
  border-left-color: var(--blue);
  border-radius: 0 3px 3px 0;
}
body[data-design] #dosing :is(.dose-highlight-label, .dose-highlight-source) { color: var(--blue-deep); }
body[data-design] #dosing .dose-highlight-text { color: var(--ink); line-height: 1.6; }
/* Unit legend (owner request 2026-10-11): the design's strong hairline and square radius. */
body[data-design] #dosing .dose-units { border-color: var(--line-strong); border-radius: 3px; }
body[data-design] #dosing .dose-units-label { color: var(--dim); }
body[data-design] #dosing .dose-units dt { color: var(--blue-deep); }
body[data-design] #dosing .dose-units dd { color: var(--muted); }
/* the group label reads as the designs' kickers, the dose as their figures (study count) */
body[data-design] #dosing .dosing-group h3 { font-family: Manrope, 'Avenir Next', sans-serif !important; }
body[data-design] #dosing .dose-amount { font-family: 'Space Grotesk', sans-serif !important; }
body[data-design] .reference-meta { color: var(--dim); }
body[data-design] .foot { border-color: var(--line-strong); }
/* The archive section is its own stacking context with a full-screen fixed background inside;
   without this the footer (outside that context) painted underneath the background. */
body[data-design] .foot { position: relative; z-index: 1; }

/* GSAP in ui.js owns the dialog transition; suppress legacy keyframes. */
body[data-design] #search-dialog {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
  border-radius: 5px;
  box-shadow: 0 24px 70px #0007;
}
body[data-design] #search-dialog[open],
body[data-design] #search-dialog.is-closing,
body[data-design] #search-dialog::backdrop,
body[data-design] #search-dialog.is-closing::backdrop { animation: none; }
body[data-design] #search-dialog::backdrop { background: #0009; }
body[data-design] #palette-query { color: var(--ink); }
body[data-design] .palette-option { border-radius: 3px; }
body[data-design] .palette-option.on { border-color: var(--line-strong); }
body[data-design] .palette-copy small { color: var(--dim); }
body[data-design] .section-copy { opacity: 1; }

/* A chosen static mode exposes every chapter in document order. The same
   rules cover failed media and OS reduced-motion requests. */
body[data-design].motion-static [data-cinematic] { height: auto !important; }
body[data-design].motion-static [data-stage] {
  position: relative !important;
  top: auto !important;
  height: auto !important;
  min-height: min(100svh, 720px);
  overflow: visible !important;
}
body[data-design].motion-static [data-cue] {
  position: relative !important;
  inset: auto !important;
  width: min(680px, 88%) !important;
  margin: clamp(65px, 10vh, 120px) auto !important;
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
body[data-design].motion-static :is(video[data-scrub], canvas[data-spatial]) {
  display: none !important;
}
body[data-design].motion-static [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}
body[data-design].motion-static [data-pan-track] { transform: none !important; }

@media (max-width: 700px) {
  body[data-design] .top { padding-inline: 16px; }
  body[data-design] .top nav { gap: 0; overflow-x: auto; justify-content: flex-start; }
  body[data-design] .top nav a { min-height: 42px; display: inline-flex; align-items: center; }
  body[data-design] :is(.wrap, .compound, .foot) { width: calc(100% - 32px); }
  body[data-design] .compound .sheet { padding: 20px 16px; }
  body[data-design] .evidence-panel { grid-template-columns: 1fr; }
  body[data-design] .evidence-track { min-width: 0; }
  body[data-design] .evidence-stage { font-size: 9px; letter-spacing: .03em; }
  body[data-design] .jump { top: 99px; }
  body[data-design] .palette-footer { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-design] *, body[data-design] *::before, body[data-design] *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  body[data-design]:not(.motion-ready) [data-cinematic] { height: auto !important; }
  body[data-design]:not(.motion-ready) [data-stage] { position: relative !important; top: auto !important; height: auto !important; overflow: visible !important; }
  body[data-design]:not(.motion-ready) [data-cue] { position: relative !important; inset: auto !important; transform: none !important; opacity: 1 !important; visibility: visible !important; }
  body[data-design]:not(.motion-ready) :is(video[data-scrub], canvas[data-spatial]) { display: none !important; }
}

/* The home page is one continuous archive canvas over the ambient scene. */
body[data-design] .utility-home {
  position: relative;
  isolation: isolate;
  width: 100%;
  padding: 0 0 70px;
}
body[data-design] .ambient-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--bg);
  background-image: var(--ambient-poster);
  background-position: var(--ambient-position, center);
  background-size: cover;
}
body[data-design] .ambient-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ambient-tint);
}
body[data-design] .ambient-scene video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--ambient-position, center);
  opacity: 0;
}
body[data-design] .utility-hero,
body[data-design] .utility-home .premium-archive {
  position: relative;
  z-index: 1;
}
body[data-design] .utility-hero {
  padding: clamp(22px, 3vw, 38px) 16px 0;
}
body[data-design] .utility-hero-inner {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 16px 12px 0;
  color: var(--hero-ink);
  text-align: center;
}
body[data-design] .utility-kicker {
  margin: 0 0 9px;
  color: var(--hero-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
}
body[data-design] .utility-hero h1 {
  margin: 0;
  color: var(--hero-ink);
  font-size: clamp(46px, 4.2vw, 60px);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -.065em;
}
body[data-design] .utility-description {
  max-width: 540px;
  margin: 8px auto 20px;
  color: var(--hero-muted);
  font-size: 15px;
  line-height: 1.5;
}
body[data-design] .utility-search {
  width: min(700px, 100%);
  margin: 0 auto;
  text-align: left;
}
body[data-design] .utility-search label {
  display: block;
  margin-bottom: 6px;
  color: var(--hero-muted);
  font-size: 11px;
  font-weight: 700;
}
body[data-design] .utility-search-field {
  display: flex;
  align-items: center;
  min-height: 56px;
  overflow: hidden;
  color: var(--hero-input-ink);
  background: var(--hero-input);
  border: 1px solid var(--hero-border);
  border-radius: 10px;
  backdrop-filter: blur(8px);
}
body[data-design] .utility-search-field:focus-within {
  outline: 2px solid var(--hero-accent);
  outline-offset: 2px;
}
body[data-design] .utility-search-field > span {
  padding-left: 17px;
  color: var(--hero-input-icon, var(--hero-accent));
  font-size: 22px;
  line-height: 1;
}
body[data-design] .utility-search-field input {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 14px;
  color: var(--hero-input-ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 15px;
}
body[data-design] .utility-search-field input::placeholder {
  color: var(--hero-placeholder);
  opacity: 1;
}
body[data-design] .utility-search-field button {
  align-self: stretch;
  min-width: 95px;
  padding: 0 13px;
  color: var(--hero-accent);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--hero-border);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
body[data-design] .utility-search-field button:hover {
  color: var(--hero-input-ink);
  background: var(--hero-search-hover);
}
body[data-design] .utility-routes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: min(770px, 100%);
  margin: 15px auto 0;
  text-align: center;
}
body[data-design] .utility-routes a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 21px;
  color: var(--hero-ink);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--hero-border);
  border-radius: 0;
  text-decoration: none;
}
body[data-design] .utility-routes a:last-child { border-right: 0; }
body[data-design] .utility-routes a:hover {
  color: var(--hero-accent);
  text-decoration: underline;
}
body[data-design] .utility-routes strong { font-size: 13px; line-height: 1.2; }
body[data-design] .utility-routes span { display: none; }
body[data-design] .utility-home .premium-archive {
  width: min(1070px, calc(100% - 40px));
  margin: 16px auto 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  scroll-margin-top: 100px;
}
body[data-design] .utility-home .premium-archive > section + section {
  margin-top: 35px;
}
body[data-design] .utility-home .premium-archive .section-head,
body[data-design] .utility-home .premium-archive .archive-intro .section-head {
  margin: 0 0 10px;
  align-items: baseline;
}
body[data-design] .utility-home .premium-archive .section-head h2 {
  font-size: clamp(23px, 2.3vw, 29px);
  line-height: 1.15;
  letter-spacing: -.045em;
}
body[data-design] .utility-home .premium-archive .section-head a {
  color: var(--blue-deep);
}
body[data-design] .utility-home .premium-archive .chips {
  gap: 0 20px;
  margin: 0;
}
body[data-design] .utility-home .premium-archive .chip {
  min-height: 44px;
  padding: 10px 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
}
body[data-design] .utility-home .premium-archive .chip:hover {
  color: var(--blue-deep);
  border-bottom-color: var(--blue);
}
body[data-design] .utility-home .premium-archive .shortlist {
  display: block;
  margin: 0;
  padding: 0;
}
body[data-design] .utility-home .premium-archive .shortlist li {
  border-bottom: 1px solid var(--line-strong);
}
body[data-design] .utility-home .premium-archive .shortlist a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  align-items: center;
  gap: 14px;
  min-height: 73px;
  padding: 10px 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  transform: none;
}
body[data-design] .utility-home .premium-archive .shortlist a:hover {
  color: var(--blue-deep);
  background: transparent;
  transform: none;
}
/* The premium homepages replace the thumbnail with a two-column typographic row (the family and the
   name in the first column, the one-liner in the second), so the archive list reads as a table of
   names over the scene rather than as a row of pictures. Deliberate, not the base site's rule gone
   missing: the base home keeps its thumbnails, and review round 2 asked which of the two is meant. */
body[data-design] .utility-home .premium-archive .entry-molecule {
  display: none;
}
body[data-design] .utility-home .premium-archive .entry-copy {
  display: grid;
  grid-template-columns: minmax(175px, .42fr) minmax(0, 1fr);
  align-items: center;
  column-gap: 22px;
}
body[data-design] .utility-home .premium-archive .entry-copy em {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 4px;
  color: var(--blue-deep);
  font-size: 9px;
}
body[data-design] .utility-home .premium-archive .entry-copy b {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  font-size: 19px;
}
body[data-design] .utility-home .premium-archive .entry-copy span {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
body[data-design] .utility-home .premium-archive .entry-arrow {
  align-self: center;
  color: var(--blue-deep);
}
body[data-design] .utility-home .premium-archive .stackgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
}
body[data-design] .utility-home .premium-archive .stackcard {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 87px;
  padding: 10px 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  transform: none;
}
body[data-design] .utility-home .premium-archive .stackcard:hover {
  color: var(--blue-deep);
  background: transparent;
  border-bottom-color: var(--blue);
  transform: none;
}
body[data-design] .utility-home .premium-archive .stackcard em {
  color: var(--blue-deep);
  font-size: 9px;
}
body[data-design] .utility-home .premium-archive .stackcard strong {
  max-width: none;
  font-size: 18px;
  line-height: 1.15;
}
body[data-design] .utility-home .premium-archive .stackcard span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
@media (max-width: 700px) {
  body[data-design] .utility-hero { padding: 19px 12px 0; }
  body[data-design] .utility-hero-inner { padding: 13px 0 0; }
  body[data-design] .utility-hero h1 { font-size: clamp(36px, 9vw, 42px); }
  body[data-design] .utility-description { margin: 8px auto 18px; font-size: 13px; }
  body[data-design] .utility-search-field { min-height: 54px; border-radius: 8px; }
  body[data-design] .utility-search-field input { height: 52px; font-size: 13px; padding-inline: 9px; }
  body[data-design] .utility-search-field > span { padding-left: 12px; font-size: 19px; }
  body[data-design] .utility-search-field button { min-width: 52px; padding-inline: 10px; font-size: 0; }
  body[data-design] .utility-search-field button span { font-size: 18px; }
  body[data-design] .utility-routes { margin-top: 12px; }
  body[data-design] .utility-routes a { flex: 0 0 50%; padding: 9px 7px; }
  body[data-design] .utility-routes a:nth-child(2) { border-right: 0; }
  body[data-design] .utility-routes a:nth-child(-n+2) { border-bottom: 1px solid var(--hero-border); }
  body[data-design] .utility-home .premium-archive { width: calc(100% - 28px); margin-top: 19px; }
  body[data-design] .utility-home .premium-archive > section + section { margin-top: 30px; }
  body[data-design] .utility-home .premium-archive .section-head h2 { font-size: 23px; }
  body[data-design] .utility-home .premium-archive .section-head a { white-space: normal; text-align: right; }
  body[data-design] .utility-home .premium-archive .chips { gap: 0 14px; }
  body[data-design] .utility-home .premium-archive .entry-copy { grid-template-columns: 1fr; gap: 2px; }
  body[data-design] .utility-home .premium-archive .entry-copy em,
  body[data-design] .utility-home .premium-archive .entry-copy b,
  body[data-design] .utility-home .premium-archive .entry-copy span {
    grid-column: 1;
    grid-row: auto;
  }
  body[data-design] .utility-home .premium-archive .entry-copy b { font-size: 18px; }
  body[data-design] .utility-home .premium-archive .stackgrid { grid-template-columns: 1fr; }
  body[data-design] .ambient-scene {
    background-image: var(--ambient-mobile-poster, var(--ambient-poster));
  }
}
@media (prefers-reduced-motion: reduce) {
  body[data-design] .ambient-scene video { display: none !important; }
}
body[data-design].motion-static .ambient-scene video { display: none !important; }
