/* NARCO.BUZZ drug wiki. Sits on top of styles.css and only uses its tokens. */
:root {
  --g-psychedelic: #7b2ff7; --g-stimulant: #d7263d; --g-depressant: #2a6fdb; --g-opioid: #b8570a;
  --g-dissociative: #0e8f8f; --g-cannabinoid: #2f9e5b; --g-entactogen: #d6338a; --g-deliriant: #6b4f2a;
  --g-nootropic: #5a6b00; --g-other: #6b6273;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --g-psychedelic:#b68cff; --g-stimulant:#ff6b7d; --g-depressant:#7fb0ff; --g-opioid:#ffa257; --g-dissociative:#4fd6d6; --g-cannabinoid:#4fd388; --g-entactogen:#ff7fc0; --g-deliriant:#d2b48c; --g-nootropic:#c6e04a; --g-other:#a59cb0; }
}
:root[data-theme="dark"] { --g-psychedelic:#b68cff; --g-stimulant:#ff6b7d; --g-depressant:#7fb0ff; --g-opioid:#ffa257; --g-dissociative:#4fd6d6; --g-cannabinoid:#4fd388; --g-entactogen:#ff7fc0; --g-deliriant:#d2b48c; --g-nootropic:#c6e04a; --g-other:#a59cb0; }
.g-psychedelic { --g: var(--g-psychedelic); } .g-stimulant { --g: var(--g-stimulant); } .g-depressant { --g: var(--g-depressant); }
.g-opioid { --g: var(--g-opioid); } .g-dissociative { --g: var(--g-dissociative); } .g-cannabinoid { --g: var(--g-cannabinoid); }
.g-entactogen { --g: var(--g-entactogen); } .g-deliriant { --g: var(--g-deliriant); } .g-nootropic { --g: var(--g-nootropic); } .g-other { --g: var(--g-other); }

/* Header: search, random, and a second row that acts on the current page */
.bar { gap: 12px; }
.logo { flex: none; }
.htools { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; justify-content: flex-end; }
.hsearch { position: relative; flex: 1; max-width: 300px; min-width: 0; }
.hsearch input { padding: 7px 12px; font-size: 15px; border-radius: 999px; }
.hsearch ul { position: absolute; right: 0; top: calc(100% + 6px); width: min(340px, calc(100vw - 32px)); margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .18); z-index: 30; }
@media (max-width: 640px) {
  /* .top has a backdrop-filter, so "fixed" here is measured from the header itself */
  .hsearch ul { position: fixed; left: 16px; right: 16px; top: 54px; width: auto; }
  .rnd { padding: 6px 11px; }
}
.hsearch li a { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.hsearch li a span { flex: none; font: 400 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--g, var(--muted)); }
.hsearch li[aria-selected="true"] a, .hsearch li a:hover { background: var(--soft); }
.hsearch .nores { padding: 7px 10px; color: var(--muted); font-size: 15px; }
.rnd { flex: none; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; padding: 6px 14px; border-radius: 999px; }
.rnd:hover { border-color: var(--accent); color: var(--accent); }
.tabs button { flex: none; background: none; border: 0; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 15px; padding: 6px 12px; border-radius: 999px; }
.tabs button i { font: 400 12px var(--mono); margin-left: 2px; opacity: .75; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.tabs button:hover, .tabs a:hover { color: var(--ink); }
.tabs button[aria-pressed="true"]:hover { color: var(--bg); }
.tabs a[aria-current="true"] { background: var(--ink); color: var(--bg); }
.tabs a.back::before { content: "←"; margin-right: 6px; }
.tabs a.tgrp { color: var(--g); box-shadow: inset 0 0 0 1.5px var(--g); margin-right: 6px; }

/* Home: catalog of intoxicant.wiki pages (uses the theme's .tools / .tool cards) */
#catalog .h { margin-top: 26px; }
#catalog .sub { margin-bottom: 14px; }
.tools { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tool .ckind { font: 400 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.tool b::after { content: " ↗"; color: var(--muted); font-weight: 400; }
#index-h { margin-bottom: 0; }
@media (max-width: 600px) {
  /* one swipeable row on phones, so the drug index stays close to the top */
  #catalog .tools { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; scrollbar-width: none; }
  #catalog .tools::-webkit-scrollbar { display: none; }
  #catalog .tool { scroll-snap-align: start; }
}

/* Home: finder and A to Z */
.hello h1 { max-width: 14ch; }
.finder { position: sticky; top: 92px; z-index: 10; background: var(--bg); padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.filt { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-top: 10px; }
.filt::-webkit-scrollbar { display: none; }
.filt button { flex: none; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font-weight: 600; font-size: 14px; cursor: pointer; }
.filt button i { font: 400 12px var(--mono); color: var(--muted); margin-left: 2px; }
.filt button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filt button[aria-pressed="true"] i { color: inherit; opacity: .7; }
.finder .fine { margin: 6px 0 0; min-height: 1em; }
.jump { display: flex; flex-wrap: wrap; gap: 2px; margin: 14px 0 4px; font-family: var(--mono); font-size: 14px; }
.jump a { padding: 3px 7px; border-radius: 6px; text-decoration: none; color: var(--muted); }
.jump a:hover { background: var(--soft); color: var(--ink); }
.az { scroll-margin-top: 230px; }
.az h2 { font: 600 14px var(--mono); color: var(--accent); letter-spacing: .1em; margin: 26px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.az ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 18px; }
.az li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dotted var(--line); min-width: 0; }
.az li a { color: var(--ink); text-decoration: none; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.az li a:hover { color: var(--accent); text-decoration: underline; }
.az li span { flex: none; font: 400 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--g, var(--muted)); }
.none { color: var(--muted); padding: 30px 0; text-align: center; }

/* Drug page */
.drug { min-width: 0; }
.dhead .ph { margin: 6px 0 8px; overflow-wrap: anywhere; }
.cls { margin: 0; font: 400 13px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.grp { display: inline-block; color: var(--g); border: 1.5px solid var(--g); border-radius: 999px; padding: 1px 10px; margin-right: 8px; text-decoration: none; font-weight: 600; }
.aka { color: var(--muted); margin: 0 0 14px; max-width: 760px; }
.aka span { font: 400 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; margin-right: 6px; }
.glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.glance div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.glance span { display: block; font: 400 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.glance b { font-size: 19px; letter-spacing: -.01em; }
.toc { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 16px 0 6px; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toc::-webkit-scrollbar { display: none; }
.toc a { flex: none; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 10px; border-radius: 999px; }
.toc a:hover { background: var(--soft); color: var(--ink); }
.dgrid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; align-items: start; }
.side { position: sticky; top: 104px; max-height: calc(100vh - 120px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; font-size: 14px; }
@media (max-width: 860px) { .dgrid { grid-template-columns: minmax(0, 1fr); } .side { position: static; max-height: none; order: -1; } }
.mol { margin: 0 0 12px; display: flex; justify-content: center; }
.molsvg { display: block; max-width: 100%; height: auto; color: var(--ink); overflow: visible; }
.molsvg .ms { fill: none; stroke: var(--mc, currentColor); stroke-width: 1.5px; stroke-linecap: round; }
.molsvg .mf { fill: var(--mc, currentColor); stroke: var(--mc, currentColor); stroke-width: .4px; }
.molsvg .mt { fill: var(--mc, currentColor); stroke: none; font-family: var(--sans); }
.molsvg .c-n { --mc: var(--g-depressant); } .molsvg .c-o { --mc: var(--g-stimulant); } .molsvg .c-s { --mc: var(--g-opioid); }
.molsvg .c-f, .molsvg .c-cl { --mc: var(--g-cannabinoid); } .molsvg .c-br, .molsvg .c-i { --mc: var(--g-deliriant); } .molsvg .c-p { --mc: var(--g-entactogen); }
.facts { margin: 0; }
.facts dt { font: 400 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 10px; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 1px 0 0; overflow-wrap: anywhere; }

.sec { scroll-margin-top: 110px; padding: 6px 0 8px; min-width: 0; }
.sec > h2 { font-size: 26px; letter-spacing: -.02em; margin: 26px 0 10px; }
.sec h3 { font-size: 18px; margin: 20px 0 6px; }
.sec h4 { font-size: 16px; margin: 16px 0 4px; }
.sec p, .sec li { overflow-wrap: anywhere; }
.sec p { margin: 0 0 12px; }
.sec ul, .sec ol { padding-left: 22px; margin: 0 0 12px; }
.sec li { margin: 5px 0; }
.sec .small, .sec small { font-size: 14px; }
.sec .muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .9em; }
.label { display: block; font: 400 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 10px; }
.note-warn { border-left: 3px solid var(--caution); background: var(--soft); padding: 10px 14px; border-radius: 0 10px 10px 0; font-size: 15px; }
.sec details { margin: 0 0 12px; }
.sec summary { cursor: pointer; font-weight: 600; color: var(--accent); }

/* source chips and reference marks */
a.src { font: 600 10px var(--mono); letter-spacing: .04em; text-decoration: none; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 2px; vertical-align: 1px; white-space: nowrap; }
a.src:hover { color: var(--accent); border-color: var(--accent); }
a.refno { font: 400 11px var(--mono); text-decoration: none; vertical-align: super; line-height: 0; margin-left: 1px; }
.refs { font-size: 14px; color: var(--muted); padding-left: 30px; }
.refs li { margin: 4px 0; overflow-wrap: anywhere; }
.refs li:target { background: var(--soft); color: var(--ink); }
.kind { font: 400 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-right: 4px; }
.kind-medical_journal_or_agency { color: var(--lower); border-color: var(--lower); }

/* tables */
.scroll { overflow-x: auto; margin: 0 0 12px; }
.sec table { border-collapse: collapse; width: 100%; font-size: 15px; }
.sec th, .sec td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sec thead th { font: 400 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
.sec tbody th { font-weight: 600; }
.kv { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); gap: 0; margin: 0 0 12px; font-size: 15px; }
.kv dt { color: var(--muted); padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
.kv dd { margin: 0; padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 560px) { .kv { grid-template-columns: minmax(0, 1fr); } .kv dt { border: 0; padding-bottom: 0; } }

/* duration timeline */
.tl { display: grid; gap: 4px; margin: 0 0 12px; }
.tl .row { display: flex; height: 30px; border-radius: 8px; overflow: hidden; }
.tl .row div { display: flex; align-items: center; padding-left: 8px; font: 600 11px var(--mono); white-space: nowrap; overflow: hidden; min-width: 0; color: var(--accent-ink); }
.ph-onset { background: color-mix(in srgb, var(--accent) 35%, var(--muted)); }
.ph-comeup { background: color-mix(in srgb, var(--accent) 65%, var(--muted)); }
.ph-peak { background: var(--accent); }
.ph-offset { background: color-mix(in srgb, var(--accent) 55%, var(--bg)); }
.axis { position: relative; height: 18px; font: 400 11px var(--mono); color: var(--muted); }
.axis span { position: absolute; transform: translateX(-50%); }
.axis span:first-child { transform: none; }

/* mixing tiers */
.tier { display: inline-block; font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; border-radius: 5px; padding: 1px 7px; margin-right: 4px; color: #fff; background: var(--unknown); }
.tier-danger { background: var(--danger); } .tier-unsafe { background: color-mix(in srgb, var(--danger) 60%, var(--caution)); }
.tier-caution { background: var(--caution); } .tier-low { background: var(--lower); }
.mixlist, .af-list, .wslist, .legal { list-style: none; padding-left: 0 !important; }
.mixlist li, .af-list li, .legal li { padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
.tsgroup { margin: 0 0 14px; }
.chip { display: inline-block; font-size: 14px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; margin: 2px 2px 2px 0; color: var(--ink); text-decoration: none; }
a.chip:hover { border-color: var(--accent); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.foot .fine { max-width: none; margin: 6px 0 0; }
