:root {
  color-scheme: dark;
  --bg: #0f1419;
  --surface: #1a222d;
  --surface2: #243040;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --accent: #f4a024;
  --accent2: #2ec4b6;
  --danger: #ef476f;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,.35);
  --font: "Segoe UI", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent2); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

/* ── Ad slots ── */
.ad-slot {
  background: linear-gradient(135deg, #1e2836, #151c26);
  border: 2px dashed #3a4a5e;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  min-height: 90px;
  margin: 1rem 0;
}
.ad-leaderboard { min-height: 90px; }
.ad-rectangle { min-height: 250px; }
.ad-skyscraper { min-height: 600px; min-width: 160px; }
.ad-mobile { min-height: 50px; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,20,25,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #2a3545;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: .75rem max(1rem, env(safe-area-inset-right)) .75rem max(1rem, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  flex-wrap: wrap;
}
.logo {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent);
  letter-spacing: 1px;
}
.logo span { color: var(--text); font-weight: normal; font-size: .85rem; display: block; letter-spacing: 3px; text-transform: uppercase; }
.nav-main { display: flex; gap: .25rem; flex-wrap: wrap; }
.nav-main a {
  padding: .45rem .75rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
}
.nav-main a:hover, .nav-main a.active { background: var(--surface2); color: var(--accent); }
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.menu-btn {
  display: none;
  background: var(--surface2);
  border: none;
  color: var(--text);
  padding: .65rem .85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; padding: 1.5rem 0 3rem; }
.layout-full { padding: 1.5rem 0 3rem; }
main { min-width: 0; }
.sidebar { position: sticky; top: 80px; align-self: start; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #1a2838 0%, #0f1419 50%, #1a222d 100%);
  padding: 3rem 0;
  border-bottom: 1px solid #2a3545;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  width: 45%;
  height: 120%;
  background: radial-gradient(ellipse, rgba(244,160,36,.12), transparent 70%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center; }
.hero h1 { font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; margin-bottom: 1rem; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { color: var(--muted); font-size: 1.1rem; margin-bottom: 1.5rem; max-width: 520px; }
.hero-btns { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .75rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  border: none;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #1a1200; box-shadow: 0 4px 20px rgba(244,160,36,.35); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid #3a4a5e; }
.btn-ghost { background: transparent; color: var(--accent2); border: 1px solid var(--accent2); }
.hero-img {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4/3;
  object-fit: cover;
}

/* ── Cards ── */
.section-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.card,
a.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #2a3545;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  cursor: pointer;
}
a.card {
  display: block;
  text-decoration: none;
  color: inherit;
}
.card:hover,
a.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.card-img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.card-body { padding: 1rem 1.1rem 1.2rem; }
.card-tag {
  display: inline-block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent2);
  background: rgba(46,196,182,.12);
  padding: .2rem .5rem;
  border-radius: 4px;
  margin-bottom: .5rem;
}
.card h3 { font-size: 1.05rem; margin-bottom: .4rem; line-height: 1.35; color: var(--text); }
.card p { font-size: .85rem; color: var(--muted); }
.card-meta { font-size: .75rem; color: var(--muted); margin-top: .6rem; }
.card-hidden { display: none !important; }
.hidden { display: none !important; }

/* ── Trending ticker ── */
.ticker {
  background: var(--surface);
  border: 1px solid #2a3545;
  border-radius: var(--radius);
  padding: .6rem 1rem;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
}
.ticker-label {
  background: var(--danger);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .25rem .6rem;
  border-radius: 4px;
  white-space: nowrap;
  text-transform: uppercase;
}
.ticker-track { overflow: hidden; flex: 1; }
.ticker-inner {
  display: flex;
  gap: 2rem;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
}
.ticker-inner a { color: var(--text); font-size: .85rem; }
.ticker-inner a:hover { color: var(--accent); }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ── Widget boxes ── */
.widget {
  background: var(--surface);
  border: 1px solid #2a3545;
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 1.25rem;
}
.widget h4 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: .85rem;
}
.link-list { list-style: none; }
.link-list li { border-bottom: 1px solid #2a3545; }
.link-list li:last-child { border: none; }
.link-list a {
  display: block;
  padding: .55rem 0;
  color: var(--text);
  font-size: .88rem;
}
.link-list a:hover { color: var(--accent); padding-left: .3rem; }

/* ── Tabs ── */
.tabs { display: flex; gap: .35rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.tab-btn {
  padding: .5rem 1rem;
  border-radius: 8px;
  border: 1px solid #3a4a5e;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: .85rem;
  transition: .15s;
}
.tab-btn.active, .tab-btn:hover { background: var(--accent); color: #1a1200; border-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Gallery modal ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}
.gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  transition: .2s;
}
.gallery-item:hover { border-color: var(--accent); transform: scale(1.03); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,.7));
  display: flex;
  align-items: flex-end;
  padding: .6rem;
  font-size: .75rem;
  opacity: 0;
  transition: .2s;
}
.gallery-item:hover .overlay { opacity: 1; }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.88);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.open { display: flex; }
.modal img { max-height: 85vh; border-radius: var(--radius); }
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--surface2);
  border: none;
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
}
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface2);
  border: none;
  color: var(--text);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
}
.modal-prev { left: 1rem; }
.modal-next { right: 1rem; }

/* ── Compare table ── */
.compare-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.compare-selects select {
  width: 100%;
  padding: .75rem;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid #3a4a5e;
  color: var(--text);
  font-size: .95rem;
}
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #2a3545;
}
.compare-table th { color: var(--accent); font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; }
.compare-table tr:hover td { background: var(--surface2); }
.winner { color: var(--accent2); font-weight: 700; }

/* ── Quiz ── */
.quiz-q { margin-bottom: 1.5rem; }
.quiz-q h3 { margin-bottom: .75rem; font-size: 1.1rem; }
.quiz-options { display: flex; flex-direction: column; gap: .5rem; }
.quiz-opt {
  padding: .85rem 1rem;
  background: var(--surface);
  border: 2px solid #2a3545;
  border-radius: 10px;
  cursor: pointer;
  transition: .15s;
  text-align: left;
  color: var(--text);
  font-size: .95rem;
}
.quiz-opt:hover { border-color: var(--accent2); background: var(--surface2); }
.quiz-opt.selected { border-color: var(--accent); background: rgba(244,160,36,.1); }
.quiz-result {
  display: none;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}
.quiz-result.show { display: block; }
.quiz-result h2 { color: var(--accent); margin-bottom: .5rem; }

/* ── Hub breadcrumb ── */
.hub-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
  font-size: .88rem;
  margin-bottom: 1rem;
  padding: .65rem .85rem;
  background: var(--surface);
  border: 1px solid #2a3545;
  border-radius: var(--radius);
}
.hub-breadcrumb a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.hub-breadcrumb a:hover { text-decoration: underline; }
.hub-breadcrumb-sep { color: var(--muted); user-select: none; }
.hub-breadcrumb-current { color: var(--text); font-weight: 500; }

/* ── Article ── */
.article-header { margin-bottom: 1.5rem; }
.article-header h1 { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.2; margin-bottom: .75rem; }
.article-meta { color: var(--muted); font-size: .85rem; }
.article-body { font-size: 1.05rem; line-height: 1.75; }
.article-body h2 { font-family: var(--serif); font-size: 1.4rem; margin: 2rem 0 1rem; color: var(--accent); }
.article-body p { margin-bottom: 1.1rem; }
.article-body ul, .article-body ol { margin: 1rem 0 1.1rem 1.5rem; }
.article-body li { margin-bottom: .4rem; }
.inline-cta {
  background: linear-gradient(135deg, var(--surface2), var(--surface));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
  text-align: center;
}
.inline-cta h3 { margin-bottom: .5rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2rem; }

/* ── Accordion ── */
.accordion-item { border: 1px solid #2a3545; border-radius: var(--radius); margin-bottom: .5rem; overflow: hidden; }
.accordion-head {
  width: 100%;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: none;
  color: var(--text);
  text-align: left;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.accordion-head:hover { background: var(--surface2); }
.accordion-body { display: none; padding: 0 1.2rem 1rem; color: var(--muted); font-size: .9rem; }
.accordion-item.open .accordion-body { display: block; }
.accordion-item.open .accordion-head { color: var(--accent); }

/* ── Footer ── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid #2a3545;
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin-bottom: 2rem; }
.footer-grid h4 { color: var(--accent); font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: .75rem; }
.footer-grid a { display: block; color: var(--muted); font-size: .85rem; padding: .2rem 0; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { text-align: center; color: var(--muted); font-size: .8rem; padding-top: 1.5rem; border-top: 1px solid #2a3545; }

/* ── Content licensing & attribution ── */
.wiki-attribution {
  font-size: .88rem;
  color: var(--muted);
  background: rgba(46, 196, 182, .06);
  border: 1px solid rgba(46, 196, 182, .25);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 0 0 1.75rem;
}
.wiki-attribution-informed {
  background: rgba(100, 149, 237, .06);
  border-color: rgba(100, 149, 237, .25);
  border-left-color: #6495ed;
}
.wiki-attribution p { margin: 0 0 .65rem; }
.wiki-attribution p:last-child { margin-bottom: 0; }
.wiki-attribution a { color: var(--accent); }
.content-tier { margin-bottom: .5rem !important; }
.tier-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 4px;
}
.tier-original { background: rgba(46, 196, 182, .15); color: var(--accent); }
.tier-informed { background: rgba(100, 149, 237, .15); color: #8ab4f8; }
.tier-derived { background: rgba(212, 175, 55, .15); color: #d4af37; }
.tier-referenced { background: rgba(139, 156, 179, .12); color: var(--muted); }
.wiki-link-out {
  margin: 1.25rem 0 2rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px dashed #3a4a5e;
  border-radius: var(--radius);
  font-size: .9rem;
}
.wiki-link-out strong { color: var(--text); }
.wiki-link-out a { font-weight: 600; }
.photo-credits-intro { max-width: 42rem; margin-bottom: 1.5rem; }
.photo-credits-table { font-size: .82rem; }
.photo-credits-table td, .photo-credits-table th { vertical-align: top; }
.photo-credits-table code { font-size: .78rem; word-break: break-all; }
.photo-credits-section { margin-top: 2.5rem; }
.policy-callout {
  background: var(--surface);
  border: 1px solid #2a3545;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1rem 0 1.5rem;
}
.policy-callout h3 { font-size: 1rem; margin: 0 0 .5rem; color: var(--accent); }
.policy-callout p:last-child { margin-bottom: 0; }

/* ── Contribute form ── */
.contrib-form {
  max-width: 36rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: 1.5rem;
}
.contrib-form label {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .75rem;
}
.contrib-form input,
.contrib-form select,
.contrib-form textarea {
  background: var(--surface);
  border: 1px solid #2a3545;
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  padding: .65rem .85rem;
}
.contrib-form textarea { resize: vertical; min-height: 8rem; }
.contrib-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.25rem;
}

/* ── Batavus M48 vault (hidden page) ── */
.batavus-vault-page {
  --vault-gold: #d4af37;
  --vault-gold-bright: #f4c430;
}
.batavus-vault-page .vault-header {
  border-bottom: 1px solid rgba(212, 175, 55, .25);
}
.batavus-vault-page .vault-logo span { color: var(--vault-gold); }
.vault-hero {
  background: linear-gradient(135deg, #1a1510 0%, #0f1419 45%, #121820 100%);
  border-bottom: 2px solid var(--vault-gold);
  padding: 2.5rem 0 2rem;
  text-align: center;
}
.vault-badge {
  display: inline-block;
  color: var(--vault-gold-bright);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}
.vault-hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: .75rem;
}
.vault-hero h1 em { color: var(--vault-gold-bright); font-style: normal; }
.vault-lead {
  color: var(--muted);
  max-width: 40rem;
  margin: 0 auto;
  font-size: 1.05rem;
}
.vault-body { padding-top: 2rem; padding-bottom: 2rem; }
.vault-section-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--vault-gold-bright);
  margin: 2.5rem 0 1rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid rgba(212, 175, 55, .35);
}
.vault-secret {
  border-left: 4px solid var(--vault-gold);
  background: linear-gradient(90deg, rgba(212, 175, 55, .1), transparent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 10px 10px 0;
  font-size: .95rem;
}
.vault-secret strong { color: var(--vault-gold-bright); }
.vault-secret-final {
  border-left-color: var(--vault-gold-bright);
  background: linear-gradient(90deg, rgba(244, 196, 48, .12), transparent);
}
.vault-toc {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem .75rem;
  margin-top: 1.5rem;
}
.vault-toc a {
  font-size: .78rem;
  padding: .35rem .7rem;
  border: 1px solid rgba(212, 175, 55, .35);
  border-radius: 999px;
  color: var(--vault-gold);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.vault-toc a:hover { background: rgba(212, 175, 55, .12); color: var(--vault-gold-bright); }
.vault-wiki-credit {
  font-size: .85rem;
  color: var(--muted);
  border: 1px dashed rgba(212, 175, 55, .3);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-bottom: 1.5rem;
}
.vault-gallery { margin: 1.5rem 0; }
.vault-gallery-wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.vault-photo img {
  width: 100%;
  border-radius: 8px;
  background: #0a0e12;
}
.vault-diagram {
  margin: 1.5rem 0;
  background: var(--surface);
  border: 1px solid rgba(212, 175, 55, .2);
  border-radius: var(--radius);
  padding: 1rem;
  overflow: hidden;
}
.vault-diagram figcaption {
  color: var(--vault-gold);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .75rem;
  text-align: center;
}
.vault-diagram svg { width: 100%; height: auto; display: block; }
.vault-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.vault-tier {
  background: var(--surface);
  border: 1px solid rgba(212, 175, 55, .25);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.vault-tier h3 {
  color: var(--vault-gold-bright);
  font-size: 1rem;
  margin-bottom: .65rem;
}
.vault-tier ul { margin-left: 1.1rem; font-size: .92rem; color: var(--muted); }
.vault-tier li { margin-bottom: .35rem; }
.vault-footer { border-top: 1px solid rgba(212, 175, 55, .2); }

/* ── HS-50 gold star easter egg ── */
.batavus-star-gate {
  text-align: center;
  padding: 2.5rem 0 1rem;
  margin-top: 1rem;
}
.batavus-star-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
  opacity: .55;
  transition: opacity .25s, transform .25s;
}
.batavus-star-link:hover {
  opacity: 1;
  transform: scale(1.08);
  color: #f4c430;
}
.batavus-star {
  font-size: 1.75rem;
  color: #d4af37;
  text-shadow: 0 0 12px rgba(244, 196, 48, .5);
  line-height: 1;
}
.batavus-star-label {
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--muted);
  text-transform: lowercase;
}
.batavus-star-link:hover .batavus-star-label { color: #f4c430; }

/* ── Port timing calculator ── */
.calc-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid #2a3545;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.calc-form { display: flex; flex-direction: column; gap: 1rem; }
.calc-form label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.calc-form label span { color: var(--text); font-weight: 600; }
.calc-form input, .calc-form select {
  background: var(--surface2);
  border: 1px solid #3a4a5e;
  border-radius: 8px;
  color: var(--text);
  padding: .6rem .75rem;
  font-size: 1rem;
}
.calc-form small { color: var(--muted); font-size: .75rem; }
.calc-output {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.calc-result-grid { display: grid; gap: 1rem; }
.calc-result-label { display: block; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.calc-result-value { font-size: 2rem; color: var(--accent); }
.calc-note { margin-top: 1rem; font-size: .85rem; color: var(--muted); }
.calc-error { color: var(--danger); font-size: .9rem; }
.calc-formula {
  font-family: ui-monospace, Consolas, monospace;
  background: var(--surface2);
  padding: .75rem 1rem;
  border-radius: 8px;
  margin: .5rem 0 1rem;
  font-size: .9rem;
}
.manuals-table td { vertical-align: top; font-size: .9rem; }
.manuals-table td a { display: inline-block; margin: .15rem 0; }

/* ── Expansion chamber designer ── */
.pipe-intro {
  color: var(--muted);
  max-width: 52rem;
  margin-bottom: 1.5rem;
  font-size: 1.02rem;
}
.pipe-design-wrap {
  display: grid;
  grid-template-columns: minmax(380px, 440px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 2rem;
}
.pipe-controls-panel {
  background: var(--surface);
  border: 1px solid #2a3545;
  border-radius: var(--radius);
  padding: 1.25rem;
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}
.pipe-controls-panel .compare-table {
  font-size: .78rem;
  table-layout: fixed;
  width: 100%;
}
.pipe-controls-panel .compare-table th,
.pipe-controls-panel .compare-table td {
  padding: .35rem .4rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.pipe-controls-panel .pipe-result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.pipe-controls-panel .calc-result-value {
  font-size: 1.15rem;
}
.pipe-form .pipe-fieldset {
  border: 1px solid #2a3545;
  border-radius: 10px;
  padding: .85rem 1rem 1rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.pipe-form .pipe-fieldset legend {
  color: var(--accent);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 0 .35rem;
}
.pipe-check {
  flex-direction: row !important;
  align-items: center;
  gap: .6rem !important;
  font-size: .82rem !important;
  color: var(--muted);
}
.pipe-check input { width: auto; accent-color: var(--accent2); }
.pipe-slider-label output {
  color: var(--accent2);
  font-weight: 700;
  font-size: .9rem;
}
.pipe-range {
  width: 100%;
  height: 8px;
  margin: .35rem 0 .25rem;
  accent-color: var(--accent);
  cursor: pointer;
}
.pipe-range-ends {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: .15rem;
}
.pipe-peak-label { font-size: 1.35rem !important; color: var(--accent2) !important; }
.pipe-results {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #2a3545;
}
.pipe-result-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 1rem; }
.pipe-unit { font-size: 1rem; color: var(--muted); margin-left: .15rem; }
.pipe-dim-table { margin-top: .5rem; font-size: .85rem; }
.pipe-warn {
  background: rgba(239,71,111,.12);
  border: 1px solid rgba(239,71,111,.35);
  border-radius: 8px;
  padding: .65rem .85rem;
  margin-bottom: 1rem;
  font-size: .85rem;
  color: #f5a0b0;
}
.pipe-warn p { margin: .2rem 0; }
.pipe-visual-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}
.pipe-visual-panel {
  background: linear-gradient(160deg, #121820 0%, #1a2430 50%, #141c26 100%);
  border: 1px solid #2a3545;
  border-radius: var(--radius);
  padding: 1rem 1rem 1.25rem;
  box-shadow: var(--shadow);
  min-height: 240px;
  min-width: 0;
}
.pipe-flat-panel {
  background: var(--surface);
  border: 1px solid #2a3545;
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.pipe-visual-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.pipe-visual-header h2 {
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
  margin-right: auto;
}
.pipe-visual-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.pipe-popout-btn {
  padding: .4rem .75rem;
  font-size: .78rem;
  white-space: nowrap;
  cursor: pointer;
}
.pipe-popout-btn[aria-pressed="true"] {
  border-color: var(--accent2);
  color: var(--accent2);
}
.pipe-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.pipe-legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.pipe-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.pipe-swatch-header { background: rgba(46,196,182,.7); }
.pipe-swatch-diff { background: rgba(244,160,36,.75); }
.pipe-swatch-belly { background: rgba(244,208,96,.8); }
.pipe-swatch-baff { background: rgba(239,71,111,.7); }
.pipe-swatch-sting { background: rgba(139,156,179,.8); }
.pipe-svg-wrap {
  background: radial-gradient(ellipse at 30% 50%, rgba(46,196,182,.06) 0%, transparent 55%),
              radial-gradient(ellipse at 70% 50%, rgba(244,160,36,.05) 0%, transparent 50%),
              #0c1016;
  border: 1px solid #243040;
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 160px;
}
.pipe-svg {
  display: block;
  flex-shrink: 0;
}
.pipe-svg-hint {
  font-size: .72rem;
  color: var(--muted);
  margin: .4rem 0 0;
}
.pipe-dim-label {
  font-family: var(--font);
  font-size: 17.5px;
  fill: #9ab0c8;
  font-weight: 600;
}
.pipe-dim-sub {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 15.75px;
  fill: var(--accent2);
}
.pipe-section-label {
  font-family: var(--font);
  font-size: 19.25px;
  fill: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.pipe-scale-note {
  font-family: var(--font);
  font-size: 15.75px;
  fill: #5a6a7a;
}
.pipe-theory { margin-top: 1rem; }
.pipe-formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.pipe-formula-card {
  background: var(--surface);
  border: 1px solid #2a3545;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}
.pipe-formula-card h3 {
  font-size: .85rem;
  color: var(--accent2);
  margin-bottom: .5rem;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.pipe-formula-card p { font-size: .88rem; color: var(--muted); margin: .35rem 0 0; }
.pipe-formula-card .calc-formula { margin: 0 0 .5rem; font-size: .82rem; }
.pipe-preset-source {
  margin: .75rem 0 1rem;
  padding: .85rem 1rem;
  background: rgba(46,196,182,.08);
  border: 1px solid rgba(46,196,182,.25);
  border-radius: var(--radius);
  font-size: .85rem;
}
.pipe-preset-source h3 {
  font-size: .8rem;
  color: var(--accent2);
  margin: 0 0 .5rem;
  text-transform: uppercase;
  letter-spacing: .35px;
}
.pipe-source-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}
.pipe-source-list li { margin: .25rem 0; }
.pipe-flat-patterns {
  margin: 0;
}
.pipe-flat-patterns h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .35rem;
}
.pipe-flat-panel .calc-note {
  margin-bottom: .75rem;
}
.pipe-flat-table {
  font-size: .82rem;
  width: 100%;
}
.pipe-flat-panel .table-scroll {
  overflow-x: auto;
  margin-bottom: .5rem;
}
.pipe-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .75rem;
}
.pipe-export-actions .btn-secondary {
  padding: .45rem .85rem;
  font-size: .82rem;
  cursor: pointer;
}
.pipe-export-actions .btn-secondary:hover { border-color: var(--accent2); }

/* ── Classic model pages ── */
.model-hero-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 1.25rem 0 0;
  border: 1px solid #2a3545;
}
.classic-card-grid { margin-top: 1rem; }
.classic-card .card-meta { color: var(--accent2); }
.history-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.history-gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid #2a3545;
}
.article-body h2[id] { scroll-margin-top: 5rem; }

/* ── Performance build database ── */
.build-tier {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: .2rem .55rem;
  border-radius: 4px;
  margin-right: .35rem;
  vertical-align: middle;
}
.build-tier-mild { background: rgba(72, 187, 120, .18); color: #68d391; border: 1px solid rgba(72, 187, 120, .35); }
.build-tier-mid { background: rgba(237, 137, 54, .15); color: #f6ad55; border: 1px solid rgba(237, 137, 54, .35); }
.build-tier-wild { background: rgba(245, 101, 101, .15); color: #fc8181; border: 1px solid rgba(245, 101, 101, .35); }
.build-spec-table .build-tier { margin-right: 0; }
.build-callout {
  border-left: 3px solid var(--accent);
  background: var(--surface2);
  padding: 1rem 1.15rem;
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0 1.75rem;
  font-size: .98rem;
}
.build-callout-mild { border-left-color: #68d391; }
.build-callout-mid { border-left-color: #f6ad55; }
.build-callout-wild { border-left-color: #fc8181; }
.tech-figure { margin: 1.5rem 0; }
.tech-figure img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid #2a3545;
}
.tech-figure figcaption {
  margin-top: .6rem;
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Live chat ── */
.chat-panel {
  background: var(--surface);
  border: 1px solid #2a3545;
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.chat-embed-wrap {
  min-height: 686px;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
  text-align: center;
  max-width: 100%;
}
.chat-embed--mobile { display: none; }
.chat-embed-wrap iframe {
  max-width: 100%;
  border: 0;
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
  border-radius: var(--radius);
  border: 1px solid #2a3545;
}
.table-scroll .compare-table { min-width: 36rem; }
.table-scroll .laws-table { min-width: 52rem; }
.laws-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface2);
  z-index: 1;
  box-shadow: 0 1px 0 #2a3545;
}
.laws-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: .5rem .75rem;
  margin-bottom: 1rem;
  font-size: .82rem;
  color: var(--muted);
}
.laws-legend strong { color: var(--accent); font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; }
.chat-fallback {
  margin-top: .75rem;
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
}
.sidebar-card {
  background: var(--surface);
  border: 1px solid #2a3545;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.sidebar-card h3 {
  font-size: 1rem;
  margin-bottom: .5rem;
  color: var(--accent2);
}

/* ── External links page ── */
.link-section {
  background: var(--surface);
  border: 1px solid #2a3545;
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.link-section h2 {
  font-size: 1.1rem;
  color: var(--accent2);
  margin-bottom: .65rem;
}
.ext-link-list {
  list-style: none;
}
.ext-link-list li {
  padding: .5rem 0;
  border-bottom: 1px solid #2a3545;
  font-size: .92rem;
  color: var(--muted);
}
.ext-link-list li:last-child { border-bottom: none; }
.ext-link-list a { font-weight: 600; }


/* ── Responsive ── */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-img { max-height: 240px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: 1fr; }
  .compare-selects { grid-template-columns: 1fr; }
  .calc-panel { grid-template-columns: 1fr; }
  .pipe-design-wrap { grid-template-columns: 1fr; }
  .pipe-controls-panel { position: static; max-height: none; }
  .pipe-result-grid { grid-template-columns: 1fr; }
  .model-hero-img { max-height: 280px; }
  .ad-skyscraper { min-height: 250px; }
}
body.nav-open { overflow: hidden; }

@media (max-width: 900px) {
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .nav-main {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    padding: .75rem 1rem 1rem;
    border-bottom: 1px solid #2a3545;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .35);
    z-index: 110;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-toggle:checked ~ .nav-main,
  .nav-main.open { display: flex; }
  .nav-main a {
    padding: .75rem .85rem;
    font-size: .95rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .logo { font-size: 1.25rem; }
  .logo span { font-size: .7rem; letter-spacing: 2px; }
  .container { padding: 0 1rem; }
  .hero { padding: 2rem 0; }
  .hero p { font-size: 1rem; }
  .btn { padding: .85rem 1.2rem; min-height: 44px; }
  .calc-form input,
  .calc-form select,
  .compare-selects select,
  input[type="search"],
  input[type="text"],
  input[type="number"],
  input[type="email"] {
    font-size: 16px;
  }
  .chat-embed--desktop { display: none; }
  .chat-embed--mobile {
    display: block;
    min-height: min(70vh, 520px);
  }
  .chat-embed--mobile iframe {
    width: 100%;
    height: min(70vh, 520px);
  }
  .chat-panel { padding: .75rem; }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .ticker { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .compare-table th,
  .compare-table td {
    padding: .55rem .65rem;
    font-size: .82rem;
  }
}

/* FAQ sections — SEO + readability */
details.faq-item {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  padding: .85rem 1rem;
}
details.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item[open] summary { color: var(--accent); margin-bottom: .5rem; }
details.faq-item p { color: var(--muted); font-size: .95rem; }

/* Blog */
.blog-intro { color: var(--muted); max-width: 42rem; margin-bottom: 1.25rem; }
.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
}
.blog-filter { display: flex; flex-direction: column; gap: .35rem; min-width: 10rem; }
.blog-filter-grow { flex: 1; min-width: 12rem; }
.blog-filter-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.blog-filter select,
.blog-filter input[type="search"] {
  padding: .55rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--surface2);
  color: var(--text);
  font-size: .95rem;
}
.blog-count { margin-left: auto; color: var(--muted); font-size: .88rem; padding-bottom: .55rem; }
.blog-grid { margin-bottom: 2rem; }
.blog-card .blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  font-size: .82rem;
  color: var(--muted);
  margin-top: .5rem;
}
.blog-tag-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.blog-tag {
  font-size: .72rem;
  padding: .15rem .45rem;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--accent2);
}
.blog-project-tag { display: inline-block; margin-bottom: .25rem; }
.blog-img-missing {
  background: var(--surface2);
  min-height: 140px;
  object-fit: none;
}
.blog-empty { color: var(--muted); text-align: center; padding: 2rem; }
.blog-post-project { margin-bottom: .5rem; }
.blog-post-project a { font-weight: 600; color: var(--accent2); }
.blog-figure { margin: 1.5rem 0; }
.blog-figure img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
}
.blog-figure-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.blog-figure figcaption {
  margin-top: .5rem;
  font-size: .88rem;
  color: var(--muted);
  text-align: center;
}
.blog-post-aside {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  font-size: .92rem;
}
.blog-post-aside p { margin-bottom: .5rem; }
.blog-post-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--surface2); color: var(--muted); }
@media (max-width: 640px) {
  .blog-figure-pair { grid-template-columns: 1fr; }
  .blog-count { margin-left: 0; width: 100%; }
}