/* The Stage Editor's look. Hangar signage over a plotting table: Bahnschrift (Windows' own DIN) for what you operate. Two themes, light and
   dark (the owner's request of 2026-11-07), both set on <html data-theme> by theme.js before anything draws. The frame round the map takes
   the difficulty's colour, so you always know which difficulty you are looking at; hazard stripes mean only "this isn't saved". Text is sized
   to be read at a glance (the same request). No outside fonts or files: this page runs on this PC alone. */
:root {
  --ink: #1b2a38;
  --ink-soft: #4f6172;
  --rail: #22313f;
  --rail-line: #3a4b5b;
  --rail-hover: #4b5f72;
  --rail-ink: #dfe7ee;
  --rail-soft: #a9b8c5;
  --panel: #e9eef2;
  --panel-line: #cfd8df;
  --hover: #dbe3e9;
  --chosen: #d9e4eb;
  --table: #fbfcfd;
  --float: rgba(255, 255, 255, .94);
  --float-hover: #fff;
  --notice: #fff3cf;
  --notice-ink: #1b2a38;
  --select: #0091cf;
  --on-select: #fff;
  --normal: #0091cf;
  --hard: #e08a00;
  --hell: #d2342b;
  --hazard: #ffb400;
  --go: #1f7a4a; /* only: this goes out to the real players */
  --go-hover: #186139;
  --bad: #b3261e;
  --frame: var(--normal);
  /* A room's colour in the list on the left (docs/plans/STAGE_EDITOR_ADDITIONS.md D2212): teal, violet, pink, lime, sand, then again. Each holds
     4.6:1 or more, measured, on the list, a hovered row and an open stage's row, in each theme */
  --room-1: #096f65;
  --room-2: #7648c5;
  --room-3: #b02f72;
  --room-4: #476e05;
  --room-5: #746137;
  --sign: "Bahnschrift", "DIN Alternate", "Arial Narrow", sans-serif;
  --body: "Segoe UI", system-ui, sans-serif;
  --data: "Cascadia Mono", "Consolas", monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #e8eef4;
  --go: #2f9e63;
  --go-hover: #39b171;
  --bad: #ff9c94;
  --ink-soft: #a6b6c4;
  --rail: #0e151c;
  --rail-line: #26333f;
  --rail-hover: #364656;
  --rail-ink: #dfe7ee;
  --rail-soft: #94a5b4;
  --panel: #171f27;
  --panel-line: #2f3d4a;
  --hover: #24303b;
  --chosen: #2a3945;
  --table: #0f151b;
  --float: rgba(23, 31, 39, .94);
  --float-hover: #24303b;
  --notice: #3a3115;
  --notice-ink: #ffe9ad;
  --select: #0a84bd;
  --normal: #2aa8e0;
  --hard: #f0a020;
  --hell: #ef5148;
  --room-1: #5ed4c8;
  --room-2: #b08eff;
  --room-3: #ff6eb4;
  --room-4: #a9d65c;
  --room-5: #caa968;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  height: 100vh;
  font: 16px/1.4 var(--body);
  color: var(--ink);
  background: var(--panel);
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--select); outline-offset: 1px; }

/* The rail */
.rail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 9px 16px;
  background: var(--rail);
  color: #fff;
}
.rail h1 { margin: 0; font: 600 24px/1 var(--sign); letter-spacing: .01em; }
.switch-group { display: flex; align-items: center; gap: 8px; }
.switch-label { font: 400 14px/1 var(--sign); color: var(--rail-soft); }
.switch { display: flex; gap: 2px; }
.switch button {
  padding: 7px 14px;
  border: 0;
  background: var(--rail-line);
  color: var(--rail-ink);
  font: 600 16px/1 var(--sign);
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
  margin-right: -5px;
}
.switch button:hover { background: var(--rail-hover); }
.switch button.on { background: var(--select); color: var(--on-select); }
.switch button.on.d-hard { background: var(--hard); }
.switch button.on.d-hell { background: var(--hell); }
.pips { margin-right: 6px; font-size: 8px; vertical-align: 2px; letter-spacing: 1px; }
/* Add to Duo and Squad too (docs/plans/STAGE_EDITOR_ADDITIONS.md D2206): a box ticked or not, beside the team it carries Solo's adds to */
.also { padding: 6px 10px; border: 1px solid var(--rail-line); background: transparent; color: var(--rail-ink); font: 600 14px/1 var(--sign); }
.also::before { content: "\2610"; margin-right: 6px; }
.also[aria-pressed="true"] { background: var(--rail-line); color: #fff; }
.also[aria-pressed="true"]::before { content: "\2611"; }
.also:hover { background: var(--rail-hover); }
.meets { margin: 0 0 0 auto; font: 400 16px/1.2 var(--sign); color: var(--rail-ink); }
.meets b { font-weight: 700; color: #fff; }

/* The bar: whether this is saved. Hazard stripes mean only "this isn't saved" */
.bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--panel-line);
  background: var(--panel);
}
.bar.unsaved {
  padding-left: 44px;
  color: var(--notice-ink);
  background:
    repeating-linear-gradient(135deg, var(--hazard) 0 8px, #1b2a38 8px 16px) left / 32px 100% no-repeat,
    var(--notice);
}
.status { flex: 1 1 320px; margin: 0; font: 400 16px/1.3 var(--sign); }
.differs { font: 400 14px/1.2 var(--sign); }
.bar button, .tools button, .dialog-buttons button, .chooser button {
  padding: 6px 13px;
  border: 1px solid var(--ink-soft);
  background: var(--table);
  color: var(--ink);
  font: 400 15px/1.2 var(--sign);
}
.bar button:hover:not(:disabled), .tools button:hover:not(:disabled), .dialog-buttons button:hover, .chooser button:hover { background: var(--hover); }
.bar button[aria-pressed="true"], .bar button[aria-pressed="true"]:hover:not(:disabled) { color: var(--on-select); background: var(--select); border-color: var(--select); }
button:disabled { opacity: .45; cursor: default; }
.bar button.primary, .tools button.primary, .dialog-buttons button.primary {
  border-color: var(--select);
  background: var(--select);
  color: var(--on-select);
  font-weight: 600;
}
.bar button.primary:hover:not(:disabled), .tools button.primary:hover:not(:disabled), .dialog-buttons button.primary:hover { background: var(--normal); }
.tools button.on { background: var(--select); border-color: var(--select); color: var(--on-select); }
.tools button.on:hover:not(:disabled) { background: var(--select); } /* (the hover above outranks .on, which left a pressed choice's white words on the light hover grey) */
.tools button.danger { border-color: var(--hell); color: var(--hell); }
.tools button.danger:hover:not(:disabled) { background: var(--hell); color: #fff; }

/* The desk */
.desk {
  position: relative;
  display: grid;
  grid-template-columns: var(--tree-width, 290px) minmax(0, 1fr) var(--panel-width, 350px);
  min-height: 0;
}
/* The handle on each edge of the map (D1853): its line lights up under the cursor, and the map takes the room the column gives up */
.resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 11px;
  margin-left: -5px;
  cursor: col-resize;
  touch-action: none;
}
.resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 5px; width: 1px; }
.resizer:hover::after, .resizer:focus-visible::after, .resizer.dragging::after { left: 4px; width: 3px; background: var(--select); }
.resizer:focus-visible { outline: none; }
#resize-tree { left: var(--tree-width, 290px); }
#resize-panel { left: calc(100% - var(--panel-width, 350px)); }
@media (pointer: coarse) { .resizer { width: 28px; margin-left: -14px; } .resizer::after { left: 13px; } .resizer:hover::after, .resizer:focus-visible::after, .resizer.dragging::after { left: 12px; } }
body.resizing { cursor: col-resize; user-select: none; }

.tree {
  overflow: hidden auto;
  padding: 0 0 24px;
  border-right: 1px solid var(--panel-line);
}
.tree h2 { margin: 8px 12px 6px; font: 600 18px/1.2 var(--sign); }
/* The list's top (docs/plans/STAGE_EDITOR_ADDITIONS.md D2213): the chapter, then Expand all and Collapse all, in reach however far the list scrolls */
.tree-head { position: sticky; top: 0; z-index: 1; display: flow-root; padding: 8px 0 7px; background: var(--panel); border-bottom: 1px solid var(--panel-line); }
.tree-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 12px; }
.tree-tools button { padding: 4px 10px; border: 1px solid var(--ink-soft); background: var(--table); color: var(--ink); font: 400 14px/1.2 var(--sign); }
.tree-tools button:hover { background: var(--hover); }
@media (pointer: coarse) { .tree-tools button { min-height: 44px; } }
.tree ul { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 5px 12px;
  border: 0;
  background: none;
  text-align: left;
}
.row:hover { background: var(--hover); }
.row.on { background: var(--select); color: var(--on-select); }
.row .n { margin-left: auto; font: 14px/1.4 var(--data); font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.row.on .n { color: var(--on-select); }
.row.stage { font: 600 16px/1.5 var(--sign); }
.row.stage.open { background: var(--hover); }
.row.scene { padding-left: 24px; font: 15px/1.5 var(--data); }
.row.room { padding-left: 36px; font: 400 16px/1.4 var(--sign); }
.row.round { padding-left: 50px; font: 400 15px/1.4 var(--sign); }
/* The eye beside a round (D1898): its own button, as a button can't hold one; the row's number stays clear of it */
.with-eye { position: relative; }
.tree .row .n { margin-right: 28px; } /* (every row's count, so the numbers stay one column above and below the eyes) */
.eye { position: absolute; top: 50%; right: 8px; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; transform: translateY(-50%); color: var(--ink-soft); background: none; border: 0; border-radius: 3px; cursor: pointer; }
.eye svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.eye:hover { color: var(--ink); background: var(--hover); }
.eye.shut { color: var(--ink); }
.row.on + .eye { color: var(--on-select); }
.row.on + .eye:hover { color: var(--on-select); background: rgba(255, 255, 255, .2); }
.row.on + .eye:focus-visible { outline-color: var(--on-select); } /* (the ring's own colour is the selected row's) */
/* On a touch screen each round's row is as tall as its eye, so one eye can't lie over the next */
@media (pointer: coarse) { .eye { width: 44px; height: 44px; right: 2px; } .tree .row .n { margin-right: 44px; } .with-eye .row { min-height: 44px; align-items: center; } }
/* The arrow on a stage's, map's or room's row (D2213): it opens or folds that one alone, in the eyes' column, pointing down while folded and up while
   open. A row's own click opens nothing (docs/milestones/MILESTONE_7.md D2171) but a stage drawing one of several maps', which has no one place to show */
.with-fold { position: relative; }
.fold { position: absolute; top: 50%; right: 8px; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; transform: translateY(-50%); color: var(--ink-soft); background: none; border: 0; border-radius: 3px; cursor: pointer; }
.fold svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fold[aria-expanded="true"] svg { transform: rotate(180deg); }
.fold:hover { color: var(--ink); background: var(--hover); }
.row.on + .fold { color: var(--on-select); }
.row.on + .fold:hover { color: var(--on-select); background: rgba(255, 255, 255, .2); }
.row.on + .fold:focus-visible { outline-color: var(--on-select); }
.tree .row.stage { padding-right: 40px; white-space: nowrap; } /* (its words stay clear of its arrow; in a narrow list its name stays whole and what it draws wraps) */
.tree .row.stage .draws { white-space: normal; }
@media (pointer: coarse) { .fold { width: 44px; height: 44px; right: 2px; } .with-fold .row { min-height: 44px; align-items: center; } .tree .row.stage { padding-right: 50px; } }
/* A room's colour (D2212): its name and its rounds' names, and a stripe down their left edge that joins them; on the chosen row the words take the
   chosen row's own colour and the stripe an edge of it */
.tone-1 { --room: var(--room-1); }
.tone-2 { --room: var(--room-2); }
.tone-3 { --room: var(--room-3); }
.tone-4 { --room: var(--room-4); }
.tone-5 { --room: var(--room-5); }
.tree .row.room, .tree .row.round { position: relative; color: var(--room); }
.tree .row.room::before, .tree .row.round::before { content: ""; position: absolute; top: 0; bottom: 0; left: 26px; width: 3px; background: var(--room); }
.tree .row.room.on, .tree .row.round.on { color: var(--on-select); }
.tree .row.room.on::before, .tree .row.round.on::before { box-shadow: 0 0 0 1px var(--on-select); }
.row .draws { font: 400 14px/1.4 var(--body); color: var(--ink-soft); }
.row.on .draws { color: var(--on-select); }
/* A round that brings the next one early (docs/plans/EARLY_ROUNDS_AND_CHAT.md D2190): two arrows and how many of its own must fall. It takes ink alone, as every colour on this page means something else */
.row .early-mark { display: inline-flex; align-items: center; align-self: center; gap: 1px; white-space: nowrap; font: 600 13px/1 var(--data); color: var(--ink-soft); }
.row .early-mark svg { width: 13px; height: 13px; fill: currentColor; }
.row.on .early-mark { color: var(--on-select); }

/* The map. Its frame says which difficulty this is */
.table {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--table);
  box-shadow: inset 0 0 0 3px var(--frame);
  overflow: hidden;
}
.table[data-difficulty="hard"] { --frame: var(--hard); }
.table[data-difficulty="hell"] { --frame: var(--hell); }
#map { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#map.over { cursor: move; }
#map.adding { cursor: crosshair; }
#map.dragging { cursor: grabbing; }
.map-tools { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; pointer-events: none; }
.map-tools > * { pointer-events: auto; }
.adding-note {
  margin: 0;
  padding: 5px 12px;
  background: var(--select);
  color: var(--on-select);
  font: 400 15px/1.3 var(--sign);
}
.chooser {
  position: absolute;
  z-index: 3;
  width: 300px;
  padding: 10px;
  border: 1px solid var(--ink-soft);
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.chooser p { margin: 0 0 8px; font: 600 15px/1.3 var(--sign); }
.chooser div { display: grid; gap: 4px; }
.chooser button { text-align: left; }
.map-tools button, .limit {
  padding: 5px 12px;
  border: 1px solid var(--panel-line);
  background: var(--float);
  font: 400 15px/1.3 var(--sign);
}
.map-tools button:hover { background: var(--float-hover); border-color: var(--ink-soft); }
.map-tools button[aria-pressed="true"], .map-tools button[aria-pressed="true"]:hover { background: var(--select); border-color: var(--select); color: var(--on-select); }
.limit { display: flex; align-items: center; gap: 8px; }
.limit input { width: 160px; }
.limit output { font: 14px/1 var(--data); min-width: 50px; }
.key {
  position: absolute;
  left: 12px;
  bottom: 34px;
  max-width: calc(100% - 24px);
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  padding: 5px 10px;
  background: var(--float);
  font: 14px/1.5 var(--body);
  pointer-events: none;
}
.key span { display: inline-flex; align-items: center; gap: 5px; }
.key i { display: inline-block; width: 13px; height: 13px; border: 1px solid rgba(128, 128, 128, .6); }
.where {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  margin: 0;
  font: 14px/1.4 var(--data);
  color: var(--ink-soft);
  pointer-events: none;
}
.tip {
  position: absolute;
  z-index: 2;
  max-width: 320px;
  padding: 5px 10px;
  background: var(--rail);
  color: #fff;
  font: 400 15px/1.35 var(--sign);
  pointer-events: none;
}
.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font: 400 24px/1 var(--sign);
  color: var(--ink-soft);
  pointer-events: none;
}

/* The panel */
.panel {
  min-width: 0;
  overflow: hidden auto; /* (up and down only, whatever it shows, D1853: what's in it fits its width) */
  padding: 0 16px 24px;
  border-left: 1px solid var(--panel-line);
}
.panel:focus { outline: none; } /* (focus rests on the panel after a redraw: not a control, so no ring) */
.panel > * { max-width: 100%; }
.panel > h2:first-child { margin-top: 14px; } /* (the first screen has no bar over it) */
/* Its back arrow and its close, on every screen but the first (D1855): they stay at the top as the panel scrolls */
.panel-nav {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  max-width: none;
  margin: 0 -16px 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--panel-line);
  background: var(--panel);
}
.panel-nav button { min-width: 34px; height: 30px; padding: 0 8px; border: 1px solid var(--ink-soft); background: var(--table); color: var(--ink); font: 600 18px/1 var(--sign); }
.panel-nav button:hover:not(:disabled) { background: var(--hover); }
@media (pointer: coarse) { .panel-nav button { min-width: 44px; height: 44px; } }
.panel h2 { margin: 0 0 2px; font: 600 22px/1.2 var(--sign); }
.panel h3 { margin: 16px 0 4px; font: 600 16px/1.2 var(--sign); }
.panel p { margin: 6px 0; }
.panel .sub { font: 15px/1.4 var(--body); color: var(--ink-soft); }
.panel .note { font: 14px/1.45 var(--body); color: var(--ink-soft); }
.counts { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.counts th { font: 400 14px/1.2 var(--sign); color: var(--ink-soft); text-align: right; padding: 4px; }
.counts th:first-child, .counts td:first-child { text-align: left; }
.counts td { padding: 5px 4px; border-top: 1px solid var(--panel-line); text-align: right; font: 15px/1.3 var(--data); }
.counts td:first-child { font: 15px/1.3 var(--body); }
.counts .chosen { font-weight: 700; background: var(--chosen); }
.counts tfoot td { font-weight: 600; border-top: 2px solid var(--ink-soft); }
/* A team's number of a kind in one round (MILESTONE_7.md D1806): bold where the round sets its own, faint where it follows its multiplier */
.counts input.count { width: 3.6em; padding: 2px 4px; text-align: right; font: inherit; color: var(--ink); background: var(--table);
  border: 1px solid var(--panel-line); border-radius: 3px; }
.counts input.count.set { font-weight: 700; border-color: var(--ink-soft); }
.counts input.count.auto { color: var(--ink-soft); }
.counts input.count:focus-visible { outline: 2px solid var(--select); outline-offset: 1px; }
/* The shortcut for Duo's and Squad's multipliers (D1833, D1837) */
.team-sizes { display: grid; gap: 6px; margin: 6px 0; }
.team-sizes select, .team-sizes input { padding: 5px; font: 15px/1.3 var(--body); color: var(--ink); background: var(--table);
  border: 1px solid var(--ink-soft); border-radius: 3px; }
.team-sizes .fields { display: flex; flex-wrap: wrap; gap: 12px; }
.team-sizes label { display: flex; align-items: center; gap: 6px; font: 15px/1.3 var(--body); }
.team-sizes input { width: 5em; }
.team-sizes .tools { margin: 0; }
/* A marker's chance, its minions and a boss's timed elites (MILESTONE_7.md D1811-D1815) */
.settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 6px 0; }
.settings label, .minion .line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; font: 15px/1.3 var(--body); }
.settings input, .menu input, .minion input, .minion select { padding: 4px 5px; font: 15px/1.3 var(--body); color: var(--ink);
  background: var(--table); border: 1px solid var(--ink-soft); border-radius: 3px; }
.settings input, .menu input, .minion input { width: 4.4em; text-align: right; font-family: var(--data); }
.minion select { max-width: 100%; }
.settings input.auto { color: var(--ink-soft); }
.settings input.set { font-weight: 700; }
/* A round's next round early (EARLY_ROUNDS_AND_CHAT.md D2190): a switch, squared like the rest of the signage, then a line a team size, the one on show marked as the counts' column is */
.early { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 6px 0; }
.toggle { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 4px 10px 4px 4px; border: 1px solid var(--ink-soft); background: var(--table); color: var(--ink); font: 600 15px/1 var(--sign); }
.toggle:hover:not(:disabled) { background: var(--hover); }
.toggle .track { position: relative; width: 36px; height: 20px; background: var(--ink-soft); }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: var(--table); }
.toggle[aria-checked="true"] .track { background: var(--select); }
.toggle[aria-checked="true"] .track::after { left: 19px; background: var(--on-select); }
.toggle .state { min-width: 1.8em; text-align: left; }
@media (pointer: coarse) { .toggle { min-height: 44px; } }
.early-lines { gap: 2px; margin: 0; }
.early-lines label { display: grid; grid-template-columns: 3.4em auto 4.4em minmax(0, 1fr); gap: 6px; padding: 3px 6px; }
.early-lines label.chosen { background: var(--chosen); }
.early-lines label.refused input { border-color: #e5281e; box-shadow: 0 0 0 1px #e5281e; } /* (a marker's "must fix" red: a number a Save won't take) */
.early-lines .who { font: 600 14px/1.2 var(--sign); }
.early-lines label.chosen .who { font-weight: 700; }
/* A jump pad's panel (docs/plans/STAGE_EDITOR_ADDITIONS.md D2211): when it starts working, one of the map's rooms or the stage's start */
.pad-start { margin: 6px 0; }
.pad-start select { max-width: 100%; padding: 5px; font: 15px/1.3 var(--body); color: var(--ink); background: var(--table); border: 1px solid var(--ink-soft); border-radius: 3px; }
@media (pointer: coarse) { .pad-start select { min-height: 44px; } }
.minions { margin: 4px 0; }
.minion { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 7px 0; border-top: 1px solid var(--panel-line); }
/* A row lit on the map (D1858): under the cursor, and clicked to stay */
.minion { border-left: 3px solid transparent; padding-left: 5px; }
.minion.hot { border-left-color: var(--ink-soft); background: var(--hover); }
.minion.kept { border-left-color: #0091cf; background: var(--hover); }
.minion .line button.n { min-width: 1.9em; padding: 3px 4px; font: 600 14px/1 var(--data); color: var(--ink-soft); text-align: center; }
.minion .line button.n[aria-pressed="true"] { background: #0091cf; border-color: #0091cf; color: #fff; }
.minion .picker { flex: 1 1 0; min-width: 0; }
.minion .unit { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.settings .picker { flex: 1 1 0; min-width: 0; }
/* A choice of monster, with their pictures (D1857): the choice on a button, and the list opened under it */
.picker { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.picker-now, .picker-option { display: flex; align-items: center; gap: 2px; width: 100%; min-width: 0; padding: 3px 6px; text-align: left; font: 15px/1.3 var(--body); color: var(--ink); background: var(--table); }
.picker-now { border: 1px solid var(--ink-soft); border-radius: 3px; }
.picker-now .caret { margin-left: auto; padding-left: 6px; color: var(--ink-soft); }
.picker-now .name, .picker-option .name { min-width: 0; overflow-wrap: anywhere; }
.picker-now:hover, .picker-option:hover { background: var(--hover); }
.picker-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; max-height: 300px; overflow: hidden auto; padding: 2px; border: 1px solid var(--ink-soft); background: var(--table); }
.picker-option { border: 0; }
.picker-option.on { background: var(--select); color: var(--on-select); }
.picker-group { margin: 6px 4px 2px; font: 600 14px/1.2 var(--sign); color: var(--ink-soft); }
.picker .face { width: 34px; height: 34px; }
.picker .query { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; margin-right: 7px; border: 2px solid var(--ink-soft); border-radius: 50%; font: 700 17px/1 var(--sign); }
.minion input { width: 3.6em; }
.minion .line button.danger { margin-left: auto; }
.minion button { padding: 3px 8px; font: 14px/1.2 var(--body); color: var(--ink); background: var(--table); border: 1px solid var(--ink-soft);
  border-radius: 3px; cursor: pointer; }
.minion button.danger { border-color: var(--hell); color: var(--hell); }
.minion button:hover { background: var(--hover); }
.minion button.danger:hover { background: var(--hell); color: #fff; }
.swatch { display: inline-block; flex: none; width: 11px; height: 11px; margin-right: 7px; border: 1px solid rgba(128, 128, 128, .7); border-radius: 50%; vertical-align: 0; }
.swatch.big { border-radius: 0; transform: rotate(45deg); }
.swatch.boss { border-radius: 0; }
.named { display: flex; align-items: center; }
.face { width: 26px; height: 26px; margin-right: 7px; border: 2px solid; border-radius: 50%; background: var(--rail); vertical-align: middle; flex: none; }
.face.big { width: 72px; height: 72px; margin: 2px 0 6px; display: block; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 10px 0; font-size: 15px; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-family: var(--data); font-size: 14px; }
.facts dd.word { font-family: var(--body); font-size: 15px; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.problems { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 4px; }
.problem, .said {
  width: 100%;
  margin: 4px 0;
  padding: 5px 8px;
  border: 0;
  border-left: 4px solid var(--ink-soft);
  background: var(--table);
  text-align: left;
  font: 14px/1.35 var(--body);
}
.panel .said { margin: 6px 0; }
.problem:hover { background: var(--hover); }
.problem b { font-weight: 600; }
.block { border-left-color: #e5281e; }
.warn { border-left-color: #ff7a00; }
.palette { display: grid; gap: 1px; margin: 6px 0; }
.palette .group { margin: 10px 0 2px; font: 600 14px/1.2 var(--sign); color: var(--ink-soft); }
.kind {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border: 0;
  background: none;
  text-align: left;
  font: 15px/1.3 var(--body);
}
.kind:hover { background: var(--hover); }
.kind.on { background: var(--select); color: var(--on-select); }
.kind .role { margin-left: auto; padding-left: 8px; font-size: 13px; color: var(--ink-soft); }
.kind.on .role { color: var(--on-select); }

/* What a right-click on the map offers (D1856) */
.menu {
  position: fixed;
  z-index: 5;
  width: 280px;
  max-height: calc(100vh - 16px);
  overflow: hidden auto;
  padding: 10px 12px;
  border: 1px solid var(--ink-soft);
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.menu:focus { outline: none; }
.menu-head { display: flex; align-items: center; min-width: 0; }
.menu-head .face { width: 34px; height: 34px; }
.menu-head b { display: block; font: 600 17px/1.2 var(--sign); overflow-wrap: anywhere; }
.menu-head small { display: block; font: 14px/1.3 var(--body); color: var(--ink-soft); }
.menu h3 { margin: 10px 0 4px; font: 600 15px/1.2 var(--sign); }
.menu .tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 10px 0 0; }
.menu .tools button { width: 100%; text-align: left; padding: 6px 10px; border: 1px solid var(--ink-soft); background: var(--table); color: var(--ink); font: 400 15px/1.2 var(--sign); }
.menu .tools button:hover { background: var(--hover); }
.menu .tools button.danger { border-color: var(--hell); color: var(--hell); }
.menu .tools button.danger:hover { background: var(--hell); color: #fff; }

/* Questions */
dialog {
  max-width: 500px;
  padding: 18px 20px;
  border: 1px solid var(--ink-soft);
  background: var(--panel);
  color: var(--ink);
}
dialog::backdrop { background: rgba(10, 16, 22, .55); }
dialog h2 { margin: 0 0 8px; font: 600 22px/1.2 var(--sign); }
dialog p { margin: 6px 0 12px; }
dialog fieldset { margin: 0 0 12px; padding: 6px 10px 10px; border: 1px solid var(--panel-line); }
dialog legend { font: 600 15px/1.2 var(--sign); }
dialog label { display: block; padding: 3px 0; }
dialog input { margin-right: 8px; }
.dialog-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
/* Dragging a stage or a map in the list (D1816) */
.row.movable { cursor: grab; }
body.row-dragging, body.row-dragging .row { cursor: grabbing; user-select: none; }
.row.drag-source { opacity: .55; }
.row.drop-target { outline: 2px solid var(--select); outline-offset: -2px; }
/* Where a dragged stage or round will land, what's being dragged, and where it landed (D1975) */
.drop-line { position: fixed; z-index: 52; height: 3px; margin-top: -1.5px; background: var(--select); border-radius: 2px; pointer-events: none; }
.drop-line::before { content: ""; position: absolute; top: -3px; left: -3px; width: 9px; height: 9px; background: var(--select); border-radius: 50%; }
.row.drag-ghost { position: fixed; top: 0; left: 0; z-index: 51; color: var(--ink); background: var(--table); border: 1px solid var(--select); border-radius: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); opacity: .95; pointer-events: none; }
.row.just-moved { animation: just-moved 2.4s ease-out; }
@keyframes just-moved { 0%, 40% { color: var(--on-select); background: var(--select); } }
/* The chapters to switch between (D1973) */
.tree h2.chapters { display: flex; align-items: center; gap: 4px; }
.tree h2.chapters button { min-width: 30px; height: 28px; margin-left: 2px; padding: 0 6px; color: var(--ink); background: var(--table); border: 1px solid var(--ink-soft); font: 600 16px/1 var(--sign); cursor: pointer; }
.tree h2.chapters button:hover:not(.on) { background: var(--hover); }
.tree h2.chapters button.on { color: var(--on-select); background: var(--select); border-color: var(--select); }
/* Play this next's banner (D1820): it's on until turned off */
.play-next { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; padding: 4px 10px; font: 600 15px/1.3 var(--sign); color: var(--ink); background: var(--table); border-left: 4px solid var(--select); }
.play-next[hidden] { display: none; }
.play-next button { padding: 3px 10px; font: 14px/1.2 var(--body); color: var(--ink); background: var(--panel); border: 1px solid var(--ink-soft); border-radius: 3px; }
.play-next button:hover { background: var(--hover); }
/* The chat (D1817): beside the map, in place of the details; its conversation scrolls in its own box */
.chat { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 12px; }
.chat[hidden] { display: none; }
.chat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 12px; font: 15px/1.3 var(--body); }
.chat-head h2 { margin: 0 auto 0 0; font: 600 22px/1.2 var(--sign); }
.chat-head select, .chat textarea { font: 15px/1.35 var(--body); color: var(--ink); background: var(--table); border: 1px solid var(--ink-soft); border-radius: 3px; }
.chat-head button, .chat .tools button { padding: 5px 10px; font: 14px/1.2 var(--body); color: var(--ink); background: var(--table); border: 1px solid var(--ink-soft); border-radius: 3px; cursor: pointer; }
.chat-head button:hover:not(:disabled), .chat .tools button:hover:not(:disabled) { background: var(--hover); }
.chat .tools button.primary { background: var(--select); border-color: var(--select); color: #fff; font-weight: 600; }
.chat .tools button:disabled, .chat-head button:disabled { opacity: .5; cursor: default; }
.chat-log { flex: 1 1 0; min-height: 80px; display: flex; flex-direction: column; gap: 8px; margin: 10px 0 6px; overflow: hidden auto; }
.msg { padding: 8px 10px; border-radius: 6px; font: 15px/1.4 var(--body); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.you { align-self: flex-end; max-width: 92%; background: var(--hover); }
.msg.claude { background: var(--table); border: 1px solid var(--panel-line); white-space: normal; }
/* A reply's Markdown (D1900). A wide table or code block scrolls in a box of its own, so the panel never scrolls sideways */
.msg.claude > :first-child { margin-top: 0; }
.msg.claude > :last-child { margin-bottom: 0; }
.msg.claude p { margin: 0 0 8px; white-space: pre-wrap; }
.msg.claude h3, .msg.claude h4, .msg.claude h5, .msg.claude h6 { margin: 12px 0 4px; font: 600 16px/1.25 var(--sign); }
.msg.claude h3 { font-size: 18px; }
.msg.claude h5, .msg.claude h6 { font-size: 15px; }
.msg.claude ul, .msg.claude ol { margin: 0 0 8px; padding-left: 22px; }
.msg.claude li > p { margin: 0; }
.msg.claude li > * + p { margin-top: 6px; }
.msg.claude li > ul, .msg.claude li > ol { margin: 2px 0 0; }
.msg.claude code { padding: 0 3px; font: 13.5px/1.3 var(--data); background: var(--hover); border-radius: 3px; overflow-wrap: anywhere; }
.msg.claude pre { margin: 0 0 8px; padding: 7px 9px; overflow-x: auto; background: var(--hover); border-radius: 4px; }
.msg.claude pre code { padding: 0; background: none; white-space: pre; overflow-wrap: normal; }
.msg.claude blockquote { margin: 0 0 8px; padding-left: 10px; color: var(--ink-soft); border-left: 3px solid var(--panel-line); }
.msg.claude hr { margin: 10px 0; border: 0; border-top: 1px solid var(--panel-line); }
.md-table { margin: 0 0 8px; overflow-x: auto; }
.md-table table { border-collapse: collapse; font: 14px/1.3 var(--body); }
.md-table th, .md-table td { padding: 4px 8px; text-align: left; overflow-wrap: normal; border: 1px solid var(--panel-line); }
.md-table th { font-weight: 600; background: var(--hover); }
.md-table .align-right { text-align: right; }
.md-table .align-center { text-align: center; }
.msg.failed { color: var(--hell); border: 1px solid var(--hell); }
.chat-status { min-height: 1.3em; margin: 0; font: 14px/1.3 var(--body); color: var(--ink-soft); }
.chat-draft { margin: 6px 0; padding: 4px 10px 8px; max-height: 40%; overflow: hidden auto; border-left: 4px solid #7c3aed; background: var(--table); }
.chat-draft[hidden] { display: none; }
.chat-draft h3 { margin: 6px 0 4px; font: 600 15px/1.2 var(--sign); }
.chat-draft ul { margin: 0; padding-left: 18px; font: 14px/1.35 var(--body); overflow-wrap: anywhere; }
.chat-draft .said { margin: 6px 0 0; font: 14px/1.35 var(--body); }
.chat-draft .said.block { color: var(--hell); }
.chat textarea { display: block; box-sizing: border-box; width: 100%; padding: 6px 8px; resize: vertical; }
.chat .tools { margin: 6px 0 0; }
.chat-used { margin: 4px 0 0; font: 13px/1.3 var(--body); color: var(--ink-soft); }
/* The History list (D1818): newest first, it scrolls in its own box */
#history-box { width: min(720px, calc(100vw - 32px)); }
.changes { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.changes > li { padding: 10px 2px; border-top: 1px solid var(--panel-line); }
.changes > li.note { color: var(--ink-soft); }
.change-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font: 16px/1.3 var(--body); }
.change-head .when { font: 14px/1.3 var(--data); color: var(--ink-soft); }
.change-head .scope { font: 14px/1.3 var(--body); color: var(--ink-soft); }
.change-head button { margin-left: auto; padding: 4px 10px; font: 14px/1.2 var(--body); color: var(--ink); background: var(--table); border: 1px solid var(--ink-soft); border-radius: 3px; cursor: pointer; }
.change-head button:hover:not(:disabled) { background: var(--hover); }
.change-head button:disabled { opacity: .5; cursor: default; }
.changes ul, .changed-what { margin: 4px 0 0; padding-left: 20px; font: 15px/1.35 var(--body); overflow-wrap: anywhere; }

/* (Measured: the three columns and the rail's one line need about 1080 px; below it the columns stack.) */
@media (max-width: 1080px) {
  body { height: auto; min-height: 100vh; }
  .desk { grid-template-columns: 1fr; }
  .resizer { display: none; }
  .table { height: 70vh; }
  .tree { max-height: 40vh; border-right: 0; }
  .meets { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }

/* Push to Server and Versions (docs/plans/PUSH_TO_SERVER.md Phases 6 and 7). Green means only: this goes out to the real players */
.bar button.go, .dialog-buttons button.go { border-color: var(--go); background: var(--go); color: #fff; font-weight: 600; }
.bar button.go:hover:not(:disabled), .dialog-buttons button.go:hover:not(:disabled) { background: var(--go-hover); }
#push-box, #versions-box { width: min(760px, calc(100vw - 32px)); }
dialog .field { display: block; margin: 8px 0; font: 600 15px/1.3 var(--sign); }
dialog .field input { display: block; box-sizing: border-box; width: min(100%, 420px); margin: 4px 0 0; padding: 6px 8px; font: 400 16px/1.3 var(--body); border: 1px solid var(--ink-soft); background: var(--table); color: var(--ink); }
dialog h3 { margin: 12px 0 6px; font: 600 16px/1.2 var(--sign); }
.change-box { max-height: 40vh; overflow-y: auto; padding: 2px 8px; border: 1px solid var(--panel-line); background: var(--float); }
.change-group h4 { margin: 8px 0 2px; font: 600 15px/1.3 var(--data); overflow-wrap: anywhere; }
.change-lines { margin: 0 0 6px; padding-left: 20px; font: 15px/1.4 var(--body); overflow-wrap: anywhere; }
.push-went-back { margin: 4px 0 10px; font: 600 15px/1.3 var(--body); }
.push-steps { list-style: none; margin: 8px 0; padding: 0; font: 15px/1.4 var(--body); }
.push-step { display: flex; gap: 12px; padding: 4px 0; border-top: 1px solid var(--panel-line); }
.step-word { flex: 0 0 8em; font: 600 14px/1.5 var(--sign); color: var(--ink-soft); }
.push-step.running .step-word { color: var(--select); }
.push-step.done .step-word { color: var(--go); }
.push-step.failed .step-word, .push-message.bad { color: var(--bad); }
.push-message { font: 15px/1.4 var(--body); min-height: 1.4em; }
.push-message .place { margin: 4px 0; }
.push-message .place b { font-family: var(--sign); }
.push-message .place.took b, .push-message .place.done b { color: var(--go); }
.push-message .place.late b, .push-message .place.partial b { color: var(--bad); }
.push-floors { margin: 6px 0 10px; padding: 4px 10px; border-left: 4px solid #ff7a00; background: var(--float); font: 15px/1.4 var(--body); overflow-wrap: anywhere; }
.push-floors p { margin: 4px 0; }
.push-floors .push-floors-head { font: 600 15px/1.3 var(--sign); }
#revert-box, #confirm-box { width: min(620px, calc(100vw - 32px)); }
.versions-list { max-height: 52vh; overflow-y: auto; border-top: 1px solid var(--panel-line); }
.versions-page { align-self: center; font: 14px/1.3 var(--sign); color: var(--ink-soft); padding: 0 6px; }
.version-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 2px; border-bottom: 1px solid var(--panel-line); }
.version-row input { margin: 5px 0 0; }
.version-main { flex: 1; min-width: 0; }
.version-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; font: 16px/1.3 var(--body); }
.version-head .when { font: 14px/1.3 var(--data); color: var(--ink-soft); }
.version-tag { padding: 1px 8px; font: 600 13px/1.4 var(--sign); color: var(--on-select); background: var(--go); border-radius: 2px; }
.version-tag.went { background: var(--ink-soft); }
.version-note { margin: 4px 0 6px; font: 15px/1.35 var(--body); overflow-wrap: anywhere; }
.version-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.version-actions button { padding: 4px 10px; border: 1px solid var(--ink-soft); background: var(--table); color: var(--ink); font: 14px/1.2 var(--body); cursor: pointer; }
.version-actions button:hover:not(:disabled) { background: var(--hover); }
