/* Disaster City live demo. Dark, legible from a distance; everything is sized in rem and rem follows the window width. */
:root {
  --bg: #0b0e13; --panel: #141a22; --panel2: #1b222c; --line: #2b3440; --text: #e8edf3; --muted: #8e9bab;
  --accent: #4da3ff; --green: #3fbf4a; --red: #ff5a52; --amber: #f0b429; --orange: #ff9838; --purple: #b693ff; --teal: #4fd1c5;
  --found: #2ca02c; --missed: #d62728;
  --mono: ui-monospace, "DejaVu Sans Mono", "Liberation Mono", Menlo, Consolas, monospace;
}
html { font-size: clamp(11.5px, 0.9vw, 18px); }
* { box-sizing: border-box; }
body { margin: 0; height: 100vh; overflow: hidden; display: grid; grid-template: auto minmax(0, 1fr) / minmax(0, 1fr);
  background: var(--bg); color: var(--text); font: 1rem/1.35 system-ui, "Segoe UI", "DejaVu Sans", Arial, sans-serif; }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: #3a4554 transparent; }
.muted, small { color: var(--muted); }
.spacer { flex: 1; }

button, select, input[type=number] { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: .4rem; padding: .32rem .7rem; }
button { cursor: pointer; white-space: nowrap; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.accent { background: #1f4f8a; border-color: #2f6fb8; }
button.mode.on, .seg button.on { background: var(--amber); border-color: var(--amber); color: #111; }
button.mode.on { font-weight: 600; }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; flex: none; }
/* the drone picker: one button per drone, in its colour (--c) */
.robot-pick { display: inline-flex; gap: .3rem; }
.robot-pick button { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .55rem; font-size: .93rem; color: var(--muted); }
.robot-pick button i { width: .7em; height: .7em; border-radius: 50%; background: var(--c); }
.robot-pick button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 38%, var(--panel)); color: #fff; font-weight: 600; }
select, input[type=number] { padding: .2rem .3rem; }
input[type=range] { accent-color: var(--amber); }
kbd { font: .85em var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: .3rem; padding: 0 .35rem; background: var(--panel2); }
.spin { display: none; width: .85em; height: .85em; margin-right: .45em; vertical-align: -.1em; border: .16em solid rgba(255, 255, 255, .3);
  border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.busy > .spin, .busy.spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- top bar ---- */
#bar { display: flex; align-items: center; gap: .8rem; padding: .4rem .7rem; background: var(--panel); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
#bar > * { flex: none; }
#bar .title { display: flex; align-items: baseline; gap: .5rem; flex: 0 1 auto; min-width: 0; }
#bar .title b { flex: none; font-size: 1.25rem; letter-spacing: .01em; }
#bar .title span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#bar .spacer { flex: 1 1 0; }
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .2rem .75rem; border-radius: 99px; font-weight: 600; border: 1px solid; }
.pill i { width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; }
.pill.searching { color: var(--green); } .pill.searching i { animation: pulse 1.4s ease-in-out infinite; }
.pill.waiting { color: var(--amber); }
.pill.offline { color: var(--red); background: rgba(255, 90, 82, .12); }
@keyframes pulse { 50% { opacity: .25; } }
.stat { position: relative; display: flex; align-items: baseline; gap: .35rem; }
.stat b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.sep { width: 1px; align-self: stretch; background: var(--line); }

/* ---- layout ---- */
main { display: grid; grid-template-columns: minmax(0, 57fr) minmax(0, 43fr); gap: .5rem; padding: .5rem; min-height: 0; }
#map-panel, .cam, #tabs { background: var(--panel); border: 1px solid var(--line); border-radius: .5rem; overflow: hidden; }
#side { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .5rem; min-height: 0; min-width: 0; }

/* ---- map ---- */
#map-panel { position: relative; background: #07090c; min-height: 0; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#map.dragging { cursor: grabbing; }
#map.aim { cursor: crosshair; }
#map.pick { cursor: pointer; }
#map-tools { position: absolute; top: .5rem; left: .5rem; display: flex; gap: .4rem; }
#map-tools button, #legend, #mode-strip, #tooltip { background: rgba(13, 17, 23, .86); backdrop-filter: blur(3px); }
#map-tools button.on { background: var(--amber); border-color: var(--amber); color: #111; font-weight: 600; }
#mode-strip { position: absolute; top: 3rem; left: .5rem; display: flex; align-items: center; gap: .2rem .9rem; padding: .4rem .7rem;
  border: 1px solid var(--amber); border-radius: .5rem; max-width: calc(100% - 1rem); flex-wrap: wrap; }
#mode-strip b { color: var(--amber); margin-right: .4rem; }
#mode-strip span { white-space: nowrap; }
#mode-strip .for-goto, #mode-strip .for-add { display: contents; }
#mode-strip label { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); }
#mode-strip input[type=range] { width: 4.5rem; }
#mode-strip input[type=number] { width: 3.4rem; }
#mode-strip select { max-width: 9.5rem; }
#mode-strip output { display: inline-block; width: 2.4rem; color: var(--text); font-variant-numeric: tabular-nums; }
#mode-strip:not(.goto) .for-goto, #mode-strip:not(.add) .for-add { display: none; }
#map-banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); padding: .9rem 1.6rem; border-radius: .6rem; text-align: center;
  font-size: 1.5rem; font-weight: 700; background: rgba(13, 17, 23, .9); border: 1px solid var(--amber); color: var(--amber); pointer-events: none; }
#map-banner.offline { border-color: var(--red); color: var(--red); }
#map-banner small { display: block; font-size: .95rem; font-weight: 400; margin-top: .2rem; }
#map-panel.offline #map { filter: grayscale(.8) brightness(.6); }
#legend { position: absolute; left: .5rem; bottom: .5rem; padding: .35rem .6rem .45rem; border: 1px solid var(--line); border-radius: .5rem;
  font-size: .88rem; line-height: 1.5; user-select: none; }
#legend > * { display: flex; align-items: center; gap: .35rem; }
#legend.collapsed > :not(#legend-toggle), #map-panel:not(.details) #legend .layer { display: none; }
#legend-toggle { cursor: pointer; margin: 0; color: var(--text); }
#legend-toggle::after { content: '▾'; margin-left: auto; padding-left: .6rem; }
#legend.collapsed #legend-toggle::after { content: '▸'; }
#legend label { cursor: pointer; }
#legend label:has(input:not(:checked)) { color: var(--muted); }
#legend input { margin: 0 .1rem 0 0; accent-color: var(--accent); }
#legend svg { width: 1.1em; height: 1.1em; flex: none; }
.legend-title { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; margin-top: .25rem; }
.legend-title:first-child { margin-top: 0; }
#tooltip { position: absolute; z-index: 5; pointer-events: none; padding: .35rem .6rem; border: 1px solid var(--line); border-radius: .4rem;
  font-size: .92rem; white-space: nowrap; }

/* ---- cameras ---- */
#cams:not(.scene) #scene, #cams.scene #pov { display: none; }              /* one camera at a time */
.cam-head { display: flex; align-items: center; gap: .5rem; padding: .25rem .5rem; min-height: 2.1rem; white-space: nowrap; }
.cam-head b { overflow: hidden; text-overflow: ellipsis; }
.cam-head .seg, .cam-head button { flex: none; }
.seg { display: inline-flex; }
.seg button { border-radius: 0; margin-left: -1px; padding: .12rem .5rem; font-size: .93rem; }
.seg button:first-child { border-radius: .4rem 0 0 .4rem; margin-left: 0; }
.seg button:last-child { border-radius: 0 .4rem .4rem 0; }
.cam-body { position: relative; aspect-ratio: 16 / 10; max-height: 56vh; width: 100%; background: #000; overflow: hidden; outline: none; }
.cam-body img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: none; user-select: none; }
.cam-body.has-frame img { display: block; }
.cam-body.has-frame .placeholder { display: none; }
.placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1rem; color: var(--muted);
  background: repeating-linear-gradient(45deg, #0d1116 0 12px, #10151c 12px 24px); }
.hud { position: absolute; padding: .15rem .5rem; background: rgba(0, 0, 0, .62); border-radius: .3rem; font-size: .92rem; max-width: calc(100% - .8rem);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.hud:empty { display: none; }
.hud.bl { left: .4rem; bottom: .4rem; } .hud.br { right: .4rem; bottom: .4rem; font-variant-numeric: tabular-nums; }
.hud.tl { left: .4rem; top: .4rem; font-weight: 600; }
#pov-purpose { max-width: calc(100% - 8rem); }
#scene .cam-body.free { cursor: move; }
#scene .cam-body.free:focus { box-shadow: inset 0 0 0 2px var(--amber); }
.found-banner { position: absolute; left: 0; right: 0; top: 0; padding: .35rem; text-align: center; font-size: 1.2rem; font-weight: 700;
  color: #fff; background: rgba(44, 160, 44, .92); transform: translateY(-110%); pointer-events: none; }
.found-banner.show { animation: banner 5s ease-out; }
@keyframes banner { 0%, 100% { transform: translateY(-110%); } 4%, 90% { transform: none; } 8%, 16% { background: #7dff7d; color: #000; } 12%, 20% { background: rgba(44, 160, 44, .92); color: #fff; } }

/* ---- tabs ---- */
#tabs { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
#tabs nav { display: flex; border-bottom: 1px solid var(--line); background: var(--panel2); }
#tabs nav button { flex: 1; border: 0; border-radius: 0; background: none; color: var(--muted); padding: .45rem .3rem; border-bottom: 2px solid transparent; font-weight: 600; }
#tabs nav button.on { color: var(--text); border-bottom-color: var(--accent); background: var(--panel); }
#tab-body { position: relative; min-height: 0; }
.pane { position: absolute; inset: 0; overflow: auto; padding: .6rem .8rem; display: none; }
.pane.on { display: block; }
.pane h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: .9rem 0 .35rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600;
  white-space: nowrap; }
.pane h3 span, .pane h3 button { text-transform: none; letter-spacing: 0; font-weight: 400; }
.pane h3 button { margin-left: auto; padding: 0 .6rem; border-radius: 99px; font-size: .85rem; color: var(--muted); }
.pane h3 button.on { background: var(--accent); border-color: var(--accent); color: #06121f; font-weight: 600; }
.pane h3:first-child { margin-top: 0; }
.empty { color: var(--muted); padding: 1.2rem .2rem; }
.chip { display: inline-block; padding: 0 .5rem; border-radius: 99px; font-size: .82rem; line-height: 1.5; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.cover { color: #7fd0ff; border-color: #2c5f80; } .chip.inspect { color: #ffc978; border-color: #7d5a23; }
.chip.operator { color: var(--orange); border-color: var(--orange); }
.chip.ok, .chip.found, .chip.done { color: var(--green); border-color: #2c6e33; } .chip.bad, .chip.missed { color: var(--red); border-color: #7c2f2b; }
.chip.taken { color: var(--amber); border-color: #7d6420; } .chip.open { color: var(--text); } .chip.why-llm { color: var(--purple); border-color: #5b4a8a; }
.chip.added { color: #5ee6ff; border-color: #2a6e7c; }

.plan-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.plan-head .big { font-size: 1.5rem; font-weight: 700; }
details.steps { margin: .3rem 0 .6rem; color: var(--muted); }
details summary { cursor: pointer; }
details.steps ol { margin: .3rem 0 0; padding-left: 2.2rem; columns: 2; font: .88rem var(--mono); }
details.tasks-done { margin-top: .9rem; }
details.tasks-done summary { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin-bottom: .35rem; }
.task { display: grid; grid-template-columns: 1.7rem minmax(0, 1fr) 4.4rem 2.6rem 3rem; align-items: center; gap: .55rem; padding: .32rem .5rem;
  border: 1px solid transparent; border-radius: .4rem; cursor: pointer; }
.task:nth-child(odd) { background: rgba(255, 255, 255, .025); }
.task:hover { border-color: var(--line); }
.task.hi { border-color: #ffe14d; background: rgba(255, 225, 77, .1); }
.task.current { border-color: var(--amber); background: rgba(240, 180, 41, .09); cursor: pointer; }
.task .n { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.task .what { min-width: 0; }
.task .what b { display: block; font: 600 .95rem var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .what small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .val, .task .fl { text-align: right; font-variant-numeric: tabular-nums; }
.task .chip { justify-self: center; }
.task-cols { display: grid; grid-template-columns: 1.7rem minmax(0, 1fr) 4.4rem 2.6rem 3rem; gap: .55rem; padding: 0 .5rem; font-size: .78rem; color: var(--muted); text-align: right; }
.task-cols span:nth-child(2) { text-align: left; }
.task-cols span:nth-child(3) { text-align: center; }

/* overview: what each drone does, who was found, what happened */
.pane.overview { padding: .7rem 1rem; }
.drone { display: flex; align-items: baseline; gap: .5rem; padding: .22rem .5rem; border: 1px solid transparent; border-radius: .4rem; cursor: pointer; font-size: 1.1rem; }
.drone.on { border-color: var(--line); background: rgba(255, 255, 255, .04); }
.drone > b { flex: none; }
.drone span { min-width: 0; } .drone span b { font-size: 1.2rem; } .drone small { display: block; font-size: .95rem; }
.events { max-height: 9.5rem; overflow: auto; border-bottom: 1px solid rgba(255, 255, 255, .05); margin-bottom: .9rem; }

.pane.program { padding: 0; display: none; overflow: hidden; grid-template: auto minmax(0, 1fr) / minmax(0, 1fr); }
.pane.program.on { display: grid; }
.files { display: flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-bottom: 1px solid var(--line); }
.files button { font-family: var(--mono); font-size: .9rem; padding: .15rem .6rem; }
.files button.on { background: var(--accent); border-color: var(--accent); color: #06121f; font-weight: 600; }
.files .muted { margin-left: auto; font: .85rem var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code { overflow: auto; display: flex; background: #0c1016; font: .92rem/1.55 var(--mono); }
.code pre { margin: 0; padding: .6rem .9rem; font: inherit; tab-size: 4; flex: none; }
.code pre.gutter { padding-right: .7rem; text-align: right; color: #4b5767; user-select: none; border-right: 1px solid var(--line); position: sticky; left: 0; background: #0c1016; }
.code.wrap pre.src { white-space: pre-wrap; flex: 1 1 0; min-width: 0; font-size: 1rem; }
.tk-c { color: #7d8b9b; font-style: italic; } .tk-s { color: #a5d6a7; } .tk-k { color: #ff9e64; } .tk-n { color: #d6b4ff; } .tk-f { color: #7fd0ff; font-weight: 600; }
.tk-v { color: #ffd666; } .tk-b { color: #7fd0ff; } .tk-h { color: #fff; font-weight: 700; } .tk-m { color: var(--amber); }

.llm-head { display: flex; gap: 1.6rem; margin-bottom: .6rem; }
.llm-head div { display: flex; flex-direction: column; }
.llm-head small { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.llm-head b { font-size: 1.15rem; }
.llm-head b.busy { color: var(--purple); }
.llm-head .auto { margin-left: auto; }
.llm-head .auto span { display: flex; align-items: center; gap: .5rem; }
.notes p.run { color: var(--text); }
.switch { position: relative; flex: none; width: 2.7rem; height: 1.5rem; padding: 0; border-radius: 99px; background: #2b3440; border-color: #46515f; }
.switch i { position: absolute; top: 50%; left: .15rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #c9d3de; transform: translateY(-50%); transition: left .15s; }
.switch.on { background: var(--purple); border-color: var(--purple); }
.switch.on i { left: calc(100% - 1.25rem); background: #fff; }
.call { border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: .4rem; padding: .45rem .7rem; margin-bottom: .5rem; background: rgba(255, 255, 255, .02); }
.call.rejected { border-left-color: var(--red); }
.call header { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.call .reason { margin: .25rem 0; }
.call .problems { margin: .25rem 0; padding-left: 1.2rem; color: var(--red); }
.notes { color: #c9d3de; font-size: .93rem; }
.notes p { margin: .3rem 0; } .notes ul { margin: .3rem 0; padding-left: 1.2rem; } .notes h4 { margin: .5rem 0 .2rem; }
.notes code, .kv code { font-family: var(--mono); font-size: .92em; background: rgba(255, 255, 255, .07); padding: 0 .25em; border-radius: .25em; }

.event { display: grid; grid-template-columns: 3.9rem 4.6rem minmax(0, 1fr); gap: .6rem; padding: .16rem .2rem; border-top: 1px solid rgba(255, 255, 255, .05); }
.event time { color: var(--muted); font-variant-numeric: tabular-nums; }
.event .kind { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; align-self: center; }
.event.found { background: rgba(44, 160, 44, .13); } .event.found .kind { color: var(--green); } .event.found .text { font-weight: 600; }
.event.plan .kind { color: var(--accent); } .event.llm .kind { color: var(--purple); } .event.operator .kind { color: var(--orange); }
.event.task .kind { color: var(--muted); } .event.task .text { color: #c2ccd8; } .event.sim .kind { color: var(--teal); }

.sv-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.sv-head .big { font-size: 1.5rem; font-weight: 700; }
.sv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: .8rem; margin-top: .5rem; align-items: start; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .8rem; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.report { width: 100%; border-radius: .4rem; border: 1px solid var(--line); display: block; background: #000; }
.report-none { aspect-ratio: 16 / 10; position: relative; border-radius: .4rem; overflow: hidden; border: 1px solid var(--line); }
.found-list { display: flex; flex-wrap: wrap; gap: .3rem; }
.found-list button { padding: .05rem .5rem; border-radius: 99px; font-size: .88rem; }
.found-list button.on { border-color: #ffe14d; color: #ffe14d; }
.found-list button.f { color: var(--green); }

/* plots: inline SVG in viewBox units close to CSS px */
.plot svg { display: block; width: 100%; height: auto; }
.plot svg text { fill: #c9d3de; font-size: 13px; font-variant-numeric: tabular-nums; }
.plot svg text.val { fill: #fff; font-weight: 600; } .plot svg text.none { fill: var(--muted); }
.plot svg .grid { stroke: rgba(255, 255, 255, .09); } .plot svg .axis { stroke: #5b6878; fill: none; }
.plot svg .line { fill: none; stroke-linejoin: round; stroke-linecap: round; } .plot svg .rest { fill: #2b3440; }
.plot h3 .key { margin-left: auto; display: flex; gap: .9rem; color: var(--text); font-size: .9rem; }
.plot h3 .key span { display: inline-flex; align-items: center; gap: .35rem; }
.plot h3 .key i { width: 1.1rem; height: .22rem; border-radius: 2px; }
.plot-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .9rem 1.2rem; margin-top: .9rem; }
.plot-grid h3 { margin-top: 0; }

/* ---- toasts ---- */
#toasts { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .4rem; z-index: 20; pointer-events: none; }
.toast { padding: .5rem 1.1rem; border-radius: .5rem; font-size: 1.05rem; background: #10301a; border: 1px solid var(--green); color: #d9ffe0; box-shadow: 0 4px 18px rgba(0, 0, 0, .5);
  animation: toast 4.5s ease forwards; }
.toast.bad { background: #3a1513; border-color: var(--red); color: #ffe1df; }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 5%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }


/* the operator's actions: one colour each, the colour of what the action leaves on the map and in the events
   (the go-to cross, the added survivor's ring, the plan and LLM events) */
#btn-goto { --c: var(--orange); } #btn-add { --c: #5ee6ff; } #btn-llm { --c: var(--purple); } #btn-restart { --c: var(--red); }
#bar button.act { background: var(--c); border-color: var(--c); color: #0b0e13; font-weight: 700; padding: .4rem 1rem;
  box-shadow: 0 0 1rem -.25rem var(--c); }
#bar button.act:hover:not(:disabled) { filter: brightness(1.15); border-color: #fff; }
#bar button.act.on { outline: .17rem solid #fff; outline-offset: .13rem; animation: armed .9s ease-in-out infinite alternate; }   /* armed: click the map */
@keyframes armed { to { box-shadow: 0 0 1.5rem .1rem var(--c); } }
#btn-llm .spin { border-color: rgba(0, 0, 0, .25); border-top-color: #111; }
#mode-strip.goto { border-color: var(--orange); } #mode-strip.goto b { color: var(--orange); }
#mode-strip.add { border-color: #5ee6ff; } #mode-strip.add b { color: #5ee6ff; }

/* ---- the launcher: setup screen, start progress, Restart dialog (one card over the dimmed page) ---- */
#setup { position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; padding: 1rem; background: rgba(5, 7, 10, .62); backdrop-filter: blur(2px); }
#setup .card { width: min(47rem, 100%); max-height: 100%; overflow: auto; padding: 1.4rem 1.7rem 1.3rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: .8rem; box-shadow: 0 1rem 4rem rgba(0, 0, 0, .65); }
#setup.progress .card { width: min(38rem, 100%); }
#setup h2 { margin: 0; font-size: 1.7rem; }
#setup h2 .spin { width: .75em; height: .75em; }
#setup .lead { margin: .25rem 0 0; color: var(--muted); }
#setup h4 { margin: 1.15rem 0 .45rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
#setup em { font-style: normal; font-size: .88rem; color: var(--amber); }
#setup .pick-n { display: flex; gap: .5rem; }
#setup .pick-n button { min-width: 4.2rem; padding: .4rem 1rem; font-size: 1.25rem; font-weight: 700; }
#setup .progs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
#setup .prog { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; padding: .6rem .8rem .7rem; text-align: left; white-space: normal; }
#setup .prog b { font-size: 1.12rem; }
#setup .prog small { font-size: .92rem; line-height: 1.3; }
#setup .prog:disabled { opacity: .6; }
#setup .pick-n button.on, #setup .prog.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 24%, var(--panel2)); box-shadow: inset 0 0 0 1px var(--accent); }
#setup .prog.on small { color: #c9d3de; }
#setup .auto-row { display: flex; align-items: center; gap: .6rem; min-height: 2.8rem; }
#setup .auto-row b { min-width: 1.7rem; }
#setup .hint { margin-left: .5rem; color: #c9d3de; }
#setup .hint b { color: var(--purple); }
#setup .what { display: flex; flex-direction: column; gap: .45rem; margin-top: 1.15rem; padding: .6rem .85rem; border-radius: .5rem; border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, .045); }
#setup .what label { display: flex; align-items: center; gap: .45rem; align-self: flex-start; color: var(--muted); cursor: pointer; }
#setup .what input { margin: 0; accent-color: var(--red); }
#setup footer { display: flex; align-items: center; gap: .6rem; margin-top: 1.2rem; }
#setup footer button { padding: .45rem 1.1rem; }
#setup button.go { min-width: 8rem; padding: .5rem 1.6rem; font-size: 1.15rem; font-weight: 700; background: var(--accent); border-color: var(--accent); color: #06121f; }
#setup button.go.again { background: var(--red); border-color: var(--red); color: #0b0e13; }
#setup button.go:hover:not(:disabled) { filter: brightness(1.12); border-color: #fff; }
#setup button.quiet { background: none; color: var(--muted); }
#setup button.quiet:hover, #setup button.quiet.on { border-color: var(--red); color: var(--red); }
#setup .fail { margin-top: .9rem; padding: .6rem .85rem; border: 1px solid #7c2f2b; border-radius: .5rem; background: rgba(255, 90, 82, .09); }
#setup .fail b { color: var(--red); }
#setup .fail p { margin: .15rem 0 0; }
#setup .log { margin: .6rem 0 0; max-height: 8.5rem; overflow: auto; font: .8rem/1.45 var(--mono); color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
#setup .msg { margin: .5rem 0 .9rem; min-height: 1.4em; font-size: 1.1rem; }
#setup .bar { height: .7rem; border-radius: 99px; background: #232c37; overflow: hidden; }
#setup .bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .25s linear; }
#setup .bar.unknown i { width: 35%; animation: slide 1.3s ease-in-out infinite alternate; }
@keyframes slide { from { margin-left: 0; } to { margin-left: 65%; } }
#setup .bar-text { display: flex; justify-content: space-between; margin-top: .3rem; color: var(--muted); font-variant-numeric: tabular-nums; }
#setup .log:empty { display: none; }
