:root {
  --ink: #12181f;
  --paper: #f4f6f8;
  --line: #ccd4dc;
  --accent: #1f6feb;
  --warn: #b4551d;
}
* { box-sizing: border-box; }

/* The browser hides [hidden] with a rule of its own, and any class here
 * that sets `display` outranks it — so a searched-away figure row, which
 * is a grid, stayed on screen with the hidden attribute set on it and the
 * search looked broken while doing exactly what it was told. */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden;
  font: 13px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
#scene { position: absolute; inset: 0; right: 340px; background: #dfe7ee; }
#panel { position: absolute; top: 0; right: 0; bottom: 0; width: 340px;
  overflow-y: auto; padding: 16px 18px 40px; background: var(--paper);
  border-left: 1px solid var(--line); }
/* The page's name and the way home, in the pinned top of the panel. */
#top .masthead { display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; }
#top h1 { margin: 0; font-size: 15px; letter-spacing: 0.08em; }
#top h1 span { letter-spacing: 0; font-weight: 500; color: #61707e; }
a.home { display: inline-flex; align-items: center; justify-content: center;
  margin-left: auto; width: 32px; height: 32px; border: 1px solid var(--line);
  border-radius: 6px; color: var(--ink); background: var(--paper); }
a.home svg { width: 18px; height: 18px; }
a.home:hover { border-color: var(--accent); color: var(--accent); }
h1 { font-size: 18px; letter-spacing: 0.14em; margin: 0; }
.sub { margin: 2px 0 16px; color: #61707e; font-size: 12px; }
h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em;
  color: #61707e; margin: 20px 0 8px; }
section { border-top: 1px solid var(--line); }
section:first-of-type { border-top: none; }
label { display: block; margin-bottom: 10px; font-size: 12px; }
output { float: right; font-variant-numeric: tabular-nums; color: #47535f; }
input[type=range] { width: 100%; margin-top: 4px; accent-color: var(--accent); }
select { width: 100%; margin-top: 3px; padding: 4px; border: 1px solid var(--line);
  border-radius: 4px; background: #fff; font: inherit; }
.row { display: flex; gap: 8px; margin: 10px 0 4px; }
button { flex: 1; padding: 7px 10px; border: 1px solid var(--accent);
  border-radius: 4px; background: var(--accent); color: #fff; font: inherit;
  cursor: pointer; }
button.quiet { background: #fff; color: var(--ink); border-color: var(--line); }
/* The fidelity toggle while it is on: the numbers beside it are coarse
   and the button is the only thing on screen that undoes that. */
button.quiet.on { background: var(--warn); color: #fff; border-color: var(--warn); }
button:disabled { opacity: 0.5; cursor: progress; }
dl { display: grid; grid-template-columns: minmax(96px, 42%) minmax(0, 1fr);
  gap: 3px 10px; margin: 0; }
dt { color: #61707e; font-size: 12px; }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
dd.warn { color: var(--warn); }
.hint { color: #61707e; font-size: 11px; margin-top: 18px; }
#confirm { position: absolute; inset: 0; background: rgba(18, 24, 31, 0.45);
  display: grid; place-items: center; }
#confirm[hidden] { display: none; }
.sheet { width: 560px; max-height: 78vh; overflow-y: auto; padding: 20px 22px;
  background: #fff; border-radius: 8px; box-shadow: 0 18px 48px rgba(0,0,0,0.3); }
.sheet h2 { margin-top: 0; color: var(--ink); font-size: 13px; }
.change { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px;
  padding: 7px 0; border-bottom: 1px solid var(--line); }
.change .name { font-weight: 600; }
.change .move { font-variant-numeric: tabular-nums; }
.change .why { grid-column: 1 / -1; color: #61707e; font-size: 12px; }
#status { position: absolute; left: 14px; bottom: 12px; padding: 5px 11px;
  background: rgba(18,24,31,0.82); color: #fff; border-radius: 4px;
  font-size: 12px; opacity: 0; transition: opacity 0.15s; pointer-events: none; }
#status.on { opacity: 1; }
#status.bad { background: var(--warn); }

/* Below the camera hint, which sits over the same corner: at the top the
 * hint covered the legend's own chooser. */
#legend { position: absolute; left: 14px; top: 52px; padding: 9px 12px;
  background: rgba(255,255,255,0.9); border: 1px solid var(--line);
  border-radius: 5px; font-size: 11px; display: grid; gap: 4px; }
#legend i { display: inline-block; width: 11px; height: 11px; margin-right: 7px;
  vertical-align: -1px; border-radius: 2px; }
#legend i.served { background: rgba(47,158,87,0.75); }
#legend i.reached { background: rgba(216,178,74,0.6); }
#legend i.reach { background: none; border: 1.5px solid rgba(31,111,235,0.7);
  border-radius: 50%; }

.card { border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px;
  margin-bottom: 8px; background: #fff; }
.card header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.card header b { flex: 1; font-size: 12px; }
.card header .swatch { width: 10px; height: 10px; border-radius: 2px; }
.card .drop { border: none; background: none; color: #8a97a3; cursor: pointer;
  padding: 0 2px; flex: 0; font-size: 15px; line-height: 1; }
.card .drop:hover { color: var(--warn); }
.card label { margin-bottom: 6px; font-size: 11px; }
.card select { font-size: 12px; padding: 3px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pair input[type=number] { width: 100%; padding: 3px 5px; border: 1px solid var(--line);
  border-radius: 4px; font: inherit; font-size: 12px; }
#legend i.unit { background: #b4551d; border-radius: 50%; }

.tag { float: right; font-size: 10px; font-weight: 400; letter-spacing: 0;
  color: var(--warn); text-transform: none; }
.figure { display: grid; grid-template-columns: 1fr 92px; gap: 4px 8px;
  align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.figure .name { font-size: 11px; line-height: 1.3; }
.figure .name b { font-weight: 600; }
.figure .name span { display: block; color: #8a97a3; }
.figure input { width: 100%; padding: 3px 5px; border: 1px solid var(--line);
  border-radius: 4px; font: inherit; font-size: 12px; text-align: right; }
.figure input.edited { border-color: var(--warn); background: #fff8f2; }
.figure .unit { font-size: 10px; color: #8a97a3; text-align: right;
  grid-column: 2; margin-top: -3px; }
.group { margin: 12px 0 4px; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.09em; color: #61707e; }
a.button { display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; }


/* The camera hint, and the panels that report long work. */

#controls-hint {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 4;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #d6dbe0;
  font-size: 11px;
  color: #4a5560;
}

#controls-hint b { color: #22282e; font-weight: 600; }
#controls-hint button { padding: 2px 8px; font-size: 11px; }

.option {
  border: 1px solid #dfe4e9;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
}

.option header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.option header b { font-size: 12px; }
.option .moves { font-size: 11px; color: #55606b; }
.option .moves span { display: block; font-variant-numeric: tabular-nums; }
.option .why { font-size: 11px; color: #6b7681; margin: 4px 0 0; }

#task-out, #solve-out { margin-top: 8px; }

.log {
  max-height: 190px;
  overflow-y: auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  background: #f4f6f8;
  border-radius: 5px;
  padding: 6px 8px;
  white-space: pre-wrap;
  color: #4a5560;
}

table.out {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}

table.out th, table.out td {
  padding: 3px 4px;
  border-bottom: 1px solid #e6eaee;
  text-align: right;
}

table.out th:first-child, table.out td:first-child { text-align: left; }
table.out th { color: #6b7681; font-weight: 500; }

.bar {
  height: 4px;
  border-radius: 2px;
  background: #1f6feb;
  margin-top: 2px;
}

.dominant { background: #b4551d; }


/* A row of the search space: which figure, and what to try for it. */

.vary-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.vary-row select, .vary-row input { width: 100%; }
.vary-row select { font-size: 10px; }


label.tick {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

label.tick input { width: auto; }


#fetch-panel {
  border: 1px solid #dfe4e9;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
}

#fetch-panel summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #22282e;
}


/* The three rows, as tabs. Each keeps its own prepared deployment. */

/* Pinned, like the result at the other end of the panel.
 *
 * The rows and the language belong to the whole panel rather than to
 * whichever step is open, and they used to scroll away with step one:
 * by the time somebody was working in the figures they could not reach
 * either without scrolling all the way back up. `#top` carries the
 * panel's own background so the steps pass behind it.
 */
#top {
  position: sticky;
  top: -16px;
  z-index: 3;
  margin: 0 -18px;
  padding: 16px 18px 0;
  background: var(--paper);
  box-shadow: 0 8px 16px -12px rgba(18, 24, 31, 0.4);
}

#tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 12px;
  border-bottom: 1px solid #dfe4e9;
}

#tabs button {
  flex: 1;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  background: none;
  color: #6b7681;
  font-size: 12px;
  padding: 7px 4px;
  cursor: pointer;
}

#tabs button:hover { color: #22282e; }

#tabs button.on {
  background: #fff;
  border-color: #dfe4e9;
  color: #22282e;
  font-weight: 600;
  margin-bottom: -1px;
}


/* ---------- the panel as six steps ----------
 *
 * Every control the engine has, in one column, in the order the engine
 * grew them, was about three thousand pixels of it. Nobody reads that.
 * Each step collapses to a line carrying its own state instead, so the
 * whole study is legible at a glance and only what is being worked on is
 * open.
 */

details.step { border-top: 1px solid var(--line); }
details.step:first-of-type { border-top: none; }

details.step > summary {
  display: grid;
  grid-template-columns: 18px auto 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 11px 0 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

details.step > summary::-webkit-details-marker { display: none; }

details.step > summary .n {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: #b6c0ca;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
}

details.step[open] > summary .n { background: var(--accent); }

details.step > summary .what {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #61707e;
}

details.step[open] > summary .what { color: var(--ink); font-weight: 600; }

details.step > summary .now {
  text-align: right;
  font-size: 11px;
  color: #8a97a3;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

details.step[open] > summary .now { color: #61707e; }
details.step > summary:hover .now { color: var(--ink); }
details.step > *:last-child { margin-bottom: 16px; }

/* A step the search found nothing in. Closed, and kept in place, because
 * its number is how somebody knows where they are. */
details.step.empty > summary { opacity: 0.35; }


/* ---------- one setting, three ways ----------
 *
 * What it means, where it sits in its range, and what it is exactly. A
 * slider cannot be given 4000 when its step is 500, and a number alone
 * says nothing about the range it lives in.
 */

label.knob {
  display: grid;
  grid-template-columns: 1fr 82px;
  align-items: center;
  gap: 2px 8px;
  margin-bottom: 12px;
}

label.knob > span { font-size: 12px; }
label.knob > output { float: none; text-align: right; font-size: 11px; }
label.knob > input[type=range] { margin-top: 0; }

label.knob > input.num {
  width: 100%;
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

label.knob > input:disabled { opacity: 0.45; cursor: not-allowed; }

/* A knob this arrangement does not read. Greyed whole rather than only
 * on the slider: the number beside it is the other half of the same
 * control, and a live-looking box under a greyed slider is the worst of
 * the three states. The note under the step says which reason. */
/* A control this arrangement does not read (ADR-0036). On the label
   rather than on the input, because a disabled input raises none of the
   events a tooltip waits for and the reason has to be readable. */
label.dead { color: #97a2ad; }
label.dead > output { color: #97a2ad; }


/* ---------- finding one setting among a hundred ---------- */

.find { display: flex; gap: 6px; margin: 0 0 4px; padding-bottom: 8px; }

.find input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.find input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
#find-clear { flex: 0 0 28px; padding: 4px; color: #8a97a3; }
/* Scoped to the one button it is about. As `.find button` it also hid
 * the language chooser, which lives in the same row — the chooser was
 * built, styled and wired, and invisible until somebody typed a
 * search. */
body:not(.finding) #find-clear { visibility: hidden; }
.no-hits { margin: 2px 0 0; color: var(--warn); }

/* While searching, the prose that explains a step is not what is being
 * looked for. */
body.finding .hint:not(.no-hits) { display: none; }


/* ---------- where a number came from ---------- */

.figure .name { display: grid; grid-template-columns: 9px 1fr; gap: 0 6px; }
.figure .name b, .figure .name span { grid-column: 2; }

i.prov {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 4px;
  background: #b6c0ca;
}

i.prov.datasheet { background: #2f9e57; }
i.prov.measurement { background: #1f6feb; }
i.prov.standard { background: #7a3f9e; }
i.prov.derived { background: #5c6b7a; }
i.prov.design { background: #0f9b9b; }
i.prov.assumption { background: var(--warn); }

.prov-key {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
  margin: 8px 0;
  font-size: 10px;
  color: #61707e;
}

.prov-key i { margin-right: 5px; display: inline-block; vertical-align: 0; }


/* ---------- the answer, always on screen ---------- */

#readout {
  position: sticky;
  bottom: -40px;
  margin: 0 -18px -40px;
  padding: 2px 18px 12px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 16px -12px rgba(18, 24, 31, 0.4);
}

#readout h2 { margin-top: 10px; }
/* However long the answer grows (a parts list per unit), it scrolls in
   its own box: pinned to the bottom and taller than the panel, its top
   went under the pinned tabs where no scrolling could reach it. */
#numbers { max-height: 42vh; overflow-y: auto; overscroll-behavior: contain; }


/* ---------- two languages, both on screen ----------
 *
 * Not a menu. There are two, and a two-item menu costs a click to find
 * out what is in it.
 */

#languages { display: flex; gap: 2px; flex: 0 0 auto; }

#languages button {
  flex: 0 0 auto;
  padding: 4px 7px;
  font-size: 10px;
  letter-spacing: 0.06em;
  border-color: var(--line);
  background: #fff;
  color: #8a97a3;
}

#languages button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}


/* ---------- the map somebody picks ground on ---------- */

#map-sheet {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

#map-sheet[hidden] { display: none; }

.map-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.map-bar input[type=search] {
  flex: 1;
  min-width: 120px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}

.map-bar button { flex: 0 0 auto; }
.map-bar button.on { background: var(--accent); color: #fff;
  border-color: var(--accent); }

/* What is about to be fetched, in the bar rather than discovered after:
   a size and a spacing are two numbers whose product is the work. */
.map-span {
  flex: 0 0 auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #4a5560;
  white-space: nowrap;
}
.map-span.no-hits { color: var(--warn); }

#map-hits {
  max-height: 200px;
  overflow-y: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
#map-hits[hidden] { display: none; }
#map-hits button {
  display: block;
  width: 100%;
  padding: 7px 12px;
  border: none;
  border-bottom: 1px solid #eef1f4;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
#map-hits button:hover { background: #eef3fb; }
#map-hits .where { color: #8a97a3; font-size: 11px; }

#map-canvas { flex: 1; position: relative; }

.map {
  position: relative;
  overflow: hidden;
  background: #dfe7ee;
  cursor: grab;
  touch-action: none;          /* the gestures are ours, not the page's */
  user-select: none;
}
.map.dragging { cursor: grabbing; }
.map.drawing { cursor: crosshair; }

.map-tiles { position: absolute; inset: 0; }

.map-tile {
  position: absolute;
  top: 0;
  left: 0;
  width: 256px;
  height: 256px;
  /* Not draggable: a map is dragged, and the browser's own image drag
     would fight every pan. */
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
.map-tile.missing { visibility: hidden; }

/* The ground about to be fetched. Filled faintly rather than outlined
   only, because an outline on a busy map reads as one more road. */
.map-box {
  position: absolute;
  top: 0;
  left: 0;
  border: 2px solid var(--accent);
  background: rgba(31, 111, 235, 0.12);
  box-shadow: 0 0 0 9999px rgba(18, 24, 31, 0.28);
  cursor: move;
}

.map-grip {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-radius: 3px;
  background: #fff;
}
.map-grip.nw { top: -8px; left: -8px; cursor: nwse-resize; }
.map-grip.ne { top: -8px; right: -8px; cursor: nesw-resize; }
.map-grip.se { bottom: -8px; right: -8px; cursor: nwse-resize; }
.map-grip.sw { bottom: -8px; left: -8px; cursor: nesw-resize; }

.map-credit {
  margin: 0;
  padding: 4px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: #61707e;
  font-size: 11px;
}
.map-credit a { color: #61707e; }

/* No tile address given, deliberately. Ruled rather than blank, so it
   reads as ground with no map on it and not as a map that failed. */
#map-canvas.mapless {
  background:
    repeating-linear-gradient(0deg, #e6ecf2 0 39px, #dbe3ea 39px 40px),
    repeating-linear-gradient(90deg, #e6ecf2 0 39px, #dbe3ea 39px 40px);
}


/* ---------- named arrangements ---------- */

#presets {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

#presets select { margin-top: 0; font-size: 12px; }
#presets .row { margin: 0; }
#presets button { font-size: 11px; padding: 5px 8px; }

#presets input[type=text] {
  flex: 1;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
}

/* The legend's own chooser and its four bands. */
#legend select {
  width: 100%;
  margin: 0 0 6px;
  padding: 3px 4px;
  font-size: 11px;
}
#legend-bands { display: grid; gap: 3px; margin-bottom: 5px; }
#legend-bands span { display: flex; align-items: center; gap: 7px; }
#legend-bands i {
  display: inline-block; width: 11px; height: 11px;
  border-radius: 2px; flex: 0 0 auto;
}
#legend .note { max-width: 260px; color: #61707e; font-size: 10px;
  line-height: 1.35; margin: 2px 0 5px; }

/* The scene's gestures are its own: without this a finger on a phone
   scrolls the page instead of turning the ground. */
#scene canvas { touch-action: none; }


/* ---------- what a change also moved, without stopping anybody ----------
 *
 * It used to be a sheet over the whole page with Apply and Cancel, and
 * nothing could be done until it was answered. Now the change is made at
 * once and this says, at the foot of the scene, what else moved with it
 * and how to take it back.
 */

#notice {
  position: absolute;
  left: 14px;
  right: 354px;
  bottom: 44px;
  z-index: 5;
  max-width: 560px;
  max-height: 40vh;
  overflow-y: auto;
  padding: 10px 12px 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(18, 24, 31, 0.22);
  font-size: 12px;
}
#notice h2 { margin: 0 0 4px; color: var(--ink); font-size: 11px; }
#notice .change { padding: 4px 0; }
#notice .row { margin: 6px 0 2px; }
#notice button { flex: 0 0 auto; padding: 4px 10px; font-size: 11px; }


/* ---------- what is running in the background ---------- */

#activity {
  position: absolute;
  right: 354px;
  bottom: 12px;
  z-index: 4;
  min-width: 220px;
  max-width: 340px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(18, 24, 31, 0.16);
  font-size: 11px;
}
#activity h2 { margin: 0 0 4px; font-size: 10px; }
#activity ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
#activity li { display: grid; grid-template-columns: 10px 1fr auto; gap: 6px;
  align-items: baseline; }
#activity li .dot { width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); animation: pulse 1s ease-in-out infinite; }
#activity li.waiting .dot { background: #b6c0ca; animation: none; }
#activity li.waiting .what { color: #61707e; }
#activity li .when { color: #8a97a3; font-variant-numeric: tabular-nums; }
#activity li .why { grid-column: 2 / -1; color: #8a97a3; font-size: 10px; }
@keyframes pulse { 50% { opacity: 0.3; } }


/* ---------- the first-time path: a place, a layout, a run ---------- */

#quick {
  margin: 0 0 12px;
  padding: 10px 11px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: #fff;
}
#quick h2 { margin: 0 0 4px; color: var(--ink); font-size: 12px;
  text-transform: none; letter-spacing: 0; }
#quick .hint { margin: 4px 0 6px; }
#quick ol { margin: 6px 0 0; padding-left: 18px; font-size: 11px; color: #61707e; }
#quick li.now { color: var(--ink); font-weight: 600; }
#quick li.done { color: #2f9e57; }
#quick li.bad { color: var(--warn); }


/* ---------- a phone ----------
 *
 * The panel was a fixed 340 px column on the right with the scene
 * beside it, so on a phone the panel covered the whole screen and the
 * scene was a sliver nobody could touch. Below this width the scene
 * takes the top of the screen and the panel scrolls underneath it.
 */

@media (max-width: 760px) {
  #scene { right: 0; bottom: auto; height: 46vh; height: 46dvh; }
  #panel { top: 46vh; top: 46dvh; width: auto; left: 0;
    border-left: none; border-top: 1px solid var(--line);
    padding: 12px 14px 40px; }
  /* Nothing pinned: in half a screen the pinned header and the pinned
     result left no room between them for the steps themselves. */
  #top { position: static; margin: 0 -14px; padding: 12px 14px 0;
    box-shadow: none; }
  #readout { position: static; margin: 12px -14px -40px;
    padding: 2px 14px 12px; box-shadow: none; }
  #controls-hint { top: 8px; left: 8px; padding: 4px 6px; }
  #controls-hint button { min-height: 0; font-size: 12px; padding: 3px 8px; }
  #gestures { display: none; }
  #legend { top: 44px; left: 8px; max-width: 46vw; padding: 5px 7px;
    font-size: 10px; gap: 2px; }
  #legend select { min-height: 0; font-size: 11px; padding: 2px 3px;
    margin-bottom: 3px; }
  #legend .note { display: none; }
  #legend > span { display: none; }
  #legend-bands { gap: 1px; }
  #status { left: 8px; right: 8px; bottom: auto; top: calc(46dvh - 34px); }
  #notice { left: 8px; right: 8px; bottom: 8px; max-width: none; max-height: 34vh; }
  #activity { right: 8px; bottom: auto; top: 8px; min-width: 0;
    max-width: 50vw; font-size: 10px; padding: 5px 8px; }
  .sheet { width: calc(100vw - 24px); max-height: 86vh; padding: 16px; }
  .row { flex-wrap: wrap; }
  .map-bar { flex-wrap: wrap; }
  .map-bar input[type=search] { flex-basis: 100%; }
  label.knob { grid-template-columns: 1fr 72px; }
  /* Fingers, not a mouse: controls a thumb can hit. */
  button, select, input[type=text], input[type=search], input[type=number] {
    min-height: 34px; font-size: 14px; }
  .card select, #presets select { font-size: 14px; }
  #tabs button { padding: 9px 4px; font-size: 13px; }
}

/* The roads button in the scene's key: pressed, it reads as on. */
#roads-forward { flex: none; margin: 2px 0 6px; padding: 4px 8px;
  font-size: 11px; }
#roads-forward.on { background: var(--accent); color: #fff;
  border-color: var(--accent); }
#motion.on { background: var(--accent); color: #fff; border-color: var(--accent); }
