/* Aiera PlanTag - one small system: tokens first, then layout, then components (brief section 3).
   No inline styles anywhere; the Content-Security-Policy forbids them. */
:root {
  --ink: #111827; --ink-2: #374151; --muted: #4b5563; --faint: #6b7280; --disabled: #9ca3af;
  --line: #e5e7eb; --line-strong: #d1d5db; --bg: #fff; --bg-soft: #f9fafb; --bg-hover: #f3f4f6;
  --accent: #1d4ed8; --accent-hover: #1e40af; --accent-soft: #eff6ff; --accent-ink: #1e3a8a;
  --ok: #166534; --ok-soft: #dcfce7;
  --warn: #92400e; --warn-ink: #78350f; --warn-soft: #fffbeb; --warn-line: #fde68a;
  --bad: #b91c1c; --bad-ink: #991b1b; --bad-soft: #fef2f2; --bad-line: #fecaca;
  --sugg: #5b21b6; --sugg-ink: #3b0764; --sugg-soft: #f5f3ff; --sugg-line: #ddd6fe;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px;
  --r: 6px; --hair: 1px solid var(--line);
  --mono: ui-monospace, Menlo, Consolas, monospace;
  --panel-w: 540px;
  --shadow: 0 8px 24px rgba(17, 24, 39, .12);
}

/* base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font: 13.5px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg); display: flex; flex-direction: column; min-width: 1024px;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); font-weight: 400; }
p { margin: var(--s1) 0; }

/* top bar: light, one line */
.top { display: flex; align-items: center; gap: var(--s2) var(--s3); min-height: 44px; padding: 6px var(--s4); background: var(--bg); border-bottom: var(--hair); flex-wrap: wrap; }
.brand { font-weight: 650; font-size: 15px; white-space: nowrap; }
.brand .muted { color: var(--faint); font-size: 12px; margin-left: 2px; }
.project-bar { display: flex; gap: var(--s2); align-items: center; min-width: 0; }
.project-bar label { margin: 0; font-size: 12.5px; }
#project-select { max-width: min(380px, 30vw); text-overflow: ellipsis; }
.top-end { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
/* the online-matching chip (12.5): only shown when a key is on this computer; its words say on or off */
.top .assist-ind { padding: 2px 10px; font-size: 12px; font-weight: 600; border-radius: 999px; background: var(--sugg-soft); color: var(--sugg-ink); border-color: var(--sugg-line); }
.top .assist-ind:hover:not(:disabled) { background: #ede9fe; border-color: #c4b5fd; }
.top .assist-ind.off { background: var(--bg-soft); color: var(--ink-2); border-color: var(--line-strong); }
.top .assist-ind.off:hover:not(:disabled) { background: var(--bg-hover); }
/* the boundary sentence: one quiet line under the top bar, never removed (brief section 1) */
.notice { background: var(--bg-soft); color: var(--muted); border-bottom: var(--hair); padding: 3px var(--s4); font-size: 12px; }
.assist-notice { display: flex; align-items: center; gap: var(--s3); background: var(--sugg-soft); color: var(--sugg-ink); border-bottom-color: var(--sugg-line); }
.assist-notice p { margin: 0; flex: 1; min-width: 0; }
.assist-notice button { flex: none; }

/* layout: a fixed panel on the left, the plan fills the rest */
main { flex: 1; display: flex; min-height: 0; }
aside { width: var(--panel-w); flex: none; overflow-y: auto; overflow-x: hidden; background: var(--bg); border-right: var(--hair); padding: var(--s2) var(--s4) 32px; }
aside > *, .step > * { max-width: 100%; }

/* stepper: state mark (a shape; the state is in words for screen readers), number, short name */
.steps { display: flex; flex-wrap: wrap; gap: 0 2px; margin: 0 -5px; max-width: none; }
.steps button { font-size: 12px; font-weight: 500; padding: 4px 5px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  border: 0; background: none; color: var(--ink-2); }
.steps button:hover:not(:disabled) { background: var(--bg-hover); border-color: transparent; }
.steps .num { font-variant-numeric: tabular-nums; }
.steps button.active, .steps button.active:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.steps .mark { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%;
  font-size: 9px; font-weight: 700; line-height: 1; border: 1px solid var(--disabled); color: var(--faint); background: var(--bg); flex: none; }
.steps button[data-state="done"] .mark { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.steps button[data-state="attention"] .mark { border-color: var(--warn); color: var(--warn); border-width: 1.5px; }
.steps button[data-state="optional"] .mark { border-style: dashed; }
/* the stepper, the Next: line and the "changed" line stay in view while a long step scrolls */
.aside-head { position: sticky; top: calc(-1 * var(--s2)); z-index: 5; background: var(--bg); margin: calc(-1 * var(--s2)) 0 var(--s3); padding: var(--s2) 0 0; border-bottom: var(--hair); }
.next-step { margin: var(--s1) 0 0; padding: 2px 0 var(--s2); font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.changed-line { margin: 0; padding: 0 0 var(--s2); font-size: 12.5px; color: var(--ink); }
#no-project p { margin: 0 0 var(--s2); color: var(--muted); }

/* headings and text */
h2 { font-size: 16px; font-weight: 650; margin: var(--s1) 0 var(--s1); }
h3 { font-size: 13.5px; font-weight: 650; margin: var(--s4) 0 6px; }
h4 { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: var(--s3) 0 var(--s1); }
.hint { color: var(--muted); font-size: 12.5px; margin: var(--s1) 0; }
/* status words in running text stay in ink (brief 3: status colours only on the badges) */
.ok { color: inherit; } .bad, .warn { color: var(--ink); font-weight: 600; }
.status-line { margin: var(--s1) 0; }
.status-line .badge { margin-right: 2px; }
.evidence-bad { font-weight: 600; }
.counts { color: var(--faint); font-size: 11.5px; font-weight: 400; }
.hash { overflow-wrap: anywhere; font-family: var(--mono); font-size: 11px; color: var(--muted); }
kbd { font: 11px var(--mono); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 3px; padding: 0 3px; background: var(--bg); color: var(--ink); }

/* "How this step works": the step's explanations, closed by default */
details.help { margin: 0 0 var(--s3); font-size: 12.5px; }
details.help > summary { cursor: pointer; color: var(--muted); font-weight: 500; width: max-content; max-width: 100%; }
details.help > summary:hover { color: var(--accent); }
details.help[open] > summary { margin-bottom: var(--s1); color: var(--ink-2); }
details.help > p { margin: var(--s1) 0; padding-left: 14px; }
/* a fold for data the engineer opens when needed (never a warning or a status) */
details.fold { margin: var(--s2) 0; }
details.fold > summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 12.5px; width: max-content; max-width: 100%; }
details.fold > summary:hover { color: var(--accent); }
details.fold[open] > summary { margin-bottom: var(--s1); }
#wb-map-form > summary { font-size: 13.5px; }
.files-line { margin: 2px 0; overflow-wrap: anywhere; }

/* forms: labels above their fields */
button, .btn, select, input { font: inherit; line-height: 1.4; padding: 5px 10px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); }
select { max-width: 100%; }
input::placeholder { color: var(--faint); }
input.short { width: 90px; }
input[type="radio"], input[type="checkbox"] { padding: 0; margin: 0; width: auto; flex: none; accent-color: var(--accent); }
label { display: block; margin: var(--s2) 0; font-size: 12.5px; color: var(--ink-2); }
label > input:not([type="radio"]):not([type="checkbox"]), label > select { display: block; margin-top: var(--s1); font-size: 13.5px; color: var(--ink); }
label > input:not([type="radio"]):not([type="checkbox"]):not(.short), label > select { width: 100%; max-width: 360px; }
label.check { display: flex; gap: var(--s2); align-items: flex-start; font-size: 13.5px; color: var(--ink); margin: 6px 0; }
label.check input { margin-top: 3px; }
label.radio { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; color: var(--ink); }
.radio-typed { display: inline-flex; align-items: center; gap: 6px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s2) var(--s3); margin: var(--s2) 0; }
.form-grid label { margin: 0; }
.form-grid label > input:not([type="radio"]):not([type="checkbox"]):not(.short), .form-grid label > select { max-width: none; }
#wb-mapping .form-grid { align-items: end; }
fieldset { border: 0; grid-column: span 2; margin: 0; padding: 0; min-width: 0; }
fieldset > legend { padding: 0; margin-bottom: var(--s1); font-size: 12.5px; color: var(--ink-2); }
fieldset.hsrc { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) 18px; }
.row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: flex-end; margin: var(--s2) 0; }
.row > label { margin: 0; }
/* the file inputs stay focusable; their label is the visible button */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.file-input:focus-visible + label.btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.checklist { max-height: 160px; overflow: auto; border: var(--hair); border-radius: var(--r); padding: var(--s1) var(--s2); margin: var(--s1) 0; }
.checklist label { margin: 2px 0; overflow-wrap: anywhere; }
.region input { width: 22%; margin: 2px; }

/* buttons: main (filled accent), plain, quiet, danger */
button, .btn { cursor: pointer; display: inline-block; font-weight: 500; }
label.btn { margin: 0; font-size: 13.5px; color: var(--ink); }
button:hover:not(:disabled), .btn:hover { background: var(--bg-hover); border-color: var(--disabled); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.danger:hover:not(:disabled) { background: var(--bad-ink); border-color: var(--bad-ink); }
button.small { padding: 2px 8px; font-size: 12px; }
button.quiet, .menu-btn.icon, td.actions button.small, .row-actions button.small { background: transparent; border-color: transparent; color: var(--ink-2); }
td.actions button.small, .row-actions button.small { color: var(--accent); }
button.quiet:hover:not(:disabled), .menu-btn.icon:hover:not(:disabled), td.actions button.small:hover:not(:disabled), .row-actions button.small:hover:not(:disabled) { background: var(--bg-hover); border-color: transparent; }
/* a pressed tool (aria-pressed) */
button.on, button.on:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
button:disabled, button.primary:disabled, button.danger:disabled { background: var(--bg-soft); border-color: var(--line); color: var(--disabled); cursor: not-allowed; }
td.actions button.small:disabled, .row-actions button.small:disabled, button.quiet:disabled { background: transparent; border-color: transparent; }
button[aria-busy="true"] { cursor: progress; opacity: .7; }
/* a tool group: one compact row */
.row.seg { gap: 0; }
.row.seg > button { border-radius: 0; margin-left: -1px; }
.row.seg > button:first-child { border-radius: var(--r) 0 0 var(--r); margin-left: 0; }
.row.seg > button:last-child { border-radius: 0 var(--r) var(--r) 0; }
.row.seg > button.on { position: relative; z-index: 1; }

/* menus (top bar, "More", table rows): the list floats under its button and is never clipped by a wrapper */
.menu { display: inline-block; position: relative; }
.menu-btn.icon { min-width: 30px; font-weight: 700; letter-spacing: .05em; }
.top .menu-btn.icon { font-size: 16px; padding: 1px 8px; }
.menu-btn[aria-expanded="true"], .menu-btn.icon[aria-expanded="true"] { background: var(--bg-hover); }
.menu-list { position: fixed; z-index: 40; min-width: 180px; max-width: min(360px, 90vw); display: flex; flex-direction: column; padding: var(--s1);
  background: var(--bg); color: var(--ink); border: var(--hair); border-radius: 8px; box-shadow: var(--shadow); }
.menu-list > button, .menu-list > a { display: block; width: 100%; text-align: left; border: 0; border-radius: 4px; background: none;
  padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 400; color: var(--ink); text-decoration: none; white-space: nowrap; cursor: pointer; }
.menu-list > button:hover:not(:disabled), .menu-list > a:hover { background: var(--bg-hover); color: var(--ink); }
.menu-list > button:disabled { background: none; color: var(--disabled); }
.menu-list > button:focus-visible, .menu-list > a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.menu-list > .danger-item { color: var(--bad); }
.menu-list hr { border: 0; border-top: var(--hair); margin: var(--s1) 0; }
.row-actions { display: flex; gap: 2px; align-items: center; justify-content: flex-end; }

/* sections and notices: a hairline instead of a box; status notices are tinted and always carry words */
.info { margin: var(--s3) 0 0; padding: var(--s3) 0 var(--s1); border-top: var(--hair); font-size: 12.5px; }
.info p { margin: 2px 0; overflow-wrap: anywhere; }
.info > h3:first-child { margin-top: 0; }
.warn-box { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: var(--r); padding: var(--s2) var(--s3); font-weight: 600; font-size: 12.5px; margin: var(--s2) 0; }
.danger-box, .error { background: var(--bad-soft); color: var(--bad-ink); border: 1px solid var(--bad-line); border-radius: var(--r); padding: var(--s2) var(--s3); margin: var(--s2) 0; font-weight: 600; font-size: 12.5px; }
.danger-box p { margin: 2px 0; }
.error { margin-top: var(--s3); white-space: pre-wrap; overflow-wrap: anywhere; }
.stale-box ul, .refreshed-box ul { margin: var(--s1) 0 2px; padding-left: 20px; }
.stale-box li, .refreshed-box li { overflow-wrap: anywhere; }
.stamp-preview { border: 1px solid var(--bad); color: var(--bad); font-weight: 700; padding: var(--s2) 10px; margin: var(--s2) 0; font-size: 12px; overflow-wrap: anywhere; }

/* badges: the only place for status colours, always with the status word */
.badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; border: 1px solid transparent; }
.badge.pass { background: var(--ok-soft); color: var(--ok); }
.badge.fail { background: #fee2e2; color: var(--bad-ink); }
.badge.warn { background: #fef3c7; color: var(--warn); }
.badge.pending { background: var(--bg-hover); color: var(--ink-2); }
.badge.not_checked { background: var(--bg); color: var(--ink-2); border: 1px dashed var(--faint); }
.badge.error { background: var(--bg); color: var(--bad-ink); border: 1px dashed var(--bad); }

/* suggestions: prefilled by the tool, not saved until the engineer saves */
.suggested { border-color: #7c3aed !important; background: var(--sugg-soft) !important; }
.sugg-tag { display: inline-block; font-size: 10.5px; font-weight: 700; line-height: 1.4; color: var(--sugg); background: #ede9fe;
  border-radius: 3px; padding: 0 4px; margin: 0 4px 2px; vertical-align: middle; text-transform: uppercase; letter-spacing: .02em; }
.sugg-tag.jev { text-transform: none; letter-spacing: 0; color: #fff; background: #6d28d9; }
.form-grid .sugg-tag { margin-left: 6px; }
.jev-link { color: var(--sugg); font-size: 11px; font-weight: 600; white-space: nowrap; }
.suggest-box { margin: var(--s2) 0; padding: var(--s2) 10px; border: 1px solid var(--sugg-line); border-radius: var(--r); background: var(--sugg-soft); color: var(--sugg-ink); font-size: 12.5px; }
.suggest-box.none { border-color: var(--line); background: var(--bg-soft); color: var(--ink); }
.suggest-box p { margin: 2px 0; overflow-wrap: anywhere; }
.suggest-box .title { font-weight: 650; }
#sp-suggest .table-wrap { background: var(--bg); border-radius: 4px; }

/* tables: row lines only; wide ones scroll inside their own wrapper, never the whole panel */
.table-wrap { max-width: 100%; overflow-x: auto; margin: var(--s2) 0; }
/* a wrapper that does scroll shows its scrollbar (no hidden overlay scrollbar) */
.table-wrap::-webkit-scrollbar, .grid-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.table-wrap::-webkit-scrollbar-thumb, .grid-wrap::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.table-wrap::-webkit-scrollbar-track, .grid-wrap::-webkit-scrollbar-track { background: var(--bg-soft); }
.table-wrap > table { margin: 0; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; margin: var(--s2) 0; }
th, td { border: 0; border-bottom: var(--hair); padding: 5px 6px; text-align: left; vertical-align: top; overflow-wrap: break-word; }
th { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--bg); vertical-align: bottom; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.name { min-width: 9em; max-width: 22em; overflow-wrap: anywhere; }
td.actions, td.nowrap, td.links { white-space: nowrap; }
td.actions input { margin-right: var(--s1); }
table.compact th, table.compact td { padding: 3px 5px; }
td.wrap { overflow-wrap: anywhere; }
td.num.wrap { white-space: normal; }
span.nowrap { white-space: nowrap; }
.src { display: block; font-size: 11px; color: var(--muted); font-variant-numeric: normal; white-space: normal; overflow-wrap: break-word; }
table.review td.src-cell { min-width: 6em; overflow-wrap: anywhere; }
table.review td.flags { min-width: 7em; overflow-wrap: break-word; }
.stack { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
table.checks td:first-child { width: 1%; }
table.checks tr.errored td { background: var(--bad-soft); }
table.placements tr:hover td { background: var(--bg-soft); }
table.placements td.name { min-width: 6em; }
table.placements input.short { width: 72px; padding: 2px 6px; }
table.placements tr.sel td { background: var(--accent-soft); }
table.placements tr.sel td:first-child { box-shadow: inset 3px 0 var(--accent); font-weight: 700; }
table.placements tr.moving td { background: #e0e7ff; }
/* spaces: two lines per space (one tbody): name, zone, link and actions; then the figures with their sources */
table.spaces { table-layout: auto; }
table.spaces tbody.space { cursor: pointer; }
table.spaces tbody.space:hover td { background: var(--bg-soft); }
table.spaces tr.main td { border-bottom: 0; padding-bottom: 1px; }
table.spaces td.name { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
table.spaces td.zone { color: var(--muted); white-space: nowrap; }
table.spaces td.link { overflow-wrap: anywhere; }
table.spaces tr.stale td.link { font-weight: 700; }
table.spaces tr.figs td { padding-top: 1px; }
table.spaces th.num { text-align: right; font-weight: 500; }
table.spaces thead tr:first-child th { border-bottom: 0; padding-bottom: 0; }
#spaces-table .table-wrap { max-height: 360px; overflow-y: auto; }
#spaces-table thead { position: sticky; top: 0; z-index: 1; background: var(--bg); }
table.suggestions td { vertical-align: middle; }
table.suggestions td.name { min-width: 8em; max-width: 11em; }
table.suggestions select, table.suggestions input:not([type="checkbox"]) { padding: 2px 4px; font-size: 12px; max-width: 12em; }
table.suggestions input.short { width: 64px; }
table.suggestions .stack > div { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
table.suggestions tr.ticked td { background: var(--sugg-soft); }
table.suggestions tr:hover td { background: #ede9fe; }
table.suggestions .sugg-tag { margin: 0 0 1px; }
table.lib td:not(.actions) { overflow-wrap: anywhere; }
table.lib select { max-width: 11em; padding: 2px 4px; font-size: 12px; }
table.history td.why-not { min-width: 14em; overflow-wrap: anywhere; }
table.history td.num { width: 1%; }
/* the raw workbook grid keeps cell lines: it shows a spreadsheet */
.grid-wrap { max-height: 240px; overflow: auto; border: var(--hair); border-radius: var(--r); margin: var(--s2) 0; }
.grid-wrap table { font-size: 11px; width: auto; margin: 0; }
.grid-wrap th, .grid-wrap td { border: var(--hair); padding: 2px 5px; }
.grid-wrap th { background: var(--bg-soft); }
.grid-wrap td { white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.grid-wrap td.f { color: var(--accent); }
.grid-wrap td.missing { background: #fee2e2; }
.grid-wrap th.rh { position: sticky; left: 0; }
.symgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.symgrid figure { margin: 0; border: var(--hair); border-radius: var(--r); padding: var(--s1); text-align: center; font-size: 11px; overflow-wrap: anywhere; }
.symgrid svg { width: 100%; height: 60px; }
.symgrid path { fill: none; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* online matching dialog */
.assist-sends { margin: var(--s1) 0 var(--s2); padding-left: 20px; }
.assist-sends li { margin: 2px 0; overflow-wrap: anywhere; }
.assist-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px var(--s3); margin: var(--s2) 0; }
.assist-facts dt { font-weight: 600; }
.assist-facts dd { margin: 0; overflow-wrap: anywhere; }
label.assist-switch { margin: 10px 0 2px; font-weight: 600; }

/* plan viewer, toolbar and read-outs */
.viewer { flex: 1; position: relative; background: var(--bg); overflow: hidden; min-width: 0; }
.toolbar { position: absolute; top: var(--s3); left: var(--s3); z-index: 2; display: flex; flex-wrap: wrap; gap: 2px; align-items: center; background: var(--bg);
  border: var(--hair); border-radius: 8px; padding: 2px; box-shadow: 0 1px 2px rgba(17, 24, 39, .06); width: max-content; max-width: calc(100% - 24px); }
.toolbar button { padding: 3px 10px; min-width: 32px; background: transparent; border-color: transparent; color: var(--ink-2); }
.toolbar button:hover:not(:disabled), .toolbar button[aria-expanded="true"] { background: var(--bg-hover); border-color: transparent; }
#btn-zoom-in, #btn-zoom-out { font-weight: 700; }
#mode-label { font-size: 12px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); border-radius: 4px; padding: 2px var(--s2); margin: 0 2px; }
.partial { position: absolute; top: 0; left: 0; right: 0; z-index: 3; background: var(--warn-soft); color: var(--warn-ink); border-bottom: 1px solid var(--warn-line);
  font-weight: 600; text-align: center; padding: 5px var(--s3); font-size: 12.5px; }
.partial::before { content: "\26A0  "; }
.partial + .toolbar { top: 44px; }
#preview { width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
#preview .geom { fill: none; stroke: #334155; stroke-width: 1; vector-effect: non-scaling-stroke; }
#preview .layer text { fill: #52606d; font-family: Helvetica, Arial, sans-serif; }
#preview .outline-hl { fill: rgba(29, 78, 216, .12); stroke: #1d4ed8; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
#preview .space { fill: rgba(22, 163, 74, .08); stroke: #16a34a; stroke-width: 2; vector-effect: non-scaling-stroke; }
#preview .space-label { fill: #166534; font-weight: 700; font-family: Helvetica, Arial, sans-serif; }
#preview .unit circle, #preview .unit line { fill: none; stroke: #dc2626; stroke-width: 2; vector-effect: non-scaling-stroke; }
#preview .unit.out circle { stroke: #9333ea; stroke-dasharray: 4 3; }
#preview .unit text { fill: #dc2626; font-weight: 700; font-family: Helvetica, Arial, sans-serif; }
#preview .unit.hl circle, #preview .unit.hl line, #preview .unit.sel circle, #preview .unit.sel line { stroke: #1d4ed8; stroke-width: 4; }
#preview .unit.hl text, #preview .unit.sel text { fill: #1d4ed8; }
#preview .unit.sel circle { fill: rgba(29, 78, 216, .15); }
#preview .unit.moving { opacity: .4; }
#preview .rubber { fill: rgba(29, 78, 216, .08); stroke: #1d4ed8; stroke-dasharray: 6 4; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
#preview polyline.rubber { fill: none; }
#preview .poly-start { fill: #fff; stroke: #1d4ed8; stroke-width: 2; vector-effect: non-scaling-stroke; }
#preview .snap-mark { fill: none; stroke: #c2410c; stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
#preview .suggest-hl { fill: rgba(124, 58, 237, .16); stroke: #7c3aed; }
.layers { position: absolute; top: 56px; left: var(--s3); z-index: 2; background: var(--bg); border: var(--hair); border-radius: 8px; box-shadow: var(--shadow);
  padding: 6px var(--s2); max-height: 60%; overflow: auto; font-size: 12px; min-width: 200px; }
.partial ~ .layers { top: 88px; }
.layers label { margin: 2px 0; white-space: nowrap; font-size: 12px; color: var(--ink); }
.viewer > .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--faint); pointer-events: none; }
.progress { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 4; background: var(--bg); border: var(--hair); border-radius: 8px;
  padding: 14px 18px; width: 380px; box-shadow: var(--shadow); }
.progress .bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.progress .bar.indeterminate span { width: 30%; animation: slide 1.2s infinite linear; }
@keyframes slide { from { margin-left: -30%; } to { margin-left: 100%; } }
.progress p { margin: var(--s2) 0 0; font-size: 12.5px; }
.coords { position: absolute; left: var(--s3); bottom: var(--s2); font: 11.5px var(--mono); color: var(--muted); background: rgba(255, 255, 255, .9); border-radius: 4px; padding: 2px 6px; pointer-events: none; }
.coords:empty { display: none; }

/* toast, drop hint, dialog */
/* the notice sits over the plan, never over the panel's controls */
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: min(460px, calc(100vw - var(--panel-w) - 44px));
  background: var(--ink); color: #fff; padding: var(--s2) 14px; border-radius: 8px; box-shadow: var(--shadow);
  font-weight: 500; font-size: 13px; pointer-events: none; overflow-wrap: anywhere; }
.toast::before { content: "\2713  "; color: #86efac; }
.toast:empty { display: none; }
.toast.warn { background: var(--warn-ink); }
.toast.warn::before { content: "\26A0  "; color: #fed7aa; }
.drop-hint { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(29, 78, 216, .10);
  border: 2px dashed var(--accent); pointer-events: none; }
.drop-hint p { background: var(--bg); padding: var(--s4) 22px; border-radius: 10px; font-size: 15px; font-weight: 600; box-shadow: var(--shadow); max-width: 520px; text-align: center; }
dialog#dlg { border: var(--hair); border-radius: 10px; padding: 20px 22px; width: min(460px, 92vw); box-shadow: 0 16px 48px rgba(17, 24, 39, .22); color: var(--ink); }
dialog#dlg.wide { width: min(720px, 94vw); }
dialog#dlg::backdrop { background: rgba(17, 24, 39, .40); }
dialog#dlg h2 { margin: 0 0 var(--s3); }
dialog#dlg h3 { margin: var(--s3) 0 var(--s1); }
#dlg-text p { margin: var(--s1) 0; overflow-wrap: anywhere; }
.dlg-field { margin: var(--s3) 0 var(--s1); }
.dlg-field > span:first-child { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: var(--s1); }
.dlg-field input, .dlg-field select { width: 100%; }
.dlg-error { color: var(--bad); font-weight: 600; margin: 6px 0 0; }
.dlg-error::before { content: "\2717  "; }
.dlg-buttons { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s4); }

/* the in-app document pages (/guide, /limits, /guide/overlay): the same plain light bar */
body.doc { display: block; background: var(--bg); min-width: 0; }
.doc-bar { background: var(--bg); color: var(--ink); font-weight: 650; font-size: 14px; padding: 10px var(--s4); border-bottom: var(--hair); }
.doc-body { max-width: 820px; margin: 0 auto; padding: 24px var(--s4) 48px; font-size: 15px; line-height: 1.65; }
.doc-body h1 { font-size: 24px; font-weight: 650; margin: 8px 0 16px; }
.doc-body h2 { font-size: 18px; margin: 28px 0 8px; padding-bottom: 4px; border-bottom: var(--hair); }
.doc-body h3 { font-size: 15px; margin: 20px 0 6px; }
.doc-body table { font-size: 14px; }
.doc-body pre { background: var(--bg-soft); border: var(--hair); border-radius: var(--r); padding: var(--s3); overflow: auto; }
.doc-body code { background: var(--bg-hover); border-radius: 3px; padding: 0 3px; font-size: .92em; }
.doc-body pre code { background: none; padding: 0; }

/* hosted mode (13.8): the sign-in page, and the quiet line that says where the data is and who is signed in */
.login-box { display: block; flex: none; max-width: 360px; margin: 48px auto; padding: 0 var(--s4); }
.login-box h1 { font-size: 20px; font-weight: 650; margin: 0 0 var(--s2); }
.login-box label { margin: var(--s3) 0 var(--s1); }
.login-box input { display: block; width: 100%; }
.login-box button { margin-top: var(--s4); }
.hosted-notice { color: var(--ink-2); }
