:root {
  /* Cloudflare console palette: white canvas, hairline rules, orange rationed to the action. */
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --hairline: #ededed;
  --border: #d9d9d9;
  --fg: #1d1f20;
  --muted: #717174;
  --accent: #f6821f;
  --accent-hover: #e2700b;
  --accent-press: #d9700f;
  --accent-text: #c2670f;
  --accent-soft: #fdf3e7;
  --accent-dim: rgba(246, 130, 31, .3);
  --ring: rgba(246, 130, 31, .2);
  --link: #0051c3;
  --warn: #8a6d1b;
  --warn-soft: #fcf3d6;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --veil: rgba(255, 255, 255, .92);

  --c-eth: #7c3aed;
  --c-arp: #0f766e;
  --c-ip: #1d4ed8;
  --c-tcp: #c2620a;
  --c-udp: #a16207;
  --c-dns: #0e7490;
  --c-dhcp: #9333ea;
  --c-http: #15803d;
  --c-ospf: #4338ca;
  --c-bgp: #be123c;
}

/* The second palette. Which one is in force is `data-theme` on <html>, written by src/ui.js before
   the first frame — "auto" there resolves to whichever the system reports. `color-scheme` follows so
   scrollbars and native widgets take the same side. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15171a;
  --surface: #262a2e;
  --surface-2: #1e2226;
  --hairline: #2e3338;
  --border: #3a3f44;
  --fg: #e4e6e7;
  --muted: #9ba1a6;
  --accent-text: #faad3f;
  --accent-soft: rgba(246, 130, 31, .14);
  --ring: rgba(246, 130, 31, .25);
  --link: #7aa7ff;
  --warn: #e8c56a;
  --warn-soft: rgba(246, 197, 73, .14);
  --veil: rgba(38, 42, 46, .92);
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  --c-eth: #a78bfa;
  --c-arp: #5eead4;
  --c-ip: #7fa9ff;
  --c-tcp: #f0a868;
  --c-udp: #d8b45a;
  --c-dns: #67d3e8;
  --c-dhcp: #c99cf5;
  --c-http: #74d99f;
  --c-ospf: #a5b4fc;
  --c-bgp: #fb7185;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  box-shadow: 0 0 0 3px var(--ring);
}

/* ---------- top bar ---------- */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 20px;
  min-height: 56px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.brand {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.brand::before {
  content: '';
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: linear-gradient(180deg, var(--accent), #faad3f);
}
.tagline { align-self: center; flex: 1; color: var(--muted); font-size: 13px; min-width: 200px; }
.phases { display: flex; gap: 6px; flex-wrap: wrap; align-items: stretch; }

/* the walkthrough and theme switchers: recessed segmented controls, as the console groups its own
   lists */
#scenarios, #themes { align-self: center; gap: 3px; padding: 3px; border-radius: 8px; background: var(--surface-2); }
#scenarios .pip, #themes .pip { background: transparent; border-color: transparent; }
#scenarios .pip.active, #themes .pip.active {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border), var(--shadow);
  color: var(--fg);
}

/* the chapters: underline tabs, orange rule under the one that is open */
#phases { gap: 18px; }
.pip {
  font: 600 13px var(--sans);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease;
}
.pip:hover { color: var(--fg); }
.pip.active { color: var(--fg); border-bottom-color: var(--accent); }
#scenarios .pip, #themes .pip { padding: 5px 12px; border-radius: 6px; border-bottom: 0; }
#scenarios .pip.active, #themes .pip.active { color: var(--fg); }

/* ---------- layout: the canvas is everything under the top bar ---------- */
.app { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* ---------- the board: the canvas is the page, the chrome floats on it ---------- */
.board {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(var(--hairline) 1px, transparent 1.2px);
  background-size: 18px 18px;
}
.app.drawer-open .board { margin-right: min(480px, 92vw); }
.board-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--hairline);
  background: var(--veil);
  flex-wrap: wrap;
}
.transport { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.board-bar button { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.board-bar button.primary { min-width: 92px; }
.board-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  cursor: grab;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.board-scroll::-webkit-scrollbar { display: none; }
.board.dragging .board-scroll { cursor: grabbing; }
/* The map floats in this canvas, sized by src/ui.js to be a little bigger than the view — that
   slack is what a drag pans over, at any zoom. It stays static so the absolutely placed map
   measures itself against the view instead. */
.board-canvas { position: static; }
#topology { position: absolute; left: 0; top: 0; width: 100%; height: auto; display: block; }

/* the step's own figures sit beside the map, not in the drawer: the messages keep moving and the
   table stays readable at the same time, and the map is fitted into what is left. On the left,
   where the closed-drawer tab in the top right corner cannot sit over it. */
.board-stage { flex: 1 1 auto; min-height: 0; display: flex; }
.board-stage > .board-scroll { min-width: 0; }
.board-table {
  flex: 0 0 clamp(260px, 33%, 430px);
  min-width: 0;
  overflow: auto;
  padding: 12px 14px;
  border-right: 1px solid var(--hairline);
  background: var(--surface);
}
.board-table[hidden] { display: none; }
.board-table h3 {
  margin: 0 0 8px;
  font: 600 12.5px var(--sans);
  color: var(--muted);
}
.board-table-from { margin: 0 0 8px; font: 11.5px var(--sans); color: var(--muted); }
/* a notch smaller than the field-by-field tables: the panel shares the screen with the map */
.board-table table.fields { font-size: 12px; }
.board-table table.fields th, .board-table table.fields td { padding: 4px 8px 4px 0; }

.layer-rail { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 3px; }
.layer {
  padding: 3px 9px;
  border-radius: 6px;
  opacity: .45;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity .25s ease, background .25s ease;
}
.layer.active {
  opacity: 1;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.layer.active .layer-name { color: var(--accent-text); }

.board-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.board-tools button { padding: 3px 9px; font-size: 13px; border-radius: 6px; }
.zoom-level { min-width: 36px; text-align: center; font: 11px var(--mono); color: var(--muted); }

/* the one line of narration: the story for somebody who never opens the drawer */
.board-say {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 14px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  background: var(--veil);
  border-top: 1px solid var(--hairline);
}

/* the chapter and step number, so the visible caption always says where the story is */
.say-where {
  margin-right: 7px;
  font: 600 11.5px var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-text);
}

@media (max-width: 720px) {
  .tagline { display: none; }
  .layer { padding: 2px 8px; font-size: 12px; }
  .board-say { font-size: 13.5px; padding: 9px 12px; }
  .app.drawer-open .board { margin-right: 0; }
  .board-stage { flex-direction: column; }
  .board-table {
    order: 2;
    flex: 0 1 auto;
    max-height: 42%;
    border-right: 0;
    border-top: 1px solid var(--hairline);
  }
}

/* the packet, field by field: rows stack up as the layers wrap around the payload */
.packet-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 13px 11px;
  border-top: 1px dashed var(--border);
}
.packet-stack:empty { display: none; }
.stack-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 3px 10px;
  border-left: 3px solid var(--border);
  border-radius: 0 6px 6px 0;
  background: var(--surface-2);
  font: 12.5px/1.5 var(--mono);
  opacity: 1;
  transform: none;
  transition: opacity .2s ease, transform .2s ease;
}
.stack-row.off { opacity: 0; transform: translateY(6px); }
.stack-chip { flex: 0 0 auto; font: 600 13px var(--sans); }
.stack-fields { min-width: 0; color: var(--muted); }
.stack-row-ethernet { border-left-color: var(--c-eth); }
.stack-row-arp { border-left-color: var(--c-arp); }
.stack-row-ip { border-left-color: var(--c-ip); }
.stack-row-tcp { border-left-color: var(--c-tcp); }
.stack-row-udp { border-left-color: var(--c-udp); }
.stack-row-dns { border-left-color: var(--c-dns); }
.stack-row-dhcp { border-left-color: var(--c-dhcp); }
.stack-row-http { border-left-color: var(--c-http); }
.stack-row-ospf { border-left-color: var(--c-ospf); }
.stack-row-bgp { border-left-color: var(--c-bgp); }

.link { stroke: var(--border); stroke-width: 2; transition: opacity .3s ease, stroke .3s ease; }
.link-dashed { stroke-dasharray: 4 4; }
.link.traversed { stroke: var(--accent); stroke-width: 3.5; }
.link.unknown { opacity: .18; }
/* the interface cost the link was given, haloed in the canvas colour so the stroke under it
   cannot run through the number */
.link-cost {
  font: 9px var(--mono);
  fill: var(--muted);
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
}
.link-cost.unknown { opacity: .18; }
/* the cost of the link the packet is walking: readable as the path it is adding up */
.link-cost.traversed { fill: var(--accent); font-weight: 600; }

.node { transition: opacity .35s ease; }
.node-icon {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: stroke .3s ease, stroke-width .3s ease;
}
.node-label { font: 600 11px var(--sans); fill: var(--fg); }
.node-sub { font: 9px var(--mono); fill: var(--muted); }
/* a network on the map: a dashed boundary around the nodes that share an AS number */
.region { fill: none; stroke: var(--border); stroke-width: 1.5; stroke-dasharray: 7 5; }
.region-label { font: 600 10px var(--mono); fill: var(--muted); letter-spacing: .06em; }
.node.unknown { opacity: .18; }
.node.known { opacity: .55; }
.node.current { opacity: 1; }
.node.current .node-icon { stroke: var(--accent); stroke-width: 2.5; }
.node.current .node-label { fill: var(--accent-text); }

/* the travelling packet: one outline per header, wrapped from the inside out */
.packet { transition: transform .43s ease-in-out; }
.packet.hidden { display: none; }
.wire-rail {
  fill: var(--surface);
  fill-opacity: .92;
  stroke-width: 2.5;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity .22s ease, transform .22s cubic-bezier(.2, 1.5, .45, 1);
}
.wire-rail.off { opacity: 0; transform: scale(.72); }
.wire-rail-ethernet { stroke: var(--c-eth); }
.wire-rail-arp { stroke: var(--c-arp); }
.wire-rail-ip { stroke: var(--c-ip); }
.wire-rail-tcp { stroke: var(--c-tcp); }
.wire-rail-udp { stroke: var(--c-udp); }
.wire-rail-dns { stroke: var(--c-dns); }
.wire-rail-dhcp { stroke: var(--c-dhcp); }
.wire-rail-http { stroke: var(--c-http); }
.wire-rail-ospf { stroke: var(--c-ospf); }
.wire-rail-bgp { stroke: var(--c-bgp); }

.chip-text { font: 700 10px var(--mono); fill: var(--fg); }
.chip-line { font: 700 10px var(--mono); }
.chip-mode { text-transform: uppercase; letter-spacing: .05em; }
.chip-mode-broadcast { fill: var(--warn); }
.chip-mode-multicast { fill: var(--c-dns); }
.chip-mode-unicast { fill: var(--muted); }
.chip-mode-local { fill: var(--muted); }
.chip-ttl { fill: var(--accent-text); }
.chip-sep { fill: var(--muted); }
.chip-ttl.hidden, .chip-sep.hidden { display: none; }

/* unicast: one station reads it, so the frame traces the one link it crosses */
.link.flow {
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-dasharray: 7 7;
  animation: march .5s linear infinite;
}
@keyframes march { to { stroke-dashoffset: -14; } }

/* broadcast/multicast: more than the next station reads it, so it rings at each one */
.wave {
  fill: none;
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: ripple .9s ease-out forwards;
}
.wave-broadcast { stroke: var(--warn); }
.wave-multicast { stroke: var(--c-dns); }
@keyframes ripple {
  0% { opacity: .8; transform: scale(.4); }
  100% { opacity: 0; transform: scale(2.1); }
}

@media (prefers-reduced-motion: reduce) {
  .link.flow { animation: none; }
  .wave { display: none; }
}

.badge rect { fill: var(--accent); }
.badge text { font: 700 10px var(--mono); fill: #fff; }
.badge { animation: floatUp 1.1s ease-out forwards; }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(4px); }
  25% { opacity: 1; transform: translateY(-6px); }
  100% { opacity: 0; transform: translateY(-22px); }
}

/* ---------- the step head inside the drawer ---------- */
.eyebrow {
  margin: 0;
  display: flex;
  gap: 8px;
  font: 600 12px var(--sans);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.eyebrow .dot { opacity: .5; }
#phase { color: var(--accent-text); }
.step-head { padding-bottom: 15px; margin-bottom: 16px; border-bottom: 1px solid var(--hairline); }
.step-head .sub { margin: 7px 0 0; font-size: 17px; font-weight: 600; color: var(--fg); line-height: 1.35; }

button {
  font: 600 14px var(--sans);
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
button:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  min-width: 118px;
}
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.primary:active:not(:disabled) { background: var(--accent-press); border-color: var(--accent-press); }

/* the progress bar is the bottom edge of the canvas, one segment per step */
.ticks {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  background: var(--veil);
  border-top: 1px solid var(--hairline);
}
.tick {
  flex: 1 1 0;
  min-width: 3px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--hairline);
  transition: transform .15s ease, background .2s ease;
}
.ticks .tick:hover:not(.done):not(.current) { background: var(--border); }
.tick.done { background: var(--accent-dim); }
.tick.current { background: var(--accent); transform: scaleY(1.7); }
.tick-gap { flex: 0 0 7px; }

/* ---------- the drawer: a panel that slides over the canvas ---------- */
.drawer {
  position: absolute;
  top: 62px;
  right: 12px;
  width: auto;              /* closed, it is just the tab; [open] sets the panel width */
  overflow: hidden;
  z-index: 5;
}
.drawer summary {
  cursor: pointer;
  padding: 10px 16px;
  font: 600 13.5px var(--sans);
  color: var(--fg);
  background: var(--surface);
  list-style: none;
}
.drawer summary::-webkit-details-marker { display: none; }
.drawer summary::before { content: '▸ '; color: var(--accent-text); }
.drawer[open] summary::before { content: '▾ '; }
.drawer[open] {
  top: 0;
  right: 0;
  width: min(480px, 92vw);
  height: 100%;
  border-radius: 0;
  border-top: none;
  border-right: none;
  border-bottom: none;
  overflow-y: auto;
}
.drawer[open] summary {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
}
.drawer-body { padding: 18px 22px 30px; }

.detail { display: grid; gap: 18px; font-size: 14.5px; }
/* the field-by-field strip scrolls sideways inside the panel; without this its intrinsic width
   would widen the whole grid (and the panel) to fit it */
.detail > * { min-width: 0; }
.detail-say { margin: 0; line-height: 1.65; }
.detail-block h3 {
  margin: 0 0 8px;
  font: 600 12px var(--sans);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.detail-block ul { margin: 0; padding-left: 20px; }
.detail-block li { margin-bottom: 4px; }
.detail-note { background: var(--warn-soft); border-left: 3px solid var(--warn); border-radius: 0 8px 8px 0; padding: 11px 15px; }
.detail-note h3 { color: inherit; }
.detail-note p { margin: 0; }
.detail-analogy { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 12px 16px; }
.detail-analogy h3 { color: var(--accent-text); }
.detail-analogy p { margin: 0; font-size: 15.5px; line-height: 1.5; }
.detail-preamble { background: var(--surface-2); border-left: 3px solid var(--hairline); border-radius: 0 8px 8px 0; padding: 12px 16px; }
.detail-preamble p { margin: 0; }

/* the map's vocabulary, for a reader who does not know it yet */
.legend { border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface-2); padding: 0 13px; }
.legend summary { cursor: pointer; padding: 11px 0; font: 600 13.5px var(--sans); color: var(--fg); list-style: none; }
.legend summary::-webkit-details-marker { display: none; }
.legend summary::before { content: '▸ '; color: var(--accent-text); }
.legend[open] summary::before { content: '▾ '; }
.legend-list { margin: 0; padding: 0 0 13px; list-style: none; display: grid; gap: 6px; font-size: 13.5px; }
.legend-list li { color: var(--muted); }
.legend-name { font: 600 12.5px var(--mono); color: var(--fg); }

/* the field-by-field walk, one layer under the next, in the order the animation takes */
.packets { display: flex; flex-direction: column; gap: 7px; }
.packet-cell {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
}
.packet-cell-ethernet { border-left-color: var(--c-eth); }
.packet-cell-arp { border-left-color: var(--c-arp); }
.packet-cell-ip { border-left-color: var(--c-ip); }
.packet-cell-tcp { border-left-color: var(--c-tcp); }
.packet-cell-udp { border-left-color: var(--c-udp); }
.packet-cell-dns { border-left-color: var(--c-dns); }
.packet-cell-dhcp { border-left-color: var(--c-dhcp); }
.packet-cell-http { border-left-color: var(--c-http); }
.packet-cell-ospf { border-left-color: var(--c-ospf); }
.packet-cell-bgp { border-left-color: var(--c-bgp); }
.packet-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 11px;
  font: 600 12px var(--sans);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
}
.packet-osi { font: 400 11.5px var(--mono); color: var(--muted); text-transform: none; letter-spacing: 0; }

/* the same walk the animation takes: the cells stack in one at a time, in that order */
.walk-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 13.5px;
}
.packet-mode {
  font: 600 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface);
}
.packet-mode-broadcast { color: var(--warn); background: var(--warn-soft); }
.packet-mode-multicast { color: var(--c-dns); }
.packet-mode-unicast { color: var(--accent-text); background: var(--accent-soft); }
.packet-mode-local { color: var(--muted); }
.walk-arrow { align-self: center; color: var(--muted); transform: rotate(90deg); }
.packet-cell { animation: cellIn .3s ease-out both; animation-delay: var(--d, 0ms); }
@keyframes cellIn { from { opacity: 0; transform: translateY(7px); } }

table.fields { border-collapse: collapse; width: 100%; font: 13px var(--mono); }
table.fields th { text-align: left; font-weight: 400; color: var(--muted); padding: 6px 12px 6px 11px; vertical-align: top; white-space: normal; max-width: 46%; }
.fields-name { display: block; font-family: var(--mono); color: var(--fg); }
.fields-help { display: block; font-family: var(--sans); font-size: 11.5px; line-height: 1.3; color: var(--muted); }
table.fields td { padding: 6px 10px 6px 0; word-break: break-all; }
table.fields tr + tr th, table.fields tr + tr td { border-top: 1px solid var(--hairline); }
table.fields tr.changed td { color: var(--warn); font-weight: 700; }

/* a step's own evidence table: the first row is a header, and its cells are words, not addresses */
table.step-table thead th { color: var(--fg); font-weight: 600; }
table.step-table td { word-break: normal; }
/* These figures are read row by row and column by column, so the aside gets the strokes a table
   has: at the panel's width the field list's hairlines are invisible against the surface. */
table.step-table tr + tr th, table.step-table tr + tr td { border-top-color: var(--border); }
table.step-table thead th { border-bottom: 1px solid var(--border); }
table.step-table tr:last-child th, table.step-table tr:last-child td { border-bottom: 1px solid var(--border); }
table.step-table th:first-child, table.step-table td:first-child { border-right: 1px solid var(--border); }
table.step-table th:nth-child(2), table.step-table td:nth-child(2) { padding-left: 9px; }

ul.cites { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; font: 12px var(--mono); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* last, so it wins over the panel rules above: on a phone the panel is a sheet under the canvas */
@media (max-width: 720px) {
  .drawer[open] {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    height: min(72dvh, 620px);
    border-radius: 12px 12px 0 0;
    border-top: 1px solid var(--hairline);
  }
}
