/* ReefReads — moody dark, bioluminescent accents */

/* Self-hosted webfonts.
   On first deploy these may 404 silently — the site falls back to system
   fonts (still legible). Run the curl commands in fonts/README.md once to
   download the woff2 files into /fonts/, then the branded type kicks in. */
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: oklch(0.16 0.03 240);
  --bg-2: oklch(0.20 0.035 235);
  --bg-3: oklch(0.24 0.04 230);
  --panel: oklch(0.22 0.035 235 / 0.72);
  --panel-solid: oklch(0.22 0.035 235);
  --line: oklch(0.32 0.03 230 / 0.6);
  --line-strong: oklch(0.42 0.04 220);
  --ink: oklch(0.97 0.01 220);
  --ink-2: oklch(0.82 0.02 220);
  --ink-3: oklch(0.62 0.03 225);
  --cyan: oklch(0.82 0.14 195);
  --cyan-deep: oklch(0.62 0.14 210);
  --lime: oklch(0.88 0.13 150);
  --amber: oklch(0.82 0.14 75);
  --coral: oklch(0.72 0.17 30);
  --violet: oklch(0.70 0.15 310);
  --radius: 14px;
  --radius-sm: 8px;
  --f-serif: "Instrument Serif", "Times New Roman", serif;
  --f-sans: "Inter", -apple-system, system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="light"] {
  --bg: oklch(0.98 0.005 220);
  --bg-2: oklch(0.96 0.008 220);
  --bg-3: oklch(0.93 0.01 220);
  --panel: oklch(1 0 0 / 0.7);
  --panel-solid: oklch(0.99 0.005 220);
  --line: oklch(0.80 0.01 220);
  --line-strong: oklch(0.65 0.015 220);
  --ink: oklch(0.20 0.02 230);
  --ink-2: oklch(0.36 0.025 230);
  --ink-3: oklch(0.52 0.03 230);
  --cyan: oklch(0.55 0.14 210);
  --cyan-deep: oklch(0.45 0.14 215);
  --lime: oklch(0.60 0.15 150);
  --amber: oklch(0.62 0.15 60);
  --coral: oklch(0.58 0.18 25);
  --violet: oklch(0.52 0.17 300);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font-family: inherit; color: inherit; }

.mono { font-family: var(--f-mono); }
.serif { font-family: var(--f-serif); font-weight: 400; }
.kicker {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  position: relative;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  padding: 22px 18px;
  background:
    linear-gradient(180deg, oklch(0.14 0.03 245) 0%, var(--bg) 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 2;
}
[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, oklch(0.99 0.005 220) 0%, var(--bg-2) 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 14px;
  border-bottom: 1px dashed var(--line);
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background:
    radial-gradient(circle at 30% 30%, var(--cyan) 0%, transparent 55%),
    radial-gradient(circle at 70% 70%, var(--lime) 0%, transparent 55%),
    var(--bg-3);
  position: relative;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 6px;
  border-radius: 50%;
  border: 1px solid oklch(1 0 0 / 0.25);
}
.brand-name {
  font-family: var(--f-serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand-sub {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 2px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 14px 10px 6px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-2);
  position: relative;
  transition: background 150ms, color 150ms;
}
.nav a:hover { background: var(--bg-3); color: var(--ink); }
.nav a.active {
  background: var(--bg-3);
  color: var(--ink);
}
.nav a.active::before {
  content: "";
  position: absolute; left: -18px; top: 8px; bottom: 8px; width: 2px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.nav-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink-3);
}
.nav a.active .nav-dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

.nav-group { margin: 2px 0; }
.nav-group-head {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  text-align: left;
}
.nav-group-head:hover { background: var(--bg-3); color: var(--ink); }
.nav-caret {
  font-size: 9px; color: var(--ink-3); width: 10px;
}
.nav-group.open .nav-caret { color: var(--cyan); }
.nav-group-count {
  margin-left: auto;
  font-size: 9.5px;
  color: var(--ink-3);
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--bg-3);
}
.nav-group-items {
  padding-left: 14px;
  margin: 2px 0 6px;
  display: flex; flex-direction: column; gap: 2px;
  border-left: 1px solid var(--line);
  margin-left: 14px;
}
.nav-group-items a { padding: 6px 10px; font-size: 12.5px; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-mini {
  display: flex; justify-content: space-between;
  font-family: var(--f-mono); font-size: 10.5px;
  color: var(--ink-3);
}
.stat-mini span:last-child { color: var(--ink-2); }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 20px;
  border: 1px solid var(--line);
  font-family: var(--f-mono); font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2);
  align-self: flex-start;
}
.theme-toggle:hover { border-color: var(--line-strong); color: var(--ink); }
.theme-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

/* ---------- Main column ---------- */
.main {
  min-width: 0;
  position: relative;
}

.topbar {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
}
.breadcrumb {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
  display: flex; gap: 8px; align-items: center;
}
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb b { color: var(--ink); font-weight: 500; }

.search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-2);
  min-width: 280px;
  transition: border-color 150ms, box-shadow 150ms;
}
.search:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px oklch(0.82 0.14 195 / 0.12);
}
.search input {
  border: none; outline: none; background: none;
  flex: 1; font-size: 13px; color: var(--ink);
}
.search input::placeholder { color: var(--ink-3); }
.kbd {
  font-family: var(--f-mono); font-size: 10px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--bg-3); color: var(--ink-3);
  border: 1px solid var(--line);
}

.page {
  padding: 40px 44px 80px;
}
@media (min-width: 1600px) {
  .page { padding: 48px 64px 96px; }
}
@media (min-width: 2200px) {
  .page { padding: 56px 88px 120px; }
}

/* ---------- Star (favorites) ---------- */
.rr-star {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 150ms;
  line-height: 1;
}
.rr-star:hover { border-color: var(--amber); color: var(--amber); }
.rr-star.on { color: var(--amber); border-color: var(--amber); background: oklch(0.82 0.14 75 / 0.10); }
.rr-star-sm { padding: 6px 8px; }
.rr-star-lg { padding: 10px 14px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.rr-star-lg svg { width: 16px; height: 16px; }
.rr-star-label { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; }

/* Star overlaid on species card thumbnails */
.sp-star {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
}
.sp-star .rr-star {
  background: oklch(0.10 0.02 240 / 0.55);
  border-color: transparent;
  backdrop-filter: blur(4px);
  color: rgba(255,255,255,0.9);
  padding: 7px;
}
.sp-star .rr-star:hover { color: var(--amber); }
.sp-star .rr-star.on { color: var(--amber); border-color: var(--amber); background: oklch(0.10 0.02 240 / 0.7); }

/* ---------- Hero Instagram fallback card ---------- */
.hero-ig-card {
  display: block;
  position: absolute;
  inset: 0;
  text-decoration: none;
  color: inherit;
}
.hero-ig-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, oklch(0 0 0 / 0.2), oklch(0 0 0 / 0.55));
  transition: background 200ms;
}
.hero-ig-card:hover .hero-ig-card-overlay {
  background: linear-gradient(180deg, oklch(0 0 0 / 0.1), oklch(0 0 0 / 0.4));
}
.hero-ig-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: oklch(0.20 0.02 230);
  padding: 10px 16px;
  border-radius: 100px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 20px -8px oklch(0 0 0 / 0.4);
}

/* ---------- My Reef ---------- */
.myreef-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-3);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 22px;
  width: max-content;
}
.myreef-tabs button {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 7px;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.myreef-tabs button span {
  background: var(--bg);
  color: var(--ink-3);
  padding: 2px 7px;
  border-radius: 100px;
  font-size: 10px;
  min-width: 22px;
  text-align: center;
}
.myreef-tabs button.on {
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.2);
}
.myreef-tabs button.on span { background: var(--cyan); color: var(--bg); }

.myreef-empty {
  text-align: center;
  padding: 80px 20px;
}
.myreef-empty svg { margin-bottom: 14px; }
.myreef-empty h3 { font-family: var(--f-serif); font-size: 28px; font-weight: 400; margin-bottom: 10px; }
.myreef-empty p { color: var(--ink-3); max-width: 38ch; margin: 0 auto; }
.myreef-empty-cta { display: flex; justify-content: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.myreef-articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.myreef-article-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 22px 24px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all 150ms;
}
.myreef-article-card:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -16px oklch(0.82 0.14 195 / 0.3);
}
.myreef-article-kicker {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.myreef-article-title {
  font-family: var(--f-serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
}
.myreef-article-dek {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
  margin-top: 4px;
}

/* ---------- Quarantine Timeline ---------- */
.qt-setup {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 880px) { .qt-setup { grid-template-columns: 1fr; } }
.qt-field { display: flex; flex-direction: column; gap: 5px; }
.qt-field > span {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.qt-field select, .qt-field input {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 14px;
  font-family: var(--f-sans);
  outline: none;
  color: var(--ink);
}
.qt-field select:focus, .qt-field input:focus { border-color: var(--cyan); }

.qt-summary {
  display: grid;
  grid-template-columns: 1.5fr auto 2fr;
  gap: 24px;
  align-items: center;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 28px;
}
@media (max-width: 880px) {
  .qt-summary { grid-template-columns: 1fr; gap: 8px; }
}
.qt-summary-protocol {
  font-family: var(--f-serif);
  font-size: 20px;
}
.qt-summary-duration {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.qt-summary-duration strong { font-family: var(--f-serif); color: var(--ink); font-size: 32px; line-height: 1; }
.qt-summary-note { font-size: 13px; color: var(--ink-2); font-style: italic; }

.qt-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qt-step {
  display: grid;
  grid-template-columns: 28px 100px 1fr;
  gap: 16px;
  align-items: start;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  transition: all 150ms;
}
.qt-step.past { opacity: 0.5; }
.qt-step.today {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), 0 12px 30px -16px oklch(0.82 0.14 195 / 0.3);
}
.qt-step.done {
  background: oklch(0.88 0.13 150 / 0.06);
}
.qt-step.done .qt-step-title { text-decoration: line-through; opacity: 0.65; }
.qt-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  color: var(--lime);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 2px;
  transition: all 120ms;
}
.qt-check:hover { border-color: var(--lime); }
.qt-step.done .qt-check { background: var(--lime); border-color: var(--lime); color: var(--bg); }
.qt-step-day {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.qt-step-n {
  font-family: var(--f-serif);
  font-size: 22px;
  line-height: 1;
}
.qt-step-date {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.qt-step.today .qt-step-n { color: var(--cyan); }
.qt-step-title { font-weight: 500; font-size: 15px; margin-bottom: 4px; }
.qt-step-note { font-size: 13px; color: var(--ink-2); line-height: 1.6; }

.qt-disclaimer {
  margin-top: 28px;
  padding: 14px 18px;
  background: oklch(0.82 0.14 75 / 0.06);
  border: 1px solid oklch(0.82 0.14 75 / 0.2);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}

/* ---------- Dosing Scheduler ---------- */
.ds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 1000px) { .ds-grid { grid-template-columns: 1fr; } }
.ds-inputs, .ds-output {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.ds-section-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 4px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.ds-section-label:not(:first-child) { margin-top: 22px; }
.ds-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.ds-field > span {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
}
.ds-field > span em { font-style: normal; opacity: 0.6; margin-left: 4px; }
.ds-field input, .ds-field select {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  outline: none;
  color: var(--ink);
}
.ds-field input:focus, .ds-field select:focus { border-color: var(--cyan); }
.ds-hint { font-size: 12px; color: var(--ink-3); line-height: 1.55; margin-bottom: 14px; }
.ds-checkbox {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-2);
  margin: 8px 0 14px;
  cursor: pointer;
}
.ds-checkbox input { accent-color: var(--cyan); width: 16px; height: 16px; }

.ds-output { background: linear-gradient(180deg, oklch(0.82 0.14 195 / 0.04), var(--panel-solid)); }
.ds-output-hdr {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}
.ds-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}
.ds-total {
  padding: 14px 16px;
  background: var(--bg-3);
  border-radius: 10px;
}
.ds-total-l {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.ds-total-v {
  font-family: var(--f-serif);
  font-size: 36px;
  line-height: 1;
  color: var(--cyan);
}
.ds-total-v em { font-style: normal; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); margin-left: 4px; }
.ds-schedule {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}
.ds-dose-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  align-items: center;
  background: var(--panel-solid);
  padding: 12px 16px;
}
.ds-dose-time {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--cyan);
  letter-spacing: 0.02em;
}
.ds-dose-amt {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.ds-dose-amt strong { font-family: var(--f-serif); font-weight: 400; color: var(--ink); font-size: 18px; }
.ds-dose-amt-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.ds-notes {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.65;
}
.ds-notes p { margin-bottom: 8px; }
.ds-notes strong { color: var(--ink); }
.ds-notes em { color: var(--cyan); font-style: italic; }

/* ---------- Guides depth toggle ---------- */
.guides-depth-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.guides-depth-seg {
  display: flex;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}
.guides-depth-seg button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--ink-3);
  text-align: left;
  cursor: pointer;
  transition: all 120ms;
}
.guides-depth-seg button strong {
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1px;
}
.guides-depth-seg button span {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.guides-depth-seg button:hover { color: var(--ink-2); }
.guides-depth-seg button.on {
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.2);
}
.guides-depth-seg button.on span { color: var(--cyan); }

.guides-depth-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg-3);
  color: var(--ink-3);
  border: 1px solid var(--line);
}
.guides-depth-pill.detailed {
  background: oklch(0.82 0.14 195 / 0.12);
  color: var(--cyan);
  border-color: oklch(0.82 0.14 195 / 0.5);
}

.guides-depth-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--bg);
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  margin: 0 4px;
}

/* ---------- Best Of: tier-group spacing ---------- */
.bestof-group { margin-top: 32px; }
.bestof-group:first-of-type { margin-top: 0; }

/* ---------- Breadcrumbs ---------- */
.rr-breadcrumb {
  margin-bottom: 22px;
}
.rr-breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
  padding: 0;
}
.rr-breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.rr-breadcrumb a {
  color: var(--ink-3);
  text-decoration: none;
  transition: color 120ms;
  padding: 4px 0;
}
.rr-breadcrumb a:hover { color: var(--cyan); }
.rr-breadcrumb [aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
}
.rr-bc-sep {
  margin: 0 10px;
  color: var(--ink-3);
  opacity: 0.45;
}

/* ---------- Last reviewed stamp ---------- */
.rr-updated {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.rr-updated time { color: var(--ink-2); }

/* ---------- 404 page ---------- */
.rr-404 {
  max-width: 720px;
  margin: 40px auto 80px;
  text-align: center;
  padding: 0 24px;
}
.rr-404-art {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  opacity: 0.85;
}
.rr-404-title {
  font-family: var(--f-serif);
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 10px 0 14px;
}
.rr-404-lede {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 52ch;
  margin: 0 auto;
}
.rr-404-lede code {
  font-family: var(--f-mono);
  background: var(--bg-3);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
}
.rr-404-suggestions {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  text-align: left;
}
.rr-404-suggestions a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: all 150ms;
}
.rr-404-suggestions a:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
}
.rr-404-sug-kind {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.rr-404-sug-name {
  font-family: var(--f-serif);
  font-size: 18px;
  line-height: 1.2;
}
.rr-404-sug-latin {
  font-style: italic;
  font-size: 12px;
  color: var(--ink-3);
}
.rr-404-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 36px;
}

/* ---------- Tank Journal (parameter log) ---------- */
.tj-latest {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}
.tj-latest-cell {
  text-align: left;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 150ms;
  position: relative;
  overflow: hidden;
}
.tj-latest-cell::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--p);
  opacity: 0.5;
}
.tj-latest-cell:hover { border-color: var(--line-strong); }
.tj-latest-cell.on {
  border-color: var(--p);
  box-shadow: 0 0 0 1px var(--p);
}
.tj-latest-cell.on::before { opacity: 1; }
.tj-latest-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.tj-latest-value {
  font-family: var(--f-serif);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.tj-latest-unit {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-left: 4px;
}
.tj-latest-status {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  margin-top: 8px;
  text-transform: uppercase;
}
.tj-latest-status.ok { color: var(--lime); }
.tj-latest-status.off { color: var(--coral); }
.tj-latest-status.none { color: var(--ink-3); }

.tj-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
}
@media (max-width: 1100px) {
  .tj-grid { grid-template-columns: 1fr; }
}

.tj-main {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 24px;
  min-width: 0;
}
.tj-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.tj-tabs { display: flex; gap: 4px; background: var(--bg-3); padding: 3px; border-radius: 10px; }
.tj-tabs button {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 7px;
  color: var(--ink-3);
}
.tj-tabs button.on {
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.2);
}
.tj-range { display: flex; gap: 4px; }
.tj-range button {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--ink-3);
  border: 1px solid transparent;
}
.tj-range button.on {
  color: var(--ink);
  border-color: var(--line);
  background: var(--bg-3);
}

.tj-chart-wrap { display: flex; flex-direction: column; }
.tj-chart-hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 12px;
}
.tj-chart-title { font-family: var(--f-serif); font-size: 28px; line-height: 1; }
.tj-chart-unit { color: var(--ink-3); font-size: 16px; font-family: var(--f-sans); }
.tj-chart-sub { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); margin-top: 6px; letter-spacing: 0.04em; }
.tj-chart-counts { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; }
.tj-chart {
  width: 100%;
  height: auto;
  display: block;
}
.tj-axis { font-family: var(--f-mono); font-size: 10px; fill: var(--ink-3); }
.tj-chart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
}
.tj-chart-empty p { margin-top: 10px; max-width: 38ch; margin-left: auto; margin-right: auto; }
.tj-chart-empty strong { color: var(--ink-2); font-family: var(--f-serif); font-style: italic; font-weight: 400; }

/* Log table */
.tj-table-wrap { overflow-x: auto; }
.tj-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.tj-table th {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3); text-align: left;
  padding: 8px 8px; border-bottom: 1px solid var(--line); font-weight: 500;
}
.tj-table th em { font-style: normal; color: var(--ink-3); margin-left: 4px; opacity: 0.7; }
.tj-table td { padding: 10px 8px; border-bottom: 1px dashed var(--line); }
.tj-table-date { font-family: var(--f-mono); color: var(--ink-2); white-space: nowrap; }
.tj-table-v { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.tj-table-v.ok { color: var(--ink); }
.tj-table-v.off { color: var(--coral); }
.tj-table-v.empty { color: var(--ink-3); opacity: 0.4; }
.tj-table-note { color: var(--ink-2); font-style: italic; max-width: 280px; }
.tj-table-actions button {
  width: 24px; height: 24px; border-radius: 6px;
  color: var(--ink-3); font-size: 14px;
}
.tj-table-actions button:hover { background: var(--coral); color: white; }

/* Side: add entry + actions */
.tj-side { display: flex; flex-direction: column; gap: 16px; }
.tj-add, .tj-actions {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 22px;
}
.tj-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.tj-field { display: flex; flex-direction: column; gap: 5px; }
.tj-field > span {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
}
.tj-field > span em { font-style: normal; opacity: 0.7; margin-left: 4px; }
.tj-field input {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color 150ms;
}
.tj-field input:focus { border-color: var(--cyan); }
.tj-field input::placeholder { color: var(--ink-3); opacity: 0.5; }
.tj-field-date, .tj-field-note { grid-column: 1 / -1; }
.tj-submit {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  font-size: 13px;
}

.tj-actions h4 { font-weight: 400; }
.tj-action-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: all 150ms;
}
.tj-action-btn:hover { border-color: var(--line-strong); }
.tj-action-btn > span:first-child {
  font-family: var(--f-mono);
  width: 18px; text-align: center; color: var(--ink-3);
}
.tj-action-btn.danger:hover { background: var(--coral); color: white; border-color: var(--coral); }
.tj-action-btn.danger:hover > span:first-child { color: white; }
.tj-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tj-action-note {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
  margin-top: 12px;
}
.tj-action-note code {
  font-family: var(--f-mono);
  background: var(--bg-3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}
.sp-creature:has(> .sp-photo),
.sp-creature:has(> .sp-video) {
  animation: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}
.sp-photo, .sp-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sp-media:has(.sp-photo) .sp-media-label,
.sp-media:has(.sp-video) .sp-media-label {
  background: oklch(0.10 0.02 240 / 0.65);
  color: var(--ink);
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}
.detail-photo, .detail-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}
.sp-credit {
  position: absolute;
  bottom: 8px;
  right: 10px;
  z-index: 3;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: oklch(0.10 0.02 240 / 0.55);
  padding: 3px 7px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  text-decoration: none;
}
.sp-credit:hover { color: white; }

/* ---------- Hero (animated reef) ---------- */
.hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
  margin-bottom: 48px;
  border: 1px solid var(--line);
  min-height: 520px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.hero-reef {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% -10%, oklch(0.30 0.10 210 / 0.6), transparent 60%),
    radial-gradient(ellipse at 80% 110%, oklch(0.22 0.12 260 / 0.6), transparent 60%),
    linear-gradient(180deg, oklch(0.14 0.04 240) 0%, oklch(0.10 0.03 250) 100%);
  z-index: 0;
}
[data-theme="light"] .hero-reef {
  background:
    radial-gradient(ellipse at 20% -10%, oklch(0.85 0.08 210 / 0.6), transparent 60%),
    radial-gradient(ellipse at 80% 110%, oklch(0.80 0.10 250 / 0.5), transparent 60%),
    linear-gradient(180deg, oklch(0.94 0.02 230) 0%, oklch(0.88 0.03 240) 100%);
}

.caustics {
  position: absolute; inset: -40%;
  background:
    radial-gradient(circle at 30% 20%, oklch(1 0 0 / 0.08) 0%, transparent 25%),
    radial-gradient(circle at 70% 50%, oklch(1 0 0 / 0.07) 0%, transparent 22%),
    radial-gradient(circle at 40% 80%, oklch(1 0 0 / 0.06) 0%, transparent 28%);
  filter: blur(30px);
  animation: drift 22s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}
@keyframes drift {
  0%   { transform: translate(-3%, -2%) rotate(0deg); }
  100% { transform: translate(3%, 4%) rotate(8deg); }
}

.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubble {
  position: absolute;
  width: 6px; height: 6px; border-radius: 50%;
  background: oklch(1 0 0 / 0.25);
  box-shadow: inset -1px -1px 0 oklch(1 0 0 / 0.4);
  animation: rise linear infinite;
}
@keyframes rise {
  0% { transform: translateY(10%) translateX(0); opacity: 0; }
  15% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-120%) translateX(24px); opacity: 0; }
}

.creature {
  position: absolute;
  animation: swim linear infinite;
}
@keyframes swim {
  0%   { transform: translateX(-8vw) translateY(0); }
  50%  { transform: translateX(45vw) translateY(-10px); }
  100% { transform: translateX(110vw) translateY(0); }
}
@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(4deg); }
}
@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 6px var(--cyan)); opacity: 0.85; }
  50%      { filter: drop-shadow(0 0 14px var(--cyan)); opacity: 1; }
}

.hero-content {
  position: relative; z-index: 2;
  padding: 60px 48px;
  display: flex; flex-direction: column;
  justify-content: center;
  gap: 20px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cyan);
}
.hero-eyebrow::before {
  content: "";
  width: 24px; height: 1px; background: var(--cyan);
}
.hero-title {
  font-family: var(--f-serif);
  font-size: clamp(44px, 5.4vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.hero-title em {
  font-style: italic;
  color: var(--cyan);
  text-shadow: 0 0 24px oklch(0.82 0.14 195 / 0.35);
}
.hero-lede {
  color: var(--ink-2);
  font-size: 17px;
  max-width: 52ch;
}
.hero-actions {
  display: flex; gap: 12px; margin-top: 6px;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  transition: transform 120ms, background 150ms, border-color 150ms;
  border: 1px solid transparent;
}
.btn.primary {
  background: var(--cyan);
  color: oklch(0.12 0.03 230);
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.1), 0 8px 32px oklch(0.82 0.14 195 / 0.3);
}
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn.ghost:hover { background: var(--bg-3); }
.btn.small { padding: 7px 13px; font-size: 12px; }

.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px; margin-top: 24px;
  padding-top: 24px; border-top: 1px dashed var(--line);
  max-width: 500px;
}
.hero-stat-n {
  font-family: var(--f-serif);
  font-size: 28px;
  color: var(--ink);
}
.hero-stat-l {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 2px;
}

.hero-right {
  position: relative; z-index: 1;
  overflow: hidden;
}

/* ---------- Section ---------- */
.section { margin-bottom: 60px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 24px;
  gap: 24px;
}
.section-title {
  font-family: var(--f-serif);
  font-size: 34px; letter-spacing: -0.01em;
  line-height: 1.05;
}
.section-lede {
  color: var(--ink-3); font-size: 14px;
  max-width: 42ch;
}

/* ---------- Cards / grid ---------- */
.grid {
  display: grid; gap: 16px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 150ms, transform 150ms;
}
.card.link:hover { border-color: var(--line-strong); }
.card-kicker {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.card-kicker .bar { height: 1px; width: 18px; background: var(--ink-3); }
.card h3 {
  font-family: var(--f-serif);
  font-size: 22px; line-height: 1.15; font-weight: 400;
  margin-bottom: 8px;
}
.card p { color: var(--ink-2); font-size: 13.5px; }

/* ---------- Library ---------- */
.lib-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
}
.filters {
  position: sticky; top: 80px;
  align-self: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.filter-group { margin-bottom: 18px; }
.filter-group h4 {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  font-family: var(--f-mono);
  color: var(--ink-2);
  transition: all 150ms;
  background: transparent;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active {
  background: var(--cyan);
  color: oklch(0.12 0.03 230);
  border-color: var(--cyan);
}

.range-row {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--f-mono); font-size: 11px;
  color: var(--ink-2);
  margin-bottom: 6px;
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%; height: 3px;
  background: var(--line-strong); border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--cyan);
  border: 2px solid var(--bg);
  cursor: pointer;
  box-shadow: 0 0 8px var(--cyan);
}

.species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.species-card {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 200ms, border-color 200ms, box-shadow 200ms;
  display: flex; flex-direction: column;
}
.species-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  box-shadow: 0 20px 40px -20px oklch(0.82 0.14 195 / 0.3);
}
.sp-media {
  aspect-ratio: 4 / 3;
  background:
    repeating-linear-gradient(
      -45deg,
      oklch(0.24 0.04 230) 0 8px,
      oklch(0.26 0.05 230) 8px 16px
    );
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.sp-media::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 100%, oklch(0.12 0.04 240 / 0.7), transparent 70%);
}
.sp-media-label {
  position: absolute; bottom: 8px; left: 10px;
  font-family: var(--f-mono); font-size: 9px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
  z-index: 2;
}
.sp-creature {
  z-index: 1;
  animation: sway 4s ease-in-out infinite;
  transform-origin: bottom center;
}
.sp-body {
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  flex: 1;
}
.sp-category {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan);
}
.sp-common {
  font-family: var(--f-serif); font-size: 22px;
  line-height: 1.1; color: var(--ink);
}
.sp-latin {
  font-family: var(--f-serif); font-style: italic;
  font-size: 13px; color: var(--ink-3);
}
.sp-tags {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 10px;
}
.sp-tag {
  font-family: var(--f-mono); font-size: 9.5px;
  padding: 3px 7px; border-radius: 4px;
  background: var(--bg-3); color: var(--ink-2);
}
.sp-tag.green { background: oklch(0.88 0.13 150 / 0.15); color: var(--lime); }
.sp-tag.amber { background: oklch(0.82 0.14 75 / 0.15); color: var(--amber); }
.sp-tag.coral { background: oklch(0.72 0.17 30 / 0.15); color: var(--coral); }
.sp-tag.violet { background: oklch(0.70 0.15 310 / 0.15); color: var(--violet); }

/* Difficulty dots */
.diff { display: inline-flex; gap: 3px; align-items: center; }
.diff-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-strong);
}
.diff-dot.on { background: var(--cyan); }

/* ---------- Species detail ---------- */
.detail {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.detail-media {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 40%, oklch(0.30 0.08 220) 0%, oklch(0.14 0.04 245) 80%);
}
.detail-hdr .kicker { margin-bottom: 14px; }
.detail-title {
  font-family: var(--f-serif); font-size: 56px; line-height: 1; letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.detail-latin {
  font-family: var(--f-serif); font-style: italic;
  color: var(--ink-3); font-size: 20px;
}
.detail-meta {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px; margin-top: 28px;
  padding-top: 24px; border-top: 1px dashed var(--line);
}
.meta-cell .lab {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 4px;
}
.meta-cell .val {
  font-family: var(--f-serif); font-size: 18px;
}

.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 16px;
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 150ms, border-color 150ms;
}
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--ink); border-bottom-color: var(--cyan); }

.info-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.info-block {
  padding: 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel);
}
.info-block h5 {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}
.info-block p {
  font-size: 13.5px; color: var(--ink-2); line-height: 1.6;
}

.param-bar {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0;
}
.param-bar .name {
  font-family: var(--f-mono); font-size: 11px;
  color: var(--ink-2); width: 70px;
}
.bar-track {
  flex: 1; height: 6px; border-radius: 4px;
  background: var(--bg-3); position: relative; overflow: hidden;
}
.bar-range {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  border-radius: 4px;
}
.param-bar .value {
  font-family: var(--f-mono); font-size: 11px;
  color: var(--ink-3); width: 80px; text-align: right;
}

/* ---------- Tools shared ---------- */
.tool {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.tool-head { margin-bottom: 22px; }
.tool-title {
  font-family: var(--f-serif); font-size: 28px;
  letter-spacing: -0.01em; line-height: 1.1;
  margin-bottom: 6px;
}
.tool-desc {
  font-size: 13.5px; color: var(--ink-3);
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-family: var(--f-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px;
}
.field input[type="number"], .field input[type="text"], .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px oklch(0.82 0.14 195 / 0.15);
}

.param-tool-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}

.gauge {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  position: relative;
  overflow: hidden;
}
.gauge .label {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px;
  display: flex; justify-content: space-between;
}
.gauge .val {
  font-family: var(--f-serif); font-size: 26px;
}
.gauge .val input {
  font-family: var(--f-serif); font-size: 26px;
  width: 80%; background: transparent; border: none; color: var(--ink);
  outline: none;
}
.gauge .unit {
  font-family: var(--f-mono); font-size: 11px;
  color: var(--ink-3); margin-left: 3px;
}
.gauge .track {
  margin-top: 10px;
  height: 4px; border-radius: 3px;
  background: var(--bg-3);
  position: relative; overflow: hidden;
}
.gauge .ideal {
  position: absolute; top: 0; bottom: 0;
  background: oklch(0.88 0.13 150 / 0.35);
}
.gauge .marker {
  position: absolute; top: -3px; width: 2px; height: 10px;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  border-radius: 1px;
}
.gauge.warn { border-color: var(--amber); }
.gauge.warn .marker { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.gauge.bad { border-color: var(--coral); }
.gauge.bad .marker { background: var(--coral); box-shadow: 0 0 6px var(--coral); }
.gauge .status {
  margin-top: 8px;
  font-family: var(--f-mono); font-size: 10.5px;
  letter-spacing: 0.06em;
}
.gauge.good .status { color: var(--lime); }
.gauge.warn .status { color: var(--amber); }
.gauge.bad .status { color: var(--coral); }

/* Checklist */
.checklist { list-style: none; }
.checklist li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--bg-2);
  transition: border-color 150ms;
  cursor: pointer;
}
.checklist li:hover { border-color: var(--line-strong); }
.checklist li.done {
  border-color: oklch(0.88 0.13 150 / 0.4);
  background: oklch(0.88 0.13 150 / 0.05);
}
.checkbox {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
  transition: background 150ms, border-color 150ms;
}
.checklist li.done .checkbox {
  background: var(--lime); border-color: var(--lime);
}
.checkbox svg { display: none; }
.checklist li.done .checkbox svg { display: block; }
.task-title { font-size: 14px; }
.task-meta {
  font-family: var(--f-mono); font-size: 10.5px;
  color: var(--ink-3); margin-top: 2px;
  display: flex; gap: 10px;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 1px; background: var(--line-strong);
}
.tl-phase {
  position: relative; margin-bottom: 28px;
}
.tl-phase::before {
  content: "";
  position: absolute; left: -26px; top: 6px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.tl-phase.done::before { background: var(--cyan); }
.tl-week {
  font-family: var(--f-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 4px;
}
.tl-title {
  font-family: var(--f-serif); font-size: 20px;
  margin-bottom: 6px;
}

/* Compat matrix */
.compat-table {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.compat-cell {
  background: var(--bg-2);
  padding: 14px 10px;
  font-family: var(--f-mono); font-size: 11px;
  text-align: center;
  min-height: 52px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  position: relative;
}
.compat-cell.hdr { background: var(--bg-3); color: var(--ink-3); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.compat-cell.ok { color: var(--lime); background: oklch(0.88 0.13 150 / 0.1); }
.compat-cell.warn { color: var(--amber); background: oklch(0.82 0.14 75 / 0.1); }
.compat-cell.bad { color: var(--coral); background: oklch(0.72 0.17 30 / 0.1); }
.compat-cell.self { background: var(--bg-3); color: var(--ink-3); }
.compat-cell.rowlabel { background: var(--bg-3); text-align: left; justify-content: flex-start; padding-left: 14px; font-size: 11px; color: var(--ink-2); text-transform: none; letter-spacing: 0; }

.legend {
  display: flex; gap: 14px; margin-top: 14px;
  font-family: var(--f-mono); font-size: 10.5px;
  color: var(--ink-3);
}
.legend-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 6px; vertical-align: middle;
}

/* Symptom flow */
.symptom-flow {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px;
}
.symptom-list { display: flex; flex-direction: column; gap: 8px; }
.symptom-pill {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 13.5px;
  text-align: left;
  transition: all 150ms;
}
.symptom-pill:hover { border-color: var(--line-strong); }
.symptom-pill.active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px oklch(0.82 0.14 195 / 0.12);
}
.symptom-pill .tick {
  font-family: var(--f-mono); font-size: 10px;
  color: var(--ink-3);
}

.diagnosis {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.diagnosis h4 {
  font-family: var(--f-serif); font-size: 22px;
  line-height: 1.1; margin-bottom: 4px;
}
.diag-conf {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}
.diag-conf .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 6px var(--cyan);
}
.diag-section { margin-top: 14px; }
.diag-section h5 {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px;
}
.diag-section p, .diag-section li {
  font-size: 13px; color: var(--ink-2); line-height: 1.6;
}
.diag-section ul { list-style: none; padding: 0; }
.diag-section li {
  padding-left: 18px; position: relative;
  margin-bottom: 4px;
}
.diag-section li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 6px; height: 1px; background: var(--cyan);
}

/* Layered species info anim */
.layer-cycle {
  position: relative;
  height: 36px; overflow: hidden;
}
.layer-cycle > div {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  opacity: 0; transform: translateY(8px);
  transition: opacity 300ms, transform 300ms;
}
.layer-cycle > div.on { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative; height: auto;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .hero { grid-template-columns: 1fr; min-height: 420px; }
  .detail, .symptom-flow { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .lib-layout { grid-template-columns: 1fr; }
  .filters { position: relative; top: 0; }
}
@media (max-width: 620px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .page { padding: 24px 18px 60px; }
  .topbar { padding: 12px 18px; }
  .search { display: none; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .detail-title { font-size: 40px; }
}

/* Tweaks panel */
.tweaks {
  position: fixed;
  right: 20px; bottom: 20px;
  width: 260px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 16px;
  z-index: 1000;
  box-shadow: 0 20px 60px oklch(0 0 0 / 0.5);
  display: none;
}
.tweaks.open { display: block; }
.tweaks h4 {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 12px;
}
.seg {
  display: flex; gap: 2px;
  background: var(--bg-3); padding: 3px; border-radius: 8px;
}
.seg button {
  flex: 1; padding: 6px; font-size: 12px;
  border-radius: 6px; color: var(--ink-2);
}
.seg button.on { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }


/* =============================================================
   NEW NAV STYLES — flat main nav with icons
   ============================================================= */
.nav-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  position: relative;
  transition: background 150ms, color 150ms;
}
.nav-main:hover { background: var(--bg-3); color: var(--ink); }
.nav-main.active {
  background: var(--bg-3);
  color: var(--ink);
}
.nav-main.active::before {
  content: "";
  position: absolute; left: -18px; top: 8px; bottom: 8px; width: 2px;
  background: var(--cyan);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--cyan);
}
.nav-main-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--bg-3);
  color: var(--cyan);
  font-size: 13px;
  flex-shrink: 0;
}
.nav-main.active .nav-main-icon {
  background: oklch(0.82 0.14 195 / 0.18);
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px oklch(0.82 0.14 195 / 0.4);
}

/* =============================================================
   HUB HERO (calculators, compatibility, best-of)
   ============================================================= */
.hub-hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 22px;
  min-height: 200px;
  display: flex;
  align-items: center;
}
.hub-hero-bg {
  position: absolute; inset: 0;
  opacity: 0.85;
}
.hub-hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 70% 50%, oklch(1 0 0 / 0.15), transparent 60%),
    repeating-linear-gradient(45deg, transparent 0 20px, oklch(0 0 0 / 0.05) 20px 22px);
}
.hub-hero-inner {
  position: relative;
  padding: 36px 38px;
  max-width: 720px;
}
.hub-hero-title {
  font-family: var(--f-serif);
  font-size: 44px;
  line-height: 1.05;
  color: white;
  margin-top: 6px;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.hub-hero-sub {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255,255,255,0.88);
  max-width: 540px;
}
.hub-hero-glyph {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--f-serif);
  font-size: 180px;
  line-height: 1;
  color: rgba(255,255,255,0.15);
  letter-spacing: -0.05em;
  user-select: none;
}
.hub-hero .kicker {
  color: rgba(255,255,255,0.85);
}

.hub-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.hub-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 200ms;
}
.hub-tab:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.hub-tab.on {
  border-color: var(--cyan);
  background: linear-gradient(180deg, oklch(0.82 0.14 195 / 0.08), transparent);
  box-shadow: inset 0 0 0 1px oklch(0.82 0.14 195 / 0.3);
}
.hub-tab-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  border-radius: 10px;
  flex-shrink: 0;
}
.hub-tab.on .hub-tab-icon {
  background: oklch(0.82 0.14 195 / 0.15);
}
.hub-tab-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.hub-tab-desc {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* =============================================================
   MEDICAL DATABASE — Disease library
   ============================================================= */
.med-hero {
  background:
    linear-gradient(135deg, oklch(0.18 0.04 220) 0%, oklch(0.22 0.05 250) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 38px 36px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
[data-theme="light"] .med-hero {
  background: linear-gradient(135deg, oklch(0.95 0.02 220) 0%, oklch(0.92 0.03 250) 100%);
}
.med-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 39px, oklch(0.82 0.14 195 / 0.04) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, oklch(0.82 0.14 195 / 0.04) 39px 40px);
  pointer-events: none;
}
.med-hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
  position: relative;
}
.med-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  background: oklch(0.82 0.14 195 / 0.12);
  border: 1px solid oklch(0.82 0.14 195 / 0.3);
  border-radius: 100px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
}
.med-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 var(--cyan);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 oklch(0.82 0.14 195 / 0.7); }
  70% { box-shadow: 0 0 0 8px oklch(0.82 0.14 195 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.82 0.14 195 / 0); }
}
.med-h1 {
  font-family: var(--f-serif);
  font-size: 52px;
  line-height: 1;
  margin-top: 16px;
  letter-spacing: -0.015em;
}
.med-sub {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 540px;
}
.med-search {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 100px;
  max-width: 480px;
}
.med-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
}
.med-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
}
.med-stat {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 16px;
  position: relative;
  overflow: hidden;
}
.med-stat::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
}
.med-stat.extreme::after { background: var(--coral); }
.med-stat.high::after { background: var(--amber); }
.med-stat.moderate::after { background: var(--cyan); }
.med-stat.low::after { background: var(--lime); }
.med-stat-num {
  font-family: var(--f-serif);
  font-size: 38px;
  line-height: 1;
}
.med-stat-lab {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 4px;
}

.med-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.med-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 13px;
  cursor: pointer;
  transition: all 150ms;
}
.med-filter:hover { border-color: var(--line-strong); }
.med-filter.on {
  background: oklch(0.82 0.14 195 / 0.12);
  border-color: var(--cyan);
  color: var(--cyan);
}
.med-filter-count {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-3);
}
.med-filter.on .med-filter-count {
  background: oklch(0.82 0.14 195 / 0.2);
}

.med-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(90deg, oklch(0.82 0.14 195 / 0.08), oklch(0.82 0.14 195 / 0.02));
  border: 1px solid oklch(0.82 0.14 195 / 0.2);
  border-radius: 14px;
  margin-bottom: 24px;
}
.med-banner-icon {
  width: 44px;
  height: 44px;
  background: oklch(0.82 0.14 195 / 0.18);
  color: var(--cyan);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.med-banner > div:nth-child(2) { flex: 1; }

.med-category {
  margin-bottom: 32px;
}
.med-category-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.med-category-head h3 {
  font-family: var(--f-serif);
  font-size: 26px;
  font-weight: 400;
}
.med-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.med-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-3);
  border-radius: 12px;
  padding: 18px 18px 14px;
  cursor: pointer;
  transition: transform 200ms, border-color 200ms;
  position: relative;
}
.med-card:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  box-shadow: 0 12px 30px -16px oklch(0.82 0.14 195 / 0.4);
}
.med-card.severity-1 { border-left-color: var(--lime); }
.med-card.severity-2 { border-left-color: var(--cyan); }
.med-card.severity-3 { border-left-color: var(--amber); }
.med-card.severity-4 { border-left-color: oklch(0.7 0.18 50); }
.med-card.severity-5 { border-left-color: var(--coral); }

.med-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.med-code {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  background: var(--bg-3);
  padding: 3px 8px;
  border-radius: 4px;
}
.med-card h4 {
  font-family: var(--f-serif);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 400;
}
.med-latin {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-3);
  margin-top: -4px;
}
.med-quickid {
  background: var(--bg-3);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 4px;
}
.med-quickid p {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  margin-top: 4px;
}
.med-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.med-severity-bar {
  display: flex;
  gap: 3px;
}
.med-severity-bar span {
  width: 14px;
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
}
.med-severity-bar span.on {
  background: var(--coral);
}
.med-severity-bar.large span {
  width: 28px;
  height: 6px;
}

.med-danger {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}
.med-danger.danger-extreme { background: oklch(0.72 0.17 30 / 0.18); color: var(--coral); }
.med-danger.danger-high { background: oklch(0.82 0.14 75 / 0.18); color: var(--amber); }
.med-danger.danger-moderate { background: oklch(0.82 0.14 195 / 0.15); color: var(--cyan); }
.med-danger.danger-low { background: oklch(0.88 0.13 150 / 0.15); color: var(--lime); }
.med-danger.danger-minimal { background: var(--bg-3); color: var(--ink-3); }

.med-tag-contagious {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: oklch(0.72 0.17 30 / 0.15);
  color: var(--coral);
  border: 1px solid oklch(0.72 0.17 30 / 0.3);
}

.med-cat-tag {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--bg-3);
  color: var(--ink-2);
}

/* Disease detail */
.med-detail-hero {
  position: relative;
  background: linear-gradient(135deg, oklch(0.18 0.04 220), oklch(0.22 0.05 250));
  border-radius: 18px;
  padding: 36px 36px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}
[data-theme="light"] .med-detail-hero {
  background: linear-gradient(135deg, oklch(0.94 0.02 220), oklch(0.91 0.03 250));
}
.med-detail-bg {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 50%, oklch(0.82 0.14 195 / 0.12), transparent 60%);
  pointer-events: none;
  border-radius: 18px;
}
.med-detail-inner { position: relative; }
.med-detail-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.med-code-large {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  background: var(--bg-3);
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--ink-2);
}
.med-detail-title {
  font-family: var(--f-serif);
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.015em;
}
.med-detail-latin {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-2);
  margin-top: 8px;
}
.med-detail-quickid {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 600px;
  margin-top: 18px;
  padding: 14px 18px;
  background: oklch(0.82 0.14 195 / 0.08);
  border-left: 3px solid var(--cyan);
  border-radius: 0 10px 10px 0;
}
.med-detail-severity {
  position: relative;
  text-align: center;
  padding: 20px 28px;
  background: var(--panel-solid);
  border-radius: 14px;
  border: 1px solid var(--line);
  min-width: 170px;
}
.med-severity-display {
  font-family: var(--f-serif);
  margin-top: 6px;
}
.med-severity-num {
  font-size: 64px;
  line-height: 1;
}
.med-severity-of {
  font-size: 24px;
  color: var(--ink-3);
}
.med-detail-severity .med-severity-bar {
  margin-top: 12px;
  justify-content: center;
}

.med-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
.med-symptoms ul, .info-block ul {
  list-style: none;
  margin-top: 8px;
}
.med-symptoms li, .info-block ul li {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  font-size: 13.5px;
  line-height: 1.55;
  border-bottom: 1px dashed var(--line);
}
.med-symptoms li:last-child, .info-block ul li:last-child { border-bottom: none; }
.med-bullet {
  color: var(--cyan);
  flex-shrink: 0;
}
.med-treatment {
  background: linear-gradient(180deg, oklch(0.82 0.14 195 / 0.05), transparent);
  border-color: oklch(0.82 0.14 195 / 0.3);
}
.med-disclaimer {
  padding: 14px 18px;
  background: var(--bg-3);
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 24px;
}

/* =============================================================
   BEST OF — SEO collections
   ============================================================= */
.bestof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.bestof-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 220ms, box-shadow 220ms;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.bestof-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px -24px oklch(0 0 0 / 0.5);
}
.bestof-card-bg {
  position: absolute; inset: 0;
}
.bestof-card-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, oklch(0.1 0.02 240 / 0.85) 100%);
}
.bestof-card-icon {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 56px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.bestof-card-body {
  position: relative;
  padding: 22px 22px 20px;
  color: white;
}
.bestof-card-body .kicker { color: rgba(255,255,255,0.7); }
.bestof-card-body h3 {
  font-family: var(--f-serif);
  font-size: 28px;
  line-height: 1.1;
  margin-top: 6px;
  letter-spacing: -0.01em;
}
.bestof-card-body p {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
}
.bestof-card-meta {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bestof-detail-hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 260px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 24px;
}
.bestof-detail-bg {
  position: absolute; inset: 0;
}
.bestof-detail-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, oklch(0.1 0.02 240 / 0.7) 100%);
}
.bestof-detail-glyph {
  position: absolute;
  right: 40px;
  top: 30px;
  font-size: 130px;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.35));
}
.bestof-detail-inner {
  position: relative;
  padding: 36px;
  color: white;
  max-width: 760px;
}
.bestof-detail-h1 {
  font-family: var(--f-serif);
  font-size: 50px;
  line-height: 1.05;
  margin-top: 8px;
  letter-spacing: -0.015em;
}
.bestof-detail-sub {
  margin-top: 12px;
  font-size: 17px;
  color: rgba(255,255,255,0.92);
}

.bestof-detail-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.bestof-intro {
  background: var(--panel-solid);
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
}
.bestof-factors {
  background: var(--bg-3);
  padding: 18px 22px;
  border-radius: 14px;
  border-left: 3px solid var(--cyan);
}
.bestof-factors ul {
  list-style: none;
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.bestof-factors li {
  font-size: 13px;
  color: var(--ink-2);
  padding-left: 18px;
  position: relative;
}
.bestof-factors li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--lime);
}
.bestof-list-h2 {
  font-family: var(--f-serif);
  font-size: 36px;
  margin: 12px 0 4px;
  letter-spacing: -0.01em;
}
.bestof-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bestof-item {
  display: grid;
  grid-template-columns: 60px 130px 1fr 30px;
  gap: 18px;
  align-items: center;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  transition: transform 200ms, border-color 200ms;
}
.bestof-item:hover {
  transform: translateX(4px);
  border-color: var(--cyan);
}
.bestof-rank {
  font-family: var(--f-serif);
  font-size: 32px;
  color: var(--cyan);
  text-align: center;
  letter-spacing: -0.02em;
}
.bestof-item-media {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.bestof-item-media::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 100%, oklch(0.1 0.02 240 / 0.5), transparent 70%);
}
.bestof-item-glyph {
  font-family: var(--f-serif);
  font-size: 56px;
  color: rgba(255,255,255,0.5);
  position: relative;
}
.bestof-item-body h3 {
  font-family: var(--f-serif);
  font-size: 24px;
  font-weight: 400;
  margin-top: 4px;
}
.bestof-item-latin {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-3);
  margin-top: -2px;
}
.bestof-item-body p {
  font-size: 13.5px;
  color: var(--ink-2);
  margin-top: 6px;
  line-height: 1.5;
}
.bestof-item-meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.bestof-item-arrow {
  font-size: 22px;
  color: var(--ink-3);
  text-align: center;
}
.bestof-related {
  margin-top: 24px;
  padding: 22px;
  background: var(--bg-3);
  border-radius: 14px;
}
.bestof-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 13px;
}
.bestof-pill:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* =============================================================
   DONATE PAGE
   ============================================================= */
.donate-hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, oklch(0.22 0.07 220), oklch(0.28 0.1 195));
  padding: 50px 40px 40px;
  margin-bottom: 24px;
  min-height: 260px;
}
[data-theme="light"] .donate-hero {
  background: linear-gradient(135deg, oklch(0.85 0.1 220), oklch(0.88 0.12 195));
}
.donate-hero-art {
  position: absolute; inset: 0;
  pointer-events: none;
}
.donate-coral {
  position: absolute;
  border-radius: 50% 50% 30% 30%;
  filter: blur(0.5px);
}
.donate-coral.c1 {
  width: 110px; height: 90px;
  bottom: -30px; right: 8%;
  background: radial-gradient(ellipse at center top, var(--coral), oklch(0.4 0.16 30));
  transform: rotate(-8deg);
}
.donate-coral.c2 {
  width: 80px; height: 130px;
  bottom: -50px; right: 22%;
  background: radial-gradient(ellipse at center top, var(--violet), oklch(0.4 0.13 310));
  border-radius: 60% 60% 20% 20%;
}
.donate-coral.c3 {
  width: 70px; height: 70px;
  bottom: -20px; right: 35%;
  background: radial-gradient(circle, var(--lime), oklch(0.45 0.13 150));
  border-radius: 50%;
}
.donate-bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.7), rgba(255,255,255,0.1));
  border: 1px solid rgba(255,255,255,0.3);
  animation: bubbleRise 6s infinite ease-in;
}
.donate-bubble.b1 { width: 14px; height: 14px; bottom: 20px; right: 12%; animation-delay: 0s; }
.donate-bubble.b2 { width: 9px; height: 9px; bottom: 40px; right: 25%; animation-delay: 1.5s; }
.donate-bubble.b3 { width: 18px; height: 18px; bottom: 10px; right: 40%; animation-delay: 3s; }
.donate-bubble.b4 { width: 7px; height: 7px; bottom: 30px; right: 18%; animation-delay: 4.5s; }
@keyframes bubbleRise {
  0% { transform: translateY(0) translateX(0); opacity: 0.7; }
  100% { transform: translateY(-220px) translateX(20px); opacity: 0; }
}
.donate-fish {
  position: absolute;
  width: 60px;
  height: 30px;
  top: 30%;
  right: 12%;
  background:
    radial-gradient(ellipse at 30% 50%, var(--amber) 0%, oklch(0.55 0.16 50) 60%, transparent 70%);
  border-radius: 50% 20% 20% 50%;
  filter: drop-shadow(0 0 10px oklch(0.82 0.14 75 / 0.4));
}
.donate-fish::after {
  content: "";
  position: absolute;
  right: -10px; top: 4px;
  width: 16px; height: 22px;
  background: var(--amber);
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  opacity: 0.7;
}
.donate-hero-inner {
  position: relative;
  max-width: 660px;
}
.donate-h1 {
  font-family: var(--f-serif);
  font-size: 52px;
  line-height: 1.05;
  color: white;
  margin-top: 10px;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}
.donate-sub {
  margin-top: 14px;
  font-size: 16px;
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
  max-width: 580px;
}
[data-theme="light"] .donate-h1 { color: var(--ink); }
[data-theme="light"] .donate-sub { color: var(--ink-2); }
[data-theme="light"] .donate-hero .kicker { color: var(--ink-3); }

.donate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.donate-card {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px;
  position: relative;
}
.donate-card.monthly {
  border-color: var(--cyan);
  background: linear-gradient(180deg, oklch(0.82 0.14 195 / 0.06), var(--panel-solid));
  box-shadow: 0 0 0 1px var(--cyan);
}
.donate-card h3 {
  font-family: var(--f-serif);
  font-size: 24px;
  font-weight: 400;
}
.donate-badge {
  position: absolute;
  top: -10px;
  left: 24px;
  background: var(--cyan);
  color: oklch(0.15 0.02 240);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}
.donate-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.donate-tier {
  padding: 11px 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--f-serif);
  font-size: 18px;
  cursor: pointer;
  transition: all 150ms;
}
.donate-tier:hover { border-color: var(--cyan); }
.donate-tier.on {
  background: oklch(0.82 0.14 195 / 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
}
.donate-custom {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  margin-bottom: 14px;
}
.donate-custom span {
  color: var(--ink-3);
  font-family: var(--f-serif);
  font-size: 18px;
}
.donate-custom input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 11px 8px;
  font-size: 15px;
  outline: none;
}
.donate-cta {
  width: 100%;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  margin-top: 6px;
}
.donate-perks {
  list-style: none;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.donate-perks li {
  font-size: 13px;
  color: var(--ink-2);
}
.donate-other {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 16px;
}
.donate-other-item {
  display: flex;
  gap: 12px;
}
.donate-other-icon {
  width: 38px;
  height: 38px;
  background: var(--bg-3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.donate-other-item h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.donate-other-item p {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.5;
}
.donate-trust {
  background: var(--bg-3);
  border-radius: 16px;
  padding: 26px 28px;
}
.donate-trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 14px;
}
.donate-trust-num {
  font-family: var(--f-serif);
  font-size: 38px;
  color: var(--cyan);
  letter-spacing: -0.02em;
}
.donate-trust-lab {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 4px;
  line-height: 1.4;
}

.btn-primary {
  background: var(--cyan);
  color: oklch(0.15 0.02 240);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: filter 150ms;
}
.btn-primary:hover { filter: brightness(1.1); }

@media (max-width: 1100px) {
  .donate-grid { grid-template-columns: 1fr; }
  .med-detail-grid { grid-template-columns: 1fr; }
  .med-hero-grid { grid-template-columns: 1fr; }
  .bestof-item { grid-template-columns: 50px 100px 1fr 30px; }
}


/* =============================================================
   HERO VIDEO CAROUSEL
   ============================================================= */
.hero-video-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px 16px 0;
  min-height: 0;
}
.hero-video-frame {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -30px oklch(0 0 0 / 0.6),
              inset 0 0 0 1px oklch(1 0 0 / 0.04);
}
.hero-video-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1200ms ease;
}
.hero-video-slide.on {
  opacity: 1;
  z-index: 2;
}
.hero-video-vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, transparent 50%, oklch(0 0 0 / 0.5) 100%),
    linear-gradient(180deg, transparent 50%, oklch(0 0 0 / 0.55) 100%);
  pointer-events: none;
}

/* Video poster — animated placeholders */
.vid-poster {
  width: 100%; height: 100%;
  position: relative;
  overflow: hidden;
}
.vp-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 40%, oklch(0.82 0.14 195 / 0.35), transparent 60%);
  animation: vp-glow-pulse 6s ease-in-out infinite;
}
@keyframes vp-glow-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}
.vp-stalk {
  position: absolute;
  bottom: 0;
  width: 12px;
  border-radius: 6px 6px 0 0;
  transform-origin: bottom center;
  animation: vp-sway 5s ease-in-out infinite;
  filter: blur(0.5px);
}
@keyframes vp-sway {
  0%, 100% { transform: rotate(-6deg) scaleY(1); }
  50% { transform: rotate(6deg) scaleY(1.04); }
}
.vp-anemone {
  position: absolute;
  bottom: 8%; left: 50%;
  transform: translateX(-50%);
  width: 220px; height: 180px;
  background:
    radial-gradient(ellipse at 50% 60%, oklch(0.7 0.18 30 / 0.85) 0%, oklch(0.45 0.16 30 / 0.6) 40%, transparent 70%);
  border-radius: 50% 50% 30% 30%;
  animation: vp-breathe 4s ease-in-out infinite;
  filter: blur(1px);
}
@keyframes vp-breathe {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.06); }
}
.vp-fish {
  position: absolute;
  width: 40px; height: 22px;
  top: 45%; left: -10%;
  background:
    radial-gradient(ellipse at 30% 50%, var(--amber), oklch(0.55 0.18 40) 60%, transparent 75%);
  border-radius: 50% 30% 30% 50%;
  animation: vp-swim 14s linear infinite;
  filter: drop-shadow(0 0 12px oklch(0.82 0.14 75 / 0.5));
}
.vp-fish::after {
  content: ""; position: absolute;
  right: -8px; top: 2px;
  width: 14px; height: 18px;
  background: var(--amber);
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  opacity: 0.8;
}
.vp-fish.small { width: 28px; height: 16px; opacity: 0.85; }
@keyframes vp-swim {
  0% { transform: translateX(0); }
  50% { transform: translateX(50vw) translateY(-15px) scaleX(-1); }
  50.01% { transform: translateX(50vw) translateY(-15px) scaleX(1); }
  100% { transform: translateX(0) translateY(0); }
}

.vp-school-fish {
  position: absolute;
  width: 14px; height: 6px;
  border-radius: 50% 20% 20% 50%;
  background: linear-gradient(90deg, oklch(0.78 0.14 195), oklch(0.65 0.14 210));
  opacity: 0.75;
  animation: vp-school-swim 10s linear infinite;
  filter: drop-shadow(0 0 4px oklch(0.82 0.14 195 / 0.5));
}
@keyframes vp-school-swim {
  0% { transform: translateX(-30px) translateY(0); }
  100% { transform: translateX(110vw) translateY(-20px); }
}

.vp-jelly {
  position: absolute;
  top: -40px;
  width: 80px;
  height: 110px;
  animation: vp-drift 14s ease-in-out infinite;
}
.vp-jelly::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 80px; height: 60px;
  border-radius: 50% 50% 30% 30%;
  background: radial-gradient(ellipse at 50% 30%,
                              oklch(0.85 0.1 310 / 0.55) 0%,
                              oklch(0.5 0.13 300 / 0.3) 70%,
                              transparent 100%);
  animation: vp-pulse 3s ease-in-out infinite;
  filter: blur(0.5px);
}
.vp-jelly::after {
  content: "";
  position: absolute;
  top: 40px; left: 10%;
  width: 80%; height: 70px;
  background:
    linear-gradient(180deg,
      oklch(0.7 0.1 310 / 0.4),
      transparent);
  mask: repeating-linear-gradient(90deg, white 0 2px, transparent 2px 6px);
  -webkit-mask: repeating-linear-gradient(90deg, white 0 2px, transparent 2px 6px);
  animation: vp-pulse 3s ease-in-out infinite;
}
@keyframes vp-drift {
  0% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(40vh) translateX(10px); }
  100% { transform: translateY(80vh) translateX(0); opacity: 0; }
}
@keyframes vp-pulse {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(0.85); }
}

/* Overlay UI on top of slides */
.hero-video-ui {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px;
  pointer-events: none;
}
.hero-video-ui > * { pointer-events: auto; }
.hero-video-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.hero-video-tag {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  padding: 5px 9px;
  background: oklch(0 0 0 / 0.5);
  border: 1px solid oklch(0.82 0.14 195 / 0.4);
  color: var(--cyan);
  border-radius: 4px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero-video-pause {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: oklch(0 0 0 / 0.5);
  border: 1px solid oklch(1 0 0 / 0.15);
  color: white;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 150ms;
}
.hero-video-pause:hover {
  background: oklch(0 0 0 / 0.7);
}
.hero-video-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.hero-video-meta {
  flex: 1;
  min-width: 0;
}
.hero-video-title {
  font-family: var(--f-serif);
  font-size: 22px;
  line-height: 1.2;
  color: white;
  text-shadow: 0 2px 16px oklch(0 0 0 / 0.7);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.hero-video-credit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.78);
  padding: 4px 10px 4px 8px;
  background: oklch(0 0 0 / 0.45);
  border: 1px solid oklch(1 0 0 / 0.1);
  border-radius: 100px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color 150ms, background 150ms;
}
.hero-video-credit:hover {
  color: white;
  background: oklch(0 0 0 / 0.65);
}
.hero-video-credit-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.hero-video-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.hero-video-dot {
  width: 30px;
  height: 4px;
  border-radius: 2px;
  background: oklch(1 0 0 / 0.2);
  cursor: pointer;
  padding: 0;
  position: relative;
  overflow: hidden;
  border: none;
  transition: background 150ms;
}
.hero-video-dot:hover { background: oklch(1 0 0 / 0.35); }
.hero-video-dot.on {
  background: oklch(1 0 0 / 0.25);
  width: 50px;
}
.hero-video-dot-fill {
  position: absolute;
  inset: 0;
  background: var(--cyan);
  transform: translateX(-100%);
  border-radius: 2px;
}
.hero-video-dot.on .hero-video-dot-fill {
  animation: hero-dot-fill 7s linear forwards;
  box-shadow: 0 0 8px var(--cyan);
}
.hero-video-dot.on.paused .hero-video-dot-fill {
  animation-play-state: paused;
}
@keyframes hero-dot-fill {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.hero-video-contribute {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-left: 4px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 2px 0;
  transition: color 150ms;
}
.hero-video-contribute:hover { color: var(--cyan); }
.hero-video-contribute span {
  color: var(--cyan);
}


/* =============================================================
   BEST OF — improved
   ============================================================= */
.bestof-hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 22px;
}
.bestof-hero-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}
.bestof-stat-num {
  font-family: var(--f-serif);
  font-size: 32px;
  color: white;
  letter-spacing: -0.01em;
  line-height: 1;
}
.bestof-stat-label {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

.bestof-filter-rail {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

/* Featured editor's pick card */
.bestof-featured {
  position: relative;
  display: block;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 22px;
  min-height: 280px;
  text-decoration: none;
  color: inherit;
  transition: transform 220ms, box-shadow 220ms;
}
.bestof-featured:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 60px -30px oklch(0 0 0 / 0.6);
}
.bestof-featured-bg {
  position: absolute; inset: 0;
}
.bestof-featured-bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, oklch(0.1 0.02 240 / 0.85) 0%, oklch(0.1 0.02 240 / 0.4) 50%, transparent 100%);
}
.bestof-featured-glyph {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 180px;
  opacity: 0.65;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,0.4));
}
.bestof-featured-content {
  position: relative;
  padding: 40px 44px;
  color: white;
  max-width: 600px;
}
.bestof-featured-tag {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  padding: 4px 9px;
  background: oklch(0.82 0.14 195);
  color: oklch(0.15 0.02 240);
  border-radius: 4px;
  font-weight: 600;
}
.bestof-featured-h2 {
  font-family: var(--f-serif);
  font-size: 40px;
  line-height: 1.05;
  margin-top: 8px;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}
.bestof-featured-blurb {
  margin-top: 12px;
  font-size: 16px;
  color: rgba(255,255,255,0.92);
  line-height: 1.55;
  max-width: 500px;
}
.bestof-featured-meta {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.bestof-meta-num {
  font-family: var(--f-serif);
  font-size: 22px;
  color: white;
  margin-right: 4px;
  text-transform: none;
}

/* Detail page additions */
.bestof-keywords {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bestof-keyword {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  background: oklch(0 0 0 / 0.3);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
  border-radius: 100px;
  backdrop-filter: blur(8px);
}

.bestof-twocol {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 14px;
  margin-top: 4px;
}
.bestof-compare {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  overflow-x: auto;
}
.bestof-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 13px;
}
.bestof-table th {
  text-align: left;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}
.bestof-table td {
  padding: 10px 10px 10px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-2);
}
.bestof-table tbody tr:last-child td { border-bottom: none; }
.bestof-table tbody tr:hover td { color: var(--ink); }

/* Podium-styled item ranks */
.bestof-item.podium {
  border-color: oklch(0.82 0.14 75 / 0.3);
  background: linear-gradient(135deg, oklch(0.82 0.14 75 / 0.04), var(--panel-solid));
}
.bestof-item .bestof-rank {
  position: relative;
  font-family: var(--f-serif);
  font-size: 32px;
  text-align: center;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--cyan);
}
.bestof-rank-num {
  font-family: var(--f-serif);
  font-size: 28px;
}
.bestof-medal {
  font-size: 28px;
  line-height: 1;
}

.bestof-item-media {
  position: relative;
}
.bestof-item-media-label {
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  z-index: 2;
}

.bestof-why {
  margin-top: 10px;
  padding: 10px 14px;
  background: oklch(0.82 0.14 195 / 0.08);
  border-left: 2px solid var(--cyan);
  border-radius: 0 8px 8px 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.bestof-why-label {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-right: 8px;
}

.bestof-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bestof-item .bestof-item-meta {
  margin-top: 12px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* Override the bestof-item grid for the new layout */
.bestof-item {
  display: grid;
  grid-template-columns: 70px 140px 1fr auto;
  gap: 18px;
  align-items: center;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  transition: transform 200ms, border-color 200ms, box-shadow 200ms;
}
.bestof-item:hover {
  transform: translateX(2px);
  border-color: var(--cyan);
  box-shadow: 0 12px 30px -16px oklch(0 0 0 / 0.4);
}
.bestof-item-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: all 150ms;
  flex-shrink: 0;
  text-decoration: none;
}
.bestof-item-cta:hover {
  background: oklch(0.82 0.14 195 / 0.15);
  color: var(--cyan);
  border-color: var(--cyan);
}

.bestof-verdict {
  margin-top: 24px;
  padding: 26px 30px;
  background: linear-gradient(135deg, oklch(0.82 0.14 195 / 0.08), oklch(0.7 0.15 310 / 0.05));
  border: 1px solid oklch(0.82 0.14 195 / 0.3);
  border-radius: 14px;
}
.bestof-verdict h3 {
  font-family: var(--f-serif);
  font-size: 28px;
  font-weight: 400;
  margin-top: 6px;
}
.bestof-verdict p {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 720px;
}

.bestof-stamp {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

/* FAQ section on hub */
.bestof-faq {
  margin-top: 36px;
  padding: 32px 36px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.bestof-faq-h3 {
  font-family: var(--f-serif);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}
.bestof-faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.bestof-faq-item {
  padding: 18px 20px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  border-left: 2px solid var(--cyan);
}
.bestof-faq-item h4 {
  font-family: var(--f-serif);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 8px;
}
.bestof-faq-item p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

@media (max-width: 1100px) {
  .bestof-twocol { grid-template-columns: 1fr; }
  .bestof-item { grid-template-columns: 60px 110px 1fr; }
  .bestof-item-cta { grid-column: 1 / -1; justify-content: center; }
  .bestof-featured-glyph { font-size: 120px; right: 2%; }
}
