/* CSS only to group things in tables (README). No layout framework. */
:root { --line: #d7dbe0; --muted: #667; --bg2: #f6f7f9; --ok: #1a7f37; --err: #b42318; --chg: #fff4ce; }
body { margin: 0; font: 14px/1.4 system-ui, sans-serif; color: #111; }
nav { display: flex; gap: 14px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--bg2); flex-wrap: wrap; }
nav a { color: #1f4e9c; text-decoration: none; }
nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; }
nav .who { margin-left: auto; color: var(--muted); }
nav .env { padding: 1px 8px; border-radius: 10px; background: #e8eefc; font-size: 12px; }
main { padding: 12px 14px; }
h1 { font-size: 18px; margin: 4px 0 10px; }
p.hint { color: var(--muted); margin: 4px 0 10px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar label { display: inline-flex; gap: 6px; align-items: center; }
output.status { color: var(--muted); }
output.status.err { color: var(--err); }
output.status.ok { color: var(--ok); }

/* ── tables ── */
table.t { border-collapse: collapse; width: 100%; }
table.t th, table.t td { border: 1px solid var(--line); padding: 3px 6px; text-align: left; vertical-align: top; white-space: nowrap; }
table.t thead th { position: sticky; top: 0; background: var(--bg2); z-index: 1; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t td.changed { background: var(--chg); }
table.t td.actions { white-space: nowrap; }
table.t td.msg { color: var(--muted); max-width: 26em; white-space: normal; }
table.t td.msg.err { color: var(--err); }
table.t td.msg.ok { color: var(--ok); }
table.t input, table.t select { font: inherit; width: 100%; box-sizing: border-box; min-width: 6em; }
table.t input[type=number] { width: 8em; }
table.t tr.new td { background: #f0fff4; }
/* column groups: colour the header band so the reader sees which columns belong together */
table.t colgroup.g-id { background: #f3f4f6; }
table.t colgroup.g-pos { background: #eef6ff; }
table.t colgroup.g-meta { background: #fdf7e7; }
table.t colgroup.g-act { background: #f6f0ff; }
/* subtable row: one nested table under the row that opened it */
table.t tr.sub > td { background: #fbfbfd; padding: 6px 10px 10px 28px; white-space: normal; }
table.t tr.sub table.t { width: auto; }
.pager { display: flex; gap: 8px; align-items: center; margin: 8px 0; color: var(--muted); }
button { font: inherit; padding: 2px 8px; }

/* ── searchable dropdown ── */
details.dd { position: relative; display: inline-block; min-width: 8em; max-width: 100%; }
details.dd > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; background: #fff; max-width: 22em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.dd > summary::-webkit-details-marker { display: none; }
details.dd > summary::after { content: ' ▾'; color: var(--muted); }
details.dd .dd-pop { position: absolute; z-index: 5; top: 100%; left: 0; min-width: 16em; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.12); padding: 6px; }
details.dd .dd-pop input[type=search] { width: 100%; box-sizing: border-box; margin-bottom: 4px; }
details.dd .dd-tools { display: flex; gap: 6px; margin-bottom: 4px; }
details.dd .dd-list { max-height: 14em; overflow: auto; }
details.dd .dd-list label { display: flex; gap: 6px; align-items: center; padding: 1px 2px; white-space: nowrap; }
details.dd .dd-list label span { flex: 1; }
details.dd .dd-only { font-size: 11px; padding: 0 4px; }

/* ── geometry plot ── */
svg.plot { width: 100%; max-width: 900px; height: auto; border: 1px solid var(--line); background: #fff; }
svg.plot .pt { fill: #1f6feb; }
svg.plot .shape { fill: rgba(31,111,235,.12); stroke: #1f6feb; stroke-width: 1.5; }
svg.plot .lbl { font: 11px system-ui, sans-serif; fill: #333; }

/* ── login ── */
form.login { max-width: 380px; margin: 60px auto; display: grid; gap: 8px; }
form.login input, form.login select, form.login button { font: inherit; padding: 6px 8px; }

/* ── cached: the parts `simplest` does not have ────────────────────────────────────────────────── */
/* the status bar under the nav: cache state, stream state, purge */
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 14px; border-bottom: 1px solid var(--line); background: #fbfbfd; font-size: 12px; color: var(--muted); }
.bar .chip { display: inline-flex; gap: 5px; align-items: center; }

/* Where a row came from. 🔴 Colour carries MEANING here and nothing else: no stripes, no hover
   tint, no decoration. A row is marked by a bar on its left edge, never by a filled background —
   a filled row competes with the data in it and, when the palette is reused for the legend dots,
   paints entire rows (which is exactly what it did before 2026-09-19).
   The dot classes are scoped to `.dot` for the same reason: they must not bleed onto a <tr>. */
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.src-cache { background: #6d4fc2; }        /* served from IndexedDB */
.dot.src-net   { background: #1a7f37; }        /* asked of the backend this load */
.dot.src-live  { background: #1f6feb; }        /* arrived on the stream */
.dot.src-none  { background: #b42318; }        /* no data / not intact */
table.t tbody tr.src-cache td:first-child { box-shadow: inset 3px 0 0 #6d4fc2; }
table.t tbody tr.src-net   td:first-child { box-shadow: inset 3px 0 0 #1a7f37; }
table.t tbody tr.src-live  td:first-child { box-shadow: inset 3px 0 0 #1f6feb; }
table.t tbody tr.src-none  td:first-child { box-shadow: inset 3px 0 0 #b42318; }
/* no alternating stripes in this instance: they were removed from the base rules above, not
   overridden here — decoration competes with the only colour that means something. */

/* map: left column · table · info window, one dataset behind all three */
.split { display: flex; gap: 12px; align-items: flex-start; }
.split .side { flex: 0 0 260px; max-height: 78vh; overflow: auto; }
.split .grow { flex: 1 1 auto; min-width: 0; }
.split .info { flex: 0 0 320px; max-height: 78vh; overflow: auto; border-left: 1px solid var(--line); padding-left: 10px; }
.split h2 { font-size: 14px; margin: 4px 0 6px; }
.devlist { display: flex; flex-direction: column; gap: 3px; }
.dev { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; }
.dev .nm { font-weight: 600; }
.dev .mt { font-size: 11px; color: var(--muted); }
.dev.sel { outline: 2px solid #1f6feb; }
/* how long ago it reported */
.dev.ok   { border-left: 4px solid #1a7f37; }
.dev.warn { border-left: 4px solid #d29922; }
.dev.old  { border-left: 4px solid #b42318; }
.dev.no   { border-left: 4px solid #d7dbe0; color: var(--muted); }
.info table.t th { width: 11em; background: var(--bg2); }

/* ── ver como: identical rule to `simplest` — loud while active, silent otherwise ──────────────── */
.viewas { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.viewas.on { background: #fde2e2; border-bottom: 2px solid #b42318; color: #8b1a1a; }
.viewas input[type=text] { font: inherit; padding: 2px 6px; }

/* the update offer: the one button in the bar that is not neutral */
.bar button.update { background: #1a7f37; color: #fff; border: 0; border-radius: 4px; padding: 2px 8px; }
