/* ==========================================================================
   Swiss Landscape Signatures — atlas stylesheet
   Warm-paper Swiss-editorial chrome · dark cartographic plates · Helvetica
   throughout (code blocks stay monospace). Chart palette validated (dataviz
   method):
   light surface #f2efe7 → series #2e6bbd/#c8332b/#2e8f57/#8a55c8
   dark plate    #12151c → series #4a8fdf/#e05a44/#3aa565/#a875e8
   ========================================================================== */

:root {
  --paper:    #f2efe7;
  --paper-2:  #ece8db;
  --paper-3:  #e4dfce;
  --ink:      #1c1d21;
  --ink-2:    #565962;
  --ink-3:    #8b8e96;
  --hair:     #d8d2c0;
  --hair-2:   #c7bfa8;
  --red:      #c8332b;
  --red-deep: #a02820;
  --blue:     #2e6bbd;
  --green:    #2e8f57;
  --violet:   #8a55c8;
  --plate:    #0d1016;
  --plate-2:  #12151c;
  --plate-ink:#e9ecf3;
  --plate-mut:#9aa1b0;
  --plate-line:#252b3a;
  --d-blue:   #4a8fdf;
  --d-red:    #e05a44;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --mast-h: 64px;
  --gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 15.5px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before { /* paper grain */
  content: ""; position: fixed; inset: 0; z-index: 999; pointer-events: none;
  opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--red); color: #fff; }
a { color: inherit; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.01em; }
.serif { font-family: var(--serif); }
.muted { color: var(--ink-3); }
.red { color: var(--red); }
b, strong { font-weight: 650; }
button { font: inherit; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ mast */
.masthead {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--mast-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid var(--hair);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: 0 0 auto; }
.brand-mark { width: 30px; height: 30px; display: block; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-title {
  display: block; font-weight: 800; font-stretch: 115%;
  font-size: 14.5px; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1.05;
}
.brand-sub { display: block; font-family: var(--mono); font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a {
  position: relative; text-decoration: none; text-transform: uppercase;
  font-size: 11.5px; font-weight: 640; letter-spacing: 0.09em;
  color: var(--ink-2); padding: 8px 13px; border-radius: 3px;
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a.active { color: var(--ink); }
.nav a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 3px; background: var(--red);
}
.mast-status { color: var(--ink-3); font-size: 10.5px; flex: 0 0 auto; }
@media (max-width: 1180px) { .mast-status { display: none; } }
@media (max-width: 900px) { .brand-sub { display: none; } .nav a { padding: 8px 8px; letter-spacing: 0.04em; } }

main { padding-top: var(--mast-h); min-height: 100vh; }
.view { display: none; }
.view.active { display: block; animation: viewIn 0.35s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.foot {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 18px var(--gutter) 26px; color: var(--ink-3); font-size: 10.5px;
  border-top: 1px solid var(--hair); margin-top: 40px;
}

/* ------------------------------------------------------------ reveal anim */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1); }
.reveal.d1 { transition-delay: 0.1s; } .reveal.d2 { transition-delay: 0.2s; }
.reveal.d3 { transition-delay: 0.3s; } .reveal.d4 { transition-delay: 0.42s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
/* static mode (?static=1): all entrance motion off — screenshots, print, embeds */
.static .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
.static .view.active { animation: none; }
.static .strip-track { animation: none; }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; min-height: calc(100vh - var(--mast-h)); background: var(--plate); overflow: hidden; display: flex; flex-direction: column; }
.hero-plate { position: absolute; inset: 0; }
.hero-plate img { width: 100%; height: 100%; object-fit: cover; opacity: 0.92; }
.hero-scrim { position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(13,16,22,0.55) 0%, rgba(13,16,22,0.18) 34%, rgba(13,16,22,0.62) 78%, rgba(13,16,22,0.9) 100%),
  linear-gradient(100deg, rgba(13,16,22,0.82) 0%, rgba(13,16,22,0.35) 46%, rgba(13,16,22,0.06) 75%);
}
.hero-inner { position: relative; z-index: 2; padding: clamp(56px, 11vh, 130px) var(--gutter) 30px; max-width: 1200px; flex: 1; }
.kicker {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--plate-mut); margin-bottom: 26px;
}
.kicker::before { content: ""; display: inline-block; width: 26px; height: 1px; background: var(--red); vertical-align: middle; margin-right: 12px; }
.hero-title {
  margin: 0 0 26px; color: var(--plate-ink);
  font-weight: 830; font-stretch: 120%;
  font-size: clamp(46px, 7.4vw, 108px); line-height: 0.98; letter-spacing: -0.015em;
  text-transform: uppercase;
}
.hero-title span { display: block; }
.hero-title em { font-style: normal; color: transparent; -webkit-text-stroke: 2px var(--plate-ink); }
.hero-dek { max-width: 620px; color: #c6ccd8; font-size: clamp(15px, 1.35vw, 18px); line-height: 1.62; margin: 0 0 34px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; text-decoration: none; cursor: pointer; border: 1px solid transparent;
  text-transform: uppercase; font-weight: 680; font-size: 12px; letter-spacing: 0.1em;
  padding: 13px 24px; border-radius: 3px; transition: transform 0.15s ease, background 0.15s ease, color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #d9433a; }
.btn-ghost { border-color: rgba(233,236,243,0.4); color: var(--plate-ink); }
.btn-ghost:hover { background: rgba(233,236,243,0.12); }
.btn-ink { border-color: var(--ink); color: var(--ink); }
.btn-ink:hover { background: var(--ink); color: var(--paper); }
.hero-statbar {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid rgba(233,236,243,0.18);
  background: rgba(10,12,17,0.55); backdrop-filter: blur(6px);
}
.hero-statbar .hs { padding: 18px 20px 16px; border-left: 1px solid rgba(233,236,243,0.12); }
.hero-statbar .hs:first-child { border-left: 0; }
.hero-statbar b { display: block; font-family: var(--sans); font-weight: 780; font-stretch: 108%; font-size: clamp(19px, 2vw, 30px); color: var(--plate-ink); line-height: 1; }
.hero-statbar b.red { color: #ff6a5c; }
.hero-statbar span { display: block; margin-top: 6px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--plate-mut); }
@media (max-width: 980px) { .hero-statbar { grid-template-columns: repeat(3, 1fr); } .hero-statbar .hs { border-top: 1px solid rgba(233,236,243,0.08); } }

/* -------------------------------------------------------------- sections */
.section { padding: clamp(64px, 9vh, 120px) var(--gutter); max-width: 1380px; margin: 0 auto; }
.section.wide { max-width: none; }
.sec-head { margin-bottom: 42px; max-width: 900px; }
.sec-no { display: block; color: var(--red); font-size: 12px; letter-spacing: 0.2em; margin-bottom: 12px; }
.sec-no::after { content: ""; display: inline-block; width: 44px; height: 1px; background: var(--hair-2); vertical-align: middle; margin-left: 12px; }
.sec-head h2 {
  margin: 0; font-weight: 800; font-stretch: 116%; text-transform: uppercase;
  font-size: clamp(27px, 3.6vw, 46px); line-height: 1.02; letter-spacing: -0.01em;
}
.sec-dek { color: var(--ink-2); max-width: 760px; margin: 16px 0 0; font-size: 16px; }
.page-head { padding: clamp(34px, 5vh, 56px) var(--gutter) 8px; max-width: 1380px; margin: 0 auto; }
.page-head h2 { margin: 0 0 10px; font-weight: 800; font-stretch: 116%; text-transform: uppercase; font-size: clamp(24px, 3vw, 38px); letter-spacing: -0.01em; }
.page-dek { color: var(--ink-2); max-width: 860px; margin: 0 0 8px; }

.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.split.rev { grid-template-columns: 1fr 1.05fr; }
.split.rev .split-text { order: 2; } .split.rev .split-viz { order: 1; }
@media (max-width: 940px) { .split, .split.rev { grid-template-columns: 1fr; } .split.rev .split-text { order: 1; } }
.split-text p { margin: 0 0 16px; font-size: 16.5px; line-height: 1.66; color: #2c2e35; }
.split-text .hl { background: linear-gradient(transparent 62%, rgba(200,51,43,0.22) 62%); }
.split-text .answer { border-left: 3px solid var(--red); padding: 10px 0 10px 18px; font-size: 17px; color: var(--ink); }

/* islands→continuum morph */
.morph-wrap { border: 1px solid var(--hair); background: var(--plate); border-radius: 4px; overflow: hidden; box-shadow: 0 20px 50px -28px rgba(28,29,33,0.5); }
.morph-wrap canvas { display: block; width: 100%; height: auto; }
.morph-caption { padding: 10px 14px; border-top: 1px solid var(--plate-line); color: var(--plate-mut); background: var(--plate-2); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
#morph-label { transition: opacity 0.4s; }

/* filmstrip */
.strip-band { background: var(--plate); border-top: 1px solid var(--hair-2); border-bottom: 1px solid var(--hair-2); padding: 26px 0 30px; }
.strip-caption { color: var(--plate-mut); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; padding: 0 var(--gutter) 18px; }
.strip { overflow: hidden; }
.strip-track { display: flex; gap: 10px; width: max-content; animation: marquee 70s linear infinite; }
.strip:hover .strip-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.strip-track img { height: 148px; width: auto; display: block; border-radius: 2px; opacity: 0.94; }
@media (prefers-reduced-motion: reduce) { .strip-track { animation: none; } }

/* evidence pyramid rows */
.pyramid { display: flex; flex-direction: column; }
.pyr-row {
  display: grid; grid-template-columns: 92px 300px 1fr; gap: 26px; align-items: baseline;
  padding: 26px 8px; border-top: 1px solid var(--hair);
}
.pyr-row:last-child { border-bottom: 1px solid var(--hair); }
.pyr-row:hover { background: var(--paper-2); }
.pyr-no { font-family: var(--sans); font-weight: 830; font-stretch: 120%; font-size: 44px; line-height: 1; color: var(--paper-3); -webkit-text-stroke: 1.2px var(--ink-3); }
.pyr-row:hover .pyr-no { color: var(--red); -webkit-text-stroke: 0; }
.pyr-title b { display: block; font-size: 17px; font-weight: 720; text-transform: uppercase; letter-spacing: 0.02em; }
.pyr-title span { display: block; margin-top: 5px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.pyr-text { color: #33353c; font-size: 14.5px; line-height: 1.62; max-width: 720px; }
@media (max-width: 940px) { .pyr-row { grid-template-columns: 56px 1fr; } .pyr-text { grid-column: 2; } .pyr-no { font-size: 30px; } }

/* axis gallery rail (finding) */
.axis-rail-wrap { overflow-x: auto; padding: 4px var(--gutter) 22px; scrollbar-width: thin; }
.axis-rail { display: flex; gap: 16px; width: max-content; }
.axis-card {
  width: 330px; flex: 0 0 330px; background: #fbf9f4; border: 1px solid var(--hair);
  border-radius: 4px; overflow: hidden; text-decoration: none; color: inherit; display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.axis-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -22px rgba(28,29,33,0.45); }
.axis-card .ax-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--paper); }
.axis-card .ax-imgs .col { display: grid; gap: 2px; }
.axis-card img { width: 100%; height: 86px; object-fit: cover; display: block; background: var(--plate); }
.axis-card .ax-poles { display: flex; justify-content: space-between; padding: 8px 12px 0; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.axis-card .ax-name { padding: 4px 12px 6px; font-weight: 700; font-size: 14.5px; line-height: 1.25; min-height: 44px; }
.axis-card .ax-meta { display: flex; align-items: center; gap: 8px; padding: 0 12px 12px; }
.agree-meter { flex: 1; height: 3px; background: var(--paper-3); border-radius: 2px; overflow: hidden; }
.agree-meter i { display: block; height: 100%; background: var(--blue); }
.axis-card .ax-meta .mono { color: var(--ink-3); font-size: 10px; }

/* plate teasers */
.plate-teasers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 940px) { .plate-teasers { grid-template-columns: 1fr; } }
.teaser { text-decoration: none; color: inherit; display: block; }
.teaser-img { border: 1px solid var(--hair-2); background: var(--plate); border-radius: 3px; overflow: hidden; aspect-ratio: 3 / 2; }
.teaser-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.2, 0.6, 0.2, 1); }
.teaser:hover .teaser-img img { transform: scale(1.04); }
.teaser-cap { padding: 13px 4px 0; }
.teaser-cap .mono { color: var(--red); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; }
.teaser-cap b { display: block; margin: 5px 0 4px; font-size: 17px; font-weight: 740; text-transform: uppercase; letter-spacing: 0.01em; }
.teaser-cap span:last-child { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; display: block; }

/* region mosaic */
.photo-mosaic { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.photo-mosaic img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 2px; display: block; background: var(--paper-3); }
.photo-mosaic img:nth-child(7n+2) { grid-row: span 2; aspect-ratio: auto; height: 100%; }

/* tri diagram */
.tri-wrap { display: flex; justify-content: center; }
#tri-diagram { width: 100%; max-width: 820px; }
#tri-diagram svg { width: 100%; height: auto; display: block; }

/* cta cards + colophon */
.cta-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 940px) { .cta-cards { grid-template-columns: 1fr; } }
.cta-card {
  display: block; text-decoration: none; color: inherit; border: 1px solid var(--hair-2);
  background: #fbf9f4; border-radius: 4px; padding: 26px 24px 30px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.cta-card:hover { transform: translateY(-3px); border-color: var(--ink-2); box-shadow: 0 16px 38px -24px rgba(28,29,33,0.5); }
.cta-k { display: block; color: var(--red); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 12px; }
.cta-card b { display: block; font-size: 19px; font-weight: 760; text-transform: uppercase; letter-spacing: 0.01em; margin-bottom: 8px; }
.cta-card span:last-child { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.colophon { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--hair); color: var(--ink-3); font-size: 11.5px; line-height: 1.7; max-width: 860px; font-style: italic; }

/* ------------------------------------------------------------ plates (maps) */
.plate {
  position: relative; background: var(--plate); border: 1px solid var(--hair-2);
  border-radius: 4px; overflow: hidden; height: 74vh; min-height: 470px;
  box-shadow: 0 24px 60px -34px rgba(28,29,33,0.55);
}
.plate.half { height: 62vh; min-height: 420px; }
.plate.tall2 { height: 70vh; }
.plate canvas { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; cursor: crosshair; }
.plate-corner { position: absolute; width: 14px; height: 14px; z-index: 5; pointer-events: none; opacity: 0.75; }
.plate-corner::before, .plate-corner::after { content: ""; position: absolute; background: var(--plate-mut); }
.plate-corner::before { width: 100%; height: 1px; } .plate-corner::after { width: 1px; height: 100%; }
.plate-corner.tl { top: 10px; left: 10px; } .plate-corner.tr { top: 10px; right: 10px; transform: scaleX(-1); }
.plate-corner.bl { bottom: 10px; left: 10px; transform: scaleY(-1); } .plate-corner.br { bottom: 10px; right: 10px; transform: scale(-1); }
.plate-tag {
  position: absolute; top: 12px; left: 34px; z-index: 5; pointer-events: none;
  color: var(--plate-mut); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
}
.plate-coords { position: absolute; bottom: 12px; right: 34px; z-index: 5; pointer-events: none; color: var(--plate-mut); font-size: 10.5px; }
.render-error {
  position: absolute; inset: 14px; z-index: 9; background: rgba(13,16,22,0.97);
  border: 1px solid var(--d-red); border-radius: 4px; color: var(--plate-ink);
  padding: 18px 20px; font-size: 13px; overflow: auto;
}
.render-error b { color: var(--d-red); display: block; margin-bottom: 8px; }
.render-error pre { color: var(--plate-mut); font-size: 11px; white-space: pre-wrap; }

.legend-bar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 4px; min-height: 46px;
}
.legend-ramp { display: flex; align-items: center; gap: 10px; }
.legend-ramp .ramp { width: 190px; height: 10px; border-radius: 2px; border: 1px solid var(--hair-2); }
.legend-ramp .pole { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); max-width: 210px; line-height: 1.3; }
.legend-note { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.legend-sw { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); }
.legend-sw i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }

/* ------------------------------------------------------------- workbench */
.workbench { display: grid; grid-template-columns: 292px minmax(0, 1fr); gap: 22px; padding: 22px var(--gutter) 10px; }
@media (max-width: 1020px) { .workbench { grid-template-columns: 1fr; } }
.rail { align-self: start; position: sticky; top: calc(var(--mast-h) + 16px); max-height: calc(100vh - var(--mast-h) - 30px); overflow: auto; padding-right: 4px; scrollbar-width: thin; }
.rail-block { margin-bottom: 22px; }
.rail-title { color: var(--ink-3); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; padding-bottom: 8px; border-bottom: 1px solid var(--hair); margin-bottom: 8px; }
.rail-items { display: flex; flex-direction: column; }
.rail-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; border-left: 2px solid transparent; cursor: pointer;
  padding: 8px 10px; font-size: 13.5px; font-weight: 560; color: var(--ink-2); border-radius: 0 3px 3px 0;
}
.rail-item:hover { background: var(--paper-2); color: var(--ink); }
.rail-item.active { border-left-color: var(--red); color: var(--ink); background: var(--paper-2); font-weight: 700; }
.rail-item .sub { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); margin-top: 2px; font-weight: 400; }
.rail-item .ic { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 3px; border: 1px solid var(--hair-2); }
.rail-axes { display: flex; flex-direction: column; max-height: 340px; overflow: auto; scrollbar-width: thin; }
.rail-axis {
  display: grid; grid-template-columns: 24px 1fr 40px; gap: 8px; align-items: center;
  background: none; border: 0; border-left: 2px solid transparent; cursor: pointer;
  padding: 6px 8px; text-align: left; color: var(--ink-2); font-size: 12.5px; line-height: 1.25;
}
.rail-axis:hover { background: var(--paper-2); color: var(--ink); }
.rail-axis.active { border-left-color: var(--red); background: var(--paper-2); color: var(--ink); font-weight: 650; }
.rail-axis .no { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.rail-axis .ag { font-family: var(--mono); font-size: 10px; color: var(--ink-3); text-align: right; }
.rail-select { display: block; color: var(--ink-2); font-size: 11px; margin: 6px 0 10px; }
.rail-select select, .sel select {
  display: block; width: 100%; margin-top: 6px; background: #fbf9f4; color: var(--ink);
  border: 1px solid var(--hair-2); border-radius: 3px; padding: 7px 8px; font: 500 13px var(--sans);
}
.rail-check { display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: 11px; padding: 4px 0; }
.rail-sub { padding: 6px 10px 2px; color: var(--ink-2); }
.rail-sub input[type="range"] { width: 130px; }

/* layer checkboxes (rail rows are <label>s wrapping a checkbox) */
.rail-item input[type="checkbox"], .rail-axis input[type="checkbox"], .rail-check input[type="checkbox"] {
  accent-color: var(--red); width: 14px; height: 14px; flex: 0 0 14px; margin: 0; cursor: pointer;
}
.rail-item:has(input:checked), .rail-axis:has(input:checked) {
  border-left-color: var(--red); color: var(--ink); background: var(--paper-2);
}
.rail-axis { grid-template-columns: 14px 22px 1fr 38px; }
.rail-axis .nm { min-width: 0; }

/* component groups: 116 communities / 48 archetypes, individually toggleable */
.comp-group { margin-bottom: 8px; }
.comp-head { font-weight: 620; }
.comp-body { border-left: 2px solid var(--hair); margin: 2px 0 12px 6px; padding: 6px 0 2px 8px; }
.comp-tools { display: flex; gap: 5px; margin-bottom: 6px; align-items: center; }
.comp-tools input[type="search"] {
  flex: 1; min-width: 0; background: #fbf9f4; border: 1px solid var(--hair-2); border-radius: 3px;
  padding: 4px 8px; font: 400 11.5px var(--sans); color: var(--ink);
}
.comp-tools button {
  background: none; border: 1px solid var(--hair-2); border-radius: 3px; padding: 3px 8px;
  font-family: var(--mono); font-size: 10px; color: var(--ink-2); cursor: pointer;
}
.comp-tools button:hover { background: var(--paper-2); color: var(--ink); }
.comp-list { max-height: 280px; overflow: auto; scrollbar-width: thin; }
.comp-row { display: flex; align-items: center; gap: 4px; }
.comp-row label {
  flex: 1; display: flex; align-items: center; gap: 7px; padding: 3px 4px; cursor: pointer;
  border-radius: 3px; min-width: 0; font-size: 12px; color: var(--ink-2);
}
.comp-row label:hover { background: var(--paper-2); color: var(--ink); }
.comp-row input { accent-color: var(--red); margin: 0; flex: 0 0 13px; width: 13px; height: 13px; }
.comp-row i { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 10px; }
.comp-row .no { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); }
.comp-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-row .solo {
  visibility: hidden; background: none; border: 1px solid var(--hair-2); border-radius: 3px;
  font-family: var(--mono); font-size: 9px; color: var(--ink-2); padding: 1px 6px; cursor: pointer;
}
.comp-row:hover .solo { visibility: visible; }
.comp-row .solo:hover { background: var(--paper-2); color: var(--ink); }
.comp-count { color: var(--ink-3); font-size: 10px; padding: 6px 4px 0; }
.legend-name { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); margin-right: 12px; }

.stage { min-width: 0; }
.stage-detail { margin-top: 6px; }

/* trace card over plate */
.trace-card {
  position: absolute; top: 40px; right: 14px; z-index: 6; width: 320px; max-width: 62%;
  max-height: calc(100% - 60px); overflow: auto;
  background: rgba(13,16,22,0.93); backdrop-filter: blur(6px);
  border: 1px solid var(--plate-line); border-radius: 4px; color: var(--plate-ink);
  padding: 14px 16px;
}
.trace-card h4 { margin: 0 0 2px; font-size: 15px; font-weight: 740; text-transform: uppercase; letter-spacing: 0.02em; }
.trace-card .tc-sub { color: var(--plate-mut); font-family: var(--mono); font-size: 10.5px; margin-bottom: 10px; }
.trace-card .tc-close { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--plate-mut); cursor: pointer; font-size: 16px; line-height: 1; }
.trace-card .tc-photo { width: 100%; border-radius: 3px; display: block; margin: 8px 0; }
.trace-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.trace-kv .cell { background: rgba(233,236,243,0.06); border-radius: 3px; padding: 7px 9px; }
.trace-kv .v { font-weight: 720; font-size: 14px; }
.trace-kv .k { color: var(--plate-mut); font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }
.trace-axes { margin-top: 6px; }
.trace-ax { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 11.5px; color: #c6ccd8; }
.trace-ax .bar { flex: 0 0 74px; height: 5px; border-radius: 2px; background: rgba(233,236,243,0.12); position: relative; overflow: hidden; }
.trace-ax .bar i { position: absolute; top: 0; bottom: 0; }
.trace-ax .val { font-family: var(--mono); font-size: 10px; color: var(--plate-mut); width: 42px; text-align: right; }
.tc-link { display: inline-block; margin-top: 8px; color: var(--plate-ink); background: rgba(233,236,243,0.1); border: 1px solid rgba(233,236,243,0.25); border-radius: 3px; padding: 6px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; text-decoration: none; cursor: pointer; }
.tc-link:hover { background: rgba(233,236,243,0.2); }

/* axis detail under plate */
.axis-detail-card { border: 1px solid var(--hair); background: #fbf9f4; border-radius: 4px; padding: 20px 22px; margin-top: 10px; }
.axis-detail-card .ad-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.axis-detail-card h3 { margin: 0; font-size: 21px; font-weight: 780; text-transform: uppercase; letter-spacing: 0.01em; }
.chip { display: inline-block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--hair-2); color: var(--ink-2); }
.chip.red { background: var(--red); border-color: var(--red); color: #fff; }
.chip.ok { background: rgba(46,143,87,0.12); border-color: var(--green); color: var(--green); }
.ad-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 14px; }
@media (max-width: 940px) { .ad-cols { grid-template-columns: 1fr; } }
.pole-block .pb-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.pole-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pole-strip img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 2px; display: block; background: var(--paper-3); cursor: zoom-in; }
.pole-syn { margin-top: 9px; color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }
.ad-corr { margin-top: 18px; }
.ad-corr h5, .ad-comms h5 { margin: 0 0 8px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; }
.corr-row { display: grid; grid-template-columns: 46px 130px 1fr; align-items: center; gap: 10px; padding: 2.5px 0; }
.corr-row .rho { font-family: var(--mono); font-size: 11px; text-align: right; color: var(--ink-2); }
.corr-row .track { position: relative; height: 7px; background: var(--paper-3); border-radius: 2px; }
.corr-row .track i { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.corr-row .nm { font-size: 12px; color: var(--ink-2); }
.ad-comms { margin-top: 18px; }
.comm-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 6px 6px 0; border: 1px solid var(--hair-2); background: #fff9; border-radius: 999px; padding: 3px 10px 3px 5px; font-size: 11.5px; cursor: pointer; }
.comm-chip:hover { border-color: var(--ink-2); }
.comm-chip i { width: 12px; height: 12px; border-radius: 50%; }

/* the signature-field detail: color key disc + channel loadings + axis gallery */
.sig-key { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 26px; margin-top: 16px; align-items: start; }
@media (max-width: 940px) { .sig-key { grid-template-columns: 1fr; } }
.sig-disc { width: 300px; }
.sig-disc-wrap { position: relative; width: 260px; height: 260px; margin: 0 auto; }
.sig-disc img { width: 260px; height: 260px; display: block; }
.sig-disc-cap { display: block; margin-top: 8px; font-size: 11px; line-height: 1.5; color: var(--ink-3); text-align: center; }
.sig-pin { position: absolute; transform: translate(-50%, 50%); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.sig-pin i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #fbf9f4; box-shadow: 0 0 0 1px rgba(0,0,0,0.35); }
.sig-pin em { font-style: normal; font-family: var(--mono); font-size: 9px; letter-spacing: 0.04em; color: var(--ink); background: rgba(251,249,244,0.85); border-radius: 2px; padding: 0 3px; white-space: nowrap; }
.sig-chan { margin-top: 10px; }
.sig-chan h5 { margin: 0 0 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; }
.sig-chan .chip { margin: 0 5px 5px 0; text-transform: none; letter-spacing: 0.02em; font-size: 10.5px; }
.chip.sig-ld { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 4px; }
.chip.sig-ld .pt { width: 30px; height: 20px; object-fit: cover; border-radius: 2px; display: block; }
.sig-spokes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sig-spokes line { stroke: rgba(251, 249, 244, 0.55); stroke-width: 0.7; stroke-dasharray: 2 1.6; }
.sig-spoke-end { position: absolute; transform: translate(-50%, 50%); display: flex; flex-direction: column; align-items: center; gap: 1px; pointer-events: none; }
.sig-spoke-end .pt { width: 26px; height: 18px; object-fit: cover; border-radius: 2px; border: 1.5px solid #fbf9f4; box-shadow: 0 0 0 1px rgba(0,0,0,0.35); display: block; }
.sig-spoke-end em { font-style: normal; font-family: var(--mono); font-size: 8.5px; color: var(--ink); background: rgba(251,249,244,0.88); border-radius: 2px; padding: 0 3px; }
.trace-ax .tx { flex: 0 0 30px; width: 30px; height: 20px; object-fit: cover; border-radius: 2px; display: inline-block; background: rgba(233,236,243,0.06); }
.sig-gal-head { margin: 22px 0 8px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; }
.sig-axgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sig-axgrid figure { margin: 0; cursor: pointer; }
.sig-axgrid img { width: 100%; aspect-ratio: 16/8.4; object-fit: cover; border-radius: 3px; display: block; border: 1px solid var(--hair-2); }
.sig-axgrid figure:hover img { border-color: var(--red); }
.sig-axgrid figcaption { font-size: 10px; line-height: 1.35; color: var(--ink-2); margin-top: 4px; }
.trace-ax-scroll { max-height: 240px; overflow: auto; scrollbar-width: thin; padding-right: 4px; }

/* ------------------------------------------------------------ controls */
.controls-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px var(--gutter) 18px; max-width: 1380px; margin: 0 auto; }
.search { background: #fbf9f4; border: 1px solid var(--hair-2); border-radius: 3px; color: var(--ink); padding: 9px 13px; font: 500 13.5px var(--sans); min-width: 280px; }
.search:focus { outline: 2px solid var(--red); outline-offset: -1px; }
.sel { color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; font-size: 11px; }
.sel select { width: auto; margin-top: 0; }
.chk { color: var(--ink-2); display: inline-flex; gap: 7px; align-items: center; font-size: 11px; }

/* ---------------------------------------------------------- communities */
.comm-layout { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 22px; padding: 0 var(--gutter) 30px; max-width: 1380px; margin: 0 auto; }
@media (max-width: 1020px) { .comm-layout { grid-template-columns: 1fr; } }
.comm-list { border: 1px solid var(--hair); background: #fbf9f4; border-radius: 4px; max-height: 78vh; overflow: auto; scrollbar-width: thin; }
.comm-row {
  display: grid; grid-template-columns: 16px 44px 1fr 84px; gap: 10px; align-items: center;
  width: 100%; text-align: left; background: none; border: 0; border-left: 2px solid transparent;
  border-bottom: 1px solid var(--hair); padding: 10px 12px; cursor: pointer; color: var(--ink-2);
}
.comm-row:hover { background: var(--paper-2); }
.comm-row.active { border-left-color: var(--red); background: var(--paper-2); color: var(--ink); }
.comm-row .dot { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(28,29,33,0.25); }
.comm-row .cid { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.comm-row .nm { font-size: 13px; font-weight: 620; line-height: 1.25; color: inherit; }
.comm-row .nm small { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.comm-row .sz { text-align: right; }
.comm-row .sz b { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); font-weight: 400; }
.comm-row .sz .szbar { margin-top: 4px; height: 3px; background: var(--paper-3); border-radius: 2px; overflow: hidden; }
.comm-row .sz .szbar i { display: block; height: 100%; background: var(--blue); }

.comm-detail { border: 1px solid var(--hair); background: #fbf9f4; border-radius: 4px; padding: 24px 26px; max-height: 78vh; overflow: auto; scrollbar-width: thin; }
.cd-head { display: flex; align-items: flex-start; gap: 14px; }
.cd-head .dot { width: 22px; height: 22px; border-radius: 50%; margin-top: 6px; flex: 0 0 22px; border: 1px solid rgba(28,29,33,0.2); }
.cd-head h3 { margin: 0; font-size: 24px; font-weight: 790; text-transform: uppercase; letter-spacing: 0; line-height: 1.1; }
.cd-head .cd-sub { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.cd-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 18px 0 6px; }
.cd-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 2px; display: block; background: var(--paper-3); cursor: zoom-in; }
.cd-gallery .more { grid-column: span 1; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; color: var(--ink-3); border: 1px dashed var(--hair-2); border-radius: 2px; }
.cd-nophoto { margin: 16px 0 4px; padding: 14px 16px; border: 1px dashed var(--hair-2); border-radius: 3px; color: var(--ink-3); font-family: var(--mono); font-size: 11px; }
.cd-syn { font-family: var(--serif); font-size: 15.5px; line-height: 1.65; color: #2c2e35; margin: 14px 0 4px; }
.cd-syn .src { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-top: 8px; }
.cd-sec { margin-top: 22px; }
.cd-sec h5 { margin: 0 0 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; border-bottom: 1px solid var(--hair); padding-bottom: 6px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 720px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } }
.metric { background: var(--paper-2); border-radius: 3px; padding: 10px 12px; }
.metric .v { font-weight: 760; font-size: 17px; }
.metric .k { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }
.gate-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.axisbars .row { display: grid; grid-template-columns: 1fr 160px 44px; gap: 12px; align-items: center; padding: 4px 0; }
.axisbars .lbl { font-size: 12.5px; color: var(--ink-2); }
.axisbars .track { position: relative; height: 8px; background: var(--paper-3); border-radius: 2px; }
.axisbars .track::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--hair-2); }
.axisbars .track i { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.axisbars .val { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); text-align: right; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(13,16,22,0.9); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 3px; box-shadow: 0 30px 90px rgba(0,0,0,0.6); }
.lightbox .lb-cap { position: fixed; bottom: 22px; left: 0; right: 0; text-align: center; color: var(--plate-mut); font-family: var(--mono); font-size: 11px; }

/* ---------------------------------------------------------------- evidence */
.verdict-band {
  margin: 10px var(--gutter) 22px; max-width: 1380px;
  background: var(--plate); color: var(--plate-ink); border-radius: 4px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--hair-2); overflow: hidden;
}
@media (min-width: 1428px) { .verdict-band { margin-left: auto; margin-right: auto; } }
@media (max-width: 940px) { .verdict-band { grid-template-columns: repeat(2, 1fr); } }
.vb-cell { padding: 20px 22px; border-left: 1px solid var(--plate-line); }
.vb-cell:first-child { border-left: 0; }
.vb-cell b { display: block; font-size: clamp(20px, 2vw, 28px); font-weight: 800; font-stretch: 112%; }
.vb-cell b.red { color: #ff6a5c; }
.vb-cell span { display: block; margin-top: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--plate-mut); line-height: 1.5; }

.ev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 0 var(--gutter) 30px; max-width: 1380px; margin: 0 auto; }
@media (max-width: 1020px) { .ev-grid { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--hair); background: #fbf9f4; border-radius: 4px; padding: 20px 22px; min-width: 0; }
.panel.span2 { grid-column: span 2; }
@media (max-width: 1020px) { .panel.span2 { grid-column: span 1; } }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 16px; font-weight: 760; text-transform: uppercase; letter-spacing: 0.02em; }
.fine { color: var(--ink-3); font-size: 12px; line-height: 1.55; margin: 10px 0 0; }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
table.data thead th { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; border-bottom: 1px solid var(--hair-2); }
table.data tbody th { font-weight: 600; color: var(--ink); width: 34%; }
table.data td.num { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
table.data tbody tr:hover { background: var(--paper-2); }
table.data .good { color: var(--green); font-weight: 650; }
table.data .bad { color: var(--red-deep); font-weight: 650; }

.svg-chart { width: 100%; display: block; }
.svg-chart text { font-family: var(--mono); font-size: 10px; fill: var(--ink-3); }
.svg-chart .axis-line { stroke: var(--hair-2); }
.svg-chart .grid { stroke: var(--hair); }
.svg-chart .lbl { fill: var(--ink-2); }
.chart-legend { display: flex; gap: 16px; padding: 6px 2px 0; }

.prov-card { border-top: 1px solid var(--hair); padding: 12px 2px; }
.prov-card:first-child { border-top: 0; padding-top: 2px; }
.prov-card b { display: block; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 4px; }
.prov-card p { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }

/* ---------------------------------------------------------------- predict */
.predict-grid { display: grid; grid-template-columns: minmax(330px, 430px) minmax(0, 1fr); gap: 22px; padding: 0 var(--gutter) 30px; max-width: 1380px; margin: 0 auto; }
@media (max-width: 1020px) { .predict-grid { grid-template-columns: 1fr; } }
.predict-side .panel { margin-bottom: 18px; }
.status-chip { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--hair-2); color: var(--ink-3); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 14px; }
.status-chip.ok { border-color: var(--green); color: var(--green); background: rgba(46,143,87,0.08); }
.status-chip.err { border-color: var(--red); color: var(--red-deep); background: rgba(200,51,43,0.07); }
.dropzone { display: block; cursor: pointer; border: 1.5px dashed var(--hair-2); border-radius: 4px; padding: 30px 18px; text-align: center; transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--red); background: rgba(200,51,43,0.05); }
.dropzone input { display: none; }
.dz-glyph { width: 44px; margin: 0 auto 10px; color: var(--ink-3); }
.dropzone b { display: block; font-size: 15px; text-transform: uppercase; letter-spacing: 0.03em; }
.dropzone .mono { color: var(--ink-3); margin-top: 5px; display: block; }
.pred-preview { margin-top: 14px; }
.pred-preview img { width: 100%; border-radius: 3px; display: block; }
.pred-preview .mono { margin-top: 6px; }
.topk-row { display: grid; grid-template-columns: 62px 1fr 52px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.topk-row:last-child { border-bottom: 0; }
.topk-row img, .topk-row .ph { width: 62px; height: 46px; object-fit: cover; border-radius: 3px; display: block; background: var(--paper-3); }
.mode-row { display: grid; grid-template-columns: 30px 1fr 56px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.mode-row:last-child { border-bottom: 0; }
.mode-row .rank { width: 24px; height: 24px; border-radius: 50%; background: var(--red); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.mode-row .nm { display: block; font-size: 13px; }
.mode-row small { color: var(--ink-3); display: block; margin: 1px 0 4px; }
.mode-row .pbar { display: block; height: 5px; background: var(--paper-3); border-radius: 2px; overflow: hidden; }
.mode-row .pbar i { display: block; height: 100%; background: var(--red); }
.mode-row .p { text-align: right; font-family: var(--mono); font-size: 12.5px; }
.topk-row .ph { display: flex; align-items: center; justify-content: center; }
.topk-row .ph i { width: 14px; height: 14px; border-radius: 50%; }
.topk-row .nm { font-size: 13px; font-weight: 640; line-height: 1.25; }
.topk-row .nm small { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); font-weight: 400; margin-top: 3px; }
.topk-row .p { font-family: var(--mono); font-size: 12.5px; text-align: right; color: var(--ink); }
.topk-row .pbar { height: 3px; border-radius: 2px; background: var(--paper-3); margin-top: 4px; overflow: hidden; }
.topk-row .pbar i { display: block; height: 100%; background: var(--red); }

/* ------------------------------------------------------------------ docs */
.docs-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 34px; padding: 30px var(--gutter) 40px; max-width: 1320px; margin: 0 auto; }
@media (max-width: 940px) { .docs-layout { grid-template-columns: 1fr; } }
.docs-rail { align-self: start; position: sticky; top: calc(var(--mast-h) + 20px); max-height: calc(100vh - var(--mast-h) - 40px); overflow: auto; scrollbar-width: thin; }
.doc-pick { display: flex; flex-direction: column; }
.doc-pick button {
  text-align: left; background: none; border: 0; border-left: 2px solid transparent; cursor: pointer;
  padding: 8px 10px; font-size: 13.5px; font-weight: 580; color: var(--ink-2);
}
.doc-pick button:hover { background: var(--paper-2); color: var(--ink); }
.doc-pick button.active { border-left-color: var(--red); color: var(--ink); background: var(--paper-2); font-weight: 700; }
.doc-toc { display: flex; flex-direction: column; gap: 1px; }
.doc-toc a { text-decoration: none; color: var(--ink-3); font-size: 10.5px; padding: 4px 10px; line-height: 1.4; border-left: 2px solid transparent; }
.doc-toc a:hover { color: var(--ink); border-left-color: var(--hair-2); }

.doc-body { font-size: 16.5px; line-height: 1.72; color: #26272c; max-width: 840px; }
.doc-body h1, .doc-body h2, .doc-body h3 { font-family: var(--sans); text-transform: uppercase; letter-spacing: 0; line-height: 1.15; }
.doc-body h1 { font-size: 30px; font-weight: 800; font-stretch: 114%; margin: 10px 0 20px; }
.doc-body h2 { font-size: 21px; font-weight: 760; margin: 44px 0 14px; padding-top: 18px; border-top: 1px solid var(--hair); }
.doc-body h3 { font-size: 16px; font-weight: 720; margin: 30px 0 10px; }
.doc-body p { margin: 0 0 14px; }
.doc-body code { font-family: var(--code); font-size: 12.5px; background: var(--paper-2); border-radius: 3px; padding: 1px 6px; color: var(--red-deep); }
.doc-body pre { background: var(--plate); color: var(--plate-ink); border-radius: 4px; padding: 14px 16px; overflow: auto; font-size: 12px; line-height: 1.55; }
.doc-body pre code { background: none; color: inherit; padding: 0; }
.doc-body blockquote { border-left: 3px solid var(--red); margin: 14px 0; padding: 8px 18px; background: var(--paper-2); border-radius: 0 4px 4px 0; color: var(--ink-2); }
.doc-body ul, .doc-body ol { padding-left: 26px; margin: 0 0 14px; }
.doc-body li { margin: 5px 0; }
.doc-body hr { border: none; border-top: 1px solid var(--hair); margin: 30px 0; }
.doc-body table { border-collapse: collapse; width: 100%; margin: 16px 0; font-family: var(--sans); font-size: 13px; display: block; overflow-x: auto; }
.doc-body th, .doc-body td { border: 1px solid var(--hair); padding: 7px 11px; text-align: left; vertical-align: top; }
.doc-body thead th { background: var(--paper-2); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.doc-body tbody tr:nth-child(even) { background: #f7f4ec; }

/* misc scrollbars (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--hair-2); border-radius: 6px; border: 2px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }
