/* intoxicant.wiki compound pages. One DOM per compound; html[data-view] picks the layout (a safety card, b full article, c at a glance). */
:root {
  --bg: #f3f5f7; --paper: #ffffff; --ink: #15202b; --muted: #5a6876; --line: #d6dde4;
  --accent: #0f5c8c; --accent-soft: #e2eef6; --warn: #b5470f; --warn-soft: #fbeadf;
  --pending: #7a6a1c; --pending-soft: #f6f0d4;
  --danger: #b42318; --danger-soft: #fde7e5; --unsafe: #c4570c; --unsafe-soft: #fdeedd; --caution: #8a6d00; --caution-soft: #fbf3d2; --low: #2f6b45; --low-soft: #e3f1e7;
  --band-th: #cfe3d4; --band-light: #9fcbab; --band-common: #f2cf74; --band-strong: #ec9a5c; --band-heavy: #d4583a;
  --f-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f151b; --paper: #161f28; --ink: #e4eaf0; --muted: #93a2b1; --line: #2a3643;
  --accent: #6fb6e3; --accent-soft: #19303f; --warn: #f0905c; --warn-soft: #3a2218; --pending: #e0cb6e; --pending-soft: #2f2a14;
  --danger: #ff8a80; --danger-soft: #3d1715; --unsafe: #f5a25d; --unsafe-soft: #3a2414; --caution: #e7cf6a; --caution-soft: #332c12; --low: #8fd0a4; --low-soft: #17301f;
  --band-th: #2f4a37; --band-light: #3f7350; --band-common: #9a7d2c; --band-strong: #a35a2c; --band-heavy: #b2442b; color-scheme: dark }
  :root:not([data-theme="light"]) .ico-tripsit { box-shadow: 0 0 0 1px var(--line) } }
:root[data-theme="dark"] {
  --bg: #0f151b; --paper: #161f28; --ink: #e4eaf0; --muted: #93a2b1; --line: #2a3643;
  --accent: #6fb6e3; --accent-soft: #19303f; --warn: #f0905c; --warn-soft: #3a2218; --pending: #e0cb6e; --pending-soft: #2f2a14;
  --danger: #ff8a80; --danger-soft: #3d1715; --unsafe: #f5a25d; --unsafe-soft: #3a2414; --caution: #e7cf6a; --caution-soft: #332c12; --low: #8fd0a4; --low-soft: #17301f;
  --band-th: #2f4a37; --band-light: #3f7350; --band-common: #9a7d2c; --band-strong: #a35a2c; --band-heavy: #b2442b; color-scheme: dark }
:root[data-theme="dark"] .ico-tripsit { box-shadow: 0 0 0 1px var(--line) }

* { box-sizing: border-box }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--f-body) }
h1, h2, h3, h4 { font-family: var(--f-display); text-wrap: balance; line-height: 1.15; margin: 0 }
a { color: var(--accent) }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
p { margin: 0 }
.in, .page { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.mono { font-family: var(--f-mono); font-size: .86em } .wrap { word-break: break-all }
.num { font-variant-numeric: tabular-nums }
.muted { color: var(--muted) } .small { font-size: .82rem }
.label { font: 600 .7rem var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted) }

header.site { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5 }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper) }
header.site .in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-block: 10px }
.brand { font: 800 1.1rem var(--f-display); font-stretch: 85%; color: var(--ink); text-decoration: none }
.viewswitch { display: flex; flex-wrap: wrap; align-items: center; gap: 4px }
.viewswitch button { font: 600 .82rem var(--f-body); background: none; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; cursor: pointer }
.viewswitch button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--paper) }

.page { padding-block: 22px 40px; display: grid; gap: 18px }
.titleblock { display: grid; gap: 8px }
.titleblock h1 { font-size: clamp(2rem, 5vw, 3rem); font-stretch: 80%; font-weight: 800 }
.aka { color: var(--muted) }
.wikibar { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .86rem; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper) }
.wikibar a { font-weight: 600; overflow-wrap: anywhere }
.pending-inline { color: var(--pending) }

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start }
.blocks { display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.blk { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; display: grid; gap: 10px; min-width: 0 }
.blk h2 { font-size: 1.3rem }
.blk h3 { font-size: 1rem; margin-top: 6px }
.blk h4 { font-size: .9rem }
.scroll { overflow-x: auto }
table { border-collapse: collapse; width: 100% }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .9rem }
thead th { font: 600 .7rem var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted) }
tbody th { font-weight: 600; white-space: nowrap }
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0 }
dl.kv dt { color: var(--muted); font-weight: 600 } dl.kv dd { margin: 0; min-width: 0 }
@media (max-width: 560px) { dl.kv { grid-template-columns: 1fr } dl.kv dt { margin-top: 6px } }

.src { font: 600 .64rem/1 var(--f-mono); letter-spacing: .04em; color: var(--accent); background: var(--accent-soft); border-radius: 3px; padding: 3px 5px; text-decoration: none; vertical-align: middle; white-space: nowrap }
.refno { font-size: .72em; vertical-align: super; text-decoration: none; margin-left: 1px }
.flag { display: inline-block; margin-left: 6px; font-size: .78rem; color: var(--warn); background: var(--warn-soft); border-radius: 4px; padding: 1px 6px }
.claim[data-status="disputed"] { background: var(--warn-soft); border-radius: 3px }
.chip { display: inline-block; font-size: .8rem; border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; color: var(--ink); margin: 2px 2px 2px 0 }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px }
.chips .claim { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 4px 1px 9px; font-size: .84rem }
.pending { background: var(--pending-soft); color: var(--pending); border: 1px dashed var(--pending); border-radius: 6px; padding: 10px 12px; font-size: .86rem }
.pending b { font: 600 .7rem var(--f-mono); letter-spacing: .05em; text-transform: uppercase; display: block; margin-bottom: 2px }
.note-warn { background: var(--warn-soft); border-left: 4px solid var(--warn); padding: 8px 12px; border-radius: 0 6px 6px 0 }

.tier { display: inline-block; font: 600 .68rem var(--f-mono); letter-spacing: .04em; text-transform: uppercase; border-radius: 4px; padding: 2px 6px; margin-right: 4px }
.tier-danger { background: var(--danger-soft); color: var(--danger) } .tier-unsafe { background: var(--unsafe-soft); color: var(--unsafe) }
.tier-caution { background: var(--caution-soft); color: var(--caution) } .tier-low { background: var(--low-soft); color: var(--low) }
.mixlist { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px }
.mixlist li { border-left: 3px solid var(--line); padding-left: 10px }
.tsgroup { display: grid; gap: 6px }
.refs { margin: 0; padding-left: 22px; font-size: .84rem; display: grid; gap: 4px }
.kind { font: 600 .62rem var(--f-mono); text-transform: uppercase; letter-spacing: .04em; border-radius: 3px; padding: 1px 5px; background: var(--bg); color: var(--muted) }
.kind-medical_journal_or_agency { background: var(--low-soft); color: var(--low) }
.legal { margin: 0; padding-left: 18px; display: grid; gap: 4px }

.doseband { display: grid; gap: 4px }
.doseband .bar { display: flex; height: 32px; border-radius: 4px; overflow: hidden }
.doseband .bar div { display: flex; align-items: center; justify-content: center; font: 600 .68rem var(--f-mono); color: var(--ink); overflow: hidden; white-space: nowrap; min-width: 0 }
.b-th { background: var(--band-th) } .b-light { background: var(--band-light) } .b-common { background: var(--band-common) } .b-strong { background: var(--band-strong) } .b-heavy { background: var(--band-heavy) }
.ticks, .axis { position: relative; height: 18px; font: .7rem var(--f-mono); color: var(--muted) }
.ticks span, .axis span { position: absolute; transform: translateX(-50%) } .ticks span:first-child, .axis span:first-child { transform: none }
.ticks .unit { right: 0; left: auto; transform: none }
.tl { display: grid; gap: 4px } .tl .row { display: flex; height: 28px; border-radius: 4px; overflow: hidden }
.tl .row div { display: flex; align-items: center; padding-left: 6px; font: 600 .68rem var(--f-mono); white-space: nowrap; overflow: hidden; min-width: 0 }
.ph-onset { background: var(--band-th) } .ph-comeup { background: var(--band-light) } .ph-peak { background: var(--band-common) } .ph-offset { background: var(--band-strong) }

.tiles { display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0 }
.tile .v { font: 700 1.15rem/1.2 var(--f-display); margin-top: auto }
@media (max-width: 700px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)) } }

.infobox { display: none; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: .86rem; overflow: hidden; min-width: 0 }
.infobox h2 { font-size: 1.05rem; padding: 10px 12px; background: var(--accent-soft) }
.infobox dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr) }
.infobox dt, .infobox dd { margin: 0; padding: 7px 12px; border-top: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere }
.infobox dt { color: var(--muted); font-weight: 600 }

.reports { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px }
.reports .col { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 8px; align-content: start; min-width: 0 }
.reports h3 { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 6px }
.reports .host { font: 400 .72rem var(--f-mono) }
@media (max-width: 640px) { .reports { grid-template-columns: 1fr } }

.xlinks { display: grid; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px }
.xlinks ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .9rem }

footer.site { border-top: 1px solid var(--line); background: var(--paper) }
footer.site .in { padding-block: 18px 28px; display: grid; gap: 10px }
footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 16px }

/* trust controls (shown when reviewer voting is switched on) */
.trust { display: inline-flex; gap: 2px; margin-left: 4px; vertical-align: middle; font: 600 .66rem/1 var(--f-mono) }
.trust button { font: inherit; border: 1px solid var(--line); background: var(--paper); color: var(--muted); border-radius: 3px; padding: 2px 5px; cursor: pointer }
.trust button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink) }

/* ---------- views ---------- */
/* A · safety card: single column, dose first */
html[data-view="a"] .blocks { max-width: 820px }
html[data-view="a"] #s-dose { order: 1 } html[data-view="a"] #s-timing { order: 2 } html[data-view="a"] #s-mixing { order: 3 }
html[data-view="a"] #s-risks { order: 4 } html[data-view="a"] #s-testing { order: 5 } html[data-view="a"] #s-effects { order: 6 }
html[data-view="a"] #s-summary { order: 7 } html[data-view="a"] #s-reports { order: 8 } html[data-view="a"] #s-history { order: 9 }
html[data-view="a"] #s-legal { order: 10 } html[data-view="a"] #s-chem { order: 11 } html[data-view="a"] #s-pharm { order: 12 } html[data-view="a"] #s-refs { order: 13 }
html[data-view="a"] #s-mixing, html[data-view="a"] #s-risks, html[data-view="c"] #s-mixing, html[data-view="c"] #s-risks { border-left: 4px solid var(--warn) }

/* B · full article: overview first, fact box beside */
html[data-view="b"] .layout { grid-template-columns: minmax(0, 1fr) 290px }
html[data-view="b"] .infobox { display: block; position: sticky; top: 64px }
html[data-view="b"] #s-summary { order: 1 } html[data-view="b"] #s-effects { order: 2 } html[data-view="b"] #s-dose { order: 3 }
html[data-view="b"] #s-timing { order: 4 } html[data-view="b"] #s-mixing { order: 5 } html[data-view="b"] #s-risks { order: 6 }
html[data-view="b"] #s-testing { order: 7 } html[data-view="b"] #s-pharm { order: 8 } html[data-view="b"] #s-chem { order: 9 }
html[data-view="b"] #s-history { order: 10 } html[data-view="b"] #s-legal { order: 11 } html[data-view="b"] #s-reports { order: 12 } html[data-view="b"] #s-refs { order: 13 }
html[data-view="b"] .blk { border-radius: 0; border-width: 0 0 1px; background: transparent; padding-inline: 0 }
@media (max-width: 860px) { html[data-view="b"] .layout { grid-template-columns: 1fr } html[data-view="b"] .infobox { position: static; order: -1 } }

/* C · at a glance: tiles, scale, timeline, mixing, risks; long text hidden */
html[data-view="c"] .tiles { display: grid; order: 0 }
html[data-view="c"] #s-dose { order: 1 } html[data-view="c"] #s-timing { order: 2 } html[data-view="c"] #s-mixing { order: 3 } html[data-view="c"] #s-risks { order: 4 }
html[data-view="c"] #s-testing { order: 5 } html[data-view="c"] #s-reports { order: 6 }
html[data-view="c"] .blk.long { display: none }
html[data-view="c"] #s-dose table, html[data-view="c"] #s-timing table { font-size: .82rem }
html[data-view="c"] .titleblock h1 { font-size: clamp(2.4rem, 8vw, 3.6rem) }
html[data-view="c"] .blk > p.claim, html[data-view="c"] .blk > p:not([class]), html[data-view="c"] .blk li { max-width: 70ch }
html[data-view="c"] .refno { display: none }  /* the reference list is not part of this view */
/* safety card and sparse pages: the boxes above and below the cards share the cards' width */
html[data-view="a"] .wikibar, html[data-view="a"] .page > .safety-notice, html[data-view="a"] .xlinks, .sparse .wikibar, .sparse .page > .safety-notice, .sparse .xlinks { max-width: 820px }
.clip { color: transparent }  /* a band label that does not fit its band; the band keeps its title */
#s-pharm thead th { text-transform: none; letter-spacing: 0 }  /* units such as μM must keep their case */
#s-pharm td:not(:first-child):not(:last-child) { white-space: nowrap }
.infobox dd { hyphens: auto }
.safety-notice a[href^="tel:"] { white-space: nowrap }

/* D · sparse */
.sparse .blocks { max-width: 820px }

@media (prefers-reduced-motion: no-preference) { .viewswitch button { transition: background .15s, color .15s } }
.replinks { margin: 0; padding-left: 18px; font-size: .86rem; display: grid; gap: 3px }
/* source tags: each site keeps its own colour so tags are told apart at a glance; favicon shown when saved */
/* the tag is a plain inline so the no-break space before it keeps it on the same line as the value's last word */
.src { display: inline; white-space: nowrap } .src .ico { margin-right: 3px; vertical-align: -2px }
.src .ico { width: 12px; height: 12px; border-radius: 2px; background-position: center; background-size: contain; background-repeat: no-repeat; display: inline-block; flex: none }
.src-psychonautwiki { background: #ece4f7; color: #5b2a9b }
.src-wikipedia { background: #ebebeb; color: #202122 }
.src-tripsit { background: #e1f3f1; color: #0b6b62 }
.src-pubchem { background: #e3ecf8; color: #1f4f8f }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .src-psychonautwiki { background: #2c2140; color: #c9a8f2 }
  :root:not([data-theme="light"]) .src-wikipedia { background: #2b2d30; color: #e6e6e6 }
  :root:not([data-theme="light"]) .src-tripsit { background: #12322f; color: #7fd6cb }
  :root:not([data-theme="light"]) .src-pubchem { background: #182a42; color: #9cc0ef } }
:root[data-theme="dark"] .src-psychonautwiki { background: #2c2140; color: #c9a8f2 }
:root[data-theme="dark"] .src-wikipedia { background: #2b2d30; color: #e6e6e6 }
:root[data-theme="dark"] .src-tripsit { background: #12322f; color: #7fd6cb }
:root[data-theme="dark"] .src-pubchem { background: #182a42; color: #9cc0ef }
.wslist { margin: 0; padding-left: 20px; display: grid; gap: 4px }
.ico { width: 12px; height: 12px; border-radius: 2px; background-position: center; background-size: contain; background-repeat: no-repeat; display: inline-block; flex: none }
.named { white-space: nowrap }
.named .ico { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px }
/* brand: the "." in intoxicant.wiki is drawn as a capsule centered where the dot sits; the real dot stays for copy and screen readers */
:root { --pill-a: #d4583a; --pill-b: transparent }
.brand { display: inline-flex; align-items: baseline }
.brand .dot { position: relative; display: inline-block; width: .32em }
.brand .dot-char { color: transparent }
.brand .pill { position: absolute; left: 50%; bottom: .09em; width: .5em; height: .25em; transform: translateX(-50%) rotate(var(--r, -28deg)); transform-origin: 50% 50%; color: var(--ink); overflow: visible }
/* pop culture (community-added) */
html[data-view="a"] #s-popculture { order: 9 } html[data-view="b"] #s-popculture { order: 12 }
.pclist { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px }
.pclist li { border-left: 3px solid var(--line); padding-left: 10px; display: grid; gap: 4px }
.pclist blockquote { margin: 0; color: var(--muted) }
.pcadd summary { cursor: pointer; font-weight: 600; color: var(--accent) }
.pcform { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-top: 8px }
.pcform label { display: grid; gap: 2px; font-size: .82rem; color: var(--muted) }
.pcform .wide { grid-column: 1 / -1 }
.pcform input, .pcform select, .pcform button { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--ink) }
.pcform button { justify-self: start; cursor: not-allowed }
@media (max-width: 560px) { .pcform { grid-template-columns: 1fr } }
.pclist li > .tier { justify-self: start }
.wikibar { display: grid; gap: 4px }
.wikihead { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center }
.wikibar .why { font-size: .8rem; color: var(--muted); max-width: 90ch }
.prose p, .prose li { max-width: 68ch }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 4px }
.tagline { font: italic 400 .84rem/1.3 var(--f-body); color: var(--muted); margin-left: 10px; flex: 1 1 0; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical }
/* phone: the subtitle gets its own full line under the brand, and the header scrolls away instead of sticking, so it does not cost a quarter of the screen */
@media (max-width: 640px) { .tagline { flex-basis: 100%; margin-left: 0; font-size: .8rem } header.site { position: static } }
.topnav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; margin-left: 18px }
.topnav a { color: var(--muted); text-decoration: none } .topnav a:hover { color: var(--accent); text-decoration: underline }
@media (max-width: 640px) { .topnav { margin-left: 0; order: 3; width: 100% } }
.blk > *, .scroll { min-width: 0 } .scroll { max-width: 100% }
.page > *, .layout > *, .blocks > * { min-width: 0 }
.refs li, .refs a { overflow-wrap: anywhere; min-width: 0 }
/* every sourced value: hover shows where it came from, right-click (or long-press) opens the claim menu */
.claim { border-bottom: 1px dotted transparent; transition: border-color .12s, background .12s }
.claim:hover { border-bottom-color: var(--accent); background: var(--accent-soft); border-radius: 2px; cursor: context-menu }
.claimmenu { position: fixed; z-index: 50; min-width: 240px; max-width: min(92vw, 360px); background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 6px; font-size: .88rem }
.claimmenu .hd { font: 600 .68rem var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 4px; overflow-wrap: anywhere }
.claimmenu button, .claimmenu a { display: block; width: 100%; text-align: left; font: inherit; background: none; border: 0; color: var(--ink); padding: 7px 10px; border-radius: 5px; cursor: pointer; text-decoration: none }
.claimmenu button:hover, .claimmenu a:hover, .claimmenu button:focus-visible, .claimmenu a:focus-visible { background: var(--accent-soft); outline: none }
.claimmenu .danger { color: var(--warn) }
.claimmenu form { display: grid; gap: 6px; padding: 6px 10px 8px }
.claimmenu textarea, .claimmenu input, .claimmenu select { font: inherit; width: 100%; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--ink) }
.claimmenu .row { display: flex; gap: 6px; justify-content: flex-end }
.claimmenu .row button { width: auto; border: 1px solid var(--line) }
.claimmenu .row .primary { background: var(--accent); color: var(--paper); border-color: var(--accent) }
.claimmenu .ok { padding: 8px 10px; color: var(--low) }
/* self-reported dose */
.selfreport { border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 10px }
.selfreport summary { cursor: pointer; font-weight: 600; color: var(--accent) }
.warnbox { background: var(--warn-soft); border-left: 4px solid var(--warn); padding: 10px 12px; border-radius: 0 6px 6px 0; font-size: .9rem }
.srform { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end }
.srform label { display: grid; gap: 2px; font-size: .82rem; color: var(--muted) }
.srform label.chk { grid-auto-flow: column; align-items: center; justify-content: start; gap: 6px; color: var(--ink) }
.srform input, .srform select, .srform button { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--ink) }
.srform input[type=number] { width: 7em }
.srform button { background: var(--accent); color: var(--paper); border-color: var(--accent); cursor: pointer }
.srstats table { width: auto } .srstats .few { color: var(--warn) }
.consent { position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: max(12px, env(safe-area-inset-bottom, 0px)); z-index: 40; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: .9rem; max-width: 720px; margin: 0 auto }
.consent span { flex: 1 1 320px } .consent button { font: inherit; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); cursor: pointer }
.consent button[data-c="yes"] { background: var(--accent); color: var(--paper); border-color: var(--accent) }

/* homepage and A–Z */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.hero { display: grid; gap: 12px; padding: 18px 0 6px }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); font-stretch: 80%; font-weight: 800; line-height: 1.05; margin: 0 }
.lede { font-size: 1.05rem; max-width: 70ch; margin: 0 }
.search { position: relative; display: flex; gap: 8px; max-width: 640px }
.search input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 1.05rem; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink) }
.search button { font: 600 .95rem var(--f-body); padding: 0 16px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent); color: var(--paper); cursor: pointer }
.hits { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 6; list-style: none; margin: 0; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14); max-height: 60vh; overflow: auto }
.hits li a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--ink); text-decoration: none }
.hits li a:hover, .hits li a:focus { background: var(--accent-soft) }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px }
.qt { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); text-decoration: none; font-size: .92rem; min-width: 0 }
.qt:hover { border-color: var(--accent) } .qt span { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch } @media (max-width: 760px) { .home-grid { grid-template-columns: 1fr } }
.home .blk ul { margin: 0; padding-left: 18px; display: grid; gap: 6px }
[hidden] { display: none !important }
.letters { display: flex; flex-wrap: wrap; gap: 4px } .letters a { font: 600 .9rem var(--f-mono); min-width: 2em; text-align: center; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; background: var(--paper) }
.azlist { list-style: none; margin: 0; padding: 0; columns: 3 240px; column-gap: 24px } .azlist li { break-inside: avoid; padding: 3px 0; font-size: .92rem; overflow-wrap: anywhere }
:root { --header-h: 43px } @media (max-width: 640px) { :root { --header-h: 0px } }
.azgroup { scroll-margin-top: calc(env(safe-area-inset-top, 0px) + var(--header-h) + 8px) }
.azgroup h2 { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--header-h)); background: var(--paper); margin: 0; padding: 6px 0 4px }

/* combination chart */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .84rem } .lg { display: inline-flex; align-items: center; gap: 5px }
.legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid var(--line) } .legend i.none { background: var(--bg) }
.combo-wrap { max-height: 80vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--paper) } @media (min-width: 900px) { .combo-wrap { max-height: none } }
.combos .page > p.small { max-width: 70ch }
.combo { border-collapse: separate; border-spacing: 2px; font-size: .72rem; width: auto; table-layout: fixed }
.combo-wrap { width: 100%; max-width: 100%; contain: paint } .combos .page, .combos main { min-width: 0 }
.combo th { position: sticky; background: var(--paper); z-index: 2; font-weight: 600; padding: 2px 4px; border: 0; white-space: nowrap; text-align: left }
.combo thead th { top: 0; height: 116px; vertical-align: bottom; text-transform: none; letter-spacing: 0 } .combo thead th span { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; max-height: 112px; overflow: hidden }
.combo tbody th { left: 0 } .combo th.corner { left: 0; top: 0; z-index: 3 }
.combo td { padding: 0; border: 0; width: 22px; height: 22px; min-width: 22px; border-radius: 3px; background: var(--bg) } .combo td.self { background: var(--line) }
.combo td button { display: block; width: 100%; height: 100%; min-height: 22px; background: none; border: 0; cursor: pointer; border-radius: 3px }
.combo td button:hover, .combo td button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px }
#cd-status.tier { color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.5) }

/* dose and duration tables share one column grid per page, so rows line up between route tables; row headers may wrap */
@media (min-width: 641px) { #s-dose .scroll table, #s-timing .scroll table { table-layout: fixed } #s-dose .scroll th:first-child { width: 22% } #s-timing .scroll th:first-child { width: 24% } }
#s-dose tbody th, #s-timing tbody th { white-space: normal }

/* code keys in tables stay whole; the footer emergency notice's country picker follows the theme */
td code { white-space: nowrap }
.safety-notice select { background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px }
/* table.stack: on a phone each row becomes a short block, labelled from the cells' data-label (for wide reference tables such as emergency numbers) */
@media (max-width: 640px) {
  table.stack, table.stack tbody { display: block } table.stack thead { display: none }
  table.stack tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line) }
  table.stack th, table.stack td { display: block; border: 0; padding: 2px 0; white-space: normal } table.stack tbody th { padding-bottom: 4px }
  table.stack td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 7.5rem; margin-right: .5em; font: 600 .66rem/1.4 var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted) }
}
.letters.kinds { margin-top: 6px } .letters.kinds a { font: 600 .8rem var(--f-body) }
.mixlist.sub { margin-top: 6px; padding-left: 1.2rem; gap: 4px } .mixlist.sub li { list-style: circle; border-left: 0; padding-left: 0 }
.wslist li.d2 { margin-left: 1.3rem; list-style: circle } .wslist li.d3, .wslist li.d4 { margin-left: 2.6rem; list-style: square }
p.claim.d2 { margin-left: 1.3rem }
#s-pharm thead tr:first-child th[colspan] { text-align: center; border-bottom: 1px solid var(--line) }
