/* ============================================================
   DESIGN TOKENS — Premium Urban Moto Editorial
   ============================================================ */
:root {
  /* Color — light: warm off-white; dark: charcoal */
  --bg: #faf8f4;
  --bg-subtle: #f3f0ea;
  --fg: #1d1d1b;
  --fg-strong: #000000;
  --card: #ffffff;
  --muted: #6e6a61;
  --accent: #c93a1d;
  --accent-ink: #ffffff;
  --accent-soft: rgba(201, 58, 29, 0.08);
  --border: #e6e2d8;
  --border-strong: #d5d0c4;
  --wa: #1ea952;
  /* Type scale */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  --text-hero: clamp(2rem, 1.4rem + 3vw, 3.25rem);
  /* Spacing */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  /* Radius */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-full: 999px;
  /* Shadow — low elevation only */
  --shadow-1: 0 1px 2px rgba(20, 18, 12, 0.05);
  --shadow-2: 0 2px 8px rgba(20, 18, 12, 0.07);
  /* Container */
  --container: 1160px;
  --container-narrow: 760px;
  --header-container: 1480px;
  /* Motion */
  --t-fast: 140ms cubic-bezier(0.2, 0, 0.2, 1);
  --t-med: 220ms cubic-bezier(0.2, 0, 0.2, 1);
}
[data-theme="dark"] {
  --bg: #17181a;
  --bg-subtle: #1d1f22;
  --fg: #e9e7e1;
  --fg-strong: #ffffff;
  --card: #202225;
  --muted: #9b988f;
  --accent: #ff6a4d;
  --accent-ink: #1a120e;
  --accent-soft: rgba(255, 106, 77, 0.12);
  --border: #323438;
  --border-strong: #42454a;
  --wa: #2bc765;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* ============================================================
   BASE
   ============================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-4); }
main.container { padding-top: var(--sp-5); padding-bottom: var(--sp-8); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; font-weight: 700; color: var(--fg-strong); }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
.icon { vertical-align: middle; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}
.header-inner { max-width: var(--header-container); margin: 0 auto; padding: 0 var(--sp-5); display: flex; align-items: center; gap: var(--sp-3); min-height: 60px; }
.brand { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--text-base); color: var(--fg); font-weight: 500; }
.brand b { font-weight: 700; }
.brand-logo { display: block; width: 24px; height: 24px; border-radius: var(--r-sm); flex: none; }
.brand-short { display: none; }
.brand svg { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: var(--sp-4); margin-left: auto; }
.header-actions { display: flex; align-items: center; gap: var(--sp-2); margin-left: var(--sp-3); }
.site-nav > a { color: var(--fg); font-size: var(--text-sm); font-weight: 500; padding: 6px 2px; border-radius: var(--r-sm); white-space: nowrap; }
.site-nav > a:hover { color: var(--accent); text-decoration: none; }
.site-nav a.active { color: var(--accent); }
.site-nav a:focus-visible, .nav-
drop-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm);
}
.nav-group { position: relative; }
.nav-drop-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 6px 2px;
  color: var(--fg); font-family: inherit; font-size: var(--text-sm); font-weight: 500;
  border-radius: var(--r-sm); white-space: nowrap;
}
.nav-drop-btn:hover { color: var(--accent); }
.nav-drop-btn .chev { transition: transform var(--t-fast); }
/* OPEN state: neutral, never the accent/current color */
.nav-group.open > .nav-drop-btn { color: var(--fg); background: var(--bg-subtle); }
/* CURRENT state: accent only when actually viewing one of the group's hubs/articles */
.nav-group.current > .nav-drop-btn, .nav-group.current.open > .nav-drop-btn { color: var(--accent); }
.nav-group.open .nav-drop-btn .chev { transform: rotate(180deg); }
.nav-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 70;
  min-width: 230px; margin: 0; padding: var(--sp-2); list-style: none;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
}
.nav-group.open > .nav-dropdown { display: block; }
/* Hover bridge (desktop only): keeps the 6px visual offset but lets the pointer
   travel from parent button to dropdown without leaving the .nav-group hit area */
@media (min-width: 1280px) {
  .nav-group.open > .nav-dropdown::before { content: ""; position: absolute; top: -6px; left: 0; right: 0; height: 6px; }
}
.nav-group.nav-more > .nav-dropdown { left: auto; right: 0; }
.nav-dropdown a {
  display: block; padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--fg); font-size: var(--text-sm); font-weight: 500;
}
.nav-dropdown a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.nav-dropdown a.active { color: var(--accent); }
.nav-dropdown a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.theme-toggle, .nav-toggle {
  background: none; border: 1px solid var(--border); color: var(--fg);
  border-radius: var(--r-sm); padding: 7px 9px; cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: inline; }
.nav-toggle { display: none; }

/* Sticky mobile bottom 
nav */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.mobile-nav ul { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; margin: 0; padding: var(--sp-1) 0 max(env(safe-area-inset-bottom), 4px); }
.mobile-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: var(--text-xs); font-weight: 500;
  padding: var(--sp-2) 0; min-height: 48px; justify-content: center;
}
.mobile-nav a:hover { text-decoration: none; }
.mobile-nav a.active { color: var(--accent); }
.mobile-nav a svg { width: 21px; height: 21px; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: var(--sp-8) 0 var(--sp-7);
  max-width: 720px;
}
.hero .kicker {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  margin: 0 0 var(--sp-3);
}
.hero h1 {
  font-size: var(--text-hero); font-weight: 800;
  letter-spacing: -0.03em; margin: 0 0 var(--sp-4);
}
.hero .lede { font-size: var(--text-lg); color: var(--muted); margin: 0 0 var(--sp-5); max-width: 56ch; }

/* SearchBar */
.searchbar { display: flex; gap: var(--sp-2); max-width: 560px; }
.searchbar input {
  flex: 1; padding: 13px 16px; font-size: var(--text-base); font-family: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--r-full);
  background: var(--card); color: var(--fg);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.searchbar input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.searchbar button {
  border: none; background: var(--accent); color: var(--accent-i
nk);
  font-weight: 600; font-size: var(--text-sm); font-family: inherit;
  padding: 0 22px; border-radius: var(--r-full); cursor: pointer;
  transition: filter var(--t-fast);
}
.searchbar button:hover { filter: brightness(1.08); }

/* Section headings */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4);
  margin: var(--sp-7) 0 var(--sp-4);
}
.section-head h2 { margin: 0; }
.section-head .more { font-size: var(--text-sm); font-weight: 500; white-space: nowrap; }

/* ============================================================
   CARDS
   ============================================================ */
.card-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.card a { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-5); height: 100%; color: var(--fg); }
.card a:hover { text-decoration: none; }
.card-title { font-weight: 700; font-size: var(--text-base); color: var(--fg-strong); line-height: 1.35; }
.card-desc { font-size: var(--text-sm); color: var(--muted); line-height: 1.6; }
.card .chip-row { margin-top: auto; }

/* Topic tiles */
.topic-tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-3); }
.topic-tile {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.topic-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.topic-tile a { display: flex; flex-direction
: column; gap: var(--sp-1); padding: var(--sp-4); color: var(--fg); }
.topic-tile a:hover { text-decoration: none; }
.topic-tile .tile-title { font-weight: 600; font-size: var(--text-sm); }
.topic-tile .tile-count { font-size: var(--text-xs); color: var(--muted); }

/* VehicleCard placeholder (16:10 imagery-ready) */
.vehicle-card { position: relative; }
.vehicle-media {
  aspect-ratio: 16 / 10; background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase;
}

/* SpecChip */
.spec-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); font-weight: 500;
  padding: 3px 10px; border-radius: var(--r-full);
  border: 1px solid var(--border-strong); color: var(--muted);
  background: var(--bg-subtle);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============================================================
   ARTICLE
   ============================================================ */
.article-header h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); margin: 0 0 var(--sp-2); letter-spacing: -0.02em; }
.meta { color: var(--muted); font-size: var(--text-sm); margin-top: 0; }
.article-body { max-width: var(--container-narrow); font-size: var(--text-base); }
.article-body h2 { font-size: 1.3rem; margin-top: 1.8em; }
.article-body h3 { font-size: 1.1rem; margin-top: 1.5em; }
.article-body table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); margin: 1.2em 0; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.article-body th { background: var(--bg-subtle); font-weight: 600; }
.article-body tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-subtle) 50%, transparent); }

/* Callout / blockquote */
blockquote, .callout {
  border-left: 3px solid var(--accent); mar
gin: 1.4em 0; padding: var(--sp-3) var(--sp-4);
  background: var(--bg-subtle); border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--fg); font-size: var(--text-sm);
}
blockquote strong, .callout strong { color: var(--fg-strong); }

/* LegalNotice / review banner */
.review-banner, .legal-notice {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: var(--accent-soft);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  margin: var(--sp-4) 0;
  max-width: var(--container-narrow);
}

/* ============================================================
   CTA
   ============================================================ */
.contact-cta {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  padding: var(--sp-6); margin: var(--sp-7) 0; max-width: var(--container-narrow);
}
.contact-cta h2 { margin-top: 0; }
.cta-buttons { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--r-full);
  font-weight: 600; font-size: var(--text-sm); min-height: 44px;
  transition: filter var(--t-fast), transform var(--t-fast);
}
.btn:hover { text-decoration: none; filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-wa { background: var(--wa); color: #ffffff; }
.btn-ghost { border: 1px solid var(--border-strong); color: var(--fg); background: transparent; }
.cta-note { color: var(--muted); font-size: var(--text-xs); }

/* Related */
.related { max-width: var(--container-narrow); }
.related ul { padding-left: 18px; }

/* Article sources */
.article-sources { max-width: var(--container-narrow); }
.article-sources h2 { font-size: 1.15rem; }
.article-sources ul { padding-left: 18px; font-size: var(--text-sm); color: var(--muted); }
.article-sources a { word-break: break-word; }

/* ============================================================
   FOOTER — large structured accordion
   ============================================================ */
.site-footer { margin-top: var(--sp-8); background: var(
--bg-subtle); border-top: 1px solid var(--border); padding: var(--sp-6) 0 var(--sp-5); }
.footer-accordion { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
.footer-accordion + .footer-accordion { margin-top: var(--sp-3); }
.footer-accordion summary {
  cursor: pointer; font-weight: 700; font-size: var(--text-base);
  padding: var(--sp-4) var(--sp-5); list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--fg-strong);
}
.footer-accordion summary::-webkit-details-marker { display: none; }
.footer-accordion summary::after { content: "+"; font-size: 1.2rem; color: var(--muted); font-weight: 400; }
.footer-accordion[open] summary::after { content: "\2013"; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-5); padding: 0 var(--sp-5) var(--sp-5); }
.footer-cols h3 { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 var(--sp-2); }
.footer-cols ul { list-style: none; padding: 0; margin: 0; font-size: var(--text-sm); display: grid; gap: 6px; }
.footer-cols a { color: var(--fg); }
.footer-cols a:hover { color: var(--accent); }
.footer-note { color: var(--muted); font-size: var(--text-xs); margin: var(--sp-4) 0 0; }

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-box {
  width: 100%; padding: 13px 18px; border: 1px solid var(--border-strong);
  border-radius: var(--r-full); background: var(--card); color: var(--fg);
  font-size: var(--text-base); font-family: inherit; margin: var(--sp-3) 0 var(--sp-5);
}
.search-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Breadcrumbs */
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: var(--sp-3) 0 0; margin: 0; font-size: 
var(--text-xs); color: var(--muted); }
.breadcrumbs li + li::before { content: "\203A"; margin-right: 6px; color: var(--muted); }

/* ============================================================
   MOBILE — optimized around 390px
   ============================================================ */
/* ===== TIER 1: TABLET / LAPTOP (max-width: 1279px) — hamburger panel ===== */
@media (max-width: 1279px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .header-actions { margin-left: auto; }
  .site-nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0; z-index: 65;
    flex-direction: column; align-items: stretch; background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-3) var(--sp-4) var(--sp-4); gap: 2px;
    max-height: calc(100vh - 60px); overflow-y: auto; overscroll-behavior: contain;
  }
  .site-nav.open { display: flex; }
  .site-nav > a { padding: 12px 8px; font-size: var(--text-base); }
  .nav-group { width: 100%; }
  .nav-group.nav-more > .nav-dropdown { left: 0; right: auto; }
  .nav-drop-btn { width: 100%; justify-content: space-between; padding: 12px 8px; font-size: var(--text-base); border-radius: var(--r-sm); }
  .nav-group.open .nav-drop-btn .chev { transform: rotate(180deg); }
  .nav-dropdown {
    position: static; min-width: 0; box-shadow: none; border: none; border-radius: 0;
    padding: 0 0 var(--sp-1) var(--sp-2); margin: 0;
  }
  .nav-dropdown a { padding: 10px 12px; font-size: var(--text-sm); color: var(--muted); }
  .nav-dropdown a.active { color: var(--accent); }
}

/* ===== TIER 2: PHONE (max-width: 640px) — hamburger + bottom nav ===== */
@media (max-width: 640px) {
  body { padding-bottom: 64px; } /* space for sticky bottom nav */
  .mobile-nav { display: block; }
  .brand-full { display: none; }
  .brand-short { display: inline; }
  .hero { padding: var(--sp-6) 0 var(--sp-5); }
  .hero .lede { font-size: var(--text-base); }
  .card-list { grid-template-columns: 1fr; }
  .topic-tiles { grid-template-columns: repeat(2, 1fr); }
  .se
archbar { flex-direction: row; }
  .searchbar button { padding: 0 16px; }
  .section-head { flex-direction: column; gap: var(--sp-1); }
  .contact-cta { padding: var(--sp-5); }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
  .article-body table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ===== TIER 3: SMALL PHONE (max-width: 380px) — compact brand ===== */
@media (max-width: 380px) {
  .header-inner { padding: 0 var(--sp-3); gap: var(--sp-2); }
  .brand { font-size: var(--text-sm); }
}

/* ===== WIDE DESKTOP DEFAULT (>=1280px) ===== */
@media (min-width: 1280px) {
  .site-nav { margin-left: auto; }
}

/* Content layout for medium screens */
@media (max-width: 768px) {
  .brand-full { display: none; }
  .brand-short { display: inline; }
}
@media (min-width: 769px) {
  .brand-short { display: none; }
  .brand-full { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   APP SHELL — status pill, quick actions, section cards, sheet
   ============================================================ */
/* Status pill */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 500; color: var(--muted);
  padding: 3px 10px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--bg-subtle);
  white-space: nowrap; line-height: 1.4;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border-strong); flex: none;
}
.status-pill.is-open .status-dot { background: #1ea952; box-shadow: 0 0 0 3px rgba(30,169,82,0.18); }
.status-pill.is-closed .status-dot { background: #d83a2f; box-shadow: 0 0 0 3px rgba(216,58,47,0.16); }
[data-theme="dark"] .status-pill.is-open .status-dot { background: #2bc765; }
[data-theme="dark"] .status-pill.is-closed .status-dot { bac
kground: #ff6a5b; }
@media (max-width: 1279px) { .status-pill { order: 0; } }

/* Quick actions grid */
.quick-actions {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3);
  margin: var(--sp-4) 0 var(--sp-2);
}
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-2); min-height: 88px; justify-content: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--fg); text-align: center;
  transition: border-color var(--t-fast), transform var(--t-fast), background var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.quick-action:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.quick-action:active { transform: scale(0.97); background: var(--bg-subtle); }
.qa-ic { color: var(--accent); display: flex; }
.qa-label { font-size: var(--text-xs); font-weight: 600; line-height: 1.3; }

/* Section cards (parent taxonomy) */
.section-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); }
.section-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); overflow: hidden;
  transition: border-color var(--t-med), box-shadow var(--t-med);
}
.section-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.section-card.is-empty { opacity: 0.78; }
.sc-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.sc-ic { color: var(--accent); display: flex; }
.sc-title { font-size: var(--text-base); font-weight: 700; margin: 0; flex: 1; }
.sc-count { font-size: var(--text-xs); color: var(--muted); font-weight: 500; white-space: nowrap; }
.section-card.is-empty .sc-count { font-style: italic; }
.sc-links { list-style: none; margin: 0; padding: var(--sp-2); display: grid; }
.s
c-links a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 9px 12px; border-radius: var(--r-sm); color: var(--fg); font-size: var(--text-sm); font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.sc-links a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.sc-sub-count { font-size: var(--text-xs); color: var(--muted); }

/* Search field (search page + home searchbar shared) */
.search-field { position: relative; max-width: 560px; }
.search-field-ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.search-field .search-box { padding-left: 44px; padding-right: 44px; margin: var(--sp-3) 0 var(--sp-5); }
.search-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-4px);
  background: none; border: none; color: var(--muted); cursor: pointer;
  display: inline-flex; padding: 6px; border-radius: var(--r-full);
}
.search-clear:hover { color: var(--accent); }
/* Articles library: topic cards + filter states */
.topic-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-3); margin: var(--sp-4) 0 var(--sp-6); }
.topic-card { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.topic-card-link { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--fg); }
.topic-card-link:hover .topic-name { color: var(--accent); }
.topic-name { font-weight: 600; }
.topic-count { font-size: var(--text-xs); color: var(--muted); }
.topic-desc { font-size: var(--text-xs); color: var(--muted); margin: 0; line-height: 1.45; }
.topic-group h3 { margin: var(--sp-6) 0 var(--sp-3); }
.topic-group h3 a { color: var(--fg); }
.topic-group h3 a:hover { color: var(--accent); }
.empty-note { color: var(--muted); font-size: var(--text-sm); background: var(--bg-subtle); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); padding: var(--sp-4); }
.topic-group[hidden], .card[hidden] { display: none !important; }
.search-suggest { margin-bottom: var(--sp-4); }
.search-suggest-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 var(--sp-2); }
.search-suggest-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.suggest-tag {
  font-size: var(--text-sm); font-weight: 500; padding: 7px 14px;
  border-radius: var(--r-full); border: 1px solid var(--border-strong);
  background: var(--card); color: var(--fg);
}
.suggest-tag:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Home searchbar icon */
.searchbar { position: relative; }
.searchbar-ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.searchbar input { padding-left: 46px; }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-2);
  padding: var(--sp-7) var(--sp-5); margin: var(--sp-5) 0;
  background: var(--card); border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
}
.empty-ic { color: var(--muted); display: flex; }
.empty-title { font-weight: 700; font-size: var(--text-lg); color: var(--fg-strong); margin: var(--sp-2) 0 0; }
.empty-desc { color: var(--muted); font-size: var(--text-sm); max-width: 48ch; margin: 0; }
.empty-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; margin-top: var(--sp-3); }

/* ============================================================
   CONTACT ACTION SHEET (mobile)
   ============================================================ */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(20, 18, 12, 0.42); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity var(--t-med), visibility var(--t-med);
}
.sheet-backdrop.is-open { opacity: 1; visibility: visible; }
.contact-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  max-width: 520px; margin: 0 auto;
  background: var(--card); border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: 0 -4px 24px rgba(20,18,12,0.18);
  padding: var(--sp-3) var(--sp-5) calc(var(--sp-5) + max(env(safe-area-inset-bottom), 12px));
  transform: translateY(100%); transition: transform var(--t-med);
  display: none;
}
.contact-sheet.is-open { transform: translateY(0); }
.sheet-grip { width: 38px; height: 5px; border-radius: var(--r-full); background: var(--border-strong); margin: 0 auto var(--sp-3); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-1); }
.sheet-head h2 { font-size: var(--text-lg); margin: 0; }
.sheet-close { background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: var(--r-full); display: inline-flex; }
.sheet-close:hover { color: var(--accent); }
.sheet-sub { 
font-size: var(--text-sm); color: var(--muted); margin: 0 0 var(--sp-3); }
.sheet-actions { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.sheet-action {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--bg-subtle);
  color: var(--fg); transition: background var(--t-fast), border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.sheet-action:hover { text-decoration: none; border-color: var(--accent); background: var(--accent-soft); }
.sheet-action:active { background: var(--accent-soft); }
.sheet-ic { color: var(--accent); display: flex; flex: none; }
.sheet-label { display: flex; flex-direction: column; }
.sheet-name { font-weight: 600; font-size: var(--text-sm); }
.sheet-val { font-size: var(--text-xs); color: var(--muted); }
@media (max-width: 640px) { .contact-sheet { display: block; } }

/* ============================================================
   BOTTOM TAB BAR — native feel upgrade
   ============================================================ */
.mobile-nav { box-shadow: 0 -1px 6px rgba(20,18,12,0.06); }
.mobile-nav ul { padding: 0 0 max(env(safe-area-inset-bottom), 6px); }
.mobile-nav a { position: relative; padding: var(--sp-2) 0 6px; min-height: 52px; }
.mobile-nav a::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%) scaleX(0);
  width: 26px; height: 3px; border-radius: var(--r-full); background: var(--accent);
  transition: transform var(--t-med);
}
.mobile-nav a.active::before { transform: translateX(-50%) scaleX(1); }
.mobile-nav a.active { color: var(--accent); font-weight: 600; }
.tab-label { font-size: var(--text-xs); }

/* Card pressed state for touch */
.card:active, .topic-tile:active, .section-card:active { transform: scale(0.99); }

/* ============================================================
   RESPONSIVE — app shell
   =====
======================================================= */
@media (max-width: 1279px) {
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
  .section-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .quick-actions { grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
  .quick-action { min-height: 76px; padding: var(--sp-3) var(--sp-1); }
  .qa-label { font-size: 0.7rem; }
}
@media (max-width: 380px) {
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .status-pill .status-hours { display: none; }
  .status-pill::after { content: attr(data-status); }
}
@media (min-width: 1280px) {
  .quick-actions { grid-template-columns: repeat(6, 1fr); max-width: 720px; }
}
@media (prefers-reduced-motion: reduce) {
  .contact-sheet, .sheet-backdrop, .mobile-nav a::before { transition: none !important; }
}

/* ============================================================
   FOOTER — social / external pills
   ============================================================ */
.footer-elsewhere { min-width: 220px; }
.social-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.social-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; min-height: 40px;
  font-size: var(--text-sm); font-weight: 600; color: var(--fg);
  background: var(--card); border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast), transform var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.social-pill svg { color: var(--muted); flex: none; transition: color var(--t-fast); }
.social-pill:hover {
  text-decoration: none; color: var(--accent);
  border-color: var(--accent); background: var(--accent-soft);
  transform: translateY(-1px);
}
.social-pill:hover svg { color: var(--accent); }
.social-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.social-pill:active { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .social-pill { transition: none !important; } }

/* ============================================================
   GUIDE ASSISTANT (static client-side helper, single button)
   ============================================================ */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.assistant-fab {
  position: fixed; right: 20px; bottom: 24px; z-index: 85;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 16px 0 13px; height: 46px;
  font-size: var(--text-sm); font-weight: 600;
  color: var(--accent-ink); background: var(--accent);
  border: none; border-radius: var(--r-full);
  box-shadow: 0 4px 14px rgba(20, 18, 12, 0.22);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.assistant-fab:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(20, 18, 12, 0.28); }
.assistant-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.assistant-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 95;
  width: min(380px, 100vw);
  display: flex; flex-direction: column;
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 24px rgba(20, 18, 12, 0.16);
  transform: translateX(100%); transition: transform var(--t-med);
  visibility: hidden;
}
.assistant-panel.is-open { transform: translateX(0); visibility: visible; }
.assistant-head {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.assistant-logo { width: 28px; height: 28px; border-radius: var(--r-sm); flex: none; }
.assistant-head-txt { flex: 1; min-width: 0; }
.assistant-head-txt h2 { font-size: var(--text-base); margin: 0; }
.assistant-disclosure { font-size: var(--text-xs); color: var(--muted); margin: 2px 0 0; }
.assistant-close { margin-left: auto; flex: none; }
.assistant-msgs {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.amsg { max-width: 88%; font-size: var(--text-sm); line-height: 1.5; }
.amsg-user {
  align-self: flex-end;
  background: var(--accent); color: var(--accent-ink);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-lg) var(--r-lg) var(--r-sm) var(--r-lg);
}
.amsg-bot {
  align-self: flex-start;
  background: var(--bg-subtle); color: var(--fg);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-lg) var(--r-lg) var(--r-lg) var(--r-sm);
}
.amsg p { margin: 0; }
.amsg ul, .amsg .amsg-list { margin: var(--sp-2) 0 0; padding-left: 1.1em; }
.amsg-sources { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px dashed var(--border-strong); }
.amsg-src-label { display: block; font-size: var(--text-xs); color: var(--muted); font-weight: 600; }
.amsg-sources ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.amsg-sources a { color: var(--accent); font-weight: 500; word-break: break-word; }
.amsg-contact { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.amsg-contact a {
  font-size: var(--text-xs); font-weight: 600; color: var(--fg);
  padding: 5px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-full);
  text-decoration: none;
}
.amsg-contact a:hover { color: var(--accent); border-color: var(--accent); }
.assistant-suggest {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 var(--sp-4) var(--sp-2);
}
.assistant-suggest button {
  font-size: var(--text-xs); font-weight: 500; color: var(--muted);
  background: var(--bg-subtle); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: var(--r-full);
  cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.assistant-suggest button:hover { color: var(--accent); border-color: var(--accent); }
/* Follow-up chips rendered inside the message list */
.amsg-followups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-2); }
.amsg-followups button {
  font-size: var(--text-xs); font-weight: 500; color: var(--muted);
  background: var(--bg-subtle); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: var(--r-full);
  cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.amsg-followups button:hover { color: var(--accent); border-color: var(--accent); }
.assistant-input {
  display: flex; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + max(env(safe-area-inset-bottom), 10px));
  border-top: 1px solid var(--border);
}
.assistant-input input {
  flex: 1; min-width: 0;
  font-size: 16px; /* prevents iOS zoom-on-focus */
  padding: 10px 14px;
  color: var(--fg); background: var(--bg-subtle);
  border: 1px solid var(--border-strong); border-radius: var(--r-full);
}
.assistant-input input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.assistant-send {
  flex: none; width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-ink); background: var(--accent);
  border: none; border-radius: var(--r-full); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.assistant-send:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) {
  .assistant-fab {
    right: 14px;
    bottom: calc(70px + max(env(safe-area-inset-bottom), 6px)); /* above bottom nav */
    height: 44px; padding: 0 14px 0 11px;
  }
  .assistant-fab-label { display: none; } /* compact icon-only on small phones */
  .assistant-panel {
    width: 100vw; top: auto; left: 0;
    height: 92dvh; max-height: 92dvh;
    border-left: none; border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-top: 1px solid var(--border);
    transform: translateY(100%);
    box-shadow: 0 -6px 24px rgba(20, 18, 12, 0.2);
  }
  .assistant-panel.is-open { transform: translateY(0); }
  .amsg { max-width: 94%; }
}
@media (max-width: 380px) { .assistant-fab-label { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .assistant-panel, .assistant-fab { transition: none !important; }
}

/* ============================================================
   FEATURED RENTAL BIKES — premium showcase
   ============================================================ */
.showcase { margin: var(--sp-8) 0 var(--sp-6); }
.showcase-intro {
  color: var(--muted); font-size: var(--text-base);
  max-width: 56ch; margin: calc(-1 * var(--sp-2)) 0 var(--sp-5);
}
.showcase-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}
.bike-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(20, 18, 12, 0.05);
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.bike-media {
  display: block; aspect-ratio: 4 / 3;
  background: color-mix(in srgb, var(--bg-subtle) 60%, #ffffff);
}
[data-theme="dark"] .bike-media { background: color-mix(in srgb, var(--bg-subtle) 70%, #ffffff); }
.bike-media img {
  display: block; width: 100%; height: 100%;
  object-fit: contain; padding: var(--sp-4);
}
.bike-body {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  border-top: 1px solid var(--border);
}
.bike-name { font-size: var(--text-lg); font-weight: 700; color: var(--fg-strong); margin: 0; letter-spacing: -0.01em; }
.bike-cat { font-size: var(--text-sm); color: var(--muted); margin: 0; }
.bike-price { font-size: var(--text-lg); font-weight: 700; color: var(--accent); margin: var(--sp-3) 0 0; }
.bike-price span { font-size: var(--text-sm); font-weight: 500; color: var(--muted); }
.bike-note { font-size: var(--text-xs); color: var(--muted); margin: 2px 0 var(--sp-3); }
.bike-cta {
  align-self: flex-start;
  font-size: var(--text-sm); font-weight: 600;
  color: var(--accent); text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--border-strong); border-radius: var(--r-full);
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  min-height: 40px; display: inline-flex; align-items: center;
}
.bike-cta:hover {
  color: var(--accent-ink); background: var(--accent); border-color: var(--accent);
  text-decoration: none;
}
.bike-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 1025px) {
  .bike-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(20, 18, 12, 0.1);
    border-color: var(--border-strong);
  }
}
@media (max-width: 1024px) {
  .showcase-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
}
@media (max-width: 640px) {
  .showcase-grid { grid-template-columns: 1fr; gap: var(--sp-3); }
  .showcase { margin: var(--sp-6) 0 var(--sp-5); }
  .bike-media img { padding: var(--sp-3); }
  .bike-body { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
}
@media (prefers-reduced-motion: reduce) {
  .bike-card { transition: none; }
}

/* ============================================================
   CONTACT PAGE — map card + two-column layout
   ============================================================ */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); align-items: start; margin: var(--sp-4) 0; }
.map-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: var(--sp-4); box-shadow: 0 1px 3px rgba(20, 18, 12, 0.05);
}
.map-card h2 { font-size: var(--text-lg); margin: 0 0 var(--sp-3); }
.map-frame { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-address { font-weight: 600; margin: var(--sp-3) 0 0; }
.map-hours { color: var(--muted); font-size: var(--text-sm); margin: 2px 0 var(--sp-3); }
.map-link { font-weight: 600; color: var(--accent); }

/* ============================================================
   FAQ — jump nav
   ============================================================ */
.faq-jump {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin: var(--sp-4) 0 var(--sp-6);
}
.faq-jump a {
  font-size: var(--text-sm); font-weight: 600; color: var(--fg);
  padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center;
  border: 1px solid var(--border-strong); border-radius: var(--r-full);
  text-decoration: none; transition: color var(--t-fast), border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.faq-jump a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.faq-jump a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faq-footnote { color: var(--muted); font-size: var(--text-sm); margin-top: var(--sp-6); }
@media (max-width: 900px) {
  .contact-layout { grid-template-columns: 1fr; gap: var(--sp-4); }
}

/* ============================================================
   ARTICLE EDITORIAL UPGRADE — hero, rail, TOC, progress, typography
   (owned by _layouts/article.html + assets/js/main.js)
   ============================================================ */

/* --- Reading progress bar --- */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 55;
  height: 3px; pointer-events: none;
}
.reading-progress-bar {
  height: 100%; width: 100%;
  background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%;
}
.reading-progress { display: none; }
.reading-progress.is-active { display: block; }
@media (prefers-reduced-motion: reduce) {
  .reading-progress-bar { transition: none !important; }
}

/* --- Article hero --- */
.article-header { max-width: var(--container-narrow); margin-bottom: var(--sp-5); }
.article-kicker {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 var(--sp-3);
}
.article-kicker-link { color: var(--accent); }
.article-kicker-link:hover { text-decoration: underline; }
.article-kicker-sep { color: var(--muted); }
.article-kicker span:not(.article-kicker-sep) { color: var(--muted); }
.article-header h1 {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 var(--sp-3);
}
.article-deck {
  font-size: var(--text-lg); line-height: 1.55; color: var(--muted);
  margin: 0 0 var(--sp-4); max-width: 60ch;
}
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.article-meta-sep { color: var(--border-strong); }

/* --- Shell: main column + side rail --- */
.article-shell { display: block; }
.article-main { min-width: 0; }
.article-rail { display: none; }

@media (min-width: 1100px) {
  .article-shell {
    display: grid;
    grid-template-columns: minmax(0, 740px) 240px;
    gap: var(--sp-6);
    align-items: start;
  }
  .article-main, .article-header, .review-banner { max-width: 740px; }
  .article-rail {
    display: flex; flex-direction: column; gap: var(--sp-4);
    position: sticky; top: 84px;
    max-height: calc(100vh - 100px);
    overflow-y: auto; overscroll-behavior: contain;
  }
  .article-main .article-toc { display: none; }
}

/* --- Table of contents --- */
.article-toc {
  margin: 0 0 var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  font-size: var(--text-sm);
}
.article-toc-head {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  background: none; border: none; cursor: pointer;
  padding: var(--sp-3) var(--sp-4);
  font-family: inherit; font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-strong);
  text-align: left;
}
.article-toc-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-md); }
.article-toc-head .chev { color: var(--muted); transition: transform var(--t-fast); flex: none; }
.article-toc[data-open="true"] .article-toc-head .chev { transform: rotate(180deg); }
.article-toc-list {
  list-style: none; margin: 0; padding: 0 var(--sp-3) var(--sp-3);
  display: none;
}
.article-toc[data-open="true"] .article-toc-list { display: block; }
.article-toc-list a {
  display: block; padding: 5px 10px; border-radius: var(--r-sm);
  color: var(--fg); font-size: var(--text-sm); line-height: 1.45;
  text-decoration: none; word-break: break-word;
}
.article-toc-list a:hover { color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.article-toc-list a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.article-toc-list a.toc-active { color: var(--accent); font-weight: 600; }
.article-toc-list li.toc-h3 { padding-left: var(--sp-4); }
.article-toc-list li.toc-h3 a { font-size: var(--text-xs); color: var(--muted); }
.article-toc-list li.toc-h3 a.toc-active { color: var(--accent); }

/* Rail TOC: flat, always open, no toggle chrome */
.rail-toc-slot .article-toc { margin: 0; }
.rail-toc-slot .article-toc-head { cursor: default; }
.rail-toc-slot .article-toc-head .chev { display: none; }
.rail-toc-slot .article-toc-list { display: block; padding-top: 0; }

/* --- Rail quick-contact --- */
.rail-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-4);
  box-shadow: var(--shadow-1);
}
.rail-contact-title { font-weight: 700; font-size: var(--text-base); color: var(--fg-strong); margin: 0 0 4px; }
.rail-contact-sub { font-size: var(--text-xs); color: var(--muted); margin: 0 0 var(--sp-3); line-height: 1.5; }
.rail-btn { width: 100%; padding: 10px 16px; min-height: 44px; }
.rail-btn + .rail-btn { margin-top: var(--sp-2); }

/* --- Article typography --- */
.article-body { font-size: 1.03rem; line-height: 1.75; }
.article-body p { margin: 0 0 1.1em; }
.article-body > *:first-child { margin-top: 0; }
.article-body h2 {
  font-size: 1.45rem; margin-top: 2.2em; margin-bottom: 0.6em;
  padding-bottom: 0.3em; border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
}
.article-body h3 { font-size: 1.15rem; margin-top: 1.7em; margin-bottom: 0.5em; }
.article-body h2 + p, .article-body h3 + p { margin-top: 0; }
.article-body ul, .article-body ol { margin: 0 0 1.1em; padding-left: 1.5em; }
.article-body li { margin-bottom: 0.4em; }
.article-body li > ul, .article-body li > ol { margin-top: 0.4em; margin-bottom: 0; }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }
.article-body a:hover { text-decoration-thickness: 2px; }
.article-body a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.article-body strong { color: var(--fg-strong); }
.article-body img {
  max-width: 100%; height: auto; display: block;
  margin: 1.4em auto; border-radius: var(--r-md);
}
.article-body img + em, .article-body p > img { border-radius: var(--r-md); }
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.article-body code {
  font-size: 0.9em; background: var(--bg-subtle);
  padding: 2px 6px; border-radius: var(--r-sm);
  border: 1px solid var(--border); word-break: break-word;
}
.article-body pre {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-4);
  overflow-x: auto; font-size: var(--text-sm); line-height: 1.6;
}
.article-body pre code { background: none; border: none; padding: 0; }

/* --- Tables --- */
.article-body table { font-size: var(--text-sm); }
.article-body th, .article-body td { padding: 12px 14px; }
.article-body th { color: var(--fg-strong); border-bottom: 2px solid var(--border-strong); }
@media (max-width: 640px) {
  .article-body table {
    display: block; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: normal;
  }
  .article-body th, .article-body td { padding: 10px 12px; }
}

/* --- Sources panel --- */
.article-sources {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-5);
  margin: var(--sp-7) 0;
}
.article-sources h2 { font-size: 1.15rem; margin: 0 0 var(--sp-3); }
.article-sources ul { padding-left: 20px; font-size: var(--text-sm); color: var(--fg); margin: 0; display: grid; gap: var(--sp-2); }
.article-sources li { line-height: 1.55; }
.article-sources a { word-break: break-word; text-decoration: underline; text-underline-offset: 2px; }
.article-sources a::after {
  content: ""; display: inline-block; width: 9px; height: 9px;
  margin-left: 3px;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M14 3h7v7h-2V6.4l-9.3 9.3-1.4-1.4L17.6 5H14V3zM5 5h6v2H7v10h10v-4h2v6H5V5z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M14 3h7v7h-2V6.4l-9.3 9.3-1.4-1.4L17.6 5H14V3zM5 5h6v2H7v10h10v-4h2v6H5V5z'/%3E%3C/svg%3E") no-repeat center / contain;
  vertical-align: baseline;
}
.article-sources .src-detail { color: var(--muted); }

/* --- Related cards grid --- */
.related { margin: var(--sp-3) 0 var(--sp-7); }
.related > h2 { font-size: 1.3rem; margin: var(--sp-5) 0 var(--sp-4); }
.related-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 640px) {
  .related-cards { grid-template-columns: 1fr; }
  .article-sources { padding: var(--sp-4); }
}

/* --- CTA separation --- */
.contact-cta { margin: var(--sp-7) 0 var(--sp-4); }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .article-toc-head .chev { transition: none !important; }
}
