/* ============================================================
   V4 presentation boards: engineering-schematic whiteboard
   Monochrome ink + two sanctioned accents, plus ONE soft accent
   reserved only for standalone reference cards. Emphasis from
   weight/position. No pills, gradients, glass, or glow.
   ============================================================ */

/* ---- Fonts (self-hosted) ---- */
@font-face {
  font-family: "PP Neue Machina";
  src: url("fonts/PPNeueMachina-Light.otf") format("opentype");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "PP Neue Machina";
  src: url("fonts/PPNeueMachina-Regular.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "PP Neue Machina";
  src: url("fonts/PPNeueMachina-Ultrabold.otf") format("opentype");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Urbanist";
  src: url("fonts/urbanist-latin.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2039-203A, U+2122;
}
@font-face {
  font-family: "Urbanist";
  src: url("fonts/urbanist-latinext.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Tokens ---- */
:root {
  --paper:      #FAFAF8;
  --paper-dot:  #E4E4DE;
  --ink:        #1A1A1F;
  --sec:        #4A4A4A;
  --mut:        #7A7A76;
  --hair:       #D6D6D0;
  --hair-2:     #EAEAE4;
  --fill:       #FFFFFF;
  --fill-2:     #F6F6F2;
  --state:      #B0342B; /* stops, gates, human-approval boundary */
  --layer:      #2C5F7C; /* system-layer distinction only */
  /* soft third accent, ONLY for standalone reference cards */
  --ref-ink:    #8A6A34;
  --ref-fill:   #F5EEDF;
  --ref-line:   #DCC79C;

  --font-head: "PP Neue Machina", system-ui, sans-serif;
  --font-body: "Urbanist", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;

  --rail-w: 230px;
  --panel-w: 400px;
  --top-h: 52px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }

/* ============================================================
   App shell
   ============================================================ */
#app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  grid-template-rows: var(--top-h) 1fr;
  grid-template-areas:
    "top top"
    "rail canvas";
}

/* ---- Top bar ---- */
#topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 20px;
  padding: 0 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--hair);
  z-index: 40;
}
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand-mark {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--mut);
  border: 1px solid var(--hair); padding: 2px 6px;
  letter-spacing: .02em;
}
.brand-title {
  font-family: var(--font-head); font-weight: 800;
  font-size: 16px; letter-spacing: -.01em; color: var(--ink);
  white-space: nowrap;
}
#viewName {
  font-family: var(--font-body); font-weight: 600;
  font-size: 13px; color: var(--sec);
  padding-left: 20px; border-left: 1px solid var(--hair);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-spacer { flex: 1; }
.top-btn {
  font-family: var(--font-body); font-weight: 600; font-size: 12px;
  color: var(--sec); background: var(--fill);
  border: 1px solid var(--hair); padding: 7px 12px;
  transition: border-color .12s, color .12s;
}
.top-btn:hover { border-color: var(--ink); color: var(--ink); }
a.top-btn { text-decoration: none; display: inline-flex; align-items: center; }
.rail-toggle { display: none; }

/* ---- Left rail ---- */
#rail {
  grid-area: rail;
  background: var(--paper);
  border-right: 1px solid var(--hair);
  overflow-y: auto;
  z-index: 30;
}
.rail-head {
  font-family: var(--font-mono); font-size: 10px; color: var(--mut);
  padding: 16px 18px 8px; letter-spacing: .04em;
}
#railList { display: flex; flex-direction: column; }
.rail-item {
  display: grid; grid-template-columns: 24px 1fr; align-items: baseline;
  gap: 8px; text-align: left;
  padding: 10px 18px; background: transparent; border: 0;
  border-left: 2px solid transparent;
  color: var(--sec); width: 100%;
}
.rail-item:hover { background: var(--fill-2); }
.rail-item .ri-num { font-family: var(--font-mono); font-size: 11px; color: var(--mut); }
.rail-item .ri-name { font-family: var(--font-body); font-weight: 500; font-size: 13px; line-height: 1.3; }
.rail-item.is-current { border-left-color: var(--ink); background: var(--fill-2); }
.rail-item.is-current .ri-name { font-weight: 600; color: var(--ink); }
.rail-item.is-current .ri-num { color: var(--ink); }

/* ============================================================
   Canvas + camera
   ============================================================ */
#canvas {
  grid-area: canvas;
  position: relative;
  overflow: hidden;
  background-color: var(--paper);
  background-image: radial-gradient(var(--paper-dot) 1.1px, transparent 1.1px);
  background-size: 26px 26px;
  cursor: grab;
  touch-action: none;
}
#canvas.is-panning { cursor: grabbing; }

#stage {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  will-change: transform;
}
#edges { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
#nodes { position: absolute; top: 0; left: 0; }

/* ---- Nodes ---- */
.node {
  position: absolute;
  background: var(--fill);
  border: 1px solid var(--hair);
  padding: 10px 12px 11px;
  width: 184px;
  cursor: pointer;
  user-select: none;
  transition: border-color .12s, box-shadow .12s, opacity .18s;
}
.node.has-info { padding-right: 30px; }
.node:hover { border-color: var(--sec); }
.node .node-id {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--mut);
  letter-spacing: .01em; margin-bottom: 3px;
}
.node .node-name {
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  line-height: 1.25; color: var(--ink);
}
.node .node-kind {
  font-family: var(--font-body); font-weight: 500; font-size: 11px;
  color: var(--mut); margin-top: 4px;
}
.node .node-badge {
  font-family: var(--font-mono); font-size: 10px; color: var(--sec);
  border: 1px solid var(--hair); padding: 0 4px; margin-left: 6px;
}
.node-info {
  position: absolute; top: 6px; right: 6px;
  width: 18px; height: 18px; line-height: 16px; text-align: center;
  font-family: var(--font-mono); font-size: 11px; font-style: italic;
  color: var(--mut); background: var(--fill); border: 1px solid var(--hair);
  padding: 0; border-radius: 50%;
}
.node-info:hover { color: var(--ink); border-color: var(--ink); }

/* node kinds */
.node.k-hop     { width: 158px; }
.node.k-layer   { width: 300px; border-left: 3px solid var(--layer); }
.node.k-note    { background: var(--fill-2); border-style: dashed; cursor: pointer; }
.node.k-note .node-name { font-weight: 500; color: var(--sec); font-size: 12.5px; }
.node.k-metric .node-name { font-family: var(--font-mono); font-size: 17px; font-weight: 400; }

/* standalone REFERENCE cards: rounded + soft sand (one exception color) */
.node.is-ref {
  border-radius: 11px;
  background: var(--ref-fill);
  border-color: var(--ref-line);
}
.node.is-ref .node-id { color: var(--ref-ink); }
.node.is-ref:hover { border-color: var(--ref-ink); }

/* state = red border (gates, stops, approval boundary) */
.node.s-gate, .node.s-boundary, .node.s-stop { border-color: var(--state); }
.node.s-boundary { border-style: dashed; border-width: 1.5px; background: #FCF5F4; }
.node.s-gate .node-id, .node.s-boundary .node-id, .node.s-stop .node-id { color: var(--state); }
/* state always wins over the reference tint */
.node.is-ref.s-gate, .node.is-ref.s-boundary, .node.is-ref.s-stop {
  background: #FCF5F4; border-color: var(--state);
}
.node.is-ref.s-gate .node-id, .node.is-ref.s-boundary .node-id, .node.is-ref.s-stop .node-id { color: var(--state); }

/* selection / active-path emphasis */
.node.is-active { border-color: var(--ink); border-width: 2px; padding: 9px 11px 10px; }
.node.is-active.has-info { padding-right: 29px; }
.node.is-active.s-gate, .node.is-active.s-boundary { border-color: var(--state); }
#stage.has-active .node:not(.is-active):not(.is-neighbor) { opacity: .3; }

/* ---- Edges ---- */
.edge { fill: none; stroke: var(--sec); stroke-width: 1.2; }
.edge.e-return { stroke: var(--mut); stroke-dasharray: 5 4; }
.edge.e-gate   { stroke: var(--state); stroke-width: 1.4; }
.edge.e-boundary { stroke: var(--state); stroke-dasharray: 3 3; stroke-width: 1.4; }
.edge.e-thin, .edge.e-tree { stroke: var(--hair); stroke-width: 1; }
.edge.e-block  { stroke: var(--state); stroke-dasharray: 5 4; stroke-width: 1.4; }
.edge.is-lit   { stroke: var(--ink); stroke-width: 1.8; }
#stage.has-active .edge:not(.is-lit) { opacity: .22; }
.edge-label { font-family: var(--font-body); font-weight: 600; font-size: 10.5px; fill: var(--sec); }
.edge-label-bg { fill: var(--paper); }
.arrow-head { fill: var(--sec); }
.arrow-head.a-gate { fill: var(--state); }
.arrow-head.a-block { fill: var(--state); }
.arrow-head.a-return { fill: var(--mut); }
.arrow-head.a-tree { fill: var(--hair); }
.arrow-head.is-lit { fill: var(--ink); }

/* ============================================================
   On-canvas controls
   ============================================================ */
#stepper {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  background: var(--paper); border: 1px solid var(--hair); z-index: 25;
}
#stepper button {
  border: 0; background: transparent; color: var(--sec);
  font-family: var(--font-body); font-weight: 600; font-size: 12px; padding: 8px 14px;
}
#stepper button:hover { color: var(--ink); background: var(--fill-2); }
#stepper .step-count {
  font-family: var(--font-mono); font-size: 11px; color: var(--mut);
  padding: 0 10px; border-left: 1px solid var(--hair); border-right: 1px solid var(--hair);
}

#zoomctl {
  position: absolute; right: 18px; bottom: 18px;
  display: flex; flex-direction: column; width: 46px;
  background: var(--paper); border: 1px solid var(--hair); z-index: 25;
}
#zoomctl button {
  border: 0; background: transparent; color: var(--sec);
  font-family: var(--font-mono); font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 34px; padding: 0;
  border-bottom: 1px solid var(--hair);
}
#zoomctl button:last-child { border-bottom: 0; }
#zoomctl button:hover { color: var(--ink); background: var(--fill-2); }
#zoomctl button.z-wide { font-family: var(--font-body); font-weight: 600; font-size: 11px; }

/* per-view caption, top-left */
#viewNote {
  position: absolute; left: 18px; top: 16px; max-width: 340px;
  background: var(--paper); border: 1px solid var(--hair);
  border-left: 2px solid var(--ink); padding: 10px 13px; z-index: 22;
  font-family: var(--font-body); font-size: 12px; line-height: 1.45; color: var(--sec);
}
#viewNote strong { color: var(--ink); font-weight: 600; }
#viewNote em { font-style: normal; color: var(--state); font-weight: 600; }

/* ---- Legend (top-right, vertical list) ---- */
#legend {
  position: absolute; right: 18px; top: 16px; z-index: 22;
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
  background: var(--paper); border: 1px solid var(--hair);
  padding: 10px 13px;
}
.lg-item { display: inline-flex; align-items: center; gap: 8px; }
.lg-item span { font-family: var(--font-body); font-size: 11px; color: var(--sec); white-space: nowrap; }
.lg-arrow { width: 20px; height: 0; border-top: 1.6px solid var(--sec); position: relative; top: 6px; }
.lg-arrow.dash { border-top-style: dashed; border-color: var(--mut); }
.lg-arrow.red { border-color: var(--state); }
.lg-card { width: 18px; height: 12px; border: 1px solid var(--hair); background: var(--fill); }
.lg-card.red { border-color: var(--state); border-style: dashed; background: #FCF5F4; }
.lg-card.ref { border-color: var(--ref-line); background: var(--ref-fill); border-radius: 4px; }

/* ---- Provenance popover (by Summary) ---- */
.prov-btn {
  width: 30px; height: 30px; padding: 0; line-height: 1;
  font-family: var(--font-mono); font-style: italic; font-size: 13px;
}
#provPop {
  position: absolute; top: calc(var(--top-h) + 6px); right: 14px; z-index: 70;
  width: 300px; background: var(--ink); color: #F3F3EF;
  font-family: var(--font-body); font-size: 12px; line-height: 1.5;
  padding: 12px 14px;
}
#provPop.is-hidden { display: none; }
#provPop:after {
  content: ""; position: absolute; top: -6px; right: 16px;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid var(--ink);
}

/* ---- Tooltip ((i) quick explain) ---- */
#tooltip {
  position: absolute; z-index: 50; max-width: 250px;
  background: var(--ink); color: #F5F5F2;
  font-family: var(--font-body); font-weight: 500; font-size: 12px; line-height: 1.4;
  padding: 8px 10px; pointer-events: none;
  opacity: 0; transform: translateY(2px); transition: opacity .12s, transform .12s;
}
#tooltip.is-on { opacity: 1; transform: translateY(0); }

/* ============================================================
   Detail panel
   ============================================================ */
#panel {
  position: fixed; top: 0; right: 0; height: 100%; width: var(--panel-w);
  max-width: 92vw;
  background: var(--paper); border-left: 1px solid var(--hair);
  transform: translateX(100%); transition: transform .22s ease;
  z-index: 60; display: flex; flex-direction: column;
}
#panel.is-open { transform: translateX(0); }
.panel-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--hair); }
.panel-id { font-family: var(--font-mono); font-size: 11px; color: var(--mut); margin-bottom: 6px; }
.panel-id .s-tag { color: var(--state); }
.panel-id .ref-tag { color: var(--ref-ink); }
.panel-name {
  font-family: var(--font-head); font-weight: 800; font-size: 22px;
  line-height: 1.08; letter-spacing: -.01em; color: var(--ink);
}
.panel-kind { font-family: var(--font-body); font-weight: 500; font-size: 12px; color: var(--mut); margin-top: 7px; }
.panel-close {
  position: absolute; top: 16px; right: 18px;
  border: 1px solid var(--hair); background: var(--fill);
  width: 26px; height: 26px; color: var(--sec); font-size: 14px; line-height: 1;
}
.panel-close:hover { border-color: var(--ink); color: var(--ink); }
.panel-body { padding: 4px 24px 34px; overflow-y: auto; }

/* What / Why / How */
.wwh { margin-top: 18px; }
.wwh-label {
  font-family: var(--font-mono); font-size: 10px; color: var(--mut);
  margin-bottom: 5px;
}
.wwh p {
  font-family: var(--font-body); font-size: 14px; line-height: 1.55; color: var(--sec);
  margin: 0;
}
.wwh p strong { color: var(--ink); font-weight: 600; }

/* Specs (compact field list: Knowledge collections, retrieval model) */
.specs-list { margin-top: 18px; border-top: 1px solid var(--hair-2); }
.spec-row {
  display: grid; grid-template-columns: 116px 1fr; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--hair-2);
}
.spec-k { font-family: var(--font-mono); font-size: 10px; color: var(--mut); line-height: 1.5; }
.spec-v { font-family: var(--font-body); font-size: 13px; line-height: 1.5; color: var(--sec); }
.spec-v strong { color: var(--ink); font-weight: 600; }

.panel-detail { margin-top: 16px; }
.panel-detail p { font-family: var(--font-body); font-size: 14px; line-height: 1.55; color: var(--sec); margin: 0 0 12px; }
.panel-detail strong { color: var(--ink); font-weight: 600; }

.panel-section-h {
  font-family: var(--font-mono); font-size: 10px; color: var(--mut);
  margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--hair-2);
}

/* Equations (enlarged, centered) */
.eq-block { display: flex; flex-direction: column; gap: 12px; }
.eq-row {
  background: var(--fill); border: 1px solid var(--hair-2);
  padding: 20px 14px; overflow: hidden; text-align: center;
}
.eq-row .katex { font-size: 1.9em; color: var(--ink); }
.eq-cap { font-family: var(--font-body); font-size: 11.5px; color: var(--mut); margin-top: 8px; text-align: center; }

/* Projected-figure highlight */
.hl {
  font-family: var(--font-mono); font-weight: 600; color: var(--ink);
  background: linear-gradient(transparent 62%, rgba(220,199,156,.55) 0);
  padding: 0 1px; white-space: nowrap;
}

/* Tools section */
.tools-list { display: flex; flex-direction: column; gap: 12px; }
.tool-item { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.tool-ic { width: 30px; height: 30px; }
.tool-ic svg, .tool-ic img { width: 100%; height: 100%; display: block; object-fit: contain; }
.tool-body .t-name { font-family: var(--font-body); font-weight: 700; font-size: 12.5px; color: var(--ink); }
.tool-body .t-why { font-family: var(--font-body); font-size: 12.5px; line-height: 1.5; color: var(--sec); margin-top: 2px; }

/* Example block */
.panel-example {
  font-family: var(--font-body); font-size: 13px; line-height: 1.55; color: var(--sec);
  background: var(--fill-2); border-left: 2px solid var(--ref-line); padding: 10px 13px;
}
.panel-example strong { color: var(--ink); font-weight: 600; }

/* ---- Chart node + projection cards ---- */
.node.k-chart { padding: 14px 16px 12px; cursor: default; background: var(--fill); }
.node.k-chart .chart-title { font-family: var(--font-body); font-weight: 700; font-size: 13px; color: var(--ink); margin-bottom: 2px; }
.node.k-chart .chart-sub { font-family: var(--font-body); font-size: 11px; color: var(--mut); margin-bottom: 8px; }
.chart-svg { display: block; }
.chart-svg .c-axis { stroke: var(--hair); stroke-width: 1; }
.chart-svg .c-bound { stroke: var(--state); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-svg .c-bound-label { font-family: var(--font-mono); font-size: 10px; fill: var(--state); }
.chart-svg .c-xlabel, .chart-svg .c-ylabel { font-family: var(--font-mono); font-size: 10px; fill: var(--mut); }
.chart-svg .c-line { fill: none; stroke-width: 2; }
.chart-svg .c-dot { stroke: var(--paper); stroke-width: 1.5; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.chart-legend .cl-item { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: 11px; color: var(--sec); cursor: pointer; user-select: none; padding: 2px 5px; border: 1px solid transparent; }
.chart-legend .cl-item:hover { border-color: var(--hair); }
.chart-legend .cl-item.cl-on { border-color: var(--ink); }
.chart-legend .cl-item.cl-off { opacity: .4; }
.chart-legend .cl-sw { width: 14px; height: 3px; border-radius: 2px; }
.chart-legend .cl-end { font-family: var(--font-mono); color: var(--ink); }

.node.k-phase { width: 210px; }
.node.k-phase .node-name { font-size: 13.5px; }
.phase-stats { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.phase-stat { }
.phase-stat .ps-v { font-family: var(--font-mono); font-weight: 600; font-size: 14px; color: var(--ink); }
.phase-stat .ps-k { font-family: var(--font-body); font-size: 10px; color: var(--mut); }

/* Connects to */
.connects-list { display: flex; flex-direction: column; gap: 2px; }
.connect {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline;
  text-align: left; width: 100%;
  padding: 9px 10px; background: var(--fill); border: 1px solid var(--hair-2);
}
.connect:hover { border-color: var(--sec); background: var(--fill-2); }
.connect .c-to { font-family: var(--font-mono); font-size: 11px; color: var(--ink); white-space: nowrap; }
.connect .c-label { font-family: var(--font-body); font-size: 12.5px; color: var(--sec); line-height: 1.35; }
.connect .c-name { font-weight: 600; color: var(--ink); }

/* Glossary */
.gloss-list { display: flex; flex-direction: column; gap: 12px; }
.gloss-item { }
.gloss-item .g-term { font-family: var(--font-body); font-weight: 700; font-size: 12.5px; color: var(--ink); }
.gloss-item .g-def { font-family: var(--font-body); font-size: 12.5px; line-height: 1.5; color: var(--sec); margin-top: 2px; }

/* ============================================================
   Landing overlay (executive summary)
   ============================================================ */
#overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(250,250,248,.86);
  display: flex; align-items: center; justify-content: center; padding: 32px;
}
#overlay.is-hidden { display: none; }
.summary-card {
  background: var(--paper); border: 1px solid var(--hair);
  max-width: 720px; width: 100%; max-height: 88vh; overflow-y: auto;
  padding: 44px 48px 40px;
}
.summary-title {
  font-family: var(--font-head); font-weight: 800; font-size: 36px;
  line-height: 1.04; letter-spacing: -.015em; color: var(--ink); margin: 0 0 22px;
}
.summary-lead {
  font-family: var(--font-body); font-weight: 400; font-size: 17px; line-height: 1.6;
  color: var(--sec); margin: 0 0 28px; padding-bottom: 28px; border-bottom: 1px solid var(--hair);
}
.summary-lead strong { color: var(--ink); font-weight: 600; }
.summary-points { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 36px; margin-bottom: 30px; }
.summary-point h4 { font-family: var(--font-body); font-weight: 700; font-size: 13px; color: var(--ink); margin: 0 0 5px; }
.summary-point p { font-family: var(--font-body); font-weight: 400; font-size: 13px; line-height: 1.5; color: var(--sec); margin: 0; }
.summary-point p strong { color: var(--ink); font-weight: 600; }
.summary-point .sp-fig { font-family: var(--font-mono); font-size: 12px; color: var(--state); display: block; margin-bottom: 3px; }
.summary-enter {
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  color: var(--paper); background: var(--ink); border: 1px solid var(--ink); padding: 12px 22px;
}
.summary-enter:hover { background: #000; }
.summary-meta { font-family: var(--font-body); font-size: 11.5px; color: var(--mut); margin-top: 22px; line-height: 1.5; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; grid-template-areas: "top" "canvas"; }
  #rail {
    position: fixed; top: var(--top-h); bottom: 0; left: 0; width: 250px;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  #rail.is-open { transform: translateX(0); box-shadow: 0 0 0 100vmax rgba(26,26,31,.28); }
  .rail-toggle { display: inline-flex; }
  .summary-points { grid-template-columns: 1fr; gap: 16px; }
  .summary-title { font-size: 28px; }
  .summary-card { padding: 30px 24px; }
  #legend, #viewNote { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #panel, #tooltip { transition: none; }
}
