:root {
  --bg: #15171b; --bg2: #1c1f25; --bg3: #23272f; --line: #2e333c; --fg: #d7dbe2; --dim: #8a919d; --acc: #5aa9ff;
  --sen1: #ffb454; --sen2: #ff7a59; --left: #6fd3a3; --right: #7fb8ff; --sel: rgba(90, 169, 255, 0.18); --warn: #ffcc66; --err: #ff6b6b;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; --sans: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --tree-w: 268px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--fg); font: 13px/1.4 var(--sans); }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; background: var(--bg3); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; }
.ok { color: #6fd3a3; }
button { cursor: pointer; }
button:hover { border-color: var(--acc); }
button.primary { background: var(--acc); color: #06111f; border-color: var(--acc); font-weight: 600; }
button.danger:hover { border-color: var(--err); color: var(--err); }
input[type=search], input[type=text], input[type=number] { min-width: 0; }
.dim { color: var(--dim); }
.warn { color: var(--warn); }
.err { color: var(--err); }
[hidden] { display: none !important; }

#app { display: grid; grid-template-columns: var(--tree-w) 1fr; grid-template-rows: 100%; height: 100%; }
#app.tree-collapsed { grid-template-columns: 0 1fr; }
#app.tree-collapsed #tree-panel { display: none; }
#tree-panel { grid-column: 1; grid-row: 1; }
#main { grid-column: 2; grid-row: 1; }          /* explicit: a collapsed (display: none) tree must not shift main into the 0-width column */
#tree-expand { position: fixed; left: 4px; top: 6px; z-index: 5; padding: 2px 5px; }

/* ---- tree ---------------------------------------------------------------------------------------- */
#tree-panel { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg2); min-height: 0; }
.tree-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); min-width: 0; }
/* the account links wrap onto their own line(s) inside the panel: on one nowrap line "name · sign out · accounts ·
   firmware" ran past the panel's right edge and under #main, where the last link could not be clicked (2026-10-02) */
#tree-user { margin-left: auto; font-size: 11px; text-align: right; min-width: 0; overflow-wrap: anywhere; }
#tree-user a { white-space: nowrap; }
#tree-user a { color: var(--dim); }
#tree-user a:hover { color: var(--fg); }
.brand { font-weight: 700; letter-spacing: 0.02em; }
.tree-tools { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 6px 8px; border-bottom: 1px solid var(--line); align-items: center; }
.tree-tools input[type=search] { flex: 1 1 100%; }
.tree-tools label { white-space: nowrap; color: var(--dim); }
#tree { flex: 1; overflow: auto; padding: 4px 0; outline: none; font-variant-numeric: tabular-nums; }
.tree-foot { padding: 4px 8px; border-top: 1px solid var(--line); font-size: 12px; }
/* the tick boxes and the zip bar (RV-T-9) */
.node .pick { flex: none; margin: 0; width: 13px; height: 13px; cursor: pointer; accent-color: var(--acc); }
.node .pick:disabled { cursor: default; opacity: .4; }
.tree-zip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px; border-top: 1px solid var(--line); font-size: 12px; }
.tree-zip #zip-count { flex: 1; min-width: 0; }
.tree-zip .linkish { background: none; border: 0; padding: 0; color: var(--dim); text-decoration: underline; cursor: pointer; font-size: 12px; }
.tree-zip .linkish:hover { color: var(--fg); }
.node { display: flex; align-items: center; gap: 6px; padding: 2px 8px; cursor: pointer; white-space: nowrap; user-select: none; }
.node:hover { background: var(--bg3); }
.node.focus { outline: 1px solid var(--acc); outline-offset: -1px; }
.node.selected { background: var(--sel); }
.node .tw { width: 12px; color: var(--dim); text-align: center; flex: none; }
.node.unit { font-weight: 600; }
.node.root { font-weight: 600; color: var(--acc); border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.node .glyph { font-size: 10px; margin-right: 2px; }
.glyph.live { color: #6fd3a3; } .glyph.late { color: var(--warn); } .glyph.missing { color: var(--err); } .glyph.never { color: var(--dim); }
.node.day { padding-left: 22px; color: var(--dim); }
.node.leaf { padding-left: 36px; font-family: var(--mono); font-size: 12px; }
.node.leaf.grey { color: var(--dim); }
.node .dur { color: var(--dim); }
.node .typ { color: var(--warn); }
.node .cnt { color: var(--dim); font-weight: 400; }
.badge { background: var(--acc); color: #06111f; border-radius: 8px; padding: 0 5px; font-size: 11px; font-weight: 700; }
.badge.zero { background: var(--line); color: var(--dim); }

/* ---- main ---------------------------------------------------------------------------------------- */
/* The split (RV-L-2): --upper-h is the tabbed panel's height, --lower-min the least the other panel keeps. The panel's track
   is clamped here, not only by the drag: a split saved on a taller window, or a window made shorter, would otherwise give
   the graph row 0 px — and the graph's bars overflowed that row onto the splitter, which then took no drag (2026-10-25).
   The graph row's own minimum covers its bars (toolbar, readout, ruler, overview: ~200 px) and a usable lanes box. */
#main { --lower-min: 320px; display: grid; grid-template-rows: minmax(120px, min(var(--upper-h, 40%), calc(100% - var(--lower-min) - 6px))) 6px minmax(var(--lower-min), 1fr); min-height: 0; min-width: 0; }
/* an encounter (RV-U-9, 2026-10-25): the graph on top, the tabbed panel below it — the grid rows reordered in CSS, the DOM
   order kept; the fleet and Manage pages keep the panel on top. --upper-h is the tabbed panel's height either way. */
#main.enc { grid-template-rows: minmax(var(--lower-min), 1fr) 6px minmax(120px, min(var(--upper-h, 40%), calc(100% - var(--lower-min) - 6px))); }
#main.enc #lower { grid-row: 1; }
#main.enc #splitter { grid-row: 2; }
#main.enc #upper { grid-row: 3; }
#upper { overflow: auto; padding: 8px 12px; min-height: 0; }
#splitter { background: var(--line); cursor: row-resize; position: relative; z-index: 2; }   /* above anything a neighbour overflows: always there to drag */
#splitter:hover { background: var(--acc); }
#lower { min-height: 0; min-width: 0; position: relative; display: flex; flex-direction: column; }
.empty { color: var(--dim); padding: 24px; text-align: center; }

/* ---- the encounter's tabs in the tabbed panel #upper (RV-I-6; below the graph since RV-U-9): the strip stays, the one shown pane scrolls ---- */
#upper.enc { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.enc-tabs { flex: none; display: flex; gap: 2px; padding: 5px 12px 0; border-bottom: 1px solid var(--line); background: var(--bg2); align-items: baseline; }
.enc-tab { flex: none; }
.enc-tab .tabn { margin-left: 6px; font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
.enc-tab .tabn:empty { display: none; }
.enc-id { margin-left: 12px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.enc-id b { font-size: 14px; }
#app.tree-collapsed .enc-tabs { padding-left: 34px; }            /* the fixed ▶ of the collapsed tree sits there */
.enc-id .typ { font-size: 11px; color: var(--warn); font-weight: 600; text-transform: uppercase; margin-left: 4px; }
#upper.enc > .enc-pane { flex: 1; min-height: 0; min-width: 0; overflow: auto; padding: 10px 12px; }

/* ---- the Encounter, Files and Analysis tabs: cards of tables (info.js) --------------------------------------------- */
#upper .anom { margin: 0 0 8px; padding: 4px 10px; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 4px; background: var(--bg2); }
#upper .anom div::before { content: "⚠ "; color: var(--warn); }
/* the key / value cards flow in columns (cards of unequal height pack without holes), the wide tables stack under them */
#upper .cards { columns: 270px; column-gap: 10px; }
#upper .cards .card { break-inside: avoid; margin: 0 0 10px; }
#upper .wides { display: flex; flex-direction: column; gap: 10px; }
#upper .card { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px 8px; min-width: 0; }
#analysis { display: flex; flex-direction: column; gap: 10px; }
#analysis .card { flex: none; }
#upper .card h3 { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
#upper .card h3 span { text-transform: none; letter-spacing: 0; font-weight: 400; }
#upper table.kv { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
#upper table.kv th { color: var(--dim); font-weight: 400; text-align: left; padding: 1px 12px 1px 0; white-space: nowrap; vertical-align: top; width: 1%; }
#upper table.kv td { padding: 1px 0; overflow-wrap: anywhere; }
#upper table.kv td a { white-space: nowrap; }
#upper .tblwrap { overflow-x: auto; }
#upper table.tbl { border-collapse: collapse; font-variant-numeric: tabular-nums; }      /* its own width: the columns stay beside each other */
#upper table.tbl th { color: var(--dim); font-weight: 500; text-align: left; border-bottom: 1px solid var(--line); padding: 2px 22px 2px 0; white-space: nowrap; }
#upper table.tbl td { padding: 3px 22px 3px 0; border-bottom: 1px solid var(--bg3); white-space: nowrap; vertical-align: baseline; }
#upper table.tbl th:last-child, #upper table.tbl td:last-child { padding-right: 0; }
#upper table.tbl tbody tr:last-child td { border-bottom: none; }
#upper table.tbl th.num, #upper table.tbl td.num { text-align: right; }
#upper table.tbl .mono { font-family: var(--mono); font-size: 12px; }
#upper table.tbl tfoot td { border-top: 1px solid var(--line); border-bottom: none; color: var(--dim); }
#upper table.files tbody tr:hover td { background: var(--bg2); }
#upper table.files td.det { white-space: normal; min-width: 180px; }
#upper table.sensors tbody th { color: var(--dim); font-weight: 400; text-align: left; border-bottom: 1px solid var(--bg3); padding: 3px 22px 3px 0; }
#upper table.sensors tbody tr:last-child th { border-bottom: none; }
#upper .chip { display: inline-block; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line); font-family: var(--mono); font-size: 11px; }
#upper .chip.sen1 { color: var(--sen1); border-color: var(--sen1); } #upper .chip.sen2 { color: var(--sen2); border-color: var(--sen2); }
#upper .chip.left { color: var(--left); border-color: var(--left); } #upper .chip.right { color: var(--right); border-color: var(--right); }
#upper .cardnote { margin-top: 6px; font-size: 11.5px; line-height: 1.45; white-space: normal; }
#upper details.raw summary { cursor: pointer; }
#upper details.raw { margin-top: 10px; }
#upper details.raw pre { max-height: 320px; overflow: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; font: 11px/1.4 var(--mono); margin: 4px 0 0; }
/* the Analysis tab's placeholder: one tile per value the analysis will give */
#upper .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 2px; }
#upper .tile { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 6px; background: var(--bg); }
#upper .tile .tk { color: var(--dim); font-size: 11.5px; }
#upper .tile .tv { font-size: 22px; line-height: 1.1; color: var(--dim); font-variant-numeric: tabular-nums; }
#upper .tile .tu { color: var(--dim); font-size: 11px; }

/* ---- the fleet dashboard ------------------------------------------------------------------------- */
.fleet-head { font-size: 14px; margin: 0 0 6px; }
.fleet-head .live.ok { color: #6fd3a3; } .fleet-head .live.err { color: var(--err); }
/* sixteen columns: on a narrow panel the table scrolls sideways inside its own box, the head line and the foot stay */
.fleet-scroll { overflow-x: auto; }
.fleet-table td.flags { white-space: normal; min-width: 14ch; max-width: 44ch; font-size: 12px; }
.fleet-table { border-collapse: collapse; font-variant-numeric: tabular-nums; width: 100%; }
.fleet-table th, .fleet-table td { padding: 3px 10px 3px 0; text-align: left; white-space: nowrap; }
.fleet-table th { color: var(--dim); font-weight: 500; border-bottom: 1px solid var(--line); }
.fleet-table th[data-sort] { cursor: pointer; }
.fleet-table th[data-sort]:hover { color: var(--fg); }
.fleet-table td.num { text-align: right; padding-right: 14px; }
.fleet-table td.mono { font-family: var(--mono); font-size: 12px; }
.fleet-table tr.dev { cursor: pointer; }
.fleet-table tr.dev:hover { background: var(--bg3); }
.fleet-table tr.live td.st { color: #6fd3a3; } .fleet-table tr.late td.st { color: var(--warn); } .fleet-table tr.missing td.st { color: var(--err); } .fleet-table tr.never td { color: var(--dim); }
.fleet-table tr.detail td { padding: 2px 0 8px 18px; white-space: normal; }
.fleet-table tr.detail pre { margin: 0 0 4px; font: 11.5px/1.4 var(--mono); color: var(--fg); white-space: pre-wrap; }
.fleet-foot { margin-top: 8px; font-size: 12px; }
.fleet-table td.cfg a { font-family: var(--mono); font-size: 12px; }
.fleet-table td.cfg a.ok { color: #6fd3a3; } .fleet-table td.cfg a.warn { color: var(--warn); } .fleet-table td.cfg a.err { color: var(--err); } .fleet-table td.cfg a.dim { color: var(--dim); }

/* ---- the per-unit settings editor (the Manage page's Settings tab, cloud.md § 7.9) -------------------------------- */
#unitcfg, .unitcfg { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.uc-head { padding: 5px 10px; border-bottom: 1px solid var(--line); background: var(--bg2); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.uc-head .uc-headbtns { margin-left: auto; display: flex; gap: 4px; }
.uc-badge { display: inline-block; padding: 0 6px; border-radius: 8px; font-family: var(--mono); font-size: 11px; font-weight: 700; border: 1px solid currentColor; }
.uc-badge.ok { color: #6fd3a3; } .uc-badge.warn { color: var(--warn); } .uc-badge.err { color: var(--err); } .uc-badge.dim { color: var(--dim); }
.uc-body { flex: 1; display: grid; grid-template-columns: minmax(360px, 1fr) minmax(360px, 46%); min-height: 0; }
/* the left column scrolls when its notes and the legend do not fit: the text keeps its 160 px and the boxes under it
   (problems / saved, note, hint, buttons, legend) keep their height — a flex item with overflow: auto would otherwise
   shrink to nothing in a short panel, and a save's notes with it (2026-10-03) */
.uc-edit { display: flex; flex-direction: column; min-height: 0; overflow: auto; padding: 8px 10px; gap: 6px; border-right: 1px solid var(--line); }
.uc-problems, .uc-note, .uc-hint, .uc-buttons, .uc-legend { flex: none; }
.uc-text { flex: 1 0 160px; min-height: 160px; resize: none; font: 12px/1.45 var(--mono); background: var(--bg2); padding: 6px 8px; white-space: pre; overflow: auto; tab-size: 4; }
.uc-text[readonly] { color: var(--dim); }
.uc-problems { color: var(--err); font-size: 12px; max-height: 110px; overflow: auto; }
.uc-problems .mono { font-family: var(--mono); color: var(--fg); }
.uc-note { font-size: 12px; }
.uc-buttons { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.uc-legend { font-size: 11.5px; line-height: 1.5; }
.uc-legend code { font-family: var(--mono); color: var(--fg); }
.uc-side { overflow: auto; padding: 8px 10px; font-size: 12px; position: relative; }
.uc-replne { margin-bottom: 6px; }
.uc-schema { border-collapse: collapse; width: 100%; }
.uc-schema th { color: var(--dim); font-weight: 500; text-align: left; border-bottom: 1px solid var(--line); padding: 2px 8px 2px 0; }
.uc-schema td { padding: 3px 8px 3px 0; vertical-align: top; border-bottom: 1px solid var(--bg3); }
.uc-schema td.mono { font-family: var(--mono); font-size: 11.5px; }
.uc-schema td.mono .dim { font-family: var(--sans); font-size: 11px; }
.uc-schema tr.differs td { background: rgba(255, 204, 102, 0.08); }
.uc-schema .uc-comment { font-size: 11px; }
.uc-eff { display: inline-block; padding: 0 5px; border-radius: 8px; font-size: 10.5px; border: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.uc-eff.live { color: #6fd3a3; border-color: #6fd3a3; }
/* the banner under the header: the unit's firmware and last link (the link-path rule's basis), or the unreported refusal */
.uc-banner { padding: 3px 10px; font-size: 11.5px; line-height: 1.4; border-bottom: 1px solid var(--line); background: var(--bg2); }
.uc-banner.warn { color: var(--warn); }
.uc-banner-complete { border-left: 3px solid var(--acc); }
/* a two-sided row: coordinated (wg_addr, upload_pass — the hub changes its side with the save; amber while a change of
   it is in flight) or note-only (dimmed: saved with a note, the hub's side does not move); a link-path key not on the unit's link */
.uc-ro { color: var(--dim); font-size: 11px; white-space: nowrap; }
.uc-co { display: inline-block; padding: 0 5px; border-radius: 8px; font-size: 10.5px; border: 1px solid var(--acc); color: var(--acc); white-space: nowrap; }
.uc-co.flight { color: var(--warn); border-color: var(--warn); }
.uc-mark a { font-size: 11px; }
/* the strip above the text while a coordinated change is in flight; the saved box (coordinated changes opened, notes);
   the hint of what Save does with the identity keys */
.uc-flight { padding: 4px 10px; font-size: 12px; line-height: 1.45; border-bottom: 1px solid var(--line); border-left: 3px solid var(--warn); background: var(--bg2); }
.uc-flight b { color: var(--warn); }
.uc-problems.saved { color: var(--fg); }
.uc-hint { font-size: 12px; }
.uc-hint .mono { font-family: var(--mono); color: var(--dim); }
.uc-schema tr.ro td { color: var(--dim); }
.uc-schema tr.ro td.mono b { color: var(--dim); }
.uc-eff.off { color: var(--warn); border-color: var(--warn); }
.uc-aside { position: sticky; bottom: 0; margin-top: 8px; background: var(--bg3); border: 1px solid var(--acc); border-radius: 6px; padding: 8px 10px; max-height: 50%; overflow: auto; }
.uc-aside pre { font: 11.5px/1.4 var(--mono); background: var(--bg2); padding: 6px; margin: 6px 0 0; white-space: pre-wrap; }
.uc-aside .uc-aside-close { float: right; padding: 0 5px; }
.uc-hist td { padding: 2px 8px 2px 0; } .uc-hist td.mono { font-family: var(--mono); font-size: 11.5px; }
@media (max-width: 1100px) { .uc-body { grid-template-columns: 1fr; grid-template-rows: minmax(200px, 1fr) auto; } .uc-edit { border-right: none; border-bottom: 1px solid var(--line); } }

/* ---- the Manage page and the activity log (lower panel, manage-activity design § 1, § 3) --------------------- */
#manage, #activity, #device { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
/* the bar the Manage page renders once above #info (never inside #fl-head, which every poll rewrites) */
.mg-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; padding: 0 0 6px; border-bottom: 1px solid var(--line); font-size: 13px; }
.mg-actions .mg-barnote { font-size: 12px; }
.mg-head .mg-fact { white-space: nowrap; }
.mg-tabs { display: flex; gap: 2px; padding: 4px 10px 0; border-bottom: 1px solid var(--line); background: var(--bg2); align-items: baseline; }
.mg-tab, .enc-tab { border: 1px solid var(--line); border-bottom: none; border-radius: 4px 4px 0 0; background: var(--bg3); padding: 2px 10px; color: var(--dim); }
.mg-tab.on, .enc-tab.on { background: var(--bg); color: var(--fg); border-color: var(--acc); font-weight: 600; }
.mg-tabnote { margin-left: 10px; font-size: 11.5px; }
.mg-body { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.mg-tabbody { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.mg-tabbody.mg-unit, .mg-tabbody.mg-firmware, .mg-tabbody.mg-activity, .mg-tabbody.mg-encounters, .mg-tabbody.mg-battery { overflow: auto; }
/* the Battery tab (battery.js): the range presets and the key in one row, the two panels, the read-out, the table.
   --batt is the one series colour: a step of the accent's hue inside the dark surface's lightness band */
.mg-battery { --batt: #3d8ee6; --batt-st: #d95926; }
.bt-bar { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; margin: 2px 0 6px; }
.bt-ranges { display: inline-flex; gap: 2px; }
.bt-range { font-size: 11.5px; padding: 0 8px; color: var(--dim); }
.bt-range.on { color: var(--fg); border-color: var(--acc); font-weight: 600; }
.bt-key { display: inline-flex; align-items: center; gap: 5px; color: var(--dim); font-size: 11.5px; }
.bt-chart { position: relative; outline: none; border-radius: 4px; min-width: 0; }
.bt-chart:focus-visible { box-shadow: 0 0 0 1px var(--acc); }
.bt-svg { display: block; cursor: pointer; touch-action: pan-y; }
.bt-none { padding: 24px 0; }
.bt-title { fill: var(--fg); font-size: 12px; font-weight: 600; }
.bt-tick { fill: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.bt-end { fill: var(--fg); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bt-grid { stroke: var(--line); stroke-width: 1; }
.bt-line { fill: none; stroke: var(--batt); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.bt-sline { fill: none; stroke: var(--batt-st); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.bt-sdot { fill: var(--batt-st); }
.bt-toggle { cursor: pointer; }
.bt-toggle input { margin: 0; }
.bt-dot { fill: var(--batt); stroke: var(--bg); stroke-width: 2; }
.bt-dot.ext { fill: var(--bg); stroke: var(--batt); }
.bt-dot.untimed { fill: var(--dim); }
.bt-cross { stroke: var(--dim); stroke-width: 1; }
.bt-hi { fill: none; stroke: var(--fg); stroke-width: 1.5; }
.bt-tip { position: absolute; z-index: 2; pointer-events: none; background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; font-size: 11.5px; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
.bt-tip .bt-val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bt-tip .mono { font-family: var(--mono); }
.bt-details { margin-top: 10px; }
.bt-details summary { cursor: pointer; color: var(--dim); margin-bottom: 4px; }
.bt-details summary:hover { color: var(--fg); }
/* the Console tab (cloud.md CL-VIEW-20): the head, the output that fills the tab, the one input line */
.mg-tabbody.mg-console { padding: 8px 10px; gap: 6px; }
.con-head { font-size: 12px; color: var(--dim); display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.con-head .mono { font-family: var(--mono); color: var(--fg); }
.con-out { flex: 1; min-height: 120px; overflow: auto; margin: 0; padding: 6px 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; color: var(--fg); }
.con-out .con-cmd { color: var(--acc); } .con-out .con-hub { color: var(--dim); } .con-out .con-err { color: var(--err); }
.con-line { display: flex; gap: 6px; align-items: center; }
.con-line .con-prompt { font-family: var(--mono); color: var(--acc); }
.con-line input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; color: var(--fg); background: var(--bg3); border: 1px solid var(--line); border-radius: 3px; padding: 3px 6px; }
.con-line button { font-size: 11px; padding: 1px 8px; }
.mg-enc th.num, .mg-enc td.num { text-align: right; }
.mg-enc td { white-space: nowrap; }
.mg-enc tr.mg-erarow td { padding-top: 10px; font-family: var(--mono); font-size: 11.5px; }
.mg-enc button.mg-encdel { font-size: 11px; padding: 0 6px; }
.mg-none { flex: 1; overflow: auto; padding: 8px 10px; font-size: 12px; }
.mg-none .fw-body { padding: 0; overflow: visible; }
.mg-block { margin-bottom: 14px; }
.mg-block h3 { font-size: 13px; margin: 0 0 4px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.mg-block h3 .dim { font-weight: 400; font-size: 11.5px; }
.mg-form { display: flex; gap: 6px 16px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
.mg-form label { display: inline-flex; gap: 6px; align-items: center; color: var(--dim); }
.mg-form input, .mg-form select { color: var(--fg); }
.mg-preview { margin: 6px 0; }
.mg-preview div { padding: 1px 0; white-space: pre-wrap; }
.mg-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.mg-actnote { font-size: 12px; min-height: 1.4em; }
.mg-facts { border-collapse: collapse; font-size: 12px; }
.mg-facts th { color: var(--dim); font-weight: 500; text-align: left; padding: 2px 12px 2px 0; vertical-align: top; white-space: nowrap; }
.mg-facts td { padding: 2px 0; vertical-align: top; font-family: var(--mono); font-size: 11.5px; }
.mg-facts td.mg-pending div { padding: 1px 0; }
.mg-facts td.mg-pending .mg-pendnote { font-family: var(--sans); padding: 0 0 3px 12px; }
.mg-facts td button { font-size: 11px; padding: 0 5px; margin-left: 6px; }
.fw-fold summary { cursor: pointer; color: var(--dim); font-size: 13px; font-weight: 600; }
.fw-fold summary .dim { font-weight: 400; font-size: 11.5px; }
.fw-fold[open] summary { margin-bottom: 4px; }
.mg-dialog .mg-fields { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.mg-dialog .mg-fields label { display: flex; gap: 8px; align-items: center; color: var(--dim); }
.mg-dialog .mg-fields select, .mg-dialog .mg-fields input { color: var(--fg); }
.mg-dialog .mg-ini { width: 60ch; max-width: 100%; font: 11.5px/1.4 var(--mono); background: var(--bg2); }
.mg-dialog .mg-confirm { display: flex; gap: 8px; align-items: center; margin-top: 8px; color: var(--dim); }
.mg-dialog .mg-dlghint { font-size: 11.5px; min-height: 1.2em; margin-top: 4px; }
.mg-dialog .mg-dlgnote { max-width: 70ch; }
.mg-dialog .fw-steps div { white-space: pre-wrap; }
button:disabled { opacity: 0.5; cursor: default; }
/* the manage view of the fleet table: selection, retired rows grey and last, the ⚠ column wraps */
.fleet.manage .mg-table td.flags { white-space: normal; max-width: 44ch; font-size: 12px; }
.fleet-table tr.retired td, .fleet-table tr.retired td a, .fleet-table tr.retired td.st { color: var(--dim); }
.fleet-table tr.sel td { background: var(--sel); }
.fleet-table td.cfg span { font-family: var(--mono); font-size: 12px; }
.fleet-table td.cfg span.ok { color: #6fd3a3; } .fleet-table td.cfg span.warn { color: var(--warn); } .fleet-table td.cfg span.err { color: var(--err); } .fleet-table td.cfg span.dim { color: var(--dim); }
.fleet-table td.mono span.fw.go { color: #6fd3a3; }

/* ---- the firmware page (lower panel, DESIGN.md § 3.9) ------------------------------------------------------- */
#firmware { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.fw-body { flex: 1; overflow: auto; padding: 8px 10px; font-size: 12px; }
.fw-block { margin-bottom: 14px; }
.fw-block h3 { font-size: 13px; margin: 0 0 4px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.fw-block h3 .dim { font-weight: 400; font-size: 11.5px; }
.fw-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.fw-table th { color: var(--dim); font-weight: 500; text-align: left; border-bottom: 1px solid var(--line); padding: 2px 10px 2px 0; white-space: nowrap; }
.fw-table td { padding: 3px 10px 3px 0; vertical-align: top; border-bottom: 1px solid var(--bg3); }
.fw-table td.mono, .fw-table .mono { font-family: var(--mono); font-size: 11.5px; }
.fw-table tr.invalid td { color: var(--dim); }
.fw-table tr.invalid td .err { color: var(--err); }
.fw-table tr.hl td { background: var(--sel); }
.fw-table select { max-width: 100%; }
.fw-table button.fw-run { font-size: 11px; padding: 0 5px; margin-left: 6px; }
.fw-table td.outcome { white-space: normal; }
.fw-outcome { display: inline-block; padding: 0 6px; border-radius: 8px; font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); white-space: nowrap; }
.fw-outcome.go { color: #6fd3a3; border-color: #6fd3a3; }
.fw-outcome.at { color: var(--acc); border-color: var(--acc); }
.fw-outcome.warn { color: var(--warn); border-color: var(--warn); }
.fw-outcome.err { color: var(--err); border-color: var(--err); }
.fw-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.fw-upload .fw-upmsg { flex-basis: 100%; font-size: 12px; }
.fw-when { font-size: 11.5px; line-height: 1.5; color: var(--dim); max-width: 110ch; }
.fw-when code { font-family: var(--mono); color: var(--fg); }
.fw-journal { margin-top: 8px; } .fw-journal summary { cursor: pointer; color: var(--dim); }
.fw-journal pre { font: 11px/1.4 var(--mono); background: var(--bg2); padding: 6px; max-height: 200px; overflow: auto; white-space: pre-wrap; }
.fw-dialog { background: var(--bg3); color: var(--fg); border: 1px solid var(--acc); border-radius: 6px; padding: 12px 14px; max-width: 70ch; font-size: 12.5px; box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
.fw-dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
.fw-dialog h4 { margin: 0 0 8px; font-size: 13px; }
.fw-dialog .fw-steps { font-family: var(--mono); font-size: 11.5px; margin: 6px 0; }
.fw-dialog .fw-steps div { padding: 1px 0; }
.fw-dialog .fw-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.fleet-table td.mono a.fw { color: var(--fg); }
.fleet-table td.mono a.fw.go { color: #6fd3a3; }

/* ---- annotations (the Reference card of the Analysis tab) ----------------------------------------- */
#annot { margin: 2px 0 0; }
#annot table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
#annot th, #annot td { padding: 2px 8px 2px 0; text-align: left; vertical-align: top; }
#annot th { color: var(--dim); font-weight: 500; }
#annot td.num { text-align: right; padding-right: 12px; }
#annot tr.deleted td { color: var(--dim); text-decoration: line-through; }
#annot .form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
#annot .form input[type=number] { width: 62px; }
#annot .form input.ini { width: 48px; text-transform: uppercase; }
#annot .form input.det { width: 120px; }
#annot .form input.note { width: 180px; }
#annot .form input.pos { width: 72px; }
#annot .form .msg { flex-basis: 100%; }
#annot .note-line { margin: 4px 0; }
#annot .hist { font-size: 11px; color: var(--dim); font-family: var(--mono); max-height: 120px; overflow: auto; }

/* ---- log (the Log tab: the tools stay, the lines take the rest of the panel and scroll) ------------- */
#upper.enc > #log-wrap { display: flex; flex-direction: column; overflow: hidden; }
.log-tools { flex: none; display: flex; gap: 8px; align-items: center; margin: 0 0 6px; }
#log { flex: 1; min-height: 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; margin: 0; overflow: auto; font: 11.5px/1.35 var(--mono); }
#log .l { display: block; cursor: default; white-space: pre; }
#log .l.link { cursor: pointer; }
#log .l.link:hover { background: var(--bg3); }
#log .l.E { color: var(--err); } #log .l.W { color: var(--warn); } #log .l.D { color: var(--dim); }
#log .l.tr { color: var(--acc); }
#log .l.here { background: var(--sel); }

/* ---- graph --------------------------------------------------------------------------------------- */
#graph { flex: 1; display: grid; grid-template-rows: auto auto auto auto 1fr; grid-template-columns: minmax(0, 1fr); min-height: 0; min-width: 0; }   /* the column is the panel's width: no content (a long values row) may widen the time axis */
#graph.empty { display: block; }
.gbar { display: flex; gap: 8px; align-items: center; padding: 4px 8px; border-bottom: 1px solid var(--line); background: var(--bg2); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
/* the values bar: two rows (pressure, audio) of fixed-width, right-aligned fields; the time column is shared */
.gbar .readout { font: 11.5px/1.35 var(--mono); font-variant-numeric: tabular-nums; flex: 1 0 100%; min-width: 0; padding-bottom: 3px; border-bottom: 1px solid var(--line); }
.gbar .readout + .sep { display: none; }
.gbar .readout .rrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; white-space: pre; min-height: 1.35em; }   /* fields keep their widths; a narrow panel wraps them */
.gbar .readout .rt { display: inline-block; width: 14ch; color: var(--fg); }
.gbar .readout .rrow.a .rt { color: var(--dim); }
.gbar .readout .rf { display: inline-flex; align-items: baseline; gap: 4px; }
.gbar .readout .rk { color: var(--dim); }
.gbar .readout .rv { display: inline-block; text-align: right; }
.gbar .readout .ru { color: var(--dim); font-size: 10.5px; }
.gbar .sep { color: var(--line); }
.tbar { display: flex; gap: 8px; align-items: center; padding: 3px 8px; border-bottom: 1px solid var(--line); background: var(--bg2); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.tbar .readout { font-family: var(--mono); font-size: 12px; }
.tbar .sep { color: var(--line); }
.tbar button:disabled, .tbar select:disabled, .tbar input:disabled { opacity: 0.4; cursor: default; }
.tbar #t-play { min-width: 34px; font-size: 14px; }
.tbar input[type=range] { width: 80px; }
.tbar .peak { display: inline-block; height: 8px; width: 4px; background: var(--line); border-radius: 2px; vertical-align: middle; transition: width 0.05s; }
.lanes { position: relative; display: grid; min-height: 0; overflow: hidden; }
#graph canvas { display: block; width: 100%; }          /* block: an inline canvas adds descender space and its row grows past it */
.lanes canvas { height: 100%; }
.lane { position: relative; border-bottom: 1px solid var(--line); min-height: 0; }
.lane .lbl { position: absolute; left: 6px; top: 3px; font: 600 11px var(--sans); pointer-events: none; }
.lane .scale { position: absolute; right: 6px; top: 3px; font: 11px var(--mono); color: var(--dim); pointer-events: none; text-align: right; }
.lane .scale.b { top: auto; bottom: 3px; }
.lane .note { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); color: var(--dim); pointer-events: none; }
.lane.off { display: none; }
#ruler { height: 22px; background: var(--bg2); }
#ovw { height: 34px; background: var(--bg2); border-bottom: 1px solid var(--line); cursor: grab; }
#overlay { position: absolute; inset: 0; pointer-events: none; }
.lanes .row { position: relative; }
.lanetoggle { display: flex; gap: 4px; }
.lanetoggle button { padding: 1px 6px; font-size: 11px; }
.lanetoggle button.off { opacity: 0.45; }
.pmode button { padding: 1px 6px; font-size: 11px; }
.pmode button.on { background: var(--acc); color: #06111f; border-color: var(--acc); }
.fpop { position: absolute; right: 12px; top: 34px; z-index: 6; background: var(--bg3); border: 1px solid var(--acc); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
.fpop input[type=number] { width: 64px; }
#g-xpop { right: 220px; }
#g-apop { right: 12px; }
.pmode.audio { margin-left: 6px; }
.fpop select { max-width: 260px; }
.fpop-row label { margin-right: 8px; }
.fpop-row.unused { opacity: 0.45; }   /* the automatic mode: the settings of the mode it did not apply to this encounter */
#f-seg.on { background: var(--acc); color: #06111f; border-color: var(--acc); }
.fpop-seg { border-top: 1px solid var(--line); padding-top: 6px; }
.fpop-out { font: 11px/1.45 var(--mono); white-space: pre-wrap; max-width: 660px; color: var(--fg); overflow-y: auto; min-height: 3em; }   /* the phase list shrinks and scrolls; the last row stays in view */
#g-fpop { max-width: min(680px, calc(100% - 24px)); max-height: calc(100% - 46px); overflow-y: auto; }   /* inside the graph panel: no page scroll */
#f-seg-ctl:not([hidden]) { display: flex; flex-wrap: wrap; row-gap: 6px; }                                  /* the numeric controls wrap as whole labels */
.fpop-seg { flex-wrap: wrap; row-gap: 6px; }
#graph { position: relative; }
.lanetoggle button.sen1 { border-color: var(--sen1); } .lanetoggle button.sen2 { border-color: var(--sen2); }
.lanetoggle button.left { border-color: var(--left); } .lanetoggle button.right { border-color: var(--right); }
.selstats { font-family: var(--mono); font-size: 11.5px; color: var(--dim); }

#toast { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); background: var(--bg3); border: 1px solid var(--acc); padding: 6px 12px; border-radius: 6px; z-index: 10; max-width: 70vw; }
#toast.err { border-color: var(--err); }

/* ---- the activity log (lower panel, manage-activity design § 3) -------------------------------------------------- */
.act-head { font-size: 12px; }
.act-head .mono { font-family: var(--mono); }
.act-head .uc-headbtns { align-items: center; gap: 8px; }
.act-head label { white-space: nowrap; color: var(--dim); }
.act-head select { max-width: 160px; }
.act-head button { padding: 1px 6px; font-size: 11px; }
.act-head button:disabled { opacity: 0.4; cursor: default; }
pre.act-log { flex: 1; min-height: 0; margin: 0; padding: 6px 10px; overflow: auto; background: var(--bg2); font: 11px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.act-line { display: block; }
.act-line .act-t { color: var(--dim); }
.act-line .act-u { color: var(--acc); font-weight: 600; }
.act-line .act-tag { color: var(--dim); font-size: 10px; }
.act-line.err, .act-line.err .act-x { color: var(--err); }
.act-line.warn, .act-line.warn .act-x { color: var(--warn); }
.act-line.dim, .act-line.dim .act-x, .act-line.dim .act-u { color: var(--dim); }
.act-line.act-day { color: var(--dim); margin-top: 4px; }

/* ---- the analysis tabs (RV-P-1..8, analysis.js): the run bar, the tiles with values, the plots, the tables ---------------- */
#upper .ana { display: flex; flex-direction: column; gap: 10px; }
#upper .ana .card { flex: none; }
#upper .ana-body { display: flex; flex-direction: column; gap: 10px; }
#upper .ana-run { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 6px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; }
#upper .ana-run label { display: inline-flex; gap: 6px; align-items: center; color: var(--dim); white-space: nowrap; }
#upper .ana-run select, #upper .ana-run input { color: var(--fg); }
#upper .ana-run input[type=number] { width: 58px; }
#upper .ana-run input.note { flex: 1 1 160px; min-width: 120px; }
#upper .ana-run #o-msg, #upper .ana-run #a-msg { font-size: 11.5px; }
#upper .tile.on { border-style: solid; border-color: var(--acc); }
#upper .tile.on .tv { color: var(--fg); }
#upper .ana-sub { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; line-height: 1.45; }
#upper .ana-sub b.dim { font-weight: 600; margin-right: 6px; }
#upper canvas.ana-plot { display: block; width: 100%; height: 220px; }
#upper table.tbl tr.primary td { color: var(--fg); font-weight: 600; }
#upper table.tbl.hist td { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
#upper table.tbl.beats tr.s td { color: #ffb0b0; }
#upper table.tbl.beats tr.d td { color: #b8d4ff; }
#upper table.tbl.beats tr.s.d td { color: var(--fg); }
#upper .ref-card { margin-top: 0; }

/* ---- the unified viewer (UNIFIED.md): HrBP5 collections, telemetry lanes, the plots and the server-side algorithm card ---- */
.node .kchip { display: inline-block; font-size: 9px; line-height: 12px; padding: 0 4px; border: 1px solid var(--dim); border-radius: 6px; color: var(--dim); margin-right: 4px; vertical-align: 1px; font-weight: 400; }
.node .fold { font-family: var(--mono); margin-left: 6px; }
.lanetoggle select#g-addtrack { font-size: 11px; padding: 1px 4px; max-width: 170px; color: var(--fg); }
.lane.telemetry { background: #121419; }
#annot tr.legacy td { color: var(--dim); font-style: italic; }
#upper .plots { display: flex; flex-wrap: wrap; gap: 8px; }
#upper .plots a img { max-height: 180px; max-width: 320px; border: 1px solid var(--line); border-radius: 4px; background: #fff; display: block; }
#upper .plots a { text-decoration: none; color: var(--dim); font-size: 11px; }
#upper .ana-img { max-width: 100%; max-height: 460px; border: 1px solid var(--line); border-radius: 4px; background: #fff; display: block; margin-top: 6px; }
#upper .ana-run.hrbp5 { margin-top: 2px; }
#upper .setup details { margin: 4px 0; } #upper .setup summary { cursor: pointer; color: var(--dim); }
#upper .setup .notes { color: var(--dim); font-size: 11px; margin: 2px 0 4px; }

/* ---- Phase 2 (PLAN.md): the lanes' S / M / Z tools, the selection's cuff readout, the plot viewer, the scorecards ---- */
.lane .ltools { position: absolute; left: 6px; top: 19px; display: flex; gap: 2px; z-index: 2; }
.lane .ltools .lt { padding: 0 5px; font: 600 10px var(--mono); line-height: 15px; border: 1px solid var(--line); border-radius: 3px; background: rgba(21, 23, 27, 0.85); color: var(--dim); cursor: pointer; }
.lane .ltools .lt:hover { color: var(--fg); border-color: var(--dim); }
.lane .ltools .lt.s.on { color: #06111f; background: #6fd3a3; border-color: #6fd3a3; }
.lane .ltools .lt.m.on { color: #fff; background: #ff5f5f; border-color: #ff5f5f; }
.lane .ltools .lt.z.on { color: #06111f; background: #7fb8ff; border-color: #7fb8ff; }
.gbar .selstats { display: inline-flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.gbar .selstats .selbp { color: #ff6b6b; font-weight: 600; white-space: nowrap; }
.gbar .selstats .selbp b { font-size: 13px; }
.gbar .selstats button { padding: 1px 6px; font-size: 11px; }
#plotview { position: fixed; inset: 0; z-index: 50; background: rgba(8, 10, 14, 0.92); display: flex; flex-direction: column; }
#plotview[hidden] { display: none; }
#plotview .pv-bar { display: flex; gap: 8px; align-items: center; padding: 6px 12px; background: var(--bg2); border-bottom: 1px solid var(--line); font-size: 12px; }
#plotview .pv-bar .pv-sp { flex: 1; }
#plotview .pv-bar .pv-name { font-family: var(--mono); }
#plotview .pv-bar button { padding: 2px 8px; }
#plotview .pv-stage { flex: 1; position: relative; overflow: hidden; cursor: grab; }
#plotview .pv-stage.drag { cursor: grabbing; }
#plotview .pv-stage img { position: absolute; left: 0; top: 0; max-width: none; background: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6); user-select: none; }
body.pv-open { overflow: hidden; }
#upper .plots a[data-plot] { cursor: zoom-in; }
#upper .bench { display: flex; flex-wrap: wrap; gap: 12px; }
#upper .bench .bch { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; background: var(--bg); min-width: 300px; flex: 1 1 320px; }
#upper .bench .bch h4 { margin: 0 0 4px; font-size: 12px; display: flex; gap: 10px; align-items: baseline; }
#upper .bench .grade { display: inline-block; padding: 0 8px; border-radius: 10px; font-weight: 700; font-size: 12px; color: #06111f; background: var(--dim); }
#upper .bench .grade.A, #upper .bench .grade.GOOD { background: #6fd3a3; }
#upper .bench .grade.B, #upper .bench .grade.FAIR { background: #ffd166; }
#upper .bench .grade.C, #upper .bench .grade.D, #upper .bench .grade.F, #upper .bench .grade.POOR { background: #ff6b6b; }
#upper .bench .ok { color: #6fd3a3; } #upper .bench .bad { color: #ff6b6b; }
#upper .bench img { max-height: 120px; max-width: 100%; border: 1px solid var(--line); border-radius: 4px; background: #fff; display: block; margin-top: 6px; }
#upper .defl table.tbl td.num, #upper .defl table.tbl th.num { text-align: right; }
.doctor table { border-collapse: collapse; margin: 8px 0; } .doctor th { text-align: left; color: var(--dim); font-weight: 400; padding: 2px 14px 2px 0; white-space: nowrap; vertical-align: top; } .doctor td { padding: 2px 0; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.doctor .ok { color: #6fd3a3; } .doctor .bad { color: #ff6b6b; }
.ana-run button.lnk { background: none; border: 0; color: var(--dim); text-decoration: underline dotted; cursor: pointer; padding: 0 4px; font: inherit; }
.ana-run button.lnk:hover { color: var(--fg); }
.h5doctor { margin: 4px 0 10px; }

/* ---- the Device page (PLAN.md Phase 4: RemoteTouch in the server) ---- */
.dv { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: auto; padding: 6px 10px 10px; gap: 6px; }
.dv-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.dv-bar .dv-sp { flex: 1; }
.dv-tools { padding: 4px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dv-pill { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--bg3); border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; min-width: 40px; text-align: center; }
.dv-stagewrap { display: flex; justify-content: center; align-items: flex-start; min-height: 0; flex: 1; overflow: auto; }
.dv-stage { position: relative; width: min(100%, 800px); aspect-ratio: 800 / 480; background: #000; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; touch-action: none; user-select: none; cursor: default; }
.dv-stage.on { cursor: crosshair; }
.dv-stage img { display: block; width: 100%; height: 100%; image-rendering: auto; pointer-events: none; }
.dv-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--dim); }
.dv-cross { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid #ff5a5a; border-radius: 50%; pointer-events: none; }
.dv-status { min-height: 18px; font-size: 12.5px; }
.dv-status .warn { color: var(--warn); }
.dv-doctor summary { cursor: pointer; color: var(--dim); font-size: 12px; }
.dv-doctor .doctor { margin-top: 4px; }
