/* NXTrainer Designer.
   One stylesheet, no build step, no framework -- this runs off a stdlib HTTP
   server over an ssh tunnel and adding a toolchain to it would be the tail
   wagging the dog. */

:root {
  --bg: #12151a;
  --panel: #181c23;
  --panel2: #1f242d;
  --sunken: #0d1014;
  --line: #2a313b;
  --line2: #39434f;
  --text: #ccd4dd;
  --dim: #7e8995;
  --faint: #5a6472;
  --acc: #52b6c2;
  --acc-dk: #17343a;
  --stmt: #c98a3c;
  --val: #4fa3b0;
  --addr: #8f80c4;
  --ctrl: #5f9a6b;
  --ui: #c07f97;
  --red: #d4706a;
  --green: #6fae83;
  --amber: #d59a4a;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
/* The `hidden` attribute is only a UA rule of `display: none`, so any element
   this stylesheet gives a display to beats it. #drop sets `display: grid`,
   which meant the drop veil covered the whole page permanently -- an import
   would succeed behind it and look like nothing had happened. */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 13px/1.5 var(--sans);
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
.mono, code, pre { font-family: var(--mono); }
code { color: var(--text); background: var(--panel2); padding: 0 4px; border-radius: 3px; font-size: .92em; }
.grow { flex: 1; }
.hint { color: var(--faint); font-size: 12px; line-height: 1.5; }
h2 { font-size: 17px; margin: 0 0 6px; font-weight: 600; }
h3 { font-size: 14px; margin: 0 0 4px; font-weight: 600; }

/* ---------------------------------------------------------- chrome */
#bar {
  display: flex; align-items: center; gap: 9px; padding: 0 12px;
  height: 42px; flex: 0 0 auto; overflow-x: auto;
  background: var(--panel2); border-bottom: 1px solid var(--line);
}
/* Nothing in the bar shrinks. Flex items shrink by default, which clipped the
   "Advanced" tab to "Advancec" on a 1400px window; the bar scrolls instead. */
#bar > * { flex: 0 0 auto; }
#bar .app { font-weight: 600; font-size: 14px; letter-spacing: .01em; white-space: nowrap; }
.chip {
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  border: 1px solid var(--line2); border-radius: 3px; padding: 2px 7px;
  white-space: nowrap; max-width: 30ch; overflow: hidden; text-overflow: ellipsis;
}
.chip b { color: var(--text); font-weight: 500; }
.chip.good { color: var(--green); border-color: #2c4a38; }
.chip.warn { color: var(--amber); border-color: #4a3c22; }
input.hdr {
  width: auto; background: transparent; border: 1px solid transparent;
  padding: 2px 6px; font-size: 12px; color: var(--text);
}
input.hdr::placeholder { color: var(--faint); }
input.hdr:hover { border-color: var(--line2); }
input.hdr:focus { background: var(--sunken); border-color: var(--acc); }

button, .filebtn {
  font: inherit; font-size: 12px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line2);
  border-radius: 3px; padding: 4px 11px; cursor: pointer; white-space: nowrap;
}
button:hover, .filebtn:hover { border-color: var(--acc); }
button:focus-visible, .filebtn:focus-within { outline: 2px solid var(--acc); outline-offset: 1px; }
button.primary { background: var(--acc); border-color: var(--acc); color: #08282c; font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
/* The step that deletes something or writes to a running game does not look
   like the step that saves a file. */
button.danger { background: var(--red); border-color: var(--red); color: #1a0c0c; font-weight: 600; }
button.danger:hover { filter: brightness(1.1); }
button:disabled { opacity: .45; cursor: default; border-color: var(--line2); }
button.ghost { background: transparent; border-color: transparent; color: var(--dim); }
button.ghost:hover { color: var(--text); border-color: var(--line2); }
.filebtn { position: relative; overflow: hidden; display: inline-block; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 3px; overflow: hidden; }
.seg button { border: 0; border-right: 1px solid var(--line2); border-radius: 0; background: transparent; color: var(--dim); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--acc); color: #08282c; font-weight: 600; }
.seg button { flex: 0 0 auto; }
.seg.small button { padding: 2px 9px; font-size: 11px; }

#tabs {
  display: flex; gap: 0; padding: 0 8px; flex: 0 0 auto;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
#tabs button {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; color: var(--dim); padding: 7px 14px;
}
#tabs button.on { color: var(--text); border-bottom-color: var(--acc); background: var(--bg); }

main { flex: 1; min-height: 0; display: flex; }
.tab { display: none; flex: 1; min-width: 0; min-height: 0; }
.tab.on { display: flex; }
.pad { padding: 16px; overflow: auto; flex: 1; min-width: 0; }
.scroll { overflow: auto; flex: 1; min-height: 0; }

#status {
  display: flex; gap: 16px; align-items: center; padding: 0 12px;
  height: 26px; flex: 0 0 auto; font-family: var(--mono); font-size: 11px;
  color: var(--dim); background: var(--panel2); border-top: 1px solid var(--line);
}
#problems { color: var(--red); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#problems .blame { cursor: pointer; text-decoration: underline dotted; }
#problems .blame:hover { text-decoration: underline; }

/* ---------------------------------------------------------- panes */
.split { display: flex; flex: 1; min-width: 0; min-height: 0; }
.pane {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--panel); border-right: 1px solid var(--line);
  width: 300px; flex: 0 0 300px;
}
.pane:last-child { border-right: 0; }
.pane.narrow { width: 208px; flex: 0 0 208px; }
.pane.wide { flex: 1; width: auto; }
.pane.grow { flex: 1; width: auto; }
.pane-h {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint);
  padding: 8px 10px 6px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
input, select, textarea {
  font: inherit; font-size: 12px; color: var(--text); background: var(--sunken);
  border: 1px solid var(--line2); border-radius: 3px; padding: 4px 8px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--acc); }
#toolbox-filter, #rows-filter, #blocks-filter {
  margin: 6px; width: calc(100% - 12px); flex: 0 0 auto;
}

/* ---------------------------------------------------------- rows list */
.row {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px;
  cursor: pointer; border-left: 2px solid transparent;
}
.row:hover { background: #1c2129; }
.row:focus-visible { outline: 0; background: #1c2129; border-left-color: var(--dim); }
.row.over { box-shadow: inset 0 2px 0 var(--acc); }
/* The row the compiler is complaining about. `#problems` names it too; this
   is so you can find it in a list of two hundred without reading the name. */
.row.bad { box-shadow: inset 2px 0 0 var(--red); }
.row.bad .nm { color: var(--red); }
.row.sel { background: var(--acc-dk); border-left-color: var(--acc); }
.row.off { opacity: .42; }
.row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .tag {
  font-family: var(--mono); font-size: 9.5px; color: var(--faint);
  border: 1px solid var(--line2); padding: 0 4px; border-radius: 2px;
}
/* Sticky, because a group header that scrolls away takes with it the only
   thing saying which group you are looking at. */
.row.group {
  color: var(--dim); font-family: var(--mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; padding-top: 10px; cursor: default;
  position: sticky; top: 0; z-index: 2; background: var(--panel);
  box-shadow: 0 1px 0 var(--line);
}
.sw { width: 22px; height: 12px; border-radius: 6px; background: var(--line2); position: relative; flex: 0 0 auto; }
.sw.on { background: var(--green); }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--bg); }
.sw.on::after { left: 12px; }
.star { color: var(--amber); }

/* ---------------------------------------------------------- improvements */
.hint-box {
  border: 1px dashed var(--line2); border-radius: 5px; padding: 18px 20px;
  max-width: 74ch; margin-bottom: 16px;
}
.hint-box p { color: var(--dim); margin: 0 0 10px; }
.hint-box .row { display: flex; gap: 8px; flex-wrap: wrap; padding: 0; cursor: default; }
.imp {
  border: 1px solid var(--line); border-radius: 5px; background: var(--panel);
  padding: 12px 14px; margin-bottom: 9px; display: flex; gap: 12px;
  align-items: flex-start; max-width: 96ch;
}
.imp input[type=checkbox] { width: auto; margin-top: 3px; accent-color: var(--acc); }
.imp .body { flex: 1; min-width: 0; }
.imp p { margin: 3px 0 0; color: var(--dim); font-size: 12px; }
.imp .ba { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 7px; font-family: var(--mono); font-size: 11px; }
.was { color: var(--faint); text-decoration: line-through; }
.now { color: var(--green); }
.pill { font-size: 10px; padding: 1px 6px; border-radius: 9px; border: 1px solid currentColor; }
.pill.proved { color: var(--green); }
.pill.likely { color: var(--amber); }
.sticky-apply {
  position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 40%);
  padding: 14px 0 4px; display: flex; gap: 10px; align-items: center;
}

/* ---------------------------------------------------------- blocks */
.canvas {
  background: var(--sunken); padding: 14px;
  background-image: radial-gradient(circle at 1px 1px, #1b2027 1px, transparent 0);
  background-size: 14px 14px;
}
.stack { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.node {
  border-radius: 4px; border: 1px solid rgba(0,0,0,.35); padding: 4px 8px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11.5px; color: #0d1014; cursor: grab;
}
.node.stmt { background: var(--stmt); }
.node.ctrl { background: var(--ctrl); }
.node.readout { background: var(--ui); }
.node.value { background: var(--val); }
.node.address { background: var(--addr); }
.node.bad { box-shadow: 0 0 0 2px var(--red); }
.node.moving { opacity: .4; }
/* "in front of this one". A statement takes a drop as well as the zone at the
   end of the list, or a move could only ever append. */
.node.before { box-shadow: 0 -3px 0 var(--acc); }
.socket.held { cursor: grab; }
/* The word the row writes, not the patch. Marked because it is the one the
   slider moves -- and because it is deliberately outside the guarded run. */
.words tr.tunable td { background: var(--acc-dk); }
.words tr.tunable .word { color: var(--acc); font-weight: 600; }
.cave h3 .tag {
  font-family: var(--mono); font-size: 9.5px; color: var(--faint);
  border: 1px solid var(--line2); padding: 0 4px; border-radius: 2px;
  margin-left: 6px; vertical-align: middle;
}
.canvas-bad {
  color: var(--red); border: 1px solid var(--red); border-radius: 3px;
  padding: 6px 9px; margin: 0 0 10px; font-size: 11.5px; max-width: 60ch;
}
.batch {
  display: flex; align-items: center; gap: 5px; flex: 0 0 auto;
  padding: 5px 6px; margin: 0 6px 6px; border-radius: 3px;
  background: var(--acc-dk); border: 1px solid var(--acc);
}
.batch > span:first-child {
  font-family: var(--mono); font-size: 10px; color: var(--text); padding: 0 3px;
}
.batch button { padding: 2px 7px; font-size: 10.5px; }
.row.mark { background: var(--acc-dk); }
.row.mark .nm { color: var(--text); }
.socket.held.moving { opacity: .4; }
.node .keep {
  font-family: var(--sans); font-size: 9.5px; letter-spacing: .04em;
  opacity: .45; cursor: pointer; text-transform: uppercase; padding: 0 2px;
}
.node .keep:hover { opacity: 1; }
.node .kw { font-weight: 600; }
.node .x { opacity: .5; cursor: pointer; font-weight: 600; padding: 0 2px; }
.node .x:hover { opacity: 1; }
.socket {
  background: rgba(10,12,15,.42); color: #e6ecf2; border-radius: 3px;
  padding: 1px 6px; display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(255,255,255,.08); min-height: 19px;
}
.socket.empty { color: #9fb0bd; border-style: dashed; background: rgba(10,12,15,.2); }
/* A constant the image says is executable, shown as the instruction it is.
   Five rows of `16991169...` say nothing; `str w1, [x8, #0x30]; ret` is the
   cheat. */
.socket.asm { background: rgba(10,12,15,.55); box-shadow: inset 0 0 0 1px rgba(95,154,107,.6); }
.socket.asm b { color: var(--ctrl); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.socket.asm .mn { color: #cfe3d3; }
.socket.over { border-color: var(--acc); background: rgba(82,182,194,.22); }
.socket input { width: 9ch; padding: 0 4px; font-family: var(--mono); font-size: 11px; background: rgba(0,0,0,.35); border-color: transparent; }
.socket input.wide { width: 18ch; }
.socket select { width: auto; padding: 0 2px; font-size: 11px; background: rgba(0,0,0,.35); border-color: transparent; }
.nest { border-left: 2px solid var(--ctrl); margin-left: 10px; padding: 6px 0 2px 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
/* Every level drawn the same made four-deep nesting a wall of identical
   rails. Fading each one in turn is enough to count them at a glance. */
.nest .nest { border-left-color: var(--val); }
.nest .nest .nest { border-left-color: var(--addr); }
.nest .nest .nest .nest { border-left-color: var(--line2); }
.dropzone {
  border: 1px dashed var(--line2); border-radius: 4px; padding: 4px 10px;
  color: var(--faint); font-family: var(--mono); font-size: 11px; min-width: 130px;
}
.dropzone.over { border-color: var(--acc); background: rgba(82,182,194,.12); color: var(--acc); }
.blk {
  display: flex; align-items: center; gap: 6px; padding: 3px 9px; margin: 0 6px 4px;
  border-radius: 3px; font-family: var(--mono); font-size: 11px; color: #0d1014;
  font-weight: 500; border: 1px solid rgba(0,0,0,.25); cursor: grab;
}
.blk small { font-weight: 400; opacity: .72; font-family: var(--sans); }
.blk.write { background: var(--stmt); }
.blk.control { background: var(--ctrl); }
.blk.address { background: var(--addr); }
.blk.value { background: var(--val); }
.blk.readout { background: var(--ui); }
.blk.other { background: var(--line2); color: var(--text); }
.blk.kept { background: var(--panel); color: var(--text); border: 1px dashed var(--line2); }
.blk.kept .x { opacity: .45; margin-left: 6px; }
.blk.kept .x:hover { opacity: 1; color: var(--red); }
.tbx-cat { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 10px 10px 5px; }

/* ---------------------------------------------------------- inspector */
/* Capped, because a form stretched over 1400px is unreadable -- the eye
   has to travel the whole width to get from a label to its box. */
.insp { padding: 10px; overflow: auto; }
.pane.wide .insp, .pane.grow .insp { max-width: 760px; }
.field { margin-bottom: 9px; }
.field label { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plain { background: var(--acc-dk); border-left: 2px solid var(--acc); padding: 8px 11px; font-size: 12px; line-height: 1.55; color: #cfe6ea; border-radius: 0 3px 3px 0; margin-bottom: 10px; }
.warn-box { background: #2a1d1c; border-left: 2px solid var(--red); padding: 8px 11px; font-size: 12px; color: #e7c3c0; border-radius: 0 3px 3px 0; margin-bottom: 10px; }

/* ---------------------------------------------------------- overlay preview */
.overlay-wrap { display: flex; gap: 24px; align-items: flex-start; }
.ovl {
  width: 448px; background: #000; border: 1px solid var(--line2);
  border-radius: 6px; padding: 12px 0 8px; flex: 0 0 auto;
  max-height: 720px; overflow: auto; position: relative;
}
.ovl-cat { padding: 12px 22px 4px; font-size: 11.5px; color: #5bd6e4; }
.ovl-row { display: flex; align-items: center; gap: 9px; padding: 8px 22px; font-size: 14px; color: #f0f0f0; }
.ovl-row.tall { padding: 15px 22px; }
.ovl-row .v { margin-left: auto; color: #9aa4ae; font-family: var(--mono); font-size: 13px; }
.ovl-note { padding: 0 22px 8px; margin-top: -5px; font-size: 11.5px; color: #8b8b8b; }
.ovl-bar { height: 5px; border-radius: 3px; background: #2f2f2f; flex: 1; max-width: 170px; position: relative; }
.ovl-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: #5bd6e4; }
.glyph { font-family: var(--mono); font-size: 11px; color: #d0d0d0; border: 1px solid #444; border-radius: 3px; padding: 0 5px; }
.fold { border-top: 1px dashed #333; margin: 0 18px; position: relative; }
.fold span { position: absolute; right: 0; top: -8px; background: #000; color: #666; font-size: 10px; font-family: var(--mono); padding: 0 4px; }

/* ---------------------------------------------------------- examples */
.ex h2 { margin-bottom: 10px; }
.ex .q { font-size: 15px; color: var(--text); margin: 0 0 10px; }
.ex .why { max-width: 76ch; color: var(--dim); font-size: 13px; line-height: 1.65; }
.ex .caution { margin-top: 10px; }
.ex form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); margin: 16px 0; max-width: 76ch; }
.ex form label { display: flex; flex-direction: column; gap: 3px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.words { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; max-width: 76ch; }
.words th { text-align: left; font-size: 9.5px; letter-spacing: .11em; text-transform: uppercase; color: var(--faint); font-weight: 500; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); }
.words td { padding: 5px 12px 5px 0; border-bottom: 1px solid var(--line); }
.words .word { color: var(--amber); }
.words .no { color: var(--faint); font-style: italic; }
.src { font-size: 11.5px; color: var(--faint); margin-top: 14px; max-width: 76ch; }

/* ---------------------------------------------------------- annotated listing */
.listing { font-family: var(--mono); font-size: 11.5px; line-height: 1.7; background: var(--sunken); padding: 12px 14px; border-radius: 4px; overflow-x: auto; }
.listing .l { white-space: pre; }
.listing .hd { color: var(--ctrl); }
.listing .dw { color: var(--dim); }
.listing .cm { color: var(--acc); }

/* ---------------------------------------------------------- caves */
.cave form { display: grid; gap: 10px; grid-template-columns: 1fr 200px; max-width: 860px; margin-bottom: 14px; }
.cave label { display: flex; flex-direction: column; gap: 3px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.cave textarea { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; min-height: 150px; resize: vertical; }
.cave .tpl { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cave .tpl button { font-size: 11.5px; }
.site { font-family: var(--mono); font-size: 12px; background: var(--sunken); border-radius: 4px; padding: 10px 12px; max-width: 860px; }
.site .l { white-space: pre; color: var(--dim); }
.site .l.here { color: var(--amber); font-weight: 600; }
.site .l.here::after { content: "   <- the branch replaces this"; color: var(--faint); font-weight: 400; }
.bar-used { display: flex; height: 16px; border-radius: 3px; overflow: hidden; background: var(--sunken); border: 1px solid var(--line2); margin: 8px 0; }
.bar-used i { display: block; height: 100%; }
.bar-used i.mine { background: var(--acc); }
.bar-used i.free { background: transparent; }
.alloc-row { display: flex; gap: 10px; font-family: var(--mono); font-size: 11.5px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.alloc-row b { color: var(--acc); font-weight: 500; }

/* ---------------------------------------------------------- run */
.run-controls { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.run-controls label { font-size: 11px; color: var(--faint); font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.run-controls input, .run-controls select { margin-top: 3px; }
.run-controls > label { display: flex; flex-direction: column; }
pre {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6; margin: 0;
  background: var(--sunken); padding: 12px 14px; border-radius: 4px;
  overflow: auto; color: var(--text); white-space: pre;
}
table.t { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11.5px; margin-top: 12px; }
table.t th { text-align: left; font-size: 9.5px; letter-spacing: .11em; text-transform: uppercase; color: var(--faint); font-weight: 500; padding: 6px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 4px 10px; border-bottom: 1px solid var(--line); }
td.wrote { color: var(--amber); }

/* ---------------------------------------------------------- start sheet */
#start {
  position: fixed; inset: 0; z-index: 55; background: rgba(8,10,13,.78);
  display: grid; place-items: center; padding: 20px; overflow: auto;
}
#start .sheet {
  background: var(--panel); border: 1px solid var(--line2); border-radius: 8px;
  padding: 22px 24px; width: min(720px, 100%); max-width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 20px; }
/* minmax(0, ...) rather than a bare 1fr: a grid track's automatic minimum is
   its item's min-content width, so without it a wide card pushes the track
   wider than the sheet instead of wrapping inside it. */
.choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; margin-top: 16px; }
.choice {
  display: flex; gap: 13px; align-items: flex-start; text-align: left;
  width: 100%; max-width: 100%; min-width: 0;
  padding: 13px 15px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--panel2);
  color: var(--text); font: inherit; cursor: pointer; position: relative;
  /* These cards are buttons and labels, and the shared rule for those sets
     `white-space: nowrap` -- right for a toolbar button, wrong for a
     paragraph. Every description ran off the side of the sheet. */
  white-space: normal;
}
.choice:hover { border-color: var(--acc); background: #232935; }
.choice .n {
  flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--sunken);
  border: 1px solid var(--line2); color: var(--dim);
  font-family: var(--mono); font-size: 11px; display: grid; place-items: center;
}
.choice:hover .n { border-color: var(--acc); color: var(--acc); }
.choice .c { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.choice .c b { font-size: 14px; font-weight: 600; }
.choice .c span { font-size: 12.5px; color: var(--dim); line-height: 1.55; overflow-wrap: anywhere; }
.choice .tick:empty { display: none; }
.choice .tick { color: var(--green); font-size: 12px; font-family: var(--mono); }
.choice.filebtn { overflow: visible; }
.choice.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* ---------------------------------------------------------- overlays */
#drop {
  position: fixed; inset: 0; background: rgba(8,10,13,.86); z-index: 50;
  display: grid; place-items: center; font-size: 19px; color: var(--acc);
}
#drop div { border: 2px dashed var(--acc); border-radius: 10px; padding: 46px 62px; }
#toast {
  position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--acc);
  border-radius: 4px; padding: 10px 16px; z-index: 60; max-width: 74ch;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
#toast.bad { border-left-color: var(--red); }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: 6px; padding: 18px 20px; min-width: 42ch; }
dialog::backdrop { background: rgba(8,10,13,.7); }
dialog menu { display: flex; gap: 8px; justify-content: flex-end; padding: 0; margin: 14px 0 0; }
dialog input { margin-top: 8px; }

@media (max-width: 900px) {
  .split { flex-direction: column; }
  .pane, .pane.narrow { width: auto; flex: 0 0 auto; max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .overlay-wrap { flex-direction: column; }
  .ovl { width: 100%; max-width: 448px; }
}
