/* 0tabs — shared styles. Brand tokens confirmed by Davian 2026-09-13:
   navy #131a2d · gold #90623b · cream #f1f0e9. Faces: DM Sans / Inter / IBM Plex Mono.
   Single theme by decision: cream ground, navy ink, gold accent — never a dark mode. */

:root {
  --navy: #131a2d;
  --gold: #90623b;
  --gold-soft: #f3e7d9;
  --gold-deep: #6b4527;
  --cream: #f1f0e9;

  --ground: var(--cream);
  --dot: #d6d3c6;
  --card: #ffffff;
  --card-edge: #ddd9cf;
  --ink: var(--navy);
  --ink-2: #3a3730;
  --muted: #6d685e;
  --faint: #9a948a;
  --line: #8c867a;
  --line-soft: #c9c4b6;
  --trigger: var(--navy);
  --trigger-ink: var(--cream);
  --panel: #ffffff;
  --shadow: 0 1px 2px rgba(19,26,45,.06), 0 8px 24px rgba(19,26,45,.10);
  --tile-s: 45%;
  --tile-l: 93%;
  --tile-ink-s: 40%;
  --tile-ink-l: 32%;
  --focus: var(--gold);
  color-scheme: light;
}

/* Page veil: shown at first paint, fades out when the map is ready; fades back in when leaving for another map. */
.veil { position: fixed; inset: 0; z-index: 100; background: var(--cream); display: grid; place-items: center; opacity: 1; transition: opacity .28s ease; pointer-events: none; }
.veil.in { pointer-events: auto; }
.veil.out { opacity: 0; }
.veil .mark { font-family: "DM Sans", Inter, sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -.02em; color: var(--navy); display: flex; align-items: baseline; gap: 2px; opacity: .9; }
.veil .mark b { color: var(--gold); }
.veil .bar { width: 120px; height: 2px; margin: 14px auto 0; background: var(--card-edge); border-radius: 1px; overflow: hidden; }
.veil .bar i { display: block; width: 40%; height: 100%; background: var(--gold); border-radius: 1px; animation: veil-slide 1s ease-in-out infinite; }
@keyframes veil-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .veil { transition: none; } .veil .bar i { animation: none; width: 100%; } }
@media print { .veil { display: none !important; } }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
a { color: inherit; }
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal; font-style: normal; font-size: 24px; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap;
  direction: ltr; -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.display { font-family: "DM Sans", Inter, system-ui, sans-serif; font-weight: 700; letter-spacing: -.02em; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

/* ---------- top bar (shared by index + map pages) ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--card-edge); background: var(--card);
}
.wordmark { font-family: "DM Sans", Inter, sans-serif; font-weight: 700; font-size: 17px; letter-spacing: -.02em; text-decoration: none; display: inline-flex; align-items: baseline; gap: 2px; }
.wordmark b { color: var(--gold); font-weight: 700; }
.wordmark small { font: 500 10.5px "IBM Plex Mono", monospace; color: var(--faint); margin-left: 8px; letter-spacing: .08em; text-transform: uppercase; }
.topbar .spacer { flex: 1; }
.topbar .iconbtn[aria-pressed="true"] { background: var(--ground); color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--card-edge); background: var(--card); color: var(--ink); cursor: pointer;
  font: 500 12.5px Inter, system-ui, sans-serif; text-decoration: none;
}
.btn:hover { border-color: var(--line); }
.btn.primary { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.btn .material-symbols-outlined { font-size: 18px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
.sidenav nav { scrollbar-width: thin; scrollbar-color: var(--line-soft) transparent; }

/* ---------- index ---------- */
.index { max-width: 1080px; margin: 0 auto; padding: 36px 20px 60px; }
.index-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; margin-bottom: 26px; }
.index-head h1 { font-family: "DM Sans", Inter, sans-serif; font-weight: 700; font-size: 34px; letter-spacing: -.025em; margin: 0 0 6px; text-wrap: balance; }
.index-head p { margin: 0; color: var(--muted); max-width: 60ch; font-size: 15px; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--card-edge); background: var(--card); min-width: 260px; }
.search input { border: 0; background: transparent; color: var(--ink); font: 400 14px Inter, system-ui, sans-serif; flex: 1; min-width: 0; }
.search input:focus { outline: none; }
.search .material-symbols-outlined { color: var(--faint); font-size: 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip { font: 500 12px/1 Inter, system-ui, sans-serif; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--card-edge); background: var(--card); color: var(--ink-2); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.mapcard { display: block; text-decoration: none; background: var(--card); border: 1px solid var(--card-edge); border-radius: 14px; padding: 18px 18px 16px; box-shadow: var(--shadow); transition: transform .12s ease; }
.mapcard:hover { transform: translateY(-2px); border-color: var(--line-soft); }
.mapcard .k { font: 500 10.5px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.mapcard h2 { font-family: "DM Sans", Inter, sans-serif; font-weight: 700; font-size: 18px; letter-spacing: -.015em; margin: 6px 0 6px; text-wrap: balance; }
.mapcard p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.mapcard .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 500 10.5px "IBM Plex Mono", monospace; padding: 3px 7px; border-radius: 5px; background: var(--ground); color: var(--muted); border: 1px solid var(--card-edge); }
.empty { color: var(--muted); padding: 40px 0; text-align: left; }

/* ---------- map page: left nav · canvas · right detail. Panels push, never overlay. ---------- */
.app { --nav-w: 248px; --panel-w: 360px; display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--panel-w); height: 100vh; overflow: hidden; transition: grid-template-columns .22s ease; }
.app.nav-collapsed { --nav-w: 60px; }
.app.panel-closed { --panel-w: 0px; }

.sidenav { background: var(--card); border-right: 1px solid var(--card-edge); display: flex; flex-direction: column; min-width: 0; overflow: hidden; position: sticky; top: 0; height: 100vh; }
.sidenav .top { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--card-edge); min-height: 56px; }
.sidenav .wordmark { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.sidenav .wordmark small { display: none; }
.iconbtn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.iconbtn:hover { background: var(--ground); color: var(--ink); }
.iconbtn .material-symbols-outlined { font-size: 20px; }
.sidenav nav { flex: 1; overflow-y: auto; padding: 10px 8px 12px; }
.sidenav .navtools { display: flex; gap: 6px; align-items: center; padding: 6px 8px 2px; font-size: 11px; color: var(--faint); }
.linkbtn { border: 0; background: transparent; padding: 2px 4px; border-radius: 4px; font: 500 11px Inter, system-ui, sans-serif; color: var(--muted); cursor: pointer; }
.linkbtn:hover { color: var(--ink); background: var(--ground); }
.sidenav .sec { margin-top: 6px; }
.sidenav .group { display: flex; align-items: center; gap: 4px; width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; font: 500 10.5px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); padding: 8px 6px 4px 4px; white-space: nowrap; overflow: hidden; border-radius: 6px; }
.sidenav .group:hover { background: var(--ground); }
.sidenav .group .chev { font-size: 18px; color: var(--muted); transition: transform .15s ease; }
.sidenav .sec.collapsed .group .chev { transform: rotate(-90deg); }
.sidenav .group .gname { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sidenav .group .count { font: 500 10px Inter, system-ui, sans-serif; color: var(--faint); letter-spacing: 0; text-transform: none; }
.sidenav .sec.collapsed .items { display: none; }
.sidenav a.item { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font: 500 13px/1.3 Inter, system-ui, sans-serif; min-width: 0; }
.sidenav a.item .material-symbols-outlined { font-size: 20px; color: var(--muted); flex: none; }
.sidenav a.item .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidenav a.item:hover { background: var(--ground); }
.sidenav a.item[aria-current="page"] { background: var(--navy); color: var(--cream); }
.sidenav a.item[aria-current="page"] .material-symbols-outlined { color: var(--gold); }
.sidenav .foot { border-top: 1px solid var(--card-edge); padding: 12px 14px; }
.legend { display: grid; gap: 7px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.legend span i { flex: none; }
.legend span b { font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.sw { width: 16px; height: 16px; border-radius: 4px; background: var(--card); border: 1.5px solid var(--line-soft); display: inline-block; }
.sw.trig { border-radius: 8px 4px 4px 8px; background: var(--trigger); border-color: var(--trigger); }
.sw.pub { border-style: dashed; border-color: var(--line); }
.sw.spine { box-shadow: 0 0 0 2px var(--gold); border-color: transparent; }
.app.nav-collapsed .sidenav .navtools, .app.nav-collapsed .sidenav .group .gname, .app.nav-collapsed .sidenav .group .count, .app.nav-collapsed .sidenav .group .chev, .app.nav-collapsed .sidenav a.item .lbl, .app.nav-collapsed .sidenav .foot, .app.nav-collapsed .sidenav .wordmark { display: none; }
.app.nav-collapsed .sidenav .group { height: 6px; padding: 0; margin: 4px 10px; border-top: 1px solid var(--card-edge); border-radius: 0; pointer-events: none; }
.app.nav-collapsed .sidenav .sec.collapsed .items { display: block; }
.app.nav-collapsed .sidenav .top { justify-content: center; padding: 12px 0; }
.app.nav-collapsed .sidenav .top .mini { display: block; }
.sidenav .top .mini { display: none; font-family: "DM Sans", Inter, sans-serif; font-weight: 700; font-size: 17px; color: var(--gold); text-decoration: none; }
.app.nav-collapsed .sidenav a.item { justify-content: center; padding: 10px 0; }

.main { min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.main .slide { display: contents; }
@media screen { .steps, .slide-foot { display: none; } }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--card-edge); background: var(--card); min-height: 56px; }
.topbar .spacer { flex: 1; }
.maphead { padding: 20px 24px 14px; }
.maphead .k { font: 500 10.5px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.maphead h1 { font-family: "DM Sans", Inter, sans-serif; font-weight: 700; font-size: 26px; letter-spacing: -.02em; margin: 4px 0 4px; text-wrap: balance; }
.maphead p { margin: 0; color: var(--muted); max-width: 70ch; }

.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; cursor: grab;
  border-top: 1px solid var(--card-edge); border-bottom: 1px solid var(--card-edge);
  background-color: var(--ground);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 22px 22px; }
.stage.dragging { cursor: grabbing; }
.stage.zoom-mode { cursor: zoom-in; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.world svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.edge { fill: none; stroke: var(--line); stroke-width: 1.6; }
.edge.soft { stroke-dasharray: 5 5; }
.edge-label { font: 500 10.5px Inter, system-ui, sans-serif; fill: var(--muted); }
.edge-label-bg { fill: var(--ground); }

.node { position: absolute; width: 150px; margin-left: -47px; text-align: center; cursor: pointer; }
.node .tile {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 12px; position: relative;
  border: 1.5px solid var(--card-edge); display: grid; place-items: center; box-shadow: var(--shadow);
  color: hsl(var(--h) var(--tile-ink-s) var(--tile-ink-l));
  background: hsl(var(--h) var(--tile-s) var(--tile-l));
  transition: transform .12s ease, box-shadow .12s ease;
}
.node .tile .material-symbols-outlined { font-size: 26px; }
.node .tile .n { position: absolute; left: -6px; top: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--card); border: 1px solid var(--card-edge); color: var(--muted); font: 500 10px/16px Inter, system-ui, sans-serif; }
.node:hover .tile, .node:focus-visible .tile { transform: translateY(-1px); }
.node:focus-visible { outline: none; }
.node:focus-visible .tile { outline: 2px solid var(--focus); outline-offset: 3px; }
.node.selected .tile { outline: 2px solid var(--ink); outline-offset: 3px; }
.node.trigger .tile { border-radius: 28px 12px 12px 28px; background: var(--trigger); color: var(--trigger-ink); border-color: var(--trigger); }
.node.public .tile { border-style: dashed; border-color: var(--line); background: var(--card); }
.node.public .tile::after { content: "public"; position: absolute; top: -7px; right: -8px; font: 500 8.5px/1 Inter, system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px 5px; color: var(--muted); }
.node.spine .tile { box-shadow: 0 0 0 2.5px var(--gold), var(--shadow); border-color: transparent; }
.node.branch .tile { background: var(--card); color: var(--ink-2); }
.node.branch .tile .material-symbols-outlined { transform: rotate(90deg); }
.node.end .tile { border-radius: 12px 28px 28px 12px; }
.node .label { margin-top: 8px; font: 500 12px/1.3 Inter, system-ui, sans-serif; color: var(--ink); text-wrap: balance; display: inline-block; padding: 0 4px; background: var(--ground); border-radius: 4px; }
.node .sub { margin: 2px auto 0; max-width: 140px; font: 400 10.5px/1.2 Inter, system-ui, sans-serif; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; padding: 0 4px; background: var(--ground); border-radius: 4px; width: fit-content; }
/* radial layout: hub in the middle, statement cards around it */
.node.hub { width: 200px; margin-left: -100px; margin-top: -48px; }
.node.hub .tile { width: 96px; height: 96px; border-radius: 50%; background: var(--navy); color: var(--cream); border-color: var(--navy); box-shadow: 0 0 0 6px var(--card), 0 0 0 7.5px var(--gold), var(--shadow); }
.node.hub .tile .material-symbols-outlined { font-size: 46px; }
.node.hub .label { font: 700 15px/1.25 "DM Sans", Inter, sans-serif; letter-spacing: -.01em; margin-top: 12px; }
.node.hub .sub { max-width: 200px; white-space: normal; font-style: italic; }
.node.spoke { width: 176px; min-height: 58px; margin-left: -88px; margin-top: -29px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left; background: var(--card); border: 1.5px solid var(--card-edge); border-radius: 12px; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; }
.node.spoke:hover, .node.spoke:focus-visible { transform: translateY(-1px); border-color: var(--line-soft); }
.node.spoke:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.node.spoke.selected { outline: 2px solid var(--ink); outline-offset: 3px; }
.node.spoke .material-symbols-outlined { font-size: 22px; color: var(--gold); flex: none; }
.node.spoke .txt { font: 500 12px/1.3 Inter, system-ui, sans-serif; color: var(--ink); text-wrap: balance; }
.node.spoke .n { position: absolute; left: -6px; top: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--card); border: 1px solid var(--card-edge); color: var(--muted); font: 500 10px/16px Inter, system-ui, sans-serif; }
.node.spoke.need { background: var(--navy); border-color: var(--navy); }
.node.spoke.need .txt { color: var(--cream); }
.node.spoke.need .material-symbols-outlined { color: var(--gold); }
.steplist .tile-mini.need { background: var(--navy); color: var(--gold); border-color: var(--navy); }
.steplist .tile-mini.trait { background: var(--card); color: var(--gold); }
.port { position: absolute; top: 24px; width: 8px; height: 8px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--line); }
.port.in { left: 42px; } .port.out { right: 42px; }

.controls { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 6px; z-index: 3; }
.controls button { height: 36px; min-width: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--card-edge); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; box-shadow: var(--shadow); font: 500 12px Inter, system-ui, sans-serif; white-space: nowrap; }
.controls button .material-symbols-outlined { font-size: 20px; }
.controls button[aria-pressed="true"] { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.controls .sep { width: 1px; background: var(--card-edge); margin: 6px 2px; }
/* FAB + popover (bottom-right of the canvas) */
.fab { position: absolute; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--navy); color: var(--cream); display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px rgba(19,26,45,.22); z-index: 4; }
.fab .material-symbols-outlined { font-size: 22px; transition: transform .18s ease; }
.fab[aria-expanded="true"] .material-symbols-outlined { transform: rotate(45deg); }
.popover { position: absolute; right: 16px; bottom: 70px; width: 260px; background: var(--card); border: 1px solid var(--card-edge); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 4; }
.popover[hidden] { display: none; }
.popover > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); text-align: left; font: 500 13px Inter, system-ui, sans-serif; cursor: pointer; }
.popover > button:hover { background: var(--ground); }
.popover > button .material-symbols-outlined { font-size: 19px; color: var(--muted); }
.popover > button .chev { margin-left: auto; }
.popover > button.backrow { color: var(--muted); font-size: 12px; }
.popover .legend { padding: 4px 10px 8px; }
.popover .tips { padding: 8px 10px 6px; border-top: 1px solid var(--card-edge); font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.popover kbd { font: 500 10.5px Inter, system-ui, sans-serif; padding: 1px 5px; border: 1px solid var(--card-edge); border-bottom-width: 2px; border-radius: 4px; background: var(--ground); }
.sw.branch { border-color: var(--line); background: var(--card); background-image: linear-gradient(var(--line), var(--line)); background-size: 1.5px 60%; background-repeat: no-repeat; background-position: center; }

/* right detail panel — a column, not an overlay */
.panel { background: var(--card); border-left: 1px solid var(--card-edge); min-width: 0; overflow: hidden; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.panel .head { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--card-edge); min-height: 56px; }
.panel .head .k { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel .body { padding: 18px 18px 20px; overflow-y: auto; width: 360px; flex: 1; scrollbar-width: thin; scrollbar-color: var(--line-soft) transparent; }
.panel .k { font: 500 10.5px "IBM Plex Mono", monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.panel h2 { font: 700 18px/1.3 "DM Sans", Inter, sans-serif; letter-spacing: -.015em; margin: 0 0 10px; text-wrap: balance; }
.panel .mod { display: inline-flex; align-items: center; gap: 6px; font: 500 11.5px Inter, system-ui, sans-serif; padding: 5px 9px; border-radius: 6px; margin-bottom: 14px; color: hsl(var(--h) var(--tile-ink-s) var(--tile-ink-l)); background: hsl(var(--h) var(--tile-s) var(--tile-l)); }
.panel p { margin: 0 0 12px; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.panel .lbl { font: 500 11px Inter, system-ui, sans-serif; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 6px; }
.panel .links { display: grid; gap: 6px; }
.panel .links button { display: flex; align-items: center; gap: 8px; text-align: left; font: 500 12.5px Inter, system-ui, sans-serif; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--card-edge); background: var(--ground); color: var(--ink-2); cursor: pointer; min-width: 0; }
.panel .links button .material-symbols-outlined { font-size: 16px; color: var(--muted); flex: none; }
.panel .links button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel .links button:hover { border-color: var(--line); }
.steplist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.steplist button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; min-width: 0; }
.steplist button:hover { background: var(--ground); border-color: var(--card-edge); }
.steplist .num { width: 18px; font: 500 11px Inter, system-ui, sans-serif; color: var(--gold); text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.steplist .tile-mini { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex: none; border: 1px solid var(--card-edge); color: hsl(var(--h) var(--tile-ink-s) var(--tile-ink-l)); background: hsl(var(--h) var(--tile-s) var(--tile-l)); }
.steplist .tile-mini .material-symbols-outlined { font-size: 17px; }
.steplist .tile-mini.trigger { border-radius: 15px 7px 7px 15px; background: var(--trigger); color: var(--trigger-ink); border-color: var(--trigger); }
.steplist .tile-mini.public { border-style: dashed; border-color: var(--line); background: var(--card); }
.steplist .tile-mini.branch { background: var(--card); color: var(--ink-2); }
.steplist .tile-mini.branch .material-symbols-outlined { transform: rotate(90deg); }
.steplist .tile-mini.end { border-radius: 7px 15px 15px 7px; }
.steplist .txt { min-width: 0; display: grid; }
.steplist .txt b { font: 500 13px/1.3 Inter, system-ui, sans-serif; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steplist .txt small { font: 400 11px Inter, system-ui, sans-serif; color: var(--muted); }
.scriptbtn { display: flex; align-items: center; gap: 8px; width: 100%; margin: 6px 0 4px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--card-edge); background: var(--gold-soft); color: var(--ink); font: 500 12.5px Inter, system-ui, sans-serif; cursor: pointer; text-align: left; }
.scriptbtn .material-symbols-outlined { font-size: 18px; color: var(--gold); }
.scriptbtn .chev { margin-left: auto; color: var(--muted); }
.scriptbtn:hover { border-color: var(--gold); }
.tabs { display: flex; gap: 4px; margin: -4px 0 12px; border-bottom: 1px solid var(--card-edge); }
.tabs [role="tab"] { border: 0; background: transparent; padding: 6px 10px 8px; font: 500 12.5px Inter, system-ui, sans-serif; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.say { font: 400 14px/1.6 Inter, system-ui, sans-serif; color: var(--ink); white-space: pre-line; }
.say-block { padding: 12px 0 14px; border-top: 1px solid var(--card-edge); }
.say-block:first-of-type { border-top: 0; padding-top: 4px; }
.say-k { font: 500 10.5px "IBM Plex Mono", monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.panel .src { font: 400 11px "IBM Plex Mono", monospace; color: var(--faint); word-break: break-all; border-top: 1px solid var(--card-edge); padding-top: 12px; margin-top: 16px; }

/* ---------- readable step list (screen: below canvas; print: slide 2) ---------- */
.steps { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.steps h2 { font-family: "DM Sans", Inter, sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -.02em; margin: 0 0 4px; }
.steps > p { margin: 0 0 18px; color: var(--muted); }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px 22px; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--card-edge); }
.steps li .n { font: 500 11px/24px Inter, system-ui, sans-serif; color: var(--gold); text-align: right; font-variant-numeric: tabular-nums; }
.steps li b { display: block; font-weight: 600; font-size: 13.5px; }
.steps li .m { font: 400 11.5px Inter, system-ui, sans-serif; color: var(--muted); }
.steps li p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }

@media (max-width: 900px) {
  .index-head { grid-template-columns: 1fr; }
  .app, .app.nav-collapsed, .app.panel-closed { --nav-w: 0px; --panel-w: 0px; }
  .app.panel-closed .panel { display: none; }
  .sidenav { position: fixed; left: 0; top: 0; z-index: 20; width: 260px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .app.nav-open .sidenav { transform: none; }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; max-height: 56%; z-index: 20; border-left: 0; border-top: 1px solid var(--card-edge); border-radius: 14px 14px 0 0; box-shadow: var(--shadow); }
  .panel .body { width: auto; }
  .popover { width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) { .node .tile, .mapcard { transition: none; } }

/* ---------- view-only role: no panel, no talking points, no nav tools ---------- */
html.viewer .app { --panel-w: 0px !important; }
html.viewer .panel, html.viewer .navtools { display: none !important; }
html.viewer .node { cursor: default; }
html.viewer .node:hover .tile { transform: none; }
html.viewer .hint { display: none; }

/* ---------- print: 16:9 slides (PowerPoint widescreen = 13.333in × 7.5in) ---------- */
@page { size: 13.333in 7.5in; margin: 0; }
@media print {
  :root { --ground: #f1f0e9; --dot: #d6d3c6; --card: #fff; --card-edge: #ddd9cf; --ink: #131a2d; --ink-2: #3a3730; --muted: #6d685e; --faint: #9a948a; --line: #8c867a; --line-soft: #c9c4b6; --trigger: #131a2d; --trigger-ink: #f1f0e9; --panel: #fff; --tile-s: 45%; --tile-l: 93%; --tile-ink-s: 40%; --tile-ink-l: 32%; color-scheme: light; }
  /* Pin the document to the page. Chrome otherwise measures the (clipped) 1,500–2,500px canvas layer as the
     document width and shrinks every page to fit it — that was the "everything at 66%" print. */
  html, body { width: 13.333in; height: auto; margin: 0; overflow: hidden; }
  body { background: #f1f0e9; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .app, .main { width: 13.333in; }
  .stage .world { transform: none !important; zoom: var(--print-scale, 1); left: calc(var(--print-tx, 0px) / var(--print-scale, 1)) !important; top: calc(var(--print-ty, 0px) / var(--print-scale, 1)) !important; }
  .sidenav, .topbar, .controls, .fab, .popover, .panel, .noprint { display: none !important; }
  .app { display: block; height: auto; overflow: visible; }
  .main { display: block; height: auto; overflow: visible; }
  .main .slide { display: block; }
  .steps, .slide-foot { display: block; }
  .slide-foot { display: flex; }
  .mappage { display: block; min-height: 0; }
  .slide { width: 13.333in; height: 7.5in; page-break-after: always; break-after: page; overflow: hidden; position: relative; background: #f1f0e9; }
  .slide:last-child { page-break-after: auto; break-after: auto; }
  .maphead { padding: .45in .6in 0; display: block; }
  .maphead h1 { font-size: 30px; }
  .stage { position: absolute; left: .4in; right: .4in; top: 1.7in; bottom: .5in; height: auto; min-height: 0; flex: none; border: 0; background-image: radial-gradient(#d6d3c6 1px, transparent 1.2px); }
  .maphead p { max-width: none; }
  .slide-foot { position: absolute; left: .6in; right: .6in; bottom: .28in; display: flex; justify-content: space-between; font: 500 10px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: #9a948a; }
  /* the step list flows across as many 16:9 pages as it needs */
  .slide:has(.steps) { height: auto; min-height: 7.5in; overflow: visible; }
  .steps { max-width: none; padding: .55in .6in .5in; }
  .steps ol { grid-template-columns: repeat(4, 1fr); gap: 2px 22px; }
  .steps li { padding: 5px 0; break-inside: avoid; }
  .steps li p { font-size: 10.5px; line-height: 1.4; }
  .steps li b { font-size: 11.5px; }
  .steps li .m { font-size: 10px; }
}
@media screen { .slide-foot { display: none; } }

/* ---------- nucleus layout: hubs in the middle, modules around, one line per documented connection ---------- */
.node.hub.small { width: 150px; margin-left: -75px; margin-top: -36px; }
.node.hub.small .tile { width: 72px; height: 72px; box-shadow: 0 0 0 5px var(--card), 0 0 0 6.5px var(--gold), var(--shadow); }
.node.hub.small .tile .material-symbols-outlined { font-size: 34px; }
.node.hub.small .label { font-size: 13.5px; margin-top: 8px; }
.node.spoke.innerhub { box-shadow: 0 0 0 2px var(--gold), var(--shadow); border-color: transparent; }
.node.spoke.modn .material-symbols-outlined { color: hsl(var(--h) var(--tile-ink-s) var(--tile-ink-l)); background: hsl(var(--h) var(--tile-s) var(--tile-l)); border-radius: 8px; padding: 5px; font-size: 20px; }
/* line colors by what travels along them */
:root { --e-write: #131a2d; --e-read: #8c867a; --e-email: #90623b; --e-notify: #b0483a; --e-link: #6f8fb5; --e-schedule: #3b7a70; }
.edge.t-write { stroke: var(--e-write); stroke-width: 1.6; }
.edge.t-read { stroke: var(--e-read); stroke-width: 1.2; stroke-dasharray: 4 4; }
.edge.t-email { stroke: var(--e-email); stroke-width: 1.5; }
.edge.t-notify { stroke: var(--e-notify); stroke-width: 1.3; stroke-dasharray: 2 3; }
.edge.t-link { stroke: var(--e-link); stroke-width: 1.1; stroke-dasharray: 1 4; stroke-linecap: round; }
.edge.t-schedule { stroke: var(--e-schedule); stroke-width: 1.3; stroke-dasharray: 8 4; }
.world .edge { opacity: .55; }
.edge.ring { opacity: .4; }
.world.focus .edge { opacity: .07; }
.world.focus .edge.lit { opacity: 1; stroke-width: 2.2; }
@media print { .world.focus .edge { opacity: 1; } }
.steplist .tile-mini.hub { background: var(--navy); color: var(--gold); border-color: var(--navy); border-radius: 50%; }
.panel .erow { align-items: flex-start; }
.panel .erow .sw { flex: none; margin-top: 5px; }
.panel .erow span:last-child { display: flex; flex-direction: column; white-space: normal; }
.panel .erow .ty { font: 500 9.5px "IBM Plex Mono", monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-style: normal; margin-left: 4px; }
.panel .erow small { font-weight: 400; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.sw.t-write { background: var(--e-write); } .sw.t-read { background: var(--e-read); } .sw.t-email { background: var(--e-email); }
.sw.t-notify { background: var(--e-notify); } .sw.t-link { background: var(--e-link); } .sw.t-schedule { background: var(--e-schedule); }
.panel .erow .sw, .legend .sw.line { width: 14px; height: 3px; border-radius: 2px; border: 0; display: inline-block; }

/* ---------- Present: the room's version ---------- */
html.present .sidenav, html.present .panel, html.present .controls, html.present .fab, html.present .popover, html.present .maphead { display: none !important; }
html.present .app { grid-template-columns: minmax(0, 1fr) !important; }
html.present .topbar { background: transparent; border-bottom: 0; position: absolute; right: 0; top: 0; z-index: 5; padding: 12px 16px; min-height: 0; }
html.present .topbar #navToggle, html.present .topbar #panelToggle, html.present .topbar #printpage { display: none; }
html.present .topbar #presentToggle { opacity: .35; }
html.present .topbar #presentToggle:hover { opacity: 1; }
html.present .stage { border: 0; }
html.present .world { transition: transform .45s cubic-bezier(.2,.7,.2,1); }
html.present .node { transition: opacity .3s ease, transform .3s ease; }
.world.present-focus .node.present-dim { opacity: .28; }
.world.present-focus .node.present-on { opacity: 1; }
.world.present-focus .node.present-on .tile, .world.present-focus .node.present-on.spoke, .world.present-focus .node.present-on.hub .tile { outline: 3px solid var(--gold); outline-offset: 5px; }
.world.present-focus .node.present-on .label, .world.present-focus .node.present-on .txt { color: var(--ink); }
.world.present-focus .edge { opacity: .35; }
.present-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 22px 8vw 26px; background: linear-gradient(to top, var(--cream) 78%, rgba(241,240,233,0)); cursor: pointer; }
.present-cap .k { font: 500 11px "IBM Plex Mono", monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.present-cap h2 { font: 700 34px/1.15 "DM Sans", Inter, sans-serif; letter-spacing: -.02em; color: var(--ink); margin: 0 0 10px; text-wrap: balance; }
.present-cap p { font: 400 22px/1.45 Inter, system-ui, sans-serif; color: var(--ink-2); margin: 0; max-width: 60ch; }
.present-cap .hint { position: absolute; right: 8vw; bottom: 14px; font: 500 11px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
@media (max-width: 900px) { .present-cap h2 { font-size: 24px; } .present-cap p { font-size: 17px; } }
@media print { .present-cap { display: none !important; } }

/* ---------- their view: the audience toggle, hidden maps, the panel's room voice ---------- */
.sidenav .navtools .grow { flex: 1; }
.audswitch { width: 30px; height: 16px; border-radius: 999px; border: 1px solid var(--line-soft); background: var(--ground); position: relative; cursor: pointer; padding: 0; flex: none; }
.audswitch i { position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--faint); transition: left .15s ease, background .15s ease; }
.audswitch[aria-checked="true"] { background: var(--navy); border-color: var(--navy); }
.audswitch[aria-checked="true"] i { left: 16px; background: var(--gold); }
.sidenav a.item { position: relative; }
.sidenav a.item .eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--faint); cursor: pointer; display: none; padding: 0; }
.sidenav a.item .eye .material-symbols-outlined { font-size: 16px; }
.sidenav a.item:hover .eye, .sidenav a.item.hiddenmap .eye { display: grid; place-items: center; }
.sidenav a.item .eye:hover { background: var(--card-edge); color: var(--ink); }
.sidenav a.item[aria-current="page"] .eye { color: var(--cream); }
.sidenav a.item.hiddenmap { opacity: .45; }
.app.nav-collapsed .sidenav .eye { display: none !important; }
html.audience .sidenav a.item.hiddenmap { display: none; }
html.audience .panel .src { display: none; }
html.audience .panel .scriptbtn { display: none; }
