/* ============================================================
   Hong Kong Explorer — design system
   Dark, confident, financial-editorial. Two sections, two accents:
   "Right Now" = jade  ·  "Webb Corpus" = gold.
   ============================================================ */

/* ---------- fonts ---------- */
@font-face {
  font-family: 'Space Grotesk';
  src: url('../vendor/fonts/space-grotesk-var.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../vendor/fonts/inter-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../vendor/fonts/ibm-plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../vendor/fonts/ibm-plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --bg0: #070a10;
  --bg1: #0b101a;
  --panel: #0d141f;
  --panel2: #111a28;
  --line: #1c2534;
  --line-soft: #151d2b;

  --ink: #edf1f7;
  --ink2: #a6afc3;
  --ink3: #66718a;

  --jade: #35e0b2;
  --jade-dim: #1e8a70;
  --gold: #e4b85c;
  --gold-dim: #8a6f38;
  --coral: #ff5c7a;
  --sky: #5ca8ff;
  --violet: #8f7bf0;

  --fresh-live: #35e0b2;
  --fresh-today: #e4b85c;
  --fresh-week: #66718a;

  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --maxw: 1180px;
  --pad: clamp(16px, 4vw, 40px);
  --radius: 14px;

  --accent: var(--jade);        /* swapped per-section on <body> */
  --accent-dim: var(--jade-dim);
  --shell-h: 58px;              /* measured at runtime (mobile shell is taller) */
}
body[data-section="webb"] { --accent: var(--gold); --accent-dim: var(--gold-dim); }

/* ---------- reset-ish ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(53, 224, 178, .25); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #04120d; padding: .5rem 1rem; border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- shell ---------- */
.shell {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg0) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.shell-row {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad);
  display: flex; align-items: center; gap: clamp(10px, 2vw, 24px);
  height: 58px;
}
.brand {
  display: flex; align-items: baseline; gap: 8px; flex: none;
  font-family: var(--display); letter-spacing: .04em; font-size: 15px;
}
.brand-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--jade);
  align-self: center; flex: none;
  box-shadow: 0 0 0 0 rgba(53,224,178,.5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(53,224,178,.45); }
  70% { box-shadow: 0 0 0 9px rgba(53,224,178,0); }
  100% { box-shadow: 0 0 0 0 rgba(53,224,178,0); }
}
.brand-hk { font-weight: 700; }
.brand-x { font-weight: 500; color: var(--ink3); margin-left: 2px; }

.tabs { display: flex; gap: 4px; flex: none; margin-left: auto; }
.tabs a {
  font-family: var(--mono); font-size: 12px; letter-spacing: .02em;
  padding: 7px 12px; border-radius: 999px; color: var(--ink2);
  border: 1px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="true"] {
  color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* ---------- global search ---------- */
.search { position: relative; flex: 1 1 auto; min-width: 0; max-width: 460px; }
.search-input-wrap { position: relative; display: flex; align-items: center; }
.search-input-wrap .search-ico {
  position: absolute; left: 11px; width: 14px; height: 14px; color: var(--ink3); pointer-events: none;
}
.search input {
  width: 100%; height: 36px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); font: 400 13.5px var(--body);
  padding: 0 64px 0 32px;
  transition: border-color .15s;
}
.search input::placeholder { color: var(--ink3); }
.search input:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); outline: none; }
.search-kbd {
  position: absolute; right: 9px; display: flex; gap: 4px; pointer-events: none;
}
.search-kbd kbd {
  font: 500 10px var(--mono); color: var(--ink3);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  padding: 2px 5px; background: var(--bg1);
}
.search-pop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
  overflow: hidden;
  max-height: min(430px, 70vh); overflow-y: auto;
}
.search-group {
  font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .14em;
  color: var(--ink3); padding: 10px 14px 4px;
}
.search-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 14px; text-align: left;
}
.search-item[aria-selected="true"], .search-item:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.search-item .si-glyph {
  flex: none; width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center;
  font: 600 10px var(--mono);
}
.si-glyph.company { background: rgba(228,184,92,.14); color: var(--gold); }
.si-glyph.person  { background: rgba(143,123,240,.16); color: var(--violet); }
.search-item .si-name { font-size: 13.5px; font-weight: 500; }
.search-item .si-name mark { background: none; color: var(--accent); }
.search-item .si-hint { margin-left: auto; font: 400 11px var(--mono); color: var(--ink3); white-space: nowrap; }
.search-empty { padding: 14px; font-size: 13px; color: var(--ink3); }
.search-empty b { color: var(--ink2); font-weight: 500; }

/* ---------- layout primitives ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
main { min-height: 70vh; }

.eyebrow {
  font: 500 11px var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); display: flex; align-items: center; gap: 10px;
}
.eyebrow::after { content: ''; height: 1px; width: 42px; background: color-mix(in srgb, var(--accent) 50%, transparent); }

.chapter { padding: clamp(44px, 7vw, 84px) 0 0; scroll-margin-top: calc(var(--shell-h) + 46px); }
.hero { scroll-margin-top: calc(var(--shell-h) + 46px); }
.chapter-head { max-width: 720px; margin-bottom: clamp(18px, 3vw, 28px); }
.chapter-head h2 {
  font: 600 clamp(24px, 3.4vw, 34px)/1.15 var(--display);
  letter-spacing: -.01em; margin: 10px 0 8px;
}
.chapter-head .lede { color: var(--ink2); font-size: 15px; margin: 0; }
.chapter-num { color: var(--ink3); font: 500 11px var(--mono); margin-right: 8px; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.panel-pad { padding: clamp(14px, 2.4vw, 22px); }

.asof {
  font: 400 11px var(--mono); color: var(--ink3);
  display: inline-flex; align-items: center; gap: 6px;
}
.asof::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--ink3); }
.asof.live::before { background: var(--fresh-live); }

.note-honest {
  font-size: 12.5px; color: var(--ink3); border-left: 2px solid var(--line);
  padding: 2px 0 2px 10px; margin-top: 12px;
}
.note-honest b { color: var(--ink2); font-weight: 500; }

/* chips & controls */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 500 12px var(--mono); color: var(--ink2);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  background: var(--bg1);
  transition: color .12s, border-color .12s, background .12s;
  white-space: nowrap;
}
.chip:hover { color: var(--ink); border-color: var(--ink3); }
.chip[aria-pressed="true"], .chip.on {
  color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.chip .swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.chip.off-series { opacity: .45; }

/* stat cards */
.stat-row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px;
}
.stat-card .sc-label { font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.stat-card .sc-value {
  font: 600 clamp(20px, 2.6vw, 26px)/1.1 var(--display);
  margin: 6px 0 2px; font-feature-settings: 'tnum' 1;
}
.stat-card .sc-sub { font-size: 12px; color: var(--ink2); }
.sc-value.pos { color: var(--jade); }
.sc-value.neg { color: var(--coral); }

/* charts */
.chart { width: 100%; position: relative; }
.chart > .echart { width: 100%; height: 100%; }
.chart-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--line-soft);
}
.chart-toolbar .spacer { flex: 1; }

/* skeleton / loading / error */
.sk { border-radius: var(--radius); background: linear-gradient(100deg, var(--panel) 40%, var(--panel2) 50%, var(--panel) 60%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.boot-skeleton { max-width: var(--maxw); margin: 0 auto; padding: 40px var(--pad); display: grid; gap: 18px; }
.sk-hero { height: 260px; }
.sk-block { height: 380px; }
.chart-loading { display: grid; place-items: center; color: var(--ink3); font: 400 12px var(--mono); }
.err-card {
  border: 1px solid color-mix(in srgb, var(--coral) 40%, transparent);
  background: color-mix(in srgb, var(--coral) 6%, var(--panel));
  color: var(--ink2); border-radius: var(--radius); padding: 18px; font-size: 14px;
}
.err-card button { color: var(--coral); font-weight: 600; margin-top: 8px; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   SECTION A — Hong Kong, Right Now
   ============================================================ */

/* hero */
.hero { padding: clamp(40px, 7vw, 90px) 0 clamp(28px, 4vw, 48px); }
.hero h1 {
  font: 600 clamp(38px, 7vw, 68px)/1.02 var(--display);
  letter-spacing: -.025em; margin: 14px 0 14px;
}
.hero h1 .accent { color: var(--jade); }
.hero .lede { max-width: 620px; color: var(--ink2); font-size: clamp(15px, 1.6vw, 17px); margin: 0 0 8px; }
.hero .lede b { color: var(--ink); font-weight: 600; font-feature-settings: 'tnum' 1; }

.hero-count {
  font: 600 clamp(44px, 8vw, 84px)/1 var(--display);
  letter-spacing: -.02em; font-feature-settings: 'tnum' 1;
  color: var(--ink);
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin: 22px 0 4px;
}
.hero-count .hc-label { font: 500 12px var(--mono); color: var(--ink3); letter-spacing: .12em; text-transform: uppercase; }

/* record-share composition bar */
.comp-bar { margin-top: 26px; }
.comp-track { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; }
.comp-seg { min-width: 3px; transition: flex-grow .8s cubic-bezier(.2,.8,.2,1); }
.comp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.comp-legend span { font: 400 11px var(--mono); color: var(--ink3); }
.comp-legend .swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.comp-legend b { color: var(--ink2); font-weight: 500; }

/* pulse board */
.pulse-groups { display: grid; gap: 22px; margin-top: 26px; }
.pulse-group-label {
  font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink3); display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.pulse-group-label .dot { width: 6px; height: 6px; border-radius: 50%; }
.pulse-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.pulse-card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 10px 12px; display: grid; gap: 2px;
}
.pulse-card .pc-top { display: flex; align-items: center; gap: 8px; }
.pulse-card .pc-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.pulse-card.live .pc-dot { background: var(--fresh-live); animation: pulse 2.4s ease-out infinite; }
.pulse-card.today .pc-dot { background: var(--fresh-today); }
.pulse-card.week .pc-dot { background: var(--fresh-week); }
.pulse-card .pc-label { font-size: 12.5px; color: var(--ink2); line-height: 1.3; }
.pulse-card .pc-nums { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pulse-card .pc-records { font: 500 15px var(--display); font-feature-settings: 'tnum' 1; }
.pulse-card .pc-age { font: 400 10.5px var(--mono); color: var(--ink3); white-space: nowrap; }

/* chapter nav (sticky, under shell) */
.chapnav {
  position: sticky; top: var(--shell-h); z-index: 40;
  background: color-mix(in srgb, var(--bg0) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
  margin-top: clamp(24px, 4vw, 40px);
}
.chapnav-row {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad);
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.chapnav-row::-webkit-scrollbar { display: none; }
.chapnav a {
  font: 500 11.5px var(--mono); color: var(--ink3); padding: 11px 12px;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.chapnav a:hover { color: var(--ink2); }
.chapnav a.active { color: var(--jade); border-bottom-color: var(--jade); }

/* today composite */
#today .panel-pad { padding-top: 8px; }
.today-caption { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 12px 14px 0; }

/* property */
.prop-insights { margin: 14px 0 18px; }
.era-chips { padding: 12px 14px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; flex-wrap: wrap; }

/* map */
.map-note { font-size: 12px; color: var(--ink3); }
.map-legend-missing { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--bg1); border: 1px dashed var(--ink3); vertical-align: -1px; margin-right: 6px; }

/* A&E */
.ae-layout { display: grid; gap: 14px; grid-template-columns: minmax(300px, 5fr) 7fr; align-items: start; }
@media (min-width: 901px) {
  .ae-layout > .panel:last-child { position: sticky; top: calc(var(--shell-h) + 52px); }
}
.ae-list { display: flex; flex-direction: column; }
.ae-row {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
  padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line-soft);
  transition: background .12s;
}
.ae-row:hover { background: var(--panel2); }
.ae-row.sel { background: color-mix(in srgb, var(--jade) 7%, transparent); box-shadow: inset 2px 0 0 var(--jade); }
.ae-row .ae-name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 7px; min-width: 0; }
.ae-row .ae-name .cdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ae-row .ae-wait { font: 500 13px var(--mono); font-feature-settings: 'tnum' 1; text-align: right; }
.ae-row .ae-bar-track { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--bg1); overflow: hidden; }
.ae-row .ae-bar { height: 100%; border-radius: 2px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.ae-badge {
  font: 500 10px var(--mono); color: var(--coral);
  border: 1px solid color-mix(in srgb, var(--coral) 45%, transparent); border-radius: 5px;
  padding: 1px 6px; white-space: nowrap;
}
.ae-detail-head { padding: 14px 16px 0; }
.ae-detail-head h3 { font: 600 17px var(--display); margin: 0 0 2px; }
.ae-tri { padding: 4px 16px 14px; }
.ae-tri-caption { font-size: 12px; color: var(--ink3); margin: 8px 0 0; }

/* econ */
.econ-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.econ-cpi-rows { display: grid; gap: 10px; padding: 6px 0; }
.econ-cpi-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; }
.econ-cpi-row .label { font-size: 12.5px; color: var(--ink2); }
.econ-cpi-row .bar-track { height: 6px; background: var(--bg1); border-radius: 3px; overflow: hidden; }
.econ-cpi-row .bar { height: 100%; border-radius: 3px; background: var(--sky); transition: width .7s cubic-bezier(.2,.8,.2,1); }
.econ-cpi-row .val { font: 500 12.5px var(--mono); font-feature-settings: 'tnum' 1; }

/* footer */
.site-foot { margin-top: clamp(60px, 9vw, 110px); border-top: 1px solid var(--line-soft); background: var(--bg1); }
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 34px var(--pad) 46px; display: grid; gap: 26px; grid-template-columns: 1.3fr 1fr 1fr; }
.foot-col h4 { font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); margin: 0 0 10px; }
.foot-col p, .foot-col li { font-size: 12.5px; color: var(--ink2); }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.foot-col a { color: var(--ink2); border-bottom: 1px solid var(--line); }
.foot-col a:hover { color: var(--ink); }
.foot-dedication { font-style: italic; color: var(--ink3); }
.foot-meta { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); padding-top: 16px; font: 400 11px var(--mono); color: var(--ink3); display: flex; flex-wrap: wrap; gap: 6px 22px; }

/* ============================================================
   SECTION B — The Webb Corpus
   ============================================================ */
.webb-hero { padding: clamp(40px, 6vw, 76px) 0 clamp(20px, 3vw, 36px); }
.webb-hero h1 { font: 600 clamp(34px, 6vw, 58px)/1.05 var(--display); letter-spacing: -.02em; margin: 14px 0; }
.webb-hero h1 .accent { color: var(--gold); }
.webb-hero .lede { max-width: 640px; color: var(--ink2); font-size: clamp(14.5px, 1.6vw, 16.5px); }

.sample-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  background: color-mix(in srgb, var(--gold) 7%, transparent);
  border-radius: 999px; padding: 6px 14px; margin: 14px 0 4px;
}
.sample-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

.webb-stats { display: flex; flex-wrap: wrap; gap: 10px 34px; margin-top: 22px; }
.webb-stat .ws-num { font: 600 clamp(24px, 3.4vw, 34px)/1 var(--display); font-feature-settings: 'tnum' 1; }
.webb-stat .ws-label { font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); margin-top: 4px; }

/* graph + profile layout */
.webb-main { display: grid; grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr); gap: 14px; align-items: start; }
.graph-panel { position: relative; }
.graph-panel .chart { height: min(640px, 74vh); }
.graph-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 5;
  display: grid; gap: 4px; padding: 10px 12px;
  background: color-mix(in srgb, var(--bg0) 78%, transparent);
  border: 1px solid var(--line-soft); border-radius: 10px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.graph-legend span { font: 400 10.5px var(--mono); color: var(--ink2); display: flex; align-items: center; gap: 7px; }
.graph-legend i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.graph-legend .edge { width: 14px; height: 2px; border-radius: 1px; }

.graph-hint {
  position: absolute; right: 12px; top: 56px; z-index: 5;
  font: 400 10.5px var(--mono); color: var(--ink3);
  background: color-mix(in srgb, var(--bg0) 78%, transparent);
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 6px 10px;
}

/* profile panel */
.profile { position: sticky; top: calc(var(--shell-h) + 14px); max-height: calc(100vh - var(--shell-h) - 28px); overflow-y: auto; }
.profile-empty { color: var(--ink3); font-size: 13.5px; padding: 26px 20px; }
.profile-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line-soft); }
.profile-head .p-kind { font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }
.profile-head h3 { font: 600 20px/1.2 var(--display); margin: 6px 0 8px; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ptag {
  font: 500 10.5px var(--mono); color: var(--ink2);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px;
}
.ptag.code { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.ptag.enigma { color: var(--coral); border-color: color-mix(in srgb, var(--coral) 45%, transparent); }
.ptag.delisted { color: var(--ink3); text-decoration: line-through; }
.profile-kv { display: flex; gap: 22px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.profile-kv .kv .k { font: 500 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.profile-kv .kv .v { font: 500 14px var(--display); font-feature-settings: 'tnum' 1; margin-top: 2px; }
.profile-sec { padding: 12px 18px 16px; }
.profile-sec h4 {
  font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink3); margin: 4px 0 10px;
}
.plist { display: grid; gap: 2px; }
.plist-row {
  display: grid; grid-template-columns: 1fr auto; gap: 1px 10px;
  padding: 7px 10px; margin: 0 -10px; border-radius: 8px; text-align: left;
}
.plist-row:hover { background: var(--panel2); }
.plist-row .pl-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.plist-row .pl-name .linkish { border-bottom: 1px dotted var(--ink3); }
.plist-row .pl-sub { font-size: 11.5px; color: var(--ink3); grid-row: 2; }
.plist-row .pl-val { font: 500 12px var(--mono); font-feature-settings: 'tnum' 1; color: var(--ink2); text-align: right; align-self: center; grid-row: span 2; }
.pl-holdbar { grid-column: 1 / -1; height: 3px; background: var(--bg1); border-radius: 2px; overflow: hidden; margin-top: 3px; }
.pl-holdbar i { display: block; height: 100%; background: var(--gold); border-radius: 2px; }
.profile-actions { display: flex; gap: 8px; padding: 0 18px 18px; flex-wrap: wrap; }

/* path finder */
.path-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.path-bar .path-input { position: relative; flex: 1 1 170px; }
.path-bar input {
  width: 100%; height: 34px; background: var(--bg1); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font: 400 12.5px var(--body); padding: 0 10px;
}
.path-bar input:focus { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); outline: none; }
.path-result { padding: 12px 14px; border-top: 1px solid var(--line-soft); }
.path-chain { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.path-node {
  font: 500 12px var(--mono); padding: 4px 10px; border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); color: var(--gold);
  background: color-mix(in srgb, var(--gold) 6%, transparent);
}
.path-node.person { border-color: color-mix(in srgb, var(--violet) 45%, transparent); color: var(--violet); background: color-mix(in srgb, var(--violet) 8%, transparent); }
.path-link-label { font: 400 10.5px var(--mono); color: var(--ink3); }

/* enigma matrix */
.matrix-wrap { overflow-x: auto; }
.matrix { border-collapse: separate; border-spacing: 3px; margin: 0 auto; }
.matrix th {
  font: 500 10px var(--mono); color: var(--ink3); font-weight: 500;
  padding: 4px 6px; text-align: right; white-space: nowrap;
}
.matrix thead th { text-align: center; vertical-align: bottom; max-width: 58px; }
.matrix thead th .vert { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; max-height: 110px; overflow: hidden; text-overflow: ellipsis; }
.matrix td {
  width: 44px; height: 36px; border-radius: 6px; text-align: center;
  font: 500 10.5px var(--mono); font-feature-settings: 'tnum' 1;
  background: var(--bg1); color: var(--ink2); cursor: default;
  border: 1px solid transparent;
}
.matrix td.self { background: transparent; border: 1px dashed var(--line); }
.matrix td.hl { border-color: color-mix(in srgb, var(--coral) 60%, transparent); }
.matrix-caption { font-size: 12.5px; color: var(--ink3); margin-top: 12px; max-width: 620px; }
.matrix-caption b { color: var(--ink2); font-weight: 500; }

/* leaderboards */
.board-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.rank-list { display: grid; }
.rank-row {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 14px; text-align: left; border-bottom: 1px solid var(--line-soft);
}
.rank-row:last-child { border-bottom: 0; }
.rank-row:hover { background: var(--panel2); }
.rank-row .rr-n { font: 500 11px var(--mono); color: var(--ink3); }
.rank-row .rr-name { font-size: 13.5px; font-weight: 500; }
.rank-row .rr-sub { font-size: 11.5px; color: var(--ink3); }
.rank-row .rr-val { font: 500 13px var(--mono); color: var(--gold); font-feature-settings: 'tnum' 1; }
.rank-row .rr-bar { grid-column: 2 / -1; height: 3px; background: var(--bg1); border-radius: 2px; overflow: hidden; }
.rank-row .rr-bar i { display: block; height: 100%; background: color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 2px; }

/* mobile sheet for profile */
@media (max-width: 900px) {
  .webb-main { grid-template-columns: 1fr; }
  .profile { position: fixed; inset: auto 0 0 0; top: auto; z-index: 70;
    max-height: 72vh; border-radius: 18px 18px 0 0;
    transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
    box-shadow: 0 -18px 60px rgba(0,0,0,.6);
  }
  .profile.open { transform: none; }
  .profile-grab { display: block; width: 44px; height: 4px; border-radius: 2px; background: var(--line); margin: 10px auto 0; }
  .profile-close { position: absolute; top: 10px; right: 12px; color: var(--ink3); font-size: 20px; padding: 6px; }
  .ae-layout { grid-template-columns: 1fr; }
}
@media (min-width: 901px) {
  .profile-grab, .profile-close { display: none; }
}

/* narrow phones */
@media (max-width: 720px) {
  .graph-panel .chart-toolbar .asof { display: none; }
  .shell-row { flex-wrap: wrap; height: auto; padding-top: 9px; padding-bottom: 9px; row-gap: 8px; }
  .brand { order: 1; }
  .tabs { order: 2; margin-left: auto; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .chapnav { top: 96px; }
  .profile { top: auto; }
  .foot-inner { grid-template-columns: 1fr; gap: 20px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .matrix td { width: 34px; height: 30px; font-size: 9.5px; }
}

/* ---- Webb corpus, live edition ---- */
.counts-note { font: 400 11px var(--mono); color: var(--ink3); margin-top: 10px; }
.si-cname { font-weight: 400; color: var(--ink3); font-size: .92em; }
.linkish { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--ink3); }
.linkish:hover { color: var(--gold); border-bottom-color: var(--gold); }
.graph-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
  color: var(--ink3); font-size: 13.5px; z-index: 2;
}
.graph-empty p { max-width: 42ch; }
.graph-empty .chips { justify-content: center; }
.hop-log { font: 400 11.5px var(--mono); color: var(--ink3); display: flex; flex-direction: column; gap: 3px; }
.plist-row.is-former { opacity: .62; }
.toggle-former { margin-top: 8px; }
.loop-chip { color: var(--coral); border-color: color-mix(in srgb, var(--coral) 45%, transparent); cursor: help; }
#webb-graph { position: relative; }

/* ---- Webb corpus: source pages + profile extras (broadening pass) ---- */
.webb-nav { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.webb-nav .chip { text-decoration: none; }
.webb-nav .chip[aria-current="true"] {
  color: var(--gold); border-color: color-mix(in srgb, var(--gold) 55%, transparent);
  background: color-mix(in srgb, var(--gold) 10%, transparent);
}
.page-hero { padding-bottom: clamp(16px, 2.5vw, 28px); }
.page-body { padding-bottom: 60px; }

/* stake / position deltas */
.delta { font: 500 12px var(--mono); color: var(--ink2); }
.delta.up { color: var(--jade); }
.delta.down { color: var(--coral); }

/* stacked component bars (pay league, law firms) */
.pay-bar { display: flex; gap: 0; overflow: hidden; }
.pay-bar i { display: block; height: 100%; min-width: 0; }
.pay-legend { padding: 10px 16px 14px; }

/* selectable feed rows (short list, firm list) */
button.rank-row { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line-soft); font: inherit; color: inherit; cursor: pointer; }
button.rank-row:hover { background: color-mix(in srgb, var(--gold) 4%, transparent); }
button.rank-row.sel { background: color-mix(in srgb, var(--gold) 8%, transparent); }

/* lazy profile sections */
.xsecs .xsec { border-top: 1px solid var(--line-soft); }
.xsec-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: none; border: 0; color: var(--ink2); font: 500 12.5px var(--body, inherit);
  padding: 9px 2px; cursor: pointer; letter-spacing: .01em;
}
.xsec-head:hover { color: var(--gold); }
.xsec-chev { color: var(--ink3); transition: transform .15s ease; }
.xsec.open .xsec-chev { transform: rotate(90deg); }
.xsec-body { padding: 2px 0 12px; }

/* short-interest sparkline (CSS bars) */
.short-spark { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin: 4px 0 8px; }
.short-spark i { flex: 1; background: color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 1px 1px 0 0; min-height: 3px; }

/* ---- polish pass: front door, tribute, mobile ---- */
.hero-search { position: relative; max-width: 620px; margin: 22px 0 18px; }
.hero-search-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 0 16px; transition: border-color .15s, box-shadow .15s;
}
.hero-search-box:focus-within {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 14%, transparent);
}
.hero-search-box svg { width: 18px; height: 18px; color: var(--ink3); flex: none; }
.hero-search-box input {
  flex: 1; background: none; border: 0; outline: none; color: var(--ink);
  font: 400 16.5px var(--body, inherit); padding: 15px 0; min-width: 0;
}
.hero-search-box input::placeholder { color: var(--ink3); }
.hero-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; }
.hero-starters { margin-top: 12px; align-items: center; }
.hero-starters .chip { text-decoration: none; }
.hs-label { font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); margin-right: 2px; }

.webb-tribute {
  text-align: center; max-width: 560px; padding: 44px 20px 64px; color: var(--ink3);
  font-size: 13.5px; line-height: 1.65;
}
.webb-tribute .tribute-mark { color: var(--gold); font-size: 20px; margin-bottom: 12px; opacity: .7; }
.webb-tribute p { margin: 6px 0; }

/* mobile: the new screens */
@media (max-width: 720px) {
  .webb-nav { gap: 5px; }
  .webb-nav .chip { font-size: 11px; padding: 5px 9px; }
  .page-hero h1 { font-size: clamp(28px, 8vw, 38px); }
  .hero-search { max-width: none; }
  .hero-search-box input { font-size: 16px; }   /* ≥16px stops iOS zoom-on-focus */
  .rank-row .rr-val { font-size: 12px; }
  .path-bar .path-input { flex-basis: 100%; }
  .chart-toolbar { flex-wrap: wrap; row-gap: 6px; }
  #px-chart { height: 260px !important; }
  #conc-chart { height: 260px !important; }
  #sfc-chart { height: 360px !important; }
  .webb-stats { gap: 10px 20px; }
  .webb-tribute { padding-bottom: 44px; }
}
