/* ============================================================
   site.css — the brand-neutral engine for the playbook site.
   Everything reads from tokens.css custom properties; no colour,
   font, or radius literals belong in this file.
   Layout: topbar / sidebar / content / toc-rail, mobile-first.
   ============================================================ */

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html:focus-within { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -0.015em; color: var(--text); text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 600; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--accent-tint); color: var(--text); }
kbd {
  font-family: var(--font-mono); font-size: 0.72em;
  background: var(--kbd-bg); border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: var(--radius-sm); padding: 1px 5px;
  color: var(--text-muted);
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--accent-contrast);
  padding: 10px 18px; border-radius: 0 0 var(--radius-md) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  height: 58px; padding: 0 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .topbar { background: var(--topbar-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}
.nav-toggle {
  display: inline-flex; width: 38px; height: 38px; border-radius: var(--radius-sm);
  align-items: center; justify-content: center; color: var(--text-muted); flex: none;
}
.nav-toggle:hover { background: var(--surface-alt); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; white-space: nowrap; min-width: 0; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--hero-bg);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.18);
}
.brand-mark svg { display: block; }
.brand-name { font-family: var(--font-display); font-size: 0.98rem; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; }
.brand-name .thin { color: var(--text-faint); font-weight: 500; }
.topbar-spacer { flex: 1; }
.searchbtn {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text-faint); font-size: 0.86rem;
  transition: border-color var(--speed) var(--ease);
  min-width: 190px;
}
.searchbtn:hover { border-color: var(--border-strong); color: var(--text-muted); }
.searchbtn svg { width: 15px; height: 15px; flex: none; }
.searchbtn kbd { margin-left: auto; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.icon-btn:hover { background: var(--surface-alt); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ---------- layout ----------
   Sidebar pins to the viewport's left edge (docs-site style); the
   content column caps its width and centers in the remaining space,
   so ultra-wide screens get breathing room instead of a floating
   sidebar island. */
.layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
}
/* paint the rail on the grid itself so it runs unbroken from topbar to
   footer even when the page is taller than the sticky sidebar */
@media (min-width: 1024px) {
  .layout {
    background: linear-gradient(to right,
      var(--sidebar-bg) calc(268px - 1px),
      var(--border) calc(268px - 1px) 268px,
      transparent 268px);
  }
}
.content {
  padding: 30px clamp(18px, 4vw, 56px) 72px;
  min-width: 0;
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
}
@media (min-width: 1700px) {
  .layout {
    grid-template-columns: 300px minmax(0, 1fr);
    background: linear-gradient(to right,
      var(--sidebar-bg) calc(300px - 1px),
      var(--border) calc(300px - 1px) 300px,
      transparent 300px);
  }
}
.content-with-toc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 1280px) {
  .content-with-toc { grid-template-columns: minmax(0, 1fr) 200px; }
}

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky; top: 58px; height: calc(100dvh - 58px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 20px 12px 40px;
  scrollbar-width: thin;
}
.sidebar-group { margin-bottom: 6px; }
.sidebar-title {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-faint); padding: 14px 10px 6px;
}
.sidebar a.nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 0.885rem; line-height: 1.35;
}
.sidebar a.nav-link:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.sidebar a.nav-link[aria-current="page"] {
  background: var(--accent-tint); color: var(--accent-strong); font-weight: 600;
}
.sidebar details { border-radius: var(--radius-sm); }
.sidebar summary {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 0.885rem; font-weight: 600;
  cursor: pointer; list-style: none; user-select: none;
}
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary .sum-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar summary:hover { background: var(--surface-alt); color: var(--text); }
.sidebar summary .chev { margin-left: auto; transition: transform var(--speed) var(--ease); color: var(--text-faint); width: 14px; height: 14px; flex: none; }
.sidebar details[open] > summary .chev { transform: rotate(90deg); }
.sidebar details > div { padding-left: 8px; border-left: 1px solid var(--border); margin: 2px 0 4px 14px; }
.cat-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.count-pill {
  margin-left: auto; font-size: 0.68rem; font-weight: 600; color: var(--text-faint);
  background: var(--surface-sunken); border-radius: var(--radius-pill); padding: 1px 7px;
}

/* mobile off-canvas */
.scrim { position: fixed; inset: 0; z-index: 69; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity var(--speed) var(--ease); }
@media (max-width: 1023px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 58px; z-index: 70;
    width: min(310px, 85vw); height: calc(100dvh - 58px);
    transform: translateX(-102%);
    transition: transform 240ms var(--ease);
    box-shadow: var(--shadow-3);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { position: fixed; left: 0; right: 0; overflow: hidden; }
  :root.nav-open { overflow: hidden; }
  body.nav-open .topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 71; }
  .searchbtn { min-width: 0; }
  .searchbtn .searchbtn-label, .searchbtn kbd { display: none; }
  .searchbtn { width: 38px; height: 38px; padding: 0; justify-content: center; border: none; background: none; color: var(--text-muted); }
  .searchbtn svg { width: 19px; height: 19px; }
}

/* ---------- desktop rail collapse (nav-toggle doubles as collapse button ≥1024px) ---------- */
@media (min-width: 1024px) {
  /* explicit width so the sidebar slides off intact instead of squishing
     while the grid column animates shut */
  /* the .layout gradient already paints the 1px rail divider at the column
     edge, so drop the sidebar's own border-right on desktop — otherwise the
     two divider lines separate during the collapse/expand slide (a ghost
     "second rail"). The gradient border also runs unbroken to the footer. */
  .sidebar { width: 268px; border-right: none; transition: transform 240ms var(--ease), visibility 0s; }
  .layout { transition: grid-template-columns 240ms var(--ease); }
  :root.rail-collapsed .layout { grid-template-columns: 0 minmax(0, 1fr); background: none; }
  :root.rail-collapsed .sidebar {
    transform: translateX(-102%);
    visibility: hidden;                       /* off-screen links leave the tab order */
    transition: transform 240ms var(--ease), visibility 0s 240ms;
  }
}
@media (min-width: 1700px) {
  .sidebar { width: 300px; }
  :root.rail-collapsed .layout { grid-template-columns: 0 minmax(0, 1fr); background: none; }
}

/* ---------- animated hamburger (nav-toggle) ---------- */
.nav-toggle .hb { position: relative; width: 18px; height: 14px; display: block; transition: transform 200ms var(--ease); }
.nav-toggle:active .hb { transform: scale(0.88); }
.nav-toggle .hb span {
  position: absolute; left: 0; height: 2px; width: 100%; border-radius: 2px;
  background: currentColor;
  transition: transform 260ms var(--ease), opacity 180ms var(--ease), top 260ms var(--ease), bottom 260ms var(--ease);
}
.nav-toggle .hb-t { top: 0; }
.nav-toggle .hb-m { top: 6px; }
.nav-toggle .hb-b { bottom: 0; }
/* mobile: drawer open → morph to an X */
@media (max-width: 1023px) {
  body.nav-open .nav-toggle .hb-t { transform: translateY(6px) rotate(45deg); }
  body.nav-open .nav-toggle .hb-m { opacity: 0; transform: translateX(-6px); }
  body.nav-open .nav-toggle .hb-b { transform: translateY(-6px) rotate(-45deg); }
}
/* desktop: rail expanded (open) → X; collapsed → hamburger */
@media (min-width: 1024px) {
  :root:not(.rail-collapsed) .nav-toggle .hb-t { transform: translateY(6px) rotate(45deg); }
  :root:not(.rail-collapsed) .nav-toggle .hb-m { opacity: 0; transform: translateX(-6px); }
  :root:not(.rail-collapsed) .nav-toggle .hb-b { transform: translateY(-6px) rotate(-45deg); }
}

/* ---------- breadcrumbs / page header ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-faint); margin-bottom: 18px; }
.crumbs a { color: var(--text-faint); }
.crumbs a:hover { color: var(--link); }
.crumbs .sep { opacity: 0.55; }
.page-head { margin-bottom: 28px; }
.page-head .kicker {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
.page-head .lede { margin-top: 10px; font-size: 1.05rem; color: var(--text-muted); max-width: 64ch; }

/* ---------- prose ---------- */
.prose > * + * { margin-top: 14px; }
.prose h2 { margin-top: 40px; padding-top: 8px; }
.prose h3 { margin-top: 26px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose .lead { font-size: 1.05rem; color: var(--text-muted); }

/* ---------- hero (home) ---------- */
.hero {
  background: var(--hero-bg);
  border-radius: var(--radius-lg);
  padding: clamp(30px, 5vw, 56px);
  color: var(--hero-text);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(520px 260px at 88% -10%, rgb(224 98 27 / 0.28), transparent 65%),
    radial-gradient(420px 240px at -5% 110%, rgb(53 154 76 / 0.22), transparent 65%);
}
.hero > * { position: relative; z-index: 1; }
.hero .kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--hero-muted);
  border: 1px solid rgb(255 255 255 / 0.22); border-radius: var(--radius-pill);
  padding: 5px 13px; margin-bottom: 20px;
  background: rgb(255 255 255 / 0.06);
}
.hero h1 { color: var(--hero-text); font-size: clamp(1.9rem, 4.6vw, 3rem); font-weight: 800; max-width: 21ch; }
.hero p { color: var(--hero-muted); font-size: clamp(0.98rem, 2vw, 1.12rem); max-width: 58ch; margin-top: 14px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-search {
  display: flex; align-items: center; gap: 10px; width: min(520px, 100%);
  background: rgb(255 255 255 / 0.1); border: 1px solid rgb(255 255 255 / 0.25);
  border-radius: var(--radius-md); padding: 12px 16px; color: var(--hero-muted);
  font-size: 0.95rem; text-align: left; margin-top: 28px;
  transition: background var(--speed) var(--ease);
}
.hero-search:hover { background: rgb(255 255 255 / 0.16); }
.hero-search svg { width: 17px; height: 17px; flex: none; }
.hero-search kbd { margin-left: auto; background: rgb(255 255 255 / 0.12); border-color: rgb(255 255 255 / 0.3); color: var(--hero-muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.92rem; line-height: 1;
  border: 1px solid transparent;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-contrast); box-shadow: var(--shadow-2); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--text-faint); color: var(--text); }
.btn-ghost { color: var(--link); }
.btn-ghost:hover { background: var(--surface-alt); }
.hero .btn-secondary { background: rgb(255 255 255 / 0.1); border-color: rgb(255 255 255 / 0.3); color: var(--hero-text); }
.hero .btn-secondary:hover { background: rgb(255 255 255 / 0.18); color: var(--hero-text); }
@media (max-width: 560px) {
  .hero-actions .btn { flex: 1 1 100%; text-align: center; }
  .hero .kicker { font-size: 0.68rem; padding: 4px 11px; }
}
@media (max-width: 420px) { .brand-name .thin { display: none; } }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 34px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 18px 20px;
}
.stat .n { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; color: var(--primary); line-height: 1.1; }
.stat .l { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.stat .n em { font-style: normal; color: var(--accent); }
a.stat { display: block; transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease); }
a.stat:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-1); }
a.stat .l { color: var(--link); }

/* ---------- overview hero: light "glass" variant + 2-col grid + mini-map ---------- */
.hero.glass {
  color: var(--text);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--brand-navy) 16%, var(--surface)) 0%,
    color-mix(in srgb, var(--brand-saffron) 12%, var(--surface)) 100%);
  border: 1px solid var(--border-strong);
}
.hero.glass::after {
  background:
    radial-gradient(420px 220px at 90% -20%, color-mix(in srgb, var(--brand-saffron) 30%, transparent), transparent 70%),
    radial-gradient(520px 260px at -10% 120%, color-mix(in srgb, var(--brand-green) 24%, transparent), transparent 70%);
}
.hero.glass .kicker {
  color: var(--accent);
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.hero.glass h1 { color: var(--text); }
.hero.glass p { color: var(--text-muted); }
.hero.glass .hero-search {
  margin-top: 0;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--text-muted); border: 1px solid var(--border-strong);
}
.hero.glass .hero-search:hover { background: color-mix(in srgb, var(--surface) 92%, transparent); }
.hero.glass .hero-search kbd { background: var(--kbd-bg); border-color: var(--border-strong); color: var(--text-muted); }
.hero.glass .btn-secondary {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--primary); border: 1px solid var(--border-strong);
}
.hero.glass .btn-secondary:hover { background: var(--surface); color: var(--primary); }
:root[data-theme="dark"] .hero.glass {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--brand-navy) 34%, var(--surface)) 0%,
    color-mix(in srgb, var(--brand-saffron) 16%, var(--surface)) 100%);
}

.hero-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.hero-copy { min-width: 0; }
.hero-cta { min-width: 0; }
@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
    grid-template-areas: "copy map" "cta map";
    align-items: center; column-gap: 34px;
  }
  .hero-copy { grid-area: copy; }
  .hero-map { grid-area: map; }
  .hero-cta { grid-area: cta; align-self: start; }
}
.hero-map { display: block; line-height: 0; }
.hero-map svg { width: 100%; height: auto; max-height: 420px; display: block; }
.hero-map path {
  stroke: color-mix(in srgb, var(--surface) 70%, transparent); stroke-width: 1;
  transition: fill var(--speed) var(--ease);
}
.hero-map .hm0 { fill: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.hero-map .hm1 { fill: color-mix(in srgb, var(--primary) 24%, var(--surface)); }
.hero-map .hm2 { fill: color-mix(in srgb, var(--primary) 40%, var(--surface)); }
.hero-map .hm3 { fill: color-mix(in srgb, var(--primary) 58%, var(--surface)); }
.hero-map .hm4 { fill: color-mix(in srgb, var(--primary) 76%, var(--surface)); }
.hero-map .hm5 { fill: color-mix(in srgb, var(--primary) 92%, var(--surface)); }
.hero-map circle { fill: var(--accent); stroke: color-mix(in srgb, var(--surface) 55%, transparent); stroke-width: 1; }
.hero-map:hover path { fill: color-mix(in srgb, var(--primary) 28%, var(--surface)); }
.hero-map:hover .hm3, .hero-map:hover .hm4, .hero-map:hover .hm5 { fill: color-mix(in srgb, var(--primary) 62%, var(--surface)); }
@media (max-width: 859px) {
  .hero-map { max-width: 320px; margin: 8px auto 0; width: 100%; }
}

/* ---------- news ticker (overview): auto-scrolling headline marquee ---------- */
.news-ticker {
  display: flex; align-items: stretch; gap: 0;
  margin: 0 0 22px; max-width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.ticker-tag {
  display: inline-flex; align-items: center; gap: 7px;
  flex: none; padding: 0 15px;
  background: var(--brand-navy); color: #fff;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
.ticker-tag svg { width: 15px; height: 15px; }
.ticker-viewport {
  position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 3%, #000 96%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 3%, #000 96%, transparent);
}
.ticker-track { display: flex; width: max-content; animation: ticker-scroll 60s linear infinite; will-change: transform; }
.ticker-viewport:hover .ticker-track,
.news-ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-seq { display: flex; flex: 0 0 auto; }
.ticker-item {
  display: inline-flex; align-items: baseline; gap: 7px;
  padding: 9px 0; margin: 0 18px; white-space: nowrap; color: var(--text-muted);
}
.ticker-item::before {
  content: ""; align-self: center; width: 4px; height: 4px; border-radius: 50%;
  background: var(--border-strong); margin-right: 18px;
}
.ticker-item:hover { text-decoration: none; }
.ticker-item:hover .ti-title { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.ti-src { color: var(--accent); font-weight: 700; font-size: 0.78rem; }
.ti-title { color: var(--text-muted); font-size: 0.84rem; max-width: 44ch; overflow: hidden; text-overflow: ellipsis; }
.ticker-tag:hover { text-decoration: none; color: #fff; filter: brightness(1.12); }
.ticker-more {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 0 15px; font-size: 0.76rem; font-weight: 600; color: var(--text-muted);
  white-space: nowrap; border-left: 1px solid var(--border); background: var(--surface);
}
.ticker-more:hover { text-decoration: none; color: var(--primary); background: var(--surface-alt); }
.ticker-more svg { width: 14px; height: 14px; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (max-width: 640px) { .ti-title { max-width: 30ch; } .ticker-more { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .ticker-seq[aria-hidden="true"] { display: none; }
  .ticker-viewport { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
}

/* ---------- news page ---------- */
.news-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0 0 24px; }
.news-sources .ns-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-faint); margin-right: 4px;
}
.news-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); margin-top: 6px; }
.news-card {
  display: flex; flex-direction: column; gap: 9px;
  padding: 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
  scroll-margin-top: 80px;
}
.news-card:target { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.nc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.nc-src { font-size: 0.76rem; font-weight: 700; color: var(--accent); letter-spacing: 0.01em; }
.nc-date { font-size: 0.74rem; color: var(--text-faint); font-family: var(--font-mono); white-space: nowrap; }
.nc-title { font-size: 1rem; line-height: 1.35; font-weight: 700; }
.nc-title a { color: var(--text); display: inline; }
.nc-title a:hover { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.nc-title svg { width: 13px; height: 13px; color: var(--text-faint); vertical-align: baseline; flex: none; }
.nc-summary { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; }
.nc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: auto; padding-top: 4px; }
.nc-tag {
  display: inline-block; font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 2px 9px;
}
.nc-host { margin-left: auto; font-size: 0.72rem; color: var(--text-faint); font-family: var(--font-mono); }

/* ---------- card grids ---------- */
.grid { display: grid; gap: 16px; margin-top: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; position: relative;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease);
}
a.card { color: inherit; display: block; }
a.card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card h3 { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; }
.card p { color: var(--text-muted); font-size: 0.895rem; margin-top: 8px; }
.card .go { position: absolute; top: 20px; right: 18px; color: var(--text-faint); transition: transform var(--speed) var(--ease), color var(--speed) var(--ease); }
a.card:hover .go { transform: translateX(3px); color: var(--accent); }
.card-icon {
  width: 38px; height: 38px; border-radius: var(--radius-md); flex: none;
  display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent);
}
.card-icon svg { width: 19px; height: 19px; }
.card-icon.tone-green { background: var(--success-tint); color: var(--success); }
.card-icon.tone-blue { background: var(--cat-market-tint); color: var(--cat-market); }
.card-icon.tone-violet { background: var(--cat-equity-tint); color: var(--cat-equity); }
.card-icon.tone-teal { background: var(--cat-incubation-tint); color: var(--cat-incubation); }
.card-icon.tone-amber { background: var(--warning-tint); color: var(--warning); }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  border-radius: var(--radius-pill); padding: 3px 10px;
  white-space: nowrap;
  background: var(--cat-other-tint); color: var(--cat-other);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.b-grant { background: var(--cat-grant-tint); color: var(--cat-grant); }
.badge.b-equity { background: var(--cat-equity-tint); color: var(--cat-equity); }
.badge.b-loan-credit { background: var(--cat-loan-tint); color: var(--cat-loan); }
.badge.b-incubation { background: var(--cat-incubation-tint); color: var(--cat-incubation); }
.badge.b-market-access { background: var(--cat-market-tint); color: var(--cat-market); }
.badge.b-mixed { background: var(--cat-mixed-tint); color: var(--cat-mixed); }
.badge.b-plain::before { display: none; }
.badge.b-part { background: var(--surface-sunken); color: var(--text-muted); }
.badge.b-stage::before { display: none; }

/* ---------- scheme cards (directory) ---------- */
.scheme-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px; color: inherit;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease);
}
a.scheme-card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.scheme-card .top { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.scheme-card .abbr { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; color: var(--text-faint); }
.scheme-card h3 { font-size: 0.99rem; line-height: 1.35; }
.scheme-card .ministry { font-size: 0.78rem; color: var(--text-faint); }
.scheme-card .tagline { font-size: 0.875rem; color: var(--text-muted); flex: 1; }
.scheme-card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.scheme-card .amount { margin-left: auto; font-size: 0.8rem; font-weight: 700; color: var(--success); text-align: right; }

/* ---------- filter bar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 6px; }
.toolbar .field { position: relative; flex: 1 1 220px; min-width: 180px; }
.toolbar .field svg { position: absolute; left: 11px; top: 50%; translate: 0 -50%; width: 15px; height: 15px; color: var(--text-faint); pointer-events: none; }
.toolbar input[type="search"] {
  width: 100%; height: 40px; padding: 0 12px 0 34px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text); font: inherit; font-size: 0.9rem;
}
.toolbar input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.toolbar select, .compare-pickers select {
  height: 40px; padding: 0 30px 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text); font: inherit; font-size: 0.88rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237a869c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  max-width: 100%;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 5px 13px; font-size: 0.82rem; font-weight: 500; color: var(--text-muted);
  background: var(--surface);
  transition: all var(--speed) var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); }
:root[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-strong); }
.result-count { font-size: 0.84rem; color: var(--text-faint); margin: 10px 0 14px; }
.result-count b { color: var(--text); }
.empty-state {
  text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 44px 20px; color: var(--text-muted); margin-top: 18px;
}
.empty-state .big { font-size: 1.7rem; margin-bottom: 8px; }

/* ---------- view toggle ---------- */
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.view-toggle button { padding: 8px 12px; font-size: 0.82rem; font-weight: 600; color: var(--text-faint); display: inline-flex; gap: 6px; align-items: center; }
.view-toggle button svg { width: 15px; height: 15px; }
.view-toggle button[aria-pressed="true"] { background: var(--surface-alt); color: var(--text); }

/* ---------- data tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); margin-top: 18px; background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
table.data th, table.data td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
table.data thead th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-faint); background: var(--surface-alt);
  position: sticky; top: 0; white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-alt); }
table.data td .sub { display: block; font-size: 0.78rem; color: var(--text-faint); margin-top: 2px; }
table.data .num { font-family: var(--font-mono); font-size: 0.8rem; }
table.data { min-width: 820px; }
table.data .cell-scheme { min-width: 200px; }
table.data .cell-ministry { max-width: 300px; font-size: 0.82rem; }
table.data .cell-stages { min-width: 190px; }
table.data .cell-stages .badge { margin: 2px 4px 2px 0; }
table.data .cell-amount { min-width: 130px; max-width: 190px; }

/* ---------- detail page: facts panel ---------- */
.facts {
  display: flex; flex-wrap: wrap; gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin: 24px 0;
}
.fact { background: var(--surface); padding: 14px 18px; flex: 1 1 190px; min-width: min(190px, 100%); }
.fact .k { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 6px; }
.fact .v { font-size: 0.92rem; font-weight: 600; }
.fact .v .badge { margin: 2px 4px 2px 0; }

/* ---------- detail page: sections ---------- */
.section { margin-top: 36px; scroll-margin-top: 76px; }
.section > h2 {
  display: flex; align-items: center; gap: 11px;
  font-size: 1.22rem; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.section > h2 .sec-icon {
  width: 30px; height: 30px; border-radius: var(--radius-sm); flex: none;
  display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent);
}
.section > h2 .sec-icon svg { width: 16px; height: 16px; }
.section .body { color: var(--text); }
.section .body p + p { margin-top: 12px; }

/* eligibility checklist */
.checklist { list-style: none; padding: 0; display: grid; gap: 10px; }
.checklist li {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 16px;
}
.checklist .tick {
  width: 22px; height: 22px; border-radius: 50%; flex: none; margin-top: 1px;
  display: grid; place-items: center;
  background: var(--success-tint); color: var(--success);
}
.checklist .tick svg { width: 12px; height: 12px; }

/* benefits list */
.benefits { list-style: none; padding: 0; display: grid; gap: 10px; }
.benefits li {
  display: flex; gap: 12px; align-items: flex-start;
  border-left: 3px solid var(--success);
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow-1);
}
.benefits .gift { color: var(--success); flex: none; margin-top: 2px; }
.benefits .gift svg { width: 16px; height: 16px; }

/* key links */
.keylinks { display: flex; flex-wrap: wrap; gap: 10px; }
.keylink {
  display: inline-flex; align-items: center; gap: 9px; max-width: 100%; min-width: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface); padding: 10px 15px;
  font-size: 0.88rem; font-weight: 600; color: var(--link);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.keylink:hover { border-color: var(--link); box-shadow: var(--shadow-1); text-decoration: none; }
.keylink svg { width: 15px; height: 15px; flex: none; }
.keylink > span { min-width: 0; overflow: hidden; }
.keylink .url { display: block; font-weight: 400; font-size: 0.76rem; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.keylink .ext { color: var(--text-faint); }

/* callout */
.callout {
  display: flex; gap: 12px; border-radius: var(--radius-md);
  padding: 14px 16px; font-size: 0.9rem;
  background: var(--surface-alt); border: 1px solid var(--border);
  color: var(--text-muted); margin-top: 18px;
}
.callout.tone-info { background: var(--cat-market-tint); border-color: transparent; color: var(--text); }
.callout.tone-warn { background: var(--warning-tint); border-color: transparent; color: var(--text); }
.callout .ic { flex: none; margin-top: 2px; color: var(--cat-market); }
.callout.tone-warn .ic { color: var(--warning); }
.callout .ic svg { width: 17px; height: 17px; }
.callout a { font-weight: 600; }

/* related schemes */
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 12px; }
.related a {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); padding: 12px 14px; color: inherit;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color var(--speed) var(--ease);
}
.related a:hover { text-decoration: none; border-color: var(--border-strong); }
.related .rn { font-size: 0.86rem; font-weight: 600; line-height: 1.3; }
.related .rm { font-size: 0.74rem; color: var(--text-faint); }

/* prev / next */
.pagenav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 44px; }
.pagenav a {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 13px 16px; color: inherit; display: flex; flex-direction: column; gap: 3px;
  transition: border-color var(--speed) var(--ease);
}
.pagenav a:hover { text-decoration: none; border-color: var(--border-strong); }
.pagenav .dir { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint); }
.pagenav .t { font-size: 0.88rem; font-weight: 600; color: var(--link); }
.pagenav a.next { text-align: right; align-items: flex-end; }
@media (max-width: 560px) { .pagenav { grid-template-columns: 1fr; } .pagenav a.next { text-align: left; align-items: flex-start; } }

/* ---------- toc rail ---------- */
.toc { display: none; }
@media (min-width: 1280px) {
  .toc { display: block; position: sticky; top: 84px; align-self: start; font-size: 0.82rem; max-height: calc(100dvh - 110px); overflow-y: auto; }
  .toc .toc-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-faint); margin-bottom: 10px; }
  .toc a { display: block; padding: 4px 0 4px 12px; color: var(--text-muted); border-left: 2px solid var(--border); }
  .toc a:hover { color: var(--text); text-decoration: none; }
  .toc a.active { color: var(--accent-strong); border-left-color: var(--accent); font-weight: 600; }
}

/* ---------- finder wizard ---------- */
.wizard { max-width: 780px; scroll-margin-top: 76px; }
.wizard-progress { display: flex; gap: 6px; margin: 20px 0 26px; }
.wizard-progress .seg { height: 4px; flex: 1; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.wizard-progress .seg .fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 300ms var(--ease); }
.wizard-progress .seg.done .fill { width: 100%; }
.qcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 34px); box-shadow: var(--shadow-1);
}
.qcard .qnum { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.qcard h2 { font-size: clamp(1.15rem, 3vw, 1.45rem); }
.answers { display: grid; gap: 12px; margin-top: 22px; }
@media (min-width: 640px) { .answers { grid-template-columns: 1fr 1fr; } .answers.answers-many { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.answer {
  text-align: left; border: 1.5px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 5px;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.answer:hover { border-color: var(--accent); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.answer .a-label { font-weight: 700; font-size: 0.98rem; display: flex; align-items: center; gap: 8px; }
.answer .a-note { font-size: 0.82rem; color: var(--text-muted); }
.answer .a-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.wizard-back { margin-top: 18px; }
.wizard-results .r-group { margin-top: 26px; }
.wizard-results .r-note { font-size: 0.86rem; color: var(--text-muted); margin-top: 6px; }
.restart-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }

/* ---------- lifecycle map ---------- */
.lifecycle { display: grid; gap: 0; margin-top: 26px; position: relative; }
.stage-row { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 18px; position: relative; padding-bottom: 34px; }
.stage-row:last-child { padding-bottom: 0; }
.stage-rail { position: relative; display: flex; justify-content: center; }
.stage-rail::before { content: ""; position: absolute; top: 44px; bottom: -10px; width: 2px; background: var(--border-strong); }
.stage-row:last-child .stage-rail::before { display: none; }
.stage-dot {
  width: 44px; height: 44px; border-radius: 50%; flex: none; z-index: 1;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-family: var(--font-display);
  box-shadow: var(--shadow-1);
}
.stage-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; }
.stage-card h3 { font-size: 1.08rem; }
.stage-card .desc { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }
.stage-card .cols { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 760px) { .stage-card .cols { grid-template-columns: 1fr 1fr; } }
.stage-card .col h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 8px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 7px; }
.pill-list a {
  font-size: 0.8rem; font-weight: 600;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 4px 11px; color: var(--link); background: var(--surface);
}
.pill-list a:hover { border-color: var(--link); text-decoration: none; }
.pill-list .qual { font-weight: 400; color: var(--text-faint); }
.pill-list span.dead { font-size: 0.8rem; border: 1px dashed var(--border); border-radius: var(--radius-pill); padding: 4px 11px; color: var(--text-faint); }

/* stage tone helpers */
.tone-ideation { background: var(--stage-ideation); }
.tone-prototype { background: var(--stage-prototype); }
.tone-early-stage { background: var(--stage-early); }
.tone-growth { background: var(--stage-growth); }
.tone-market-access { background: var(--stage-market); }

/* ---------- compare ---------- */
.compare-pickers { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); margin: 20px 0; }
.compare-pickers select { width: 100%; }
.compare-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
table.compare { border-collapse: collapse; width: 100%; font-size: 0.87rem; min-width: 640px; }
table.compare th, table.compare td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
table.compare thead th { background: var(--surface-alt); }
table.compare tbody th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint);
  white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1;
  border-right: 1px solid var(--border);
}
table.compare td ul { padding-left: 16px; margin: 0; }
table.compare td li + li { margin-top: 5px; }
table.compare .col-head a { font-weight: 700; }
table.compare .col-head .m { display: block; font-size: 0.74rem; color: var(--text-faint); font-weight: 400; margin-top: 3px; }

/* ---------- search modal ---------- */
.search-modal { position: fixed; inset: 0; z-index: 100; display: none; }
.search-modal.open { display: block; }
.search-modal .backdrop { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.search-panel {
  position: relative; margin: min(12vh, 110px) auto 0; width: min(620px, calc(100vw - 28px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3); overflow: hidden;
  display: flex; flex-direction: column; max-height: min(64vh, 540px);
}
.search-panel .search-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.search-panel .search-head svg { width: 17px; height: 17px; color: var(--text-faint); flex: none; }
.search-panel input { flex: 1; border: none; background: none; font: inherit; font-size: 1rem; color: var(--text); outline: none; min-width: 0; }
.search-panel .results { overflow-y: auto; padding: 8px; }
.search-panel .hit { display: block; padding: 10px 12px; border-radius: var(--radius-md); color: inherit; }
.search-panel .hit:hover, .search-panel .hit.sel { background: var(--surface-alt); text-decoration: none; }
.search-panel .hit .h-name { font-weight: 600; font-size: 0.92rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-panel .hit .h-name .badge { font-size: 0.66rem; }
.search-panel .hit .h-sub { font-size: 0.79rem; color: var(--text-faint); margin-top: 2px; }
.search-panel .none { padding: 26px 16px; text-align: center; color: var(--text-faint); font-size: 0.9rem; }
.search-panel .search-foot { border-top: 1px solid var(--border); padding: 8px 16px; display: flex; gap: 14px; font-size: 0.72rem; color: var(--text-faint); }
.search-panel mark { background: var(--accent-tint); color: var(--accent-strong); border-radius: 3px; padding: 0 2px; }

/* ---------- glossary ---------- */
.glossary-list { margin-top: 10px; }
.glossary-item { padding: 16px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 76px; }
.glossary-item dt { font-weight: 700; font-size: 1rem; font-family: var(--font-display); }
.glossary-item dd { margin: 6px 0 0; color: var(--text-muted); font-size: 0.92rem; }
.alpha-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.alpha-row a { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px 9px; }
.alpha-row a:hover { text-decoration: none; border-color: var(--link); }

/* ---------- psu / states ---------- */
.org-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); margin-top: 20px; }
.org-card {
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; color: inherit;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
a.org-card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-1); }
.org-card .o-org { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); }
.org-card .o-name { font-weight: 600; font-size: 0.93rem; }
.org-card .o-desc { font-size: 0.82rem; color: var(--text-muted); }
.org-card .o-link { font-size: 0.78rem; color: var(--link); display: flex; align-items: center; gap: 5px; margin-top: 4px; min-width: 0; }
.org-card .o-link .host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-card .o-link svg { width: 12px; height: 12px; flex: none; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--sidebar-bg); }
.footer-inner {
  max-width: 1460px; margin: 0 auto; padding: 16px clamp(18px, 4vw, 56px);
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  font-size: 0.73rem; color: var(--text-faint);
}
.footer a { color: var(--text-muted); }
.footer .f-links { display: flex; flex-wrap: wrap; gap: 12px; }
.footer .footer-note { flex: 1 1 260px; max-width: 58ch; line-height: 1.5; }
.footer-author { display: flex; align-items: center; gap: 10px; flex: none; }
.author-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid var(--border-strong); flex: none;
}
.author-meta { line-height: 1.35; }
.author-role {
  font-size: 0.56rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
}
.author-name { font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; color: var(--text); }
.author-links { font-size: 0.7rem; }
.author-links a { font-weight: 600; color: var(--link); }

/* ---------- decision tree (static view) ---------- */
.tree { margin-top: 24px; display: grid; gap: 22px; }
.tree-q { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.tree-q > h3 { padding: 14px 20px; background: var(--surface-alt); border-bottom: 1px solid var(--border); font-size: 0.98rem; display: flex; gap: 10px; align-items: baseline; }
.tree-q > h3 .qn { font-family: var(--font-mono); font-size: 0.74rem; color: var(--accent); font-weight: 700; flex: none; }
.tree-branches { display: grid; gap: 14px; padding: 16px 20px; }
@media (min-width: 700px) { .tree-branches { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.tree-branch { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.tree-branch .b-head { padding: 8px 14px; font-weight: 700; font-size: 0.85rem; background: var(--surface-alt); color: var(--text); }
.b-head.h-0 { background: var(--accent-tint); color: var(--accent-strong); }
.b-head.h-1 { background: var(--success-tint); color: var(--success); }
.b-head.h-2 { background: var(--cat-market-tint); color: var(--cat-market); }
.b-head.h-3 { background: var(--cat-incubation-tint); color: var(--cat-incubation); }
.b-head.h-4 { background: var(--cat-equity-tint); color: var(--cat-equity); }
.b-head.h-5 { background: var(--warning-tint); color: var(--warning); }
.tree-branch .b-body { padding: 12px 14px; }
.tree-branch .b-note { font-size: 0.83rem; color: var(--text-muted); }

/* ---------- misc ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.mt-0 { margin-top: 0; }
.section-gap { margin-top: 46px; }
.home-h2 { display: flex; align-items: baseline; gap: 12px; margin-top: 52px; }
.home-h2 .more { margin-left: auto; font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
hr.rule { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* back-to-top */
.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-2); color: var(--text-muted);
  display: grid; place-items: center;
  opacity: 0; pointer-events: none; translate: 0 8px;
  transition: opacity var(--speed) var(--ease), translate var(--speed) var(--ease);
}
.to-top.show { opacity: 1; pointer-events: auto; translate: 0 0; }
.to-top svg { width: 18px; height: 18px; }

/* ---------- print ---------- */
@media print {
  .topbar, .sidebar, .toc, .footer .f-links, .to-top, .pagenav, .scrim, .search-modal { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; }
  body { background: #fff; color: #000; font-size: 12px; }
  a { color: inherit; text-decoration: underline; }
  .card, .scheme-card, .qcard, .stage-card, .facts, .table-wrap { box-shadow: none; break-inside: avoid; }
  .section { break-inside: avoid; }
}

/* ---------- ecosystem map entry ---------- */
.map-entry-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, .85fr);
  gap: 34px;
  align-items: center;
  padding: 28px;
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.map-entry-copy .lede { margin-top: 12px; }
.map-entry-preview {
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--walk-water);
  background-image:
    linear-gradient(var(--walk-water-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--walk-water-grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
.map-entry-preview svg { width: 100%; height: 310px; }
.map-entry-preview path { fill: var(--walk-land); stroke: var(--walk-land-border); stroke-width: 1.6; }
.map-entry-preview path:nth-child(3n) { fill: var(--walk-land-alt); }
.map-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.map-entry-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.map-entry-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.map-entry-card.map-entry-walk { border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); }
.map-entry-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border-radius: 12px;
  background: var(--accent-tint);
}
.map-entry-icon svg { width: 23px; height: 23px; }
.map-entry-label {
  margin-top: 17px;
  color: var(--text-faint);
  font: 700 .68rem/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.map-entry-card h2 { margin-top: 8px; font-size: 1.25rem; }
.map-entry-card p { margin-top: 9px; color: var(--text-muted); font-size: .9rem; line-height: 1.55; }
.map-entry-card ul { margin: 15px 0 22px; padding-left: 19px; color: var(--text-muted); font-size: .82rem; }
.map-entry-card .btn { margin-top: auto; }
.map-entry-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 15px 17px;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: .85rem;
}
.map-entry-note > svg { width: 18px; flex: none; margin-top: 3px; color: var(--link); }

/* ---------- walkable India ---------- */
.immersive-body { overflow: hidden; }
.immersive-body .topbar { position: relative; }
.walkable-page {
  width: 100%;
  max-width: none;
  height: calc(100dvh - 58px);
  padding: 0;
  margin: 0;
}
.walkable-map { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--walk-water); }
.walkable-viewport { position: absolute; inset: 0; overflow: hidden; touch-action: none; overscroll-behavior: none; }
.walkable-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 18000px;
  height: 20034px;
  transform-origin: 0 0;
  will-change: transform;
}
.walkable-ground {
  position: absolute;
  inset: 0;
  width: 18000px;
  height: 20034px;
  max-width: none;
  background-color: var(--walk-water);
  background-image:
    linear-gradient(var(--walk-water-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--walk-water-grid) 1px, transparent 1px);
  background-size: 360px 360px;
}
/* The ground paints in layers: land fill → terrain → decor → borders →
   labels. Only .wg-border is stroked, which is what guarantees state outlines
   and nothing else — a state made of several sub-paths (islands, or a
   regression to district geometry) can only ever fill. */
.wg-fill path { fill: var(--walk-land); }
.wg-fill path:nth-child(3n) { fill: var(--walk-land-alt); }
.wg-border path {
  fill: none;
  stroke: var(--walk-land-border);
  stroke-width: 2.2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.wg-relief path { stroke: none; opacity: 0.62; }
.wg-relief path[data-kind="mtn"] { fill: var(--walk-relief-mtn); }
.wg-relief path[data-kind="plateau"] { fill: var(--walk-relief-plateau); }
.wg-relief path[data-kind="desert"] { fill: var(--walk-relief-desert); }
.wg-relief path[data-kind="wet"] { fill: var(--walk-relief-wet); }
.wg-relief path[data-kind="plain"] { fill: var(--walk-relief-plain); }
.wg-rivers path {
  fill: none;
  stroke: var(--walk-river);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.wg-lakes path { fill: var(--walk-lake); stroke: none; }
/* The watercolour sprites carry a pale halo that glows against dark land, so
   they sit back a little further there than in daylight. */
.wg-decor image { opacity: 0.92; }
:root[data-theme="dark"] .wg-decor image { opacity: 0.72; }
/* Terrain names and peaks are gated on zoom by [data-detail] — see setZoom. */
.wg-labels {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--speed) var(--ease);
}
.walkable-map[data-detail="on"] .wg-labels { opacity: 1; visibility: visible; }
/* Sizes are in SVG user units, and the ground is drawn at 18 CSS px per unit
   (1000×1113 viewBox → an 18000×20034 world). So 0.9 here is a ~16px label at
   100% zoom, growing to ~27px at the 165% ceiling. */
.wg-labels text {
  fill: var(--walk-terrain-label);
  paint-order: stroke;
  stroke: var(--walk-land);
  stroke-width: 0.14;
  text-anchor: middle;
  font-family: inherit;
}
.wg-terrain-names text {
  font-size: 0.9px;
  font-weight: 600;
  letter-spacing: 0.09px;
  text-transform: uppercase;
}
.wg-peaks text { font-size: 0.6px; font-weight: 600; }
.wg-peaks .wg-peak-elevation { font-weight: 400; opacity: 0.75; }
.wg-peak-mark { fill: var(--walk-terrain-label); stroke: none; }
/* World-unit type does not adapt to the viewport, and a phone shows barely a
   screen-width of map — at the desktop size a range name would span half of
   it. Shrink the names, not the map. */
@media (max-width: 700px) {
  .wg-terrain-names text { font-size: 0.62px; letter-spacing: 0.05px; }
  .wg-peaks text { font-size: 0.48px; }
}
.walkable-orgs,
.walkable-landmarks,
.walkable-wayfinders { position: absolute; inset: 0; pointer-events: none; }
.walkable-org,
.walkable-landmark,
.walkable-wayfinder button,
.walkable-transfer { pointer-events: auto; }
.walkable-org {
  --org-color: var(--org-private);
  position: absolute;
  z-index: 4;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid var(--walk-overlay-strong);
  border-radius: 50%;
  color: var(--org-color);
  background: color-mix(in srgb, var(--org-color) 14%, var(--walk-overlay-strong));
  box-shadow: 0 5px 16px var(--walk-shadow);
  transform: translate(-50%, -50%);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.walkable-org[data-type="academic"],
.walkable-drawer-org[data-type="academic"],
.walkable-drawer-stats [data-type="academic"] { --org-color: var(--org-academic); }
.walkable-org[data-type="tbi"],
.walkable-drawer-org[data-type="tbi"],
.walkable-drawer-stats [data-type="tbi"] { --org-color: var(--org-tbi); }
.walkable-org[data-type="aic"],
.walkable-drawer-org[data-type="aic"],
.walkable-drawer-stats [data-type="aic"] { --org-color: var(--org-aic); }
.walkable-org[data-type="government"],
.walkable-drawer-org[data-type="government"],
.walkable-drawer-stats [data-type="government"] { --org-color: var(--org-government); }
.walkable-org[data-type="sector"],
.walkable-drawer-org[data-type="sector"],
.walkable-drawer-stats [data-type="sector"] { --org-color: var(--org-sector); }
.walkable-org[data-type="private"],
.walkable-drawer-org[data-type="private"],
.walkable-drawer-stats [data-type="private"] { --org-color: var(--org-private); }
.walkable-org svg { width: 23px; height: 23px; }
.walkable-org > span {
  position: absolute;
  left: 50%;
  top: calc(100% + 7px);
  width: max-content;
  max-width: 220px;
  padding: 4px 7px;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--walk-overlay);
  box-shadow: var(--shadow-1);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  transform: translate(-50%, -3px);
  transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease);
  pointer-events: none;
}
.walkable-org:hover,
.walkable-org:focus-visible,
.walkable-org.is-nearby {
  z-index: 9;
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--org-color) 24%, transparent), var(--shadow-3);
}
.walkable-org:hover > span,
.walkable-org:focus-visible > span,
.walkable-org.is-nearby > span { opacity: 1; transform: translate(-50%, 0); }
.walkable-landmark {
  position: absolute;
  z-index: 3;
  min-width: 168px;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--walk-overlay);
  box-shadow: var(--shadow-2);
  text-align: left;
  transform: translate(-50%, -50%);
}
.walkable-landmark:hover { text-decoration: none; box-shadow: var(--shadow-3); }
.walkable-landmark strong { display: block; font-family: var(--font-display); font-size: .84rem; line-height: 1.15; }
.walkable-landmark small { display: block; margin-top: 2px; color: var(--text-faint); font-size: .62rem; }
.walkable-landmark.is-empty { opacity: .82; }
.walkable-landmark-pin {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 13px;
  height: 13px;
  border: 3px solid var(--accent);
  border-radius: 50% 50% 50% 0;
  transform: translateY(-60%) rotate(-45deg);
}
.walkable-wayfinder {
  position: absolute;
  z-index: 5;
  width: 230px;
  padding-bottom: 80px;
  transform: translate(-50%, -50%);
}
.walkable-wayfinder::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 8px;
  height: 88px;
  border-radius: 4px;
  background: var(--walk-sign-border);
  transform: translateX(-50%);
}
.walkable-wayfinder button {
  width: 100%;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
  padding: 7px 10px;
  border: 2px solid var(--walk-sign-border);
  border-radius: 5px;
  color: var(--text);
  background: var(--walk-sign);
  box-shadow: var(--shadow-1);
  font-size: .68rem;
  font-weight: 800;
}
.walkable-wayfinder-arrow { display: inline-block; color: var(--walk-sign-border); font-size: 1rem; }
.walkable-transfer {
  position: absolute;
  z-index: 7;
  min-width: 190px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 2px solid var(--link);
  border-radius: var(--radius-pill);
  color: var(--link);
  background: var(--walk-overlay);
  box-shadow: var(--shadow-2);
  font-size: .7rem;
  transform: translate(-50%, -50%);
}
.walkable-transfer:hover,
.walkable-transfer:focus-visible {
  color: var(--link-hover);
  background: var(--surface);
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--link) 18%, transparent), var(--shadow-3);
}
.walkable-transfer > span { font-size: 1rem; }
.walkable-avatar {
  position: absolute;
  z-index: 12;
  width: 34px;
  height: 46px;
  transform: translate(-50%, -72%);
  pointer-events: none;
}
.walkable-avatar-shadow {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 31px;
  height: 11px;
  border-radius: 50%;
  background: var(--walk-shadow);
  transform: translateX(-50%);
}
.walkable-avatar-body {
  position: absolute;
  left: 50%;
  top: 0;
  width: 27px;
  height: 36px;
  border: 3px solid var(--walk-overlay-strong);
  border-radius: 48% 48% 42% 42%;
  background: var(--walk-avatar);
  box-shadow: var(--shadow-2);
  transform: translateX(-50%);
}
.walkable-avatar-body::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--walk-avatar-detail);
  transform: translateX(-50%);
}
.walkable-avatar-body span::before,
.walkable-avatar-body span::after {
  content: "";
  position: absolute;
  bottom: -7px;
  width: 7px;
  height: 12px;
  border-radius: 5px;
  background: var(--walk-avatar);
}
.walkable-avatar-body span::before { left: 3px; }
.walkable-avatar-body span::after { right: 3px; }
.walkable-avatar[data-walking="true"] .walkable-avatar-body { animation: walkable-step 320ms ease-in-out infinite alternate; }
@keyframes walkable-step {
  from { transform: translateX(-50%) rotate(-2deg); }
  to { transform: translateX(-50%) rotate(2deg) translateY(-2px); }
}
.walkable-intro,
.walkable-minimap,
.walkable-zoom,
.walkable-actions,
.walkable-nearby,
.walkable-dpad { position: absolute; z-index: 30; }
.walkable-intro {
  top: 16px;
  left: 16px;
  width: min(420px, calc(100% - 32px));
  padding: 19px 48px 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--walk-overlay);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(12px);
}
.walkable-intro:not(.is-open) { display: none; }
.walkable-intro h1 { font-size: 1.3rem; }
.walkable-intro p { margin-top: 7px; color: var(--text-muted); font-size: .84rem; line-height: 1.45; }
.walkable-intro-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
}
.walkable-intro-close:hover { background: var(--surface-alt); }
.walkable-intro-close svg { width: 17px; }
.walkable-kicker {
  margin-bottom: 6px;
  color: var(--accent);
  font: 700 .65rem/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.walkable-keyhint { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; color: var(--text-faint); font-size: .7rem; }
.walkable-actions { left: 16px; bottom: 16px; display: flex; gap: 8px; }
.walkable-list-link,
.walkable-map-home,
.walkable-recenter,
.walkable-help {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--walk-overlay);
  box-shadow: var(--shadow-2);
}
.walkable-list-link { gap: 7px; padding: 0 14px; font-size: .78rem; font-weight: 700; }
.walkable-list-link:hover,
.walkable-map-home:hover,
.walkable-recenter:hover { color: var(--link); text-decoration: none; }
.walkable-list-link svg,
.walkable-map-home svg,
.walkable-recenter svg { width: 17px; }
.walkable-map-home,
.walkable-recenter,
.walkable-help { width: 42px; font-weight: 800; }
.walkable-nearby {
  left: 50%;
  bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px 10px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  background: var(--walk-overlay);
  box-shadow: var(--shadow-3);
  transform: translateX(-50%);
}
.walkable-nearby[hidden] { display: none; }
.walkable-nearby strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.walkable-nearby span { padding: 3px 7px; border-radius: var(--radius-sm); background: var(--surface-alt); color: var(--text-faint); font: 600 .65rem/1 var(--font-mono); }
.walkable-nearby[data-kind="incubator"] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent-tint) 42%, var(--walk-overlay));
}
.walkable-minimap {
  top: 16px;
  right: 16px;
  width: 190px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--walk-overlay);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(12px);
}
.walkable-minimap-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 7px; }
.walkable-minimap-head strong { font-family: var(--font-display); font-size: .85rem; }
.walkable-minimap-head span { color: var(--text-faint); font-size: .62rem; }
.walkable-minimap-stage { position: relative; height: 190px; overflow: hidden; border-radius: var(--radius-md); background: var(--walk-water); }
.walkable-minimap-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.walkable-minimap-map path { fill: var(--walk-land); stroke: var(--walk-land-border); stroke-width: 2; }
.walkable-minimap-map path:nth-child(3n) { fill: var(--walk-land-alt); }
.walkable-minimap-states { position: absolute; inset: 0; }
.walkable-minimap-states button {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid var(--walk-overlay-strong);
  border-radius: 50%;
  background: var(--link);
  box-shadow: 0 1px 4px var(--walk-shadow);
  transform: translate(-50%, -50%);
}
.walkable-minimap-states button:hover,
.walkable-minimap-states button:focus-visible,
.walkable-minimap-states button.is-active { width: 13px; height: 13px; background: var(--accent); z-index: 2; }
.walkable-minimap-dot {
  position: absolute;
  z-index: 5;
  width: 10px;
  height: 10px;
  border: 2px solid var(--walk-overlay-strong);
  border-radius: 50%;
  background: var(--walk-avatar);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--walk-avatar) 25%, transparent);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.walkable-zoom {
  top: 270px;
  right: 16px;
  display: grid;
  grid-template-columns: 42px 56px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--walk-overlay);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.walkable-zoom button,
.walkable-zoom output {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--border);
}
.walkable-zoom button { font-weight: 800; }
.walkable-zoom button:hover:not(:disabled) { background: var(--surface-alt); }
.walkable-zoom button:disabled { color: var(--text-faint); cursor: not-allowed; opacity: .5; }
.walkable-zoom output { color: var(--text-muted); font: 600 .67rem/1 var(--font-mono); }
.walkable-zoom #walkable-zoom-reset {
  grid-column: 1 / -1;
  min-height: 31px;
  border-top: 1px solid var(--border);
  border-right: 0;
  color: var(--text-muted);
  font-size: .68rem;
}
.walkable-dpad {
  right: 16px;
  bottom: 16px;
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(2, 48px);
  gap: 5px;
}
.walkable-dpad button {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--walk-overlay);
  box-shadow: var(--shadow-2);
  font-size: 1.2rem;
  font-weight: 800;
  user-select: none;
  touch-action: none;
}
.walkable-dpad button:active { background: var(--accent-tint); transform: scale(.94); }
.walkable-dpad [data-direction="up"] { grid-column: 2; }
.walkable-dpad [data-direction="left"] { grid-column: 1; grid-row: 2; }
.walkable-dpad [data-direction="down"] { grid-column: 2; grid-row: 2; }
.walkable-dpad [data-direction="right"] { grid-column: 3; grid-row: 2; }
.walkable-drawer[hidden] { display: none; }
.walkable-drawer { position: fixed; inset: 58px 0 0; z-index: 100; display: flex; justify-content: flex-end; }
.walkable-drawer-backdrop { position: absolute; inset: 0; width: 100%; background: var(--scrim); cursor: default; }
.walkable-drawer-panel {
  position: relative;
  width: min(470px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-3);
  animation: walkable-drawer-in 240ms var(--ease);
}
@keyframes walkable-drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.walkable-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.walkable-drawer-head span { color: var(--text-faint); font: 700 .63rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.walkable-drawer-head h2 { margin-top: 3px; font-size: 1.4rem; }
.walkable-drawer-body { min-height: 0; overflow-y: auto; padding: 18px 20px 28px; }
.walkable-drawer-policy { color: var(--accent); font-size: .77rem; font-weight: 700; }
.walkable-drawer-description { margin-top: 7px; color: var(--text-muted); font-size: .88rem; line-height: 1.5; }
.walkable-drawer-stats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.walkable-drawer-stats span {
  --org-color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--org-color);
  background: var(--surface-alt);
  font-size: .66rem;
  font-weight: 700;
}
.walkable-drawer-stats svg { width: 14px; height: 14px; }
.walkable-drawer-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 9px; margin-top: 18px; }
.walkable-drawer-filters label { min-width: 0; }
.walkable-drawer-filters label > span { display: block; margin-bottom: 5px; color: var(--text-faint); font-size: .66rem; font-weight: 700; }
.walkable-drawer-filters input,
.walkable-drawer-filters select {
  width: 100%;
  height: 39px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: .76rem;
}
.walkable-drawer-list { margin-top: 16px; border-top: 1px solid var(--border); }
.walkable-drawer-org {
  --org-color: var(--org-private);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.walkable-drawer-org:hover { color: var(--link); text-decoration: none; }
.walkable-drawer-org.is-focused { background: var(--accent-tint); }
.walkable-drawer-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--org-color);
  background: color-mix(in srgb, var(--org-color) 13%, var(--surface));
}
.walkable-drawer-icon svg { width: 18px; height: 18px; }
.walkable-drawer-org strong { display: block; font-size: .82rem; line-height: 1.25; }
.walkable-drawer-org small { display: block; margin-top: 2px; color: var(--text-faint); font-size: .67rem; }
.walkable-drawer-empty { padding: 20px 4px; color: var(--text-faint); font-size: .82rem; }
.walkable-drawer-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

@media (max-width: 1000px) {
  .map-entry-grid-three { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .map-entry-hero { grid-template-columns: 1fr; padding: 20px; }
  .map-entry-preview { min-height: 230px; }
  .map-entry-preview svg { height: 230px; }
  .map-entry-grid { grid-template-columns: 1fr; }
  .walkable-intro { top: 10px; left: 10px; width: calc(100% - 20px); padding: 15px 42px 15px 16px; }
  .walkable-intro h1 { font-size: 1.12rem; }
  .walkable-intro p { font-size: .77rem; }
  .walkable-keyhint { display: none; }
  .walkable-minimap { top: 10px; right: 10px; width: 142px; padding: 8px; }
  .walkable-intro.is-open ~ .walkable-minimap,
  .walkable-intro.is-open ~ .walkable-zoom { display: none; }
  .walkable-minimap-head span { display: none; }
  .walkable-minimap-stage { height: 130px; }
  .walkable-zoom { top: 200px; right: 10px; grid-template-columns: 38px; }
  .walkable-zoom button,
  .walkable-zoom output { min-width: 38px; min-height: 35px; }
  .walkable-actions { left: 10px; bottom: 12px; }
  .walkable-list-link { width: 42px; padding: 0; }
  .walkable-list-link span { display: none; }
  .walkable-dpad { right: 10px; bottom: 10px; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); }
  .walkable-nearby { bottom: 108px; width: calc(100% - 24px); max-width: calc(100% - 24px); white-space: nowrap; font-size: .75rem; }
  .walkable-landmark { min-width: 145px; }
  .walkable-org { width: 42px; height: 42px; }
  .walkable-drawer { align-items: flex-end; }
  .walkable-drawer-panel { width: 100%; height: min(80dvh, 700px); border-radius: var(--radius-lg) var(--radius-lg) 0 0; animation-name: walkable-sheet-in; }
  @keyframes walkable-sheet-in {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .walkable-drawer-head { padding: 16px; }
  .walkable-drawer-body { padding: 15px 16px 24px; }
  .walkable-drawer-filters { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .walkable-avatar[data-walking="true"] .walkable-avatar-body,
  .walkable-drawer-panel { animation: none; }
}

/* ============================================================
   INCUBATORS DIRECTORY (incubators.html)
   ============================================================ */
#incubators { margin-top: 6px; }

/* --- type badges (reuse category hues) --- */
.inc-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.01em;
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--cat-other-tint); color: var(--cat-other); white-space: nowrap;
}
.inc-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.inc-badge.t-tbi { background: var(--cat-incubation-tint); color: var(--cat-incubation); }
.inc-badge.t-aic { background: var(--cat-market-tint); color: var(--cat-market); }
.inc-badge.t-academic { background: var(--cat-equity-tint); color: var(--cat-equity); }
.inc-badge.t-government { background: var(--cat-loan-tint); color: var(--cat-loan); }
.inc-badge.t-private { background: var(--cat-grant-tint); color: var(--cat-grant); }
.inc-badge.t-sector-specific { background: var(--cat-mixed-tint); color: var(--cat-mixed); }
.inc-support {
  font-size: 0.68rem; font-weight: 600; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 2px 8px; white-space: nowrap;
}

/* --- cards --- */
.inc-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); margin-top: 18px; }
.inc-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 7px; box-shadow: var(--shadow-1);
}
.inc-card .inc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inc-card h3 { font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; line-height: 1.25; margin: 1px 0; letter-spacing: -0.01em; }
.inc-card h3 a { color: var(--text); }
.inc-card h3 a:hover { color: var(--link); text-decoration: none; }
.inc-host { font-size: 0.82rem; color: var(--text-muted); }
.inc-loc { display: flex; align-items: center; gap: 5px; font-size: 0.82rem; color: var(--text-faint); }
.inc-loc svg { flex: none; color: var(--accent); }
.inc-sectors { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.inc-sec { font-size: 0.7rem; color: var(--text-muted); background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 2px 7px; }
.inc-poc { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }
.i-contact { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.i-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 600;
  padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid var(--border);
  color: var(--text-muted); background: var(--surface);
}
.i-chip:hover { border-color: var(--border-strong); color: var(--link); text-decoration: none; }
.i-chip svg { flex: none; }

/* --- table --- */
.inc-table { min-width: 760px; }
.inc-table .cell-scheme { min-width: 240px; }
.i-tcontact a { display: inline-flex; align-items: center; margin-right: 8px; }

/* --- state-wise --- */
.inc-state-group { margin-top: 26px; }
.inc-state-h { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.2rem; padding-bottom: 8px; border-bottom: 2px solid var(--border); }

/* --- map view --- */
.inc-mapwrap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, 0.85fr); gap: 20px; margin-top: 18px; align-items: start; }
.inc-map-col { min-width: 0; }
.inc-map-scroll { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px; overflow: hidden; }
.inc-map { width: 100%; height: auto; max-height: 80vh; display: block; }
.inc-map path {
  fill: var(--surface-sunken); stroke: var(--border-strong); stroke-width: 0.5;
  transition: fill var(--speed) var(--ease), stroke var(--speed) var(--ease); cursor: pointer; outline: none;
}
.inc-map path.h1 { fill: color-mix(in srgb, var(--primary) 20%, var(--surface)); }
.inc-map path.h2 { fill: color-mix(in srgb, var(--primary) 38%, var(--surface)); }
.inc-map path.h3 { fill: color-mix(in srgb, var(--primary) 56%, var(--surface)); }
.inc-map path.h4 { fill: color-mix(in srgb, var(--primary) 74%, var(--surface)); }
.inc-map path.h5 { fill: color-mix(in srgb, var(--primary) 92%, var(--surface)); }
.inc-map path:hover, .inc-map path:focus-visible { stroke: var(--accent); stroke-width: 1.4; }
.inc-map path.sel { stroke: var(--accent); stroke-width: 1.8; fill: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.inc-marker {
  fill: var(--accent); fill-opacity: 0.72; stroke: var(--surface); stroke-width: 0.9;
  cursor: pointer; transition: fill-opacity var(--speed) var(--ease); outline: none;
}
.inc-marker:hover, .inc-marker:focus-visible, .inc-marker.active { fill-opacity: 1; stroke: var(--text); stroke-width: 1.1; }

.inc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; font-size: 0.74rem; color: var(--text-muted); }
.inc-leg-t { font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.68rem; }
.inc-leg { display: inline-flex; align-items: center; gap: 5px; }
.inc-leg .sw { width: 15px; height: 15px; border-radius: 4px; border: 1px solid var(--border); }
.inc-leg .sw.h1 { background: color-mix(in srgb, var(--primary) 20%, var(--surface)); }
.inc-leg .sw.h2 { background: color-mix(in srgb, var(--primary) 38%, var(--surface)); }
.inc-leg .sw.h3 { background: color-mix(in srgb, var(--primary) 56%, var(--surface)); }
.inc-leg .sw.h4 { background: color-mix(in srgb, var(--primary) 74%, var(--surface)); }
.inc-leg .sw.h5 { background: color-mix(in srgb, var(--primary) 92%, var(--surface)); }
.inc-leg-m { display: inline-flex; align-items: center; gap: 5px; margin-left: 2px; }
.inc-leg-m .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); opacity: 0.72; border: 1px solid var(--surface); }

/* --- side panel --- */
.inc-panel { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); max-height: 80vh; position: sticky; top: 78px; }
.inc-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.inc-scope { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; }
.i-clear { padding: 3px 9px; font-size: 0.72rem; }
.inc-panel-list { overflow-y: auto; padding: 4px 0; }
.inc-pi { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.inc-pi:last-child { border-bottom: none; }
.inc-pi-h { font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.inc-pi-h a { color: var(--text); }
.inc-pi-h a:hover { color: var(--link); }
.inc-pi-sub { font-size: 0.76rem; color: var(--text-faint); margin-top: 2px; }
.inc-pi .i-contact { margin-top: 6px; }

@media (max-width: 860px) {
  .inc-mapwrap { grid-template-columns: 1fr; }
  .inc-panel { max-height: 460px; position: static; }
  .inc-map { max-height: 64vh; }
}

/* ============================================================
   STATE & UT SCHEMES (state-schemes.html)
   Reuses .inc-map* / .inc-panel* for the map view.
   ============================================================ */
#state-schemes { margin-top: 6px; }

/* type badges */
.ss-badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--cat-other-tint); color: var(--cat-other);
}
.ss-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ss-badge.s-grant { background: var(--cat-grant-tint); color: var(--cat-grant); }
.ss-badge.s-seed-funding { background: var(--cat-equity-tint); color: var(--cat-equity); }
.ss-badge.s-subsidy { background: var(--cat-loan-tint); color: var(--cat-loan); }
.ss-badge.s-reimbursement { background: var(--cat-market-tint); color: var(--cat-market); }
.ss-badge.s-incentive { background: var(--cat-mixed-tint); color: var(--cat-mixed); }
.ss-badge.s-incubation { background: var(--cat-incubation-tint); color: var(--cat-incubation); }
.ss-badge.s-loan-credit { background: var(--warning-tint); color: var(--warning); }
.ss-badge.s-procurement, .ss-badge.s-other { background: var(--cat-other-tint); color: var(--cat-other); }

/* state group + header */
.ss-group { margin-top: 26px; }
.ss-state-head { padding-bottom: 12px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.ss-state-title { display: flex; align-items: center; gap: 10px; }
.ss-state-title h3 { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -0.01em; }
.ss-policy { font-size: 0.82rem; font-weight: 600; color: var(--accent); margin-top: 3px; }
.ss-summary { font-size: 0.9rem; color: var(--text-muted); margin-top: 7px; max-width: 70ch; }
.ss-metarow { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 10px; }
.ss-agency { font-size: 0.75rem; color: var(--text-faint); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 2px 9px; }

/* scheme grid + cards */
.ss-schemes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.ss-flat { margin-top: 18px; }
.ss-scheme {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 15px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-1);
}
.ss-scheme-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ss-benefit { font-size: 0.8rem; font-weight: 700; color: var(--success); }
.ss-state-tag { font-size: 0.68rem; font-weight: 600; color: var(--text-faint); background: var(--surface-sunken); border-radius: var(--radius-pill); padding: 2px 8px; margin-left: auto; }
.ss-scheme h4 { font-family: var(--font-display); font-size: 0.98rem; font-weight: 700; line-height: 1.25; }
.ss-scheme h4 a { color: var(--text); }
.ss-scheme h4 a:hover { color: var(--link); text-decoration: none; }
.ss-desc { font-size: 0.84rem; color: var(--text-muted); line-height: 1.5; }
.ss-elig { font-size: 0.78rem; color: var(--text-faint); line-height: 1.45; }
.ss-elig span { font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.66rem; }

/* map-panel: stacked scheme cards + state picker rows */
.ss-panel-list .ss-state-head { padding: 12px 14px 10px; margin: 0; border-bottom: 1px solid var(--border); }
.ss-panel-list .ss-scheme { border: none; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.ss-pick {
  display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 8px;
  padding: 9px 14px; font-size: 0.85rem; font-weight: 600; color: var(--text); text-align: left;
  border-bottom: 1px solid var(--border);
}
.ss-pick:hover { background: var(--surface-alt); color: var(--link); }
