:root {
  --ground: #F2F4F8;
  --surface: #FFFFFF;
  --surface-2: #E9EDF4;
  --line: #D6DDE8;
  --ink: #0C1322;
  --muted: #56627A;
  --mint: #0A9A80;
  --violet: #4B3BD9;
  --accent: var(--violet);
  --mol-c: #1A2338;
  --mol-o: #E0453F;
  --mol-n: #2F6FE0;
  --mol-s: #B98A00;
  --mol-p: #D9731A;
  --ev-strong: #12925F;
  --ev-moderate: #B7800B;
  --ev-limited: #C85436;
  --ev-anecdotal: #7A8499;
  --glow: rgba(75, 59, 217, 0.10);
  --shadow: 0 1px 2px rgba(12, 19, 34, .06), 0 8px 24px -12px rgba(12, 19, 34, .18);
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #080C16; --surface: #0F1524; --surface-2: #151D31; --line: #222C44;
    --ink: #E7ECF6; --muted: #8B97B1; --mint: #62F0CF; --violet: #9C8FFF; --accent: var(--mint);
    --mol-c: #DCE4F5; --mol-o: #FF7A74; --mol-n: #7FB0FF; --mol-s: #F5CB4C; --mol-p: #FFA15C;
    --ev-strong: #46D891; --ev-moderate: #F2BD45; --ev-limited: #FF8566; --ev-anecdotal: #8792AA;
    --glow: rgba(98, 240, 207, 0.08);
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -16px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #080C16; --surface: #0F1524; --surface-2: #151D31; --line: #222C44;
  --ink: #E7ECF6; --muted: #8B97B1; --mint: #62F0CF; --violet: #9C8FFF; --accent: var(--mint);
  --mol-c: #DCE4F5; --mol-o: #FF7A74; --mol-n: #7FB0FF; --mol-s: #F5CB4C; --mol-p: #FFA15C;
  --ev-strong: #46D891; --ev-moderate: #F2BD45; --ev-limited: #FF8566; --ev-anecdotal: #8792AA;
  --glow: rgba(98, 240, 207, 0.08);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -16px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(900px 500px at 85% -10%, var(--glow), transparent 70%);
  background-repeat: no-repeat;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: max(16px, 3vw); }
.mono { font-family: var(--mono); }
.eyebrow { font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- header ---------- */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 19px/1 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; padding: 7px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 15px; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }


/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; padding-block: 56px 40px; }
.hero h1 { font: 800 clamp(40px, 6vw, 72px)/0.98 var(--display); letter-spacing: -.035em; margin: 14px 0 18px; text-wrap: balance; }
.hero h1 em { font-style: normal; background: linear-gradient(95deg, var(--mint), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lede { font-size: 18px; color: var(--muted); max-width: 46ch; margin: 0 0 26px; }
.search { position: relative; max-width: 520px; }
.search input {
  width: 100%; height: 54px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  padding: 0 20px 0 50px; font-size: 16px; box-shadow: var(--shadow);
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow), var(--shadow); }
.search svg { position: absolute; left: 18px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); }
.suggest { position: absolute; left: 0; right: 0; top: 60px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; z-index: 5; }
.suggest a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; text-decoration: none; }
.suggest a:hover, .suggest a.on { background: var(--surface-2); }
.suggest small { color: var(--muted); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 30px; }
.stats b { display: block; font: 700 28px/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats span { font-size: 13px; color: var(--muted); }

.specimen {
  position: relative; aspect-ratio: 1 / 0.92; max-width: 100%; border-radius: 22px; border: 1px solid var(--line);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--surface);
  background-blend-mode: normal; overflow: hidden; box-shadow: var(--shadow);
}
.specimen::after { content: ""; position: absolute; inset: 0; background: radial-gradient(closest-side, transparent 55%, var(--surface) 100%); pointer-events: none; }
.specimen .mol { position: absolute; inset: 10% 8% 22%; }
.specimen .meta { position: absolute; left: 20px; right: 20px; bottom: 18px; display: flex; justify-content: space-between; align-items: end; gap: 12px; z-index: 2; }
.specimen .meta a { text-decoration: none; }
.specimen .meta h3 { margin: 0; font: 700 24px/1.1 var(--display); letter-spacing: -.02em; }
.specimen .meta .mono { color: var(--muted); font-size: 13px; }
.specimen .tick { position: absolute; top: 16px; left: 20px; right: 20px; display: flex; justify-content: space-between; z-index: 2; }
.dots { display: flex; gap: 6px; }
.dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: var(--line); cursor: pointer; }
.dots button.on { background: var(--accent); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-block: 32px 24px; gap: 28px; }
}

/* ---------- sections ---------- */
section.block { padding-block: 36px; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.sec-head h2 { font: 700 30px/1.1 var(--display); letter-spacing: -.025em; margin: 6px 0 0; text-wrap: balance; }
.link { color: var(--accent); font-weight: 600; text-decoration: none; font-size: 15px; }
.link:hover { text-decoration: underline; }

.goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.goal {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color .15s, transform .15s;
}
.goal:hover { border-color: var(--accent); transform: translateY(-2px); }
.goal strong { font: 600 16px/1.25 var(--display); }
.goal span { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.goal .n { font: 500 12px var(--mono); color: var(--accent); margin-top: 4px; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; text-decoration: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.card .thumb { height: 150px; border-bottom: 1px solid var(--line); background:
  linear-gradient(var(--surface-2) 1px, transparent 1px) 0 0 / 18px 18px,
  linear-gradient(90deg, var(--surface-2) 1px, transparent 1px) 0 0 / 18px 18px; position: relative; }
.card .thumb .mol { position: absolute; inset: 12px; }
.card .thumb .mf { position: absolute; right: 10px; bottom: 8px; font: 500 11px var(--mono); color: var(--muted); }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font: 650 18px/1.2 var(--display); letter-spacing: -.01em; }
.card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 5px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.studies { font: 500 12px var(--mono); color: var(--muted); }

/* ---------- molecule drawings ---------- */
.mol svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mol.draw svg line, .mol.draw svg path { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.4s cubic-bezier(.6,.1,.2,1) forwards; }
.mol.draw svg text, .mol.draw svg tspan { animation: fadein .6s .7s both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { from { opacity: 0; } }
.atom-model { width: 100%; height: 100%; }
.atom-model .orbit { fill: none; stroke: var(--line); stroke-width: 1; }
.atom-model .e { fill: var(--accent); }
.atom-model .spin { transform-origin: 50% 50%; animation: spin linear infinite; }
.atom-model .nuc { fill: var(--violet); }
.atom-model .sym { fill: var(--ground); font: 700 26px var(--display); }
@keyframes spin { to { transform: rotate(360deg); } }
.beads { width: 100%; height: 100%; }
.beads circle { stroke: var(--surface); stroke-width: 2; }
.beads text { font: 700 10px var(--mono); fill: var(--ground); }
.beads path { fill: none; stroke: var(--line); stroke-width: 3; stroke-linecap: round; }
.lattice { width: 100%; height: 100%; }
.lattice path { fill: none; stroke: var(--line); stroke-width: 1.5; }
.lattice text { fill: var(--muted); font: 500 11px var(--mono); }

@media (prefers-reduced-motion: reduce) {
  .mol.draw svg line, .mol.draw svg path, .mol.draw svg text { animation: none; stroke-dashoffset: 0; }
  .atom-model .spin { animation: none; }
  .card, .goal { transition: none; }
}

/* ---------- library ---------- */
.lib-head { padding-block: 36px 8px; }
.lib-head h1, .page-title { font: 800 clamp(34px, 5vw, 52px)/1 var(--display); letter-spacing: -.03em; margin: 8px 0 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 22px; }
.filters .search { flex: 1 1 280px; max-width: none; }
.filters .search input { height: 46px; box-shadow: none; }
.filters select { height: 46px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: 0 14px; max-width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 999px; font-size: 14px; cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.count { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.more { display: block; margin: 26px auto 0; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 12px 22px; cursor: pointer; font-weight: 600; }
.more:hover { border-color: var(--accent); }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }

/* ---------- profile ---------- */
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); padding-top: 28px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.prof-head { padding-block: 10px 26px; border-bottom: 1px solid var(--line); }
.prof-head h1 { font: 800 clamp(38px, 6vw, 64px)/1 var(--display); letter-spacing: -.035em; margin: 12px 0 8px; text-wrap: balance; }
.prof-head .aka { font: 500 13px var(--mono); color: var(--muted); letter-spacing: .04em; }
.prof-head .tag { font-size: 19px; max-width: 60ch; margin: 14px 0 16px; text-wrap: pretty; }
.prof { display: grid; grid-template-columns: 360px 1fr; gap: 40px; padding-block: 28px 60px; align-items: start; }
.side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 76px); display: flex; flex-direction: column; gap: 14px; }
.side .specimen { aspect-ratio: 1; }
.side .specimen .mol { inset: 12% 8% 18%; }
.side .specimen .meta { bottom: 14px; }
.facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 18px; }
.facts div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.facts div:last-child { border-bottom: 0; }
.facts dt { font: 600 10.5px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; }
.buy { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 999px; background: var(--ink); color: var(--ground); text-decoration: none; font-weight: 600; }
.buy:hover { opacity: .9; }
.fine { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 0; }

.main { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.main h2 { font: 700 24px/1.15 var(--display); letter-spacing: -.02em; margin: 6px 0 12px; }
.main p { margin: 0 0 12px; max-width: 68ch; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-s { font-size: 13.5px; padding: 5px 10px; border-radius: 8px; background: var(--surface-2); }
.effects { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 14px; }
.effect { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14.5px; }
.effect i { font-style: normal; font: 700 15px var(--mono); width: 22px; text-align: center; color: var(--accent); flex: none; }

.ev-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.ev { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.meter { display: flex; align-items: center; gap: 10px; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.meter .bars { display: flex; gap: 3px; }
.meter .bars b { width: 14px; height: 6px; border-radius: 2px; background: var(--surface-2); }
.meter[data-ev="strong"] { color: var(--ev-strong); } .meter[data-ev="strong"] b { background: var(--ev-strong); }
.meter[data-ev="moderate"] { color: var(--ev-moderate); } .meter[data-ev="moderate"] b:nth-child(-n+3) { background: var(--ev-moderate); }
.meter[data-ev="limited"] { color: var(--ev-limited); } .meter[data-ev="limited"] b:nth-child(-n+2) { background: var(--ev-limited); }
.meter[data-ev="anecdotal"] { color: var(--ev-anecdotal); } .meter[data-ev="anecdotal"] b:nth-child(1) { background: var(--ev-anecdotal); }
.meter .lbl { width: 76px; text-align: right; }
@media (max-width: 520px) { .ev { grid-template-columns: 1fr; gap: 6px; } .meter .lbl { text-align: left; } }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.panel h3 { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.panel ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.panel li { font-size: 14.5px; line-height: 1.45; }
.panel li small { display: block; color: var(--muted); font-size: 13.5px; }
.panel li a { font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }
.panel li a:hover { border-color: var(--accent); }
.sev { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 3px 6px; border-radius: 5px; margin-left: 6px; vertical-align: 2px; }
.sev.major, .sev.severe { background: color-mix(in srgb, var(--ev-limited) 18%, transparent); color: var(--ev-limited); }
.sev.moderate { background: color-mix(in srgb, var(--ev-moderate) 18%, transparent); color: var(--ev-moderate); }
.sev.minor { background: var(--surface-2); color: var(--muted); }
.panel.warn { border-color: color-mix(in srgb, var(--ev-limited) 40%, var(--line)); }
@media (max-width: 700px) { .two { grid-template-columns: 1fr; } }

.study { padding: 14px 0; border-bottom: 1px solid var(--line); }
.study:first-of-type { padding-top: 0; }
.study a { font-weight: 600; text-decoration: none; }
.study a:hover { color: var(--accent); }
.study .src { font: 500 12px var(--mono); color: var(--muted); margin: 4px 0; }
.study p { font-size: 14.5px; color: var(--muted); margin: 0; }

.variants { display: flex; flex-wrap: wrap; gap: 8px; }


@media (max-width: 900px) {
  .prof { grid-template-columns: 1fr; gap: 28px; }
  .side { position: static; }
  .side .specimen { aspect-ratio: 16 / 10; }
}

.view { animation: viewin .35s ease both; }
@keyframes viewin { from { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } }
.meter[data-ev="preclinical"] { color: var(--violet); } .meter[data-ev="preclinical"] b:nth-child(1) { background: var(--violet); }


/* ================= multi-page additions ================= */
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: var(--ground); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.narrow { max-width: 820px; }
.nav { margin-left: auto; }
.top-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex: none; color: var(--ink); text-decoration: none; position: relative; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }
.account-btn .initial { font: 700 14px var(--display); }
.menu-btn { display: none; }
@media (max-width: 1020px) {
  .menu-btn { display: grid; }
  .nav { position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px max(16px, 3vw) 16px; background: var(--ground); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 8px; border-radius: 8px; font-size: 16px; }
  .top-actions { margin-left: auto; }
}
@media (max-width: 480px) { .brand span { display: none; } }

.search-overlay { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 60px); z-index: 19; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); padding-block: 14px; }
.big-search { max-width: none; }
.search .suggest { top: calc(100% + 6px); }

.page-head { padding-block: 36px 14px; }
.page-head h1 { font: 800 clamp(34px, 5vw, 52px)/1.02 var(--display); letter-spacing: -.03em; margin: 8px 0 10px; text-wrap: balance; }
.page-head .lede, .lede { font-size: 17px; color: var(--muted); max-width: 62ch; margin: 0; }
.eyebrow.sub { margin: 20px 0 10px; display: block; }
.sub-chips { margin: 6px 0 22px; }
.chip .n { font: 500 12px var(--mono); color: var(--muted); margin-left: 4px; }
.chip.on .n { color: inherit; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--ground); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); opacity: 1; }
.btn.small { height: 34px; padding: 0 14px; font-size: 14px; }
.btn.on { background: var(--accent); border-color: var(--accent); color: var(--ground); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 14px; }
.linkbtn.danger { color: var(--ev-limited); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.tool { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--r); border: 1px solid var(--line); background: linear-gradient(135deg, var(--glow), transparent 60%), var(--surface); text-decoration: none; transition: border-color .15s, transform .15s; }
.tool:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool strong { font: 650 18px var(--display); }
.tool span { color: var(--muted); font-size: 14.5px; }

.cat-block { padding-block: 18px; border-bottom: 1px solid var(--line); }
.cat-block h2 { font: 700 22px/1.2 var(--display); margin: 0; }
.cat-block h2 a { text-decoration: none; }
.cat-block .muted { margin: 4px 0 12px; font-size: 14.5px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea, .ask-form textarea, .disc-form input, .disc-form textarea {
  font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus, .ask-form textarea:focus, .disc-form input:focus, .disc-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.field textarea, .ask-form textarea, .disc-form textarea { resize: vertical; line-height: 1.5; }
.picker { max-width: 520px; margin-bottom: 20px; }
.picker .search input { height: 48px; box-shadow: none; }

/* compare */
.cmp-out { overflow-x: auto; padding-bottom: 8px; }
.cmp { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 640px; table-layout: fixed; }
.cmp th, .cmp td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.cmp thead th { border-bottom: 0; padding-bottom: 0; }
.cmp tbody th { width: 130px; font: 600 10.5px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); position: sticky; left: 0; background: var(--ground); }
.cmp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cmp-card .thumb { height: 120px; position: relative; border-bottom: 1px solid var(--line); }
.cmp-card .thumb .mol { position: absolute; inset: 10px; }
.cmp-card .hd { padding: 10px 12px; display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.cmp-card h3 { margin: 0; font: 650 16px/1.2 var(--display); }
.cmp-card h3 a { text-decoration: none; }
.cmp td ul { margin: 0; padding-left: 16px; }
.cmp td li { margin-bottom: 4px; }
.cmp .ev-mini { display: flex; flex-direction: column; gap: 8px; }
.cmp .ev-mini .meter { font-size: 10px; }
.cmp .ev-mini .meter .lbl { width: auto; }
.x-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 4px; }
.x-btn:hover { color: var(--ink); }

/* stack */
.stack-grid { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 32px; align-items: start; padding-bottom: 60px; }
@media (max-width: 860px) { .stack-grid { grid-template-columns: 1fr; } }
.stack-col { display: flex; flex-direction: column; gap: 16px; }
.stack-col .picker { margin: 0; }
.stack-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.stack-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.stack-list .mini { width: 44px; height: 36px; flex: none; position: relative; }
.stack-list .mini .mol { position: absolute; inset: 0; }
.stack-list a { font-weight: 600; text-decoration: none; }
.stack-list small { display: block; color: var(--muted); font-size: 12.5px; }
.stack-list .grow { flex: 1; min-width: 0; }
.stack-report { display: flex; flex-direction: column; gap: 14px; }
.flag { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 14px 16px; }
.flag h3 { margin: 0 0 8px; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.flag ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.flag li { font-size: 14.5px; }
.flag li small { display: block; color: var(--muted); }
.flag.bad { border-color: color-mix(in srgb, var(--ev-limited) 45%, var(--line)); } .flag.bad h3 { color: var(--ev-limited); }
.flag.warn { border-color: color-mix(in srgb, var(--ev-moderate) 45%, var(--line)); } .flag.warn h3 { color: var(--ev-moderate); }
.flag.good { border-color: color-mix(in srgb, var(--ev-strong) 45%, var(--line)); } .flag.good h3 { color: var(--ev-strong); }
.flag.info h3 { color: var(--muted); }
.summary-row { display: flex; flex-wrap: wrap; gap: 8px; }
.summary-row .pill { font-size: 11px; }
.pill.bad { background: color-mix(in srgb, var(--ev-limited) 16%, transparent); color: var(--ev-limited); }
.pill.warn { background: color-mix(in srgb, var(--ev-moderate) 16%, transparent); color: var(--ev-moderate); }
.pill.good { background: color-mix(in srgb, var(--ev-strong) 16%, transparent); color: var(--ev-strong); }
.schedule { width: 100%; border-collapse: collapse; font-size: 14px; }
.schedule td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.schedule td:first-child { font-weight: 600; padding-right: 14px; width: 40%; }

/* AI search */
.ask-form { display: flex; flex-direction: column; gap: 12px; }
.ask-row { display: flex; justify-content: space-between; gap: 12px; align-items: start; flex-wrap: wrap; }
.ask-row .chips { flex: 1; }
.ask-row .chip { font-size: 13px; }
.ask-out { margin: 26px 0 16px; }
.answer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; font-size: 16px; line-height: 1.6; }
.answer p { margin: 0 0 12px; } .answer p:last-child { margin: 0; }
.answer ul { margin: 0 0 12px; padding-left: 20px; }
.answer a { color: var(--accent); font-weight: 600; text-decoration: none; }
.answer a:hover { text-decoration: underline; }
.answer .note { color: var(--muted); font-size: 13.5px; margin-top: 12px; }
.sources { margin-top: 18px; }
.sources .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.thinking i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 50% { opacity: .2; transform: scale(.7); } }

/* discussion + community */
.discussion { border-top: 1px solid var(--line); padding-top: 28px; }
.discussion > .muted { margin-top: -4px; }
.thread { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 14px 16px; margin-bottom: 10px; }
.thread h3 { margin: 0 0 4px; font: 650 17px/1.3 var(--display); }
.thread h3 button { all: unset; cursor: pointer; }
.thread h3 button:hover { color: var(--accent); }
.thread .by { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.thread .text { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.replies { margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.reply .text { margin: 2px 0 0; }
.disc-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.disc-form .row { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.signin-cta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--r); margin-top: 12px; }
.topic-link { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.auth-card { max-width: 440px; margin: 56px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font: 800 30px/1.1 var(--display); margin: 0; letter-spacing: -.02em; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }

/* faq / about / contact */
.faq { display: flex; flex-direction: column; gap: 8px; padding-bottom: 60px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 16.5px; }
.faq p { margin: 10px 0 0; color: var(--muted); max-width: 68ch; }
.prose p { max-width: 66ch; font-size: 17px; margin: 0 0 16px; }
.prose { padding-bottom: 60px; }
.person { display: flex; flex-direction: column; margin: 8px 0 22px; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; }
.person span { color: var(--muted); font-size: 14px; }
.contact-form { display: flex; flex-direction: column; gap: 14px; max-width: 560px; padding-bottom: 60px; }
.contact-form .btn { align-self: flex-start; }
.hp { position: absolute; left: -9999px; }

/* footer, toast, compare tray */
.site-foot { border-top: 1px solid var(--line); padding-block: 32px 40px; margin-top: 40px; color: var(--muted); font-size: 14px; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-brand { max-width: 460px; }
.foot-brand .brand { color: var(--ink); margin-bottom: 10px; }
.foot-brand p { margin: 0; line-height: 1.5; }
.foot-links { display: grid; grid-template-columns: repeat(3, auto); gap: 8px 28px; align-content: start; }
.foot-links a { text-decoration: none; color: var(--ink); }
.foot-links a:hover { color: var(--accent); }
.fine-print { margin-top: 20px; font-size: 12.5px; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); translate: -50% 0; z-index: 40; background: var(--ink); color: var(--ground); padding: 11px 18px; border-radius: 999px; font-size: 14.5px; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast a { color: inherit; font-weight: 700; }
.tray { position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); z-index: 30; display: flex; gap: 8px; }
.tray a { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 10px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; }
.tray a b { background: var(--accent); color: var(--ground); border-radius: 999px; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: 12px; padding: 0 6px; }
.tray a:hover { border-color: var(--accent); }
body[data-page="compare"] .tray a[data-t="compare"], body[data-page="stack"] .tray a[data-t="stack"] { display: none; }
.ranked { margin: 0 0 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.ranked li::marker { font: 700 15px var(--display); color: var(--accent); }
.answer .meter { display: inline-flex; vertical-align: middle; margin-left: 6px; font-size: 10px; }
.answer .meter .lbl { width: auto; }
.answer small { color: var(--muted); font-size: 13.5px; }
.answer li + li { margin-top: 8px; }
