/* Tokens follow the Operations Dashboard (white sheets on a cool paper-grey ground, hairline rules, 4 px radii) */
:root {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Roboto, Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Roboto, Arial, sans-serif;
  /* the warehouse's own lettering: Bahnschrift is the DIN 1451 face Windows ships, the face of rack labels and floor
   * signs; figures, headings and location codes wear it */
  --font-sign: Bahnschrift, "DIN Alternate", "D-DIN", "Barlow Semi Condensed", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  /* the vernacular of the racks: upright blue, beam orange, floor-tape yellow, carton kraft */
  --rack: #2b5d8f;
  --beam: #e0661b;
  --tape: #f2b705;
  --kraft: #c9a16a;
  /* what the plans bring and what consolidation frees */
  --p2b: #eb6834;
  --p2a: #2a78d6;
  --room: #1baf7a;
  --page: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f4f7fa;
  --ink: #172033;
  --ink-2: #4c5667;
  --ink-3: #7c8696;
  --border: #dfe4ea;
  --border-strong: #b9c2cd;
  --surface-3: #e9edf2;
  --grid: #e4e8ee;
  --axis: #c5ccd6;
  --series-neutral: #7c8696;
  --accent: #1f4e78;
  --accent-soft: #d9e7f2;
  --accent-ink: #1c5cab;
  --wb-head-line: #b7cbdd;
  --focus: #2a78d6;
  /* categorical series in their fixed order, and the status palette (reserved for meaning) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --good-text: #0b6b0b;
  --warn-text: #8a5a00;
  --bad-text: #a32626;
  --good-bg: #e6f3e6;
  --warn-bg: #fff3d6;
  --bad-bg: #fbe9e7;
  --info-bg: #e9f1fb;
  --radius: 4px;
  --shadow: 0 6px 20px rgba(23, 32, 51, 0.12);
  --header-h: 50px;
  --panel-w: 390px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 13.5px/1.4 var(--font); color: var(--ink); background: var(--page); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h2 { font-size: 16px; margin: 0 0 6px; }
h3 { font-size: 13px; margin: 14px 0 6px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.02em; }
p { margin: 6px 0; }
.muted { color: var(--ink-2); }
.hint { color: var(--ink-3); }
.small { font-size: 12px; }
.hint { color: var(--ink-3); padding: 24px 0; text-align: center; }

.app { display: flex; flex-direction: column; height: 100%; }
.topbar { height: var(--header-h); display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-sub { font-size: 11.5px; font-weight: 400; color: var(--ink-3); min-height: 13px; }
.brand .mark { width: 22px; height: 22px; border-radius: 5px; background: linear-gradient(135deg, #1f4e78, #2a78d6); position: relative; }
.brand .mark::after { content: ""; position: absolute; left: 5px; right: 5px; top: 6px; height: 3px; background: #fff; box-shadow: 0 5px 0 #fff; opacity: 0.9; }
.export { display: flex; align-items: center; gap: 10px; color: var(--ink-2); min-width: 0; }
.export #export-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--good-bg); color: #0b6b0b; white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.warn { background: var(--warn-bg); color: #8a5a00; }
.pill.off { background: var(--bad-bg); color: #a32626; }
.spacer { flex: 1; }
.name { display: flex; align-items: center; gap: 8px; color: var(--ink-2); white-space: nowrap; }
.name input { width: 150px; }
.name[hidden], .pill[hidden] { display: none; }

.notices { position: absolute; top: calc(var(--header-h) + 8px); left: 50%; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: 6px; pointer-events: none; max-width: 70vw; }
.notice { padding: 8px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); border-left: 4px solid var(--accent); pointer-events: auto; transition: opacity 200ms ease, transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@starting-style { .notice { opacity: 0; transform: translateY(-8px); } }
.notice.ok { border-left-color: var(--good); }
.notice.warn { border-left-color: var(--warning); }
.notice.error { border-left-color: var(--critical); }
.notice.info { border-left-color: var(--focus); }

.main { flex: 1; display: flex; min-height: 0; }
.viewport { flex: 1; position: relative; min-width: 0; }
.canvas-wrap { position: absolute; inset: 0; overflow: hidden; }
.canvas-wrap canvas.gl { display: block; width: 100%; height: 100%; outline: none; }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.labels .label { position: absolute; left: 0; top: 0; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); border: 1px solid var(--border-strong); color: var(--ink); font-weight: 700; font-size: 12px; letter-spacing: 0.04em; will-change: transform; }
.labels .label.expansion { color: var(--ink-3); border-style: dashed; }
.labels .label.dim { opacity: 0.6; color: var(--ink-3); }
.labels .label.area { font-size: 13px; padding: 2px 11px; color: var(--accent); border-color: var(--accent); background: rgba(255, 255, 255, 0.96); }

.toolbar { position: absolute; top: 10px; left: 16px; right: 16px; z-index: 7; padding: 6px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); }
.toolbar .bar { display: flex; align-items: center; gap: 8px; }
.toolbar .sep { width: 1px; height: 22px; background: var(--border); flex: 0 0 auto; }
.toolbar .time { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.toolbar .time input[type="range"] { width: 110px; }
.toolbar .time-label { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.toolbar .time.past .time-label { color: #8a5a00; font-weight: 600; }
.toolbar .time .btn[hidden] { display: none; }
.toolbar .menu-wrap { position: relative; }
.toolbar .menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 8; min-width: 190px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.toolbar .menu[hidden] { display: none; opacity: 0; transform: translateY(-4px) scale(0.98); }
.toolbar .menu { transform-origin: top; transition: opacity 180ms ease, transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), display 180ms allow-discrete, overlay 180ms allow-discrete; }
@starting-style { .toolbar .menu:not([hidden]) { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.toolbar .menu label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: pointer; }
.toolbar .menu .btn { justify-content: flex-start; }
.toolbar .menu-title { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.toolbar .menu.filter { left: 0; right: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; min-width: 400px; }
.toolbar .menu.filter[hidden] { display: none; }
.toolbar .menu.filter { transform-origin: top left; }
.toolbar .menu.filter .f { flex-direction: column; align-items: stretch; gap: 2px; }
.toolbar .menu.filter select { max-width: none; width: 100%; }
.toolbar .menu-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.toolbar input[type="search"] { width: 230px; }
.toolbar .f { display: flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.toolbar select { max-width: 150px; font-size: 12.5px; color: var(--ink); }
.toolbar select.active { border-color: var(--accent); background: var(--accent-soft); }
.toolbar .count { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.toolbar .gear { font-size: 15px; padding: 1px 8px; line-height: 1.4; }

input[type="text"], input[type="search"], input[type="number"], select, textarea { padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); min-height: 28px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input[type="range"] { accent-color: var(--focus); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
input.invalid, textarea.invalid { border-color: var(--critical); }
textarea { width: 100%; resize: vertical; font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; }
textarea.json { min-height: 320px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn { transition: transform 100ms ease, background-color 120ms ease, border-color 120ms ease; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #2a5f8f; }
.btn.small { padding: 3px 9px; font-size: 12px; }
.btn .icon { width: 14px; height: 14px; flex: 0 0 auto; color: var(--ink-2); }
.btn.primary .icon { color: #fff; }
.toolbar .gear { padding: 3px 7px; display: inline-flex; }
.btn.active { background: var(--accent-soft); border-color: var(--accent); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font-weight: 600; }

.legend { position: absolute; right: 16px; top: calc(var(--toolbar-h, 44px) + 20px); z-index: 5; max-width: 400px; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); font-size: 12px; }
.legend .card-body { padding: 4px 12px 10px; }
.legend.hidden { display: none; }
.legend-title { font-weight: 600; color: var(--ink-2); margin: 4px 0 4px; }
.legend-grid { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 3px 14px; }
.legend-grid.symbols { grid-template-columns: repeat(2, auto); margin-top: 6px; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.swatch.box { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.swatch.tint { opacity: 0.45; }
.swatch.empty { background: #c9ced6; height: 5px; }
.swatch.hatch { background: repeating-linear-gradient(135deg, #5a6470 0 2px, transparent 2px 5px); height: 6px; }
.swatch.ghost { background: rgba(42, 120, 214, 0.4); border: 1px solid rgba(42, 120, 214, 0.7); }
.swatch.dashed { border: 1px dashed var(--ink); }
.swatch.unknown { background: rgba(124, 134, 150, 0.35); border: 1px solid var(--border-strong); }
.swatch.over { background: var(--border-strong); box-shadow: inset 0 3px 0 var(--critical); }

.tooltip { position: absolute; left: 0; top: 0; z-index: 6; max-width: 340px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); pointer-events: none; font-size: 12.5px; }
.tooltip[hidden] { display: none; opacity: 0; }
.tooltip { transition: opacity 120ms ease, display 120ms allow-discrete; }
@starting-style { .tooltip:not([hidden]) { opacity: 0; } }
.tt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.tt-line { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.tt-line.planned { color: var(--accent); }
.tt-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.tt-off { color: #a32626; font-weight: 600; }

.pickhint { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); z-index: 7; padding: 8px 16px; background: var(--accent); color: #fff; border-radius: 999px; box-shadow: var(--shadow); font-weight: 600; }
.pickhint[hidden] { display: none; }
.debug { position: absolute; left: 16px; bottom: 16px; z-index: 5; padding: 6px 8px; background: rgba(23, 32, 51, 0.85); color: #fff; font: 11px/1.4 Consolas, monospace; border-radius: var(--radius); white-space: pre; }
.debug[hidden] { display: none; }

.panel { width: var(--panel-w); min-width: var(--panel-w); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); min-height: 0; overflow: hidden; transition: width 300ms cubic-bezier(0.2, 0.8, 0.2, 1), min-width 300ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.panel.closed { width: 0; min-width: 0; border-left: 0; transition-duration: 200ms; transition-timing-function: cubic-bezier(0.4, 0, 1, 1); }
.panel > * { min-width: var(--panel-w); }
.tabs { display: flex; position: relative; border-bottom: 1px solid var(--border); }
.tabs button { flex: 1; padding: 9px 2px; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; color: var(--ink-2); font-size: 12px; white-space: nowrap; transition: color 150ms ease; }
.tabs button.active { color: var(--accent); font-weight: 600; }
.tabs .tab-ink { position: absolute; left: 0; bottom: -1px; width: 0; height: 2px; background: var(--accent); transition: left 220ms cubic-bezier(0.2, 0.8, 0.2, 1), width 220ms cubic-bezier(0.2, 0.8, 0.2, 1); pointer-events: none; }
.tabs button.close { flex: 0 0 34px; font-size: 18px; line-height: 1; color: var(--ink-3); }
.tabs button.close:hover { color: var(--ink); }
.topbar #panel-toggle { margin-left: 4px; }

/* the detail: a part's locations and the history */
.loc-row { display: flex; align-items: baseline; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.loc-row .loc-units { font-variant-numeric: tabular-nums; white-space: nowrap; }
.loc-row button.link { white-space: nowrap; }
.hist-summary { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 4px 0 2px; }
.hist-filter .chip { cursor: pointer; }
.hist-filter .chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ev { padding: 6px 8px 6px 10px; margin: 4px 0; border-left: 3px solid var(--border-strong); background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; font-size: 12.5px; }
.ev.inbound { border-left-color: var(--series-3); }
.ev.outbound { border-left-color: var(--series-2); }
.ev.move { border-left-color: var(--series-1); }
.ev.adjustment { border-left-color: var(--series-4); }
.ev.planned { border-left-style: dashed; }
.ev-row { display: flex; align-items: center; gap: 8px; }
.ev-date { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ev-type { font-weight: 600; }
.ev-type.inbound { color: #0b6b0b; }
.ev-type.outbound { color: #b4471a; }
.ev-type.move { color: var(--accent-ink); }
.ev-type.adjustment { color: #8a5a00; }
.ev-units { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ev-units.plus { color: var(--good-text, #0b6b0b); }
.ev-units.minus { color: var(--bad-text, #a32626); }
.ev-loc { margin-top: 2px; color: var(--ink-2); word-break: break-all; }
.ev-doc { margin-top: 1px; font-size: 12px; }
.legend-note { font-size: 11.5px; color: var(--ink-3); margin: 2px 0 4px; }
.panel-body { flex: 1; overflow: auto; padding: 12px 14px; min-height: 0; }
.panel-foot { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--ink-3); }
.loc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.loc-head h2 { margin: 0; font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; white-space: nowrap; }
.chip.on { background: var(--good-bg); border-color: #bfe3bf; }
.chip.off { background: var(--bad-bg); border-color: #f0c8c2; }
.chip.empty { background: var(--surface-2); }
.chip.planned, .chip.info { background: var(--info-bg); border-color: #c5d8f2; }
.chip.warn { background: var(--warn-bg); border-color: #f1dda6; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.line { padding: 8px 10px; margin: 6px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.line-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.desc { margin: 2px 0 4px; }
.meta { font-size: 12.5px; }
.move { padding: 6px 8px; margin: 4px 0; border-left: 3px solid var(--accent-soft); background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; }
.form { padding: 10px; margin: 6px 0 10px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--info-bg); }
.form-title { font-weight: 600; margin-bottom: 6px; }
.form label, .grid2 label { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; font-size: 12px; color: var(--ink-2); }
.form label input, .grid2 label input, .grid2 label select { color: var(--ink); font-size: 13px; }
.form .row, .row { display: flex; align-items: center; gap: 6px; }
.form .row input { flex: 1; min-width: 0; }
.check { padding: 5px 8px; border-radius: var(--radius); font-size: 12.5px; margin: 4px 0; }
.check.none { display: none; }
.check.ok { background: var(--good-bg); color: #0b6b0b; }
.check.warn { background: var(--warn-bg); color: #8a5a00; }
.check.bad { background: var(--bad-bg); color: #a32626; }
.check.off { background: var(--bad-bg); color: #a32626; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid2 label.wide { grid-column: 1 / -1; }
label.inline { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; margin-right: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th, .table td { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { color: var(--ink-3); font-weight: 600; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.warnings { padding-left: 18px; color: #8a5a00; font-size: 12.5px; }
.event { padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.event.undo { color: var(--ink-3); }
.event.resolve { color: #0b6b0b; }

@media (max-width: 1400px) {
  :root { --panel-w: 330px; }
  .toolbar input[type="search"] { width: 160px; }
  .toolbar .time-label { min-width: 0; }
}

/* capacity: the fill bar of a line, the fill of a part's locations, the kinds table, the candidates list */
.fillbar { display: inline-block; vertical-align: middle; width: 56px; height: 5px; margin-left: 8px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.fillbar i { display: block; height: 100%; background: var(--accent); }
.fillbar.over i { background: var(--critical); }
.check.small { font-size: 12px; padding: 3px 7px; }
.loc-row .loc-fill { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.loc-row .loc-fill.over { color: #a32626; font-weight: 600; }
.cap-table { margin: 6px 0; }
.cap-table tr.used td { background: var(--accent-soft); }
.cap-summary { margin: 6px 0; font-size: 12.5px; }
.cons-table td { padding: 5px 4px; }
.cons-table .ellipsis { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* where a capacity comes from, the fill checks and their import, the max set by hand */
.src-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.badge { display: inline-block; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.manual { background: var(--info-bg); border-color: #c5d8f2; }
.badge.checks { background: var(--good-bg); border-color: #bfe3bf; }
.badge.none { background: var(--warn-bg); border-color: #f1dda6; }
.fill-buttons { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 4px; }
.fill-buttons .btn { padding: 2px 8px; font-size: 12px; }
.check-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 3px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.check-row .when { color: var(--ink-3); white-space: nowrap; }
.check-row .fill { font-weight: 600; font-variant-numeric: tabular-nums; }
.check-row .state { font-size: 11.5px; color: #8a5a00; }
.check-row .ellipsis { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-row button.x { margin-left: auto; background: none; border: 0; padding: 0 4px; color: var(--ink-3); cursor: pointer; font-size: 14px; line-height: 1; }
.check-row button.x:hover { color: var(--critical); }
.file-btn input { display: none; }
.import-result { margin: 6px 0; padding: 6px 8px; background: var(--surface-2); border-radius: var(--radius); font-size: 12.5px; }
.import-result ul { margin: 4px 0 0; padding-left: 18px; }
.import-result li.warn { color: #8a5a00; }
.import-result .actions { margin: 6px 0 0; }

/* the consolidation plan of a part */
.plan { padding: 8px 10px; margin: 6px 0 10px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--info-bg); font-size: 12.5px; }
.plan-dest { margin: 6px 0 2px; font-weight: 600; }
.plan-from { color: var(--ink-2); padding-left: 14px; }
.plan .actions { margin-bottom: 0; }
.loc-row .role { font-size: 12px; white-space: nowrap; }
.loc-row .role.empty { color: #8a5a00; font-weight: 600; }
.loc-row .role.keep { color: #0b6b0b; }
.loc-row .role.stay { color: var(--ink-3); }
.loc-row .fillbar { margin-left: 0; width: 48px; }
.loc-row .now-max { font-variant-numeric: tabular-nums; white-space: nowrap; }
.loc-row .now-max.over { color: #a32626; font-weight: 600; }

/* the KPI strip under the top bar */
.kpis { display: flex; align-items: stretch; height: 48px; padding: 0; background: var(--surface); border-bottom: 1px solid var(--border); overflow: hidden; }
.kpis:empty { display: none; }
.kpi { position: relative; display: flex; flex: 1 1 auto; align-items: center; gap: 10px; padding: 0 16px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; min-width: 0; cursor: default; }
.kpi + .kpi::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: var(--border); }
.kpi.act { cursor: pointer; transition: background-color 150ms ease, box-shadow 150ms ease, transform 100ms ease; }
.kpi.act:active { transform: scale(0.98); }
.kpi.act:hover { background: var(--surface-2); }
.kpi.active { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.kpi.active .kpi-value, .kpi.active .kpi-label { color: var(--accent); }
.kpi-value { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1; }
.kpi-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; min-width: 0; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.kpi-sub { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-scope { align-self: center; padding: 0 4px 0 16px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.kpi.warn .kpi-value { color: var(--warn-text); }
@media (max-width: 1400px) {
  .kpi { padding: 0 10px; gap: 8px; }
  .kpi-sub { display: none; }
}

/* the chips of the active search, row focus and filters, under the toolbar's row */
.toolbar .chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.toolbar .chips-row[hidden] { display: none; }
.chip.filter { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; padding-right: 3px; transition: opacity 160ms ease, transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@starting-style { .chip.filter { opacity: 0; transform: scale(0.94); } }
.chip .x { border: 0; background: none; padding: 0 4px; margin-left: 2px; color: inherit; font-size: 14px; line-height: 1; border-radius: 50%; cursor: pointer; }
.chip .x:hover { background: rgba(31, 78, 120, 0.14); }
.chips-row button.link.small { font-size: 12px; margin-left: 4px; }

/* the legend's entries act: hover spots their slots, a click filters */
button.legend-item { border: 1px solid transparent; background: none; padding: 1px 7px 1px 4px; margin: -1px -3px; border-radius: 999px; font: inherit; color: inherit; cursor: pointer; }
button.legend-item { transition: background-color 120ms ease, border-color 120ms ease, transform 100ms ease; }
button.legend-item:hover { background: var(--surface-2); border-color: var(--border); }
button.legend-item:active { transform: scale(0.97); }
button.legend-item.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.legend-item .n { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 12px; }
button.legend-item.active .n { color: var(--accent); }

/* the floor plan */
.legend, .minimap { transition: top 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.minimap { position: absolute; left: 16px; top: calc(var(--toolbar-h, 44px) + 20px); z-index: 5; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); }
.minimap .card-body { padding: 2px 6px 4px; }
.minimap.hidden { display: none; }
.minimap canvas { display: block; width: 236px; height: 214px; cursor: crosshair; }
.minimap-caption { max-width: 236px; min-height: 16px; margin-top: 3px; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the bay map of the Location tab: a row per level, a cell per tray */
.bay-map-wrap h3 { margin-top: 10px; }
.bay-map { display: grid; gap: 3px; align-items: stretch; margin: 4px 0 10px; }
.bay-map .tray { font-size: 11.5px; color: var(--ink-3); text-align: center; }
.bay-map .lvl { font-size: 12px; font-weight: 600; color: var(--ink-2); align-self: center; padding-right: 4px; }
.bay-cell { position: relative; height: 22px; padding: 0; border: 1px solid var(--border); border-radius: 3px; background: var(--surface-2); cursor: pointer; overflow: hidden; }
.bay-cell i { position: absolute; inset: 0; display: block; }
.bay-cell { transition: transform 100ms ease, border-color 120ms ease; }
.bay-cell:hover { border-color: var(--border-strong); }
.bay-cell:active:not(.sel) { transform: scale(0.94); }
.bay-cell.sel { outline: 2px solid var(--accent); outline-offset: -1px; cursor: default; }
.bay-cell.off { background: repeating-linear-gradient(135deg, #c9ced6 0 3px, var(--surface-2) 3px 7px); }
.bay-cell.none { visibility: hidden; }

/* a part's units by row */
.rowbars { display: grid; grid-template-columns: auto 1fr auto; gap: 3px 8px; align-items: center; margin: 4px 0 8px; font-size: 12px; }
.rowbar { display: contents; }
.rowbar b { font-weight: 600; color: var(--ink-2); }
.rowbar .bar { display: block; height: 7px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.rowbar .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.rowbar .val { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* everything lands at once for people who asked for less motion (the 3D growth and the counting figures check too) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* floating cards fold to their title bar */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 6px 10px 6px 12px; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; text-align: left; }
.card-head:hover { color: var(--ink); }
.card-head .chevron { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: -3px 4px 0 0; transition: transform 160ms ease; }
.folded .card-head .chevron { transform: rotate(-45deg); margin-top: 2px; }
.folded .card-body { display: none; }
.legend.folded, .minimap.folded { width: auto; }
.legend .legend-title:first-child { margin-top: 2px; }

/* the breadcrumb of a location and the folded facts of a line */
.crumbs { margin: 6px 0 8px; font-size: 12.5px; color: var(--ink-2); }
.crumbs button.link { text-decoration: none; }
.crumbs button.link:hover { text-decoration: underline; }
details.more { margin: 4px 0 2px; }
details.more > summary { cursor: pointer; font-size: 12px; color: var(--accent); list-style: none; display: inline-flex; align-items: center; gap: 4px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); margin-right: 2px; transition: transform 160ms ease; }
details.more[open] > summary::before { transform: rotate(45deg); }

/* search results */
.result { padding: 6px 0; border-bottom: 1px solid var(--border); }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.result .ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1500px) {
  .legend { max-width: 330px; }
  .legend-grid { grid-template-columns: repeat(2, auto); }
}

/* field verdicts (a move checked on the floor) in the check rows and the plan */
.check-row .fill.verdict-Y, .plan-dest .state.verdict-Y { color: #1f7a3a; }
.check-row .fill.verdict-N, .plan-dest .state.verdict-N { color: var(--bad-text, #a32626); }
.check-row .fill.verdict-q, .plan-dest .state.verdict-q { color: var(--warn-text, #8a5a00); }
/* a destination that would hold more than any bucket of its kind was ever seen holding: a fill check comes first */
.plan-dest .state.verify { color: var(--warn-text, #8a5a00); font-weight: 600; margin-left: 6px; }
.plan-dest .state { margin-left: 6px; font-size: 11px; }

/* ---------------------------------------------------------------- the pages: Overview, Space forecast, Consolidation */
.nav { display: flex; align-items: center; gap: 2px; margin-left: 10px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; }
.nav a { padding: 4px 12px; border-radius: 4px; color: var(--ink-2); text-decoration: none; font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: background-color 120ms ease, color 120ms ease; }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a.active { color: var(--accent); background: var(--surface); box-shadow: 0 1px 2px rgba(23, 32, 51, 0.08); }
/* the signed-in account and its menu */
.user-menu { position: relative; }
.user-menu[hidden] { display: none; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 4px; border: 1px solid transparent; border-radius: 999px; background: none; cursor: pointer; color: var(--ink); }
.user-btn:hover, .user-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }
.user-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); color: #fff; font-family: var(--font-sign); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.user-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.user-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--ink-3); }
.user-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transform-origin: top right; transition: opacity 160ms ease, transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@starting-style { .user-pop { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.user-pop-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.user-pop hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.menu-item { text-align: left; padding: 7px 10px; border: 0; border-radius: 5px; background: none; cursor: pointer; font-size: 13px; color: var(--ink); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.dialog { padding: 0; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 24px 60px rgba(23, 32, 51, 0.28); max-width: calc(100vw - 32px); }
.dialog::backdrop { background: rgba(23, 32, 51, 0.32); }
.pw-dialog { width: 380px; max-width: 100%; padding: 22px 24px 20px; }
.pw-dialog h2 { font-family: var(--font-sign); font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.pw-dialog .signin-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.pw-dialog .signin-field input { min-height: 36px; font-size: 14px; }
.pw-dialog .signin-error { padding: 8px 10px; border-radius: 6px; background: var(--bad-bg); color: var(--bad-text); font-size: 12.5px; }
.pw-dialog .signin-error[hidden] { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.btn.danger { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn.danger:hover { background: #b92f2f; }
.btn.quiet { border-color: transparent; background: none; color: var(--ink-2); }
.btn.quiet:hover { background: var(--surface-2); color: var(--ink); }

/* the header every page opens with: its name in the sign face and one line of what it answers */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { margin: 0; font-family: var(--font-sign); font-size: 28px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.page-lead { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; max-width: 72ch; }

/* the Accounts page */
.role-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--ink-2); font-size: 12.5px; }
.role-key li { display: inline-flex; align-items: center; gap: 8px; }
.role-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--ink-2); }
.role-tag.role-admin { background: var(--accent); border-color: var(--accent); color: #fff; }
.role-tag.role-editor { background: var(--info-bg); border-color: #c5d8f2; color: var(--accent-ink); }
.account-add h2 { font-size: 15px; margin: 0 0 10px; }
.account-add-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.account-add-row .f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.account-add-row .f.grow { flex: 1; min-width: 240px; max-width: 420px; }
.account-add-row input, .account-add-row select { min-height: 32px; font-size: 13.5px; font-weight: 400; }
.pw-row { display: flex; gap: 6px; }
.pw-row input { flex: 1; font-family: var(--font-sign); letter-spacing: 0.06em; }
.handover { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid #bfe3bf; border-left: 4px solid var(--good); border-radius: 6px; background: var(--good-bg); }
.handover p { margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; }
.handover-pw { font-family: var(--font-sign); font-size: 20px; letter-spacing: 0.08em; padding: 4px 12px; border-radius: 4px; background: var(--surface); border: 1px dashed var(--border-strong); user-select: all; }
.accounts-table td { vertical-align: middle; padding: 8px 6px; }
.accounts-table tr.off td { color: var(--ink-3); }
.accounts-table select { min-height: 28px; }
.acct-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.acct-name .avatar { width: 26px; height: 26px; font-size: 11px; }
.accounts-table tr.off .avatar { background: var(--border-strong); }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.state.off::before { background: var(--border-strong); }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: flex-end; }
.account-actions input { width: 150px; font-family: var(--font-sign); letter-spacing: 0.05em; }
.page { flex: 1; min-height: 0; overflow: auto; }
.page.p3d { display: flex; flex-direction: column; overflow: hidden; }
.page[hidden], .page.p3d[hidden], .btn[hidden] { display: none; }
.page-body { max-width: 1380px; margin: 0 auto; padding: 18px 22px 36px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px 14px; min-width: 0; }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-title h2 { margin: 0; font-size: 15px; }
.card-sub { margin: 2px 0 8px; color: var(--ink-3); font-size: 12.5px; }
.card-note { margin: 8px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.45; }
.grid2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .grid2col { grid-template-columns: 1fr; } }
.figures { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 1100px) { .figures { grid-template-columns: repeat(3, 1fr); } }
.figure { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; text-align: left; color: var(--ink); font: inherit; min-width: 0; }
.figure.act { cursor: pointer; transition: background-color 120ms ease, border-color 120ms ease, transform 100ms ease; }
.figure.act:hover { background: var(--surface-2); border-color: var(--border-strong); }
.figure.act:active { transform: scale(0.99); }
.figure-value { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.figure.good .figure-value { color: var(--good-text); }
.figure.warn .figure-value { color: var(--warn-text); }
.figure.bad .figure-value { color: var(--bad-text); }
.figure-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.figure-sub { font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.verdict { padding: 16px 20px; border-radius: 6px; border: 1px solid var(--border); border-left: 6px solid var(--good); background: var(--surface); }
.verdict.tight { border-left-color: var(--warning); }
.verdict.warn { border-left-color: var(--warning); background: var(--warn-bg); }
.verdict.bad { border-left-color: var(--critical); background: var(--bad-bg); }
.verdict-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.verdict.good .verdict-title { color: var(--good-text); }
.verdict.tight .verdict-title, .verdict.warn .verdict-title { color: var(--warn-text); }
.verdict.bad .verdict-title { color: var(--bad-text); }
.verdict-lines { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.verdict-actions { display: flex; gap: 8px; margin-top: 10px; }
.basis { color: var(--ink-3); font-size: 12px; line-height: 1.5; margin: 0; }
.notes { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.notes li { margin: 3px 0; }
.chart { display: block; width: 100%; height: auto; font-family: var(--font); }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .zero { stroke: var(--critical); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .tick { fill: var(--ink-3); font-size: 11px; }
.chart .hover .rule { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hover .tipbox { fill: #fff; stroke: var(--border-strong); stroke-width: 1; }
.chart .hover .tiptitle { fill: var(--ink); font-size: 11.5px; font-weight: 600; }
.chart .hover .tiptext { font-size: 11.5px; font-weight: 600; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 2px 0 6px; font-size: 12px; color: var(--ink-2); }
.chart-key { display: inline-flex; align-items: center; gap: 6px; }
.chart-key .swatch { width: 14px; height: 4px; border-radius: 2px; }
.chart-key .swatch.dashed-line { border-top: 2px dashed; height: 0; border-radius: 0; }
.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented .seg { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.segmented .seg .swatch { width: 10px; height: 10px; border-radius: 50%; }
.segmented .seg .seg-sub { font-weight: 400; color: var(--ink-3); }
.segmented .seg.active { border-color: var(--seg, var(--accent)); color: var(--ink); box-shadow: inset 0 0 0 1px var(--seg, var(--accent)); background: var(--surface-2); }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 2px 0 6px; }
.controls .f { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.controls .f-label { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.controls .spacer { flex: 1; }
.controls input[type="search"] { width: 240px; }
.plan-sources { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.plan { gap: 8px; padding: 3px 6px 3px 4px; max-width: 100%; }
.chip.plan .plan-file { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; color: var(--tag, var(--ink-2)); background: var(--surface-2); border: 1px solid var(--tag, var(--border)); white-space: nowrap; line-height: 1.5; }
.tag.good { color: var(--good-text); border-color: #bfe3bf; background: var(--good-bg); }
.tag.warn { color: var(--warn-text); border-color: #f1dda6; background: var(--warn-bg); }
.sharebar { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.sharebar i { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: var(--surface-3); position: relative; overflow: hidden; }
.sharebar i::after { content: ""; position: absolute; inset: 0; background: inherit; }
.sharebar span { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ink-2); min-width: 36px; }
.table .warn-text { color: var(--warn-text); }
.table .bad-text { color: var(--bad-text); font-weight: 600; }
.table .good-text { color: var(--good-text); font-weight: 600; }
.segmented.small .seg { padding: 3px 10px; font-size: 12px; }
.controls input.short { width: 120px; }
.table .low { font-weight: 700; color: var(--accent); }
.table.months td, .table.months th { padding: 3px 6px; }
.table.parts .ellipsis { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table.parts td { vertical-align: top; }
.page-body .table th { position: sticky; top: 0; background: var(--surface); z-index: 1; }

/* the capacity basis: the switch at the top of the pages, the grade of a part's carton evidence, the differences
 * between the two bases, the 2P wave, the Packing lists page */
.basis-bar { align-items: center; gap: 8px; }
.basis-bar .f-label { font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin-right: 4px; }
.basis-bar .seg .seg-sub { font-size: 12px; }
.tag.grade-A { color: var(--good-text); border-color: #bfe3bf; background: var(--good-bg); }
.tag.grade-B { color: var(--accent-ink); border-color: #c5d8f2; background: var(--info-bg); }
.tag.grade-C { color: var(--warn-text); border-color: #f1dda6; background: var(--warn-bg); }
.tag.grade-D { color: var(--ink-3); border-color: var(--border-strong); background: var(--surface-3); }
.delta { font-size: 12px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.good { color: var(--good-text); }
.delta.bad { color: var(--bad-text); }
.table .pl-wave { color: var(--accent-ink); font-weight: 600; }
.table .nowrap { white-space: nowrap; }
.compare-line { margin: -4px 0 0; padding: 8px 12px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: var(--radius); font-size: 13px; color: var(--ink-2); }
.table.review .ellipsis { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
.table.review td { vertical-align: top; }
.badge.packingList { background: var(--accent-soft); border-color: #b7cbdd; color: var(--accent); }
.pl-kind b { color: var(--ink); font-weight: 600; }
.pl-ev .ellipsis { max-width: 150px; }
.pl-ev .state { font-size: 11.5px; color: var(--accent-ink); }
.plan-dest .state.pl-proof { color: var(--accent-ink); font-weight: 600; }

/* phone width: the sheets stack, wide tables scroll inside their card, the top bar wraps, the panel takes the width */
@media (max-width: 700px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 6px 10px; padding: 6px 10px; }
  .nav { flex-wrap: wrap; margin-left: 0; }
  .export { flex: 1 1 100%; }
  .name input { width: 120px; }
  .page-body { padding: 12px 12px 28px; gap: 10px; }
  .figures { grid-template-columns: 1fr 1fr; gap: 10px; }
  .figure-value { font-size: 24px; }
  .card { overflow-x: auto; }
  .page-body .table th { position: static; }
  .controls input[type="search"] { width: 100%; }
  .verdict { padding: 12px 14px; }
  .verdict-title { font-size: 17px; }
  .basis-bar .seg { padding: 5px 9px; }
  .basis-bar .f-label { flex: 1 1 100%; margin: 0; }
  .toolbar { left: 8px; right: 8px; }
  .toolbar .bar { flex-wrap: wrap; }
  .toolbar .time { margin-left: 0; }
  .toolbar .menu.filter { min-width: 0; width: calc(100vw - 50px); }
  .kpis { overflow-x: auto; }
  .kpi { flex: 0 0 auto; padding: 0 10px; }
  .main { position: relative; }
  .panel, .panel > * { min-width: 0; }
  .panel { position: absolute; top: 0; right: 0; bottom: 0; width: 100%; z-index: 9; box-shadow: var(--shadow); }
  .panel.closed { width: 0; box-shadow: none; }
  .legend, .minimap { max-width: calc(100vw - 32px); }
}

/* the sign-in page */

/* ------------------------------------------------------------------ the charts (src/ui/viz.js) */
.viz { position: relative; }
.viz-svg { display: block; overflow: visible; font-family: var(--font); }
.viz-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.viz-axis { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.viz-zero { stroke: var(--critical); stroke-width: 1.5; }
.viz-tick { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-tick.small { font-size: 10px; }
.viz-reserve { stroke: var(--tape); stroke-width: 3; stroke-linecap: round; opacity: 0.95; }
.viz-note { fill: var(--ink-2); font-size: 11.5px; }
.viz-dot { stroke: var(--surface); stroke-width: 2; }
.viz-leader { stroke: var(--border-strong); stroke-width: 1; fill: none; }
.viz-end { fill: var(--ink); font-family: var(--font-sign); font-size: 15px; font-weight: 600; }
.viz-end.strong { font-size: 18px; }
.viz-end-name { fill: var(--ink-3); font-size: 11px; }
.viz-low-halo { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.viz-low-value { fill: var(--ink); font-family: var(--font-sign); font-size: 22px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.viz-low-text { fill: var(--ink-2); font-size: 11.5px; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.viz-rule { stroke: var(--ink-3); stroke-width: 1; }
.viz-hit { cursor: crosshair; outline: none; }
.viz-hit.pick { cursor: pointer; }
.viz-hit:focus-visible { stroke: var(--focus); stroke-width: 2; }
.viz-col-ring { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.viz-peak { fill: var(--ink); font-family: var(--font-sign); font-size: 13px; font-weight: 600; }
.viz-cell { transition: opacity 120ms ease; }
.viz-cell.pick { cursor: pointer; }
.viz-cell:hover { stroke: var(--ink); stroke-width: 1.5; }
.viz-bar-label { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.viz-seg-value { fill: #fff; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.viz-seg-value.ink { fill: var(--ink); }
.viz-peak-dot { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.5; }
.viz-tip { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; min-width: 160px; max-width: 280px; padding: 8px 10px 9px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); font-size: 12px; line-height: 1.5; }
.viz-tip[hidden] { display: none; }
.viz-tip-title { font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.viz-tip-row { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; column-gap: 8px; color: var(--ink-2); }
.viz-tip-row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-tip-row.strong span { color: var(--ink); font-weight: 600; }
.viz-key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--k, transparent); flex: 0 0 auto; }
.viz-key.dash { background: repeating-linear-gradient(90deg, var(--k) 0 4px, transparent 4px 7px); }
.viz-key.square { width: 10px; height: 10px; border-radius: 2px; }
.viz-legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.viz-legend-sep { width: 1px; height: 14px; background: var(--border); }

/* ------------------------------------------------------------------ the Overview */
.page-body.overview { gap: 18px; padding-top: 20px; }
.ov-hero { position: relative; padding: 26px 30px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.ov-answer { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.ov-corner { flex: 0 0 auto; }
.ov-corner .basis-bar { gap: 4px; }
.ov-corner .basis-bar .f-label { font-size: 11.5px; color: var(--ink-3); }
.ov-corner .basis-bar .seg { padding: 3px 10px; font-size: 11.5px; font-weight: 600; }
.ov-corner .basis-bar .seg .seg-sub { display: none; }
.status-mark { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 4px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--good-bg); color: var(--good-text); }
.status-mark i { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--good); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; }
.status-mark.tight, .status-mark.warn { background: var(--warn-bg); color: var(--warn-text); }
.status-mark.tight i, .status-mark.warn i { background: var(--warning); color: var(--ink); }
.status-mark.bad { background: var(--bad-bg); color: var(--bad-text); }
.status-mark.bad i { background: var(--critical); }
.ov-title { margin: 12px 0 8px; font-family: var(--font-sign); font-size: clamp(26px, 2.7vw, 38px); font-weight: 600; letter-spacing: -0.015em; line-height: 1.08; color: var(--ink); }
.ov-sub { margin: 0; max-width: 72ch; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.ov-compare { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; }
.ov-chart-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 24px; }
.ov-chart-head h2 { margin: 0; font-size: 14px; }
.ov-chart-head.sub { margin-top: 2px; }
.ov-chart-head h3 { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.ov-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 8px 0 4px; font-size: 12px; color: var(--ink-2); }
.ov-runway, .ov-arrivals { width: 100%; }
.ov-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ov-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.ov-tile { display: flex; flex-direction: column; min-width: 0; padding: 20px 22px 18px; border-left: 1px solid var(--border); }
.ov-tile:first-child { border-left: 0; }
.ov-tile-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ov-figure { font-family: var(--font-sign); font-size: 34px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; color: var(--ink); }
.ov-caption { margin: 6px 0 14px; color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.ov-tile-chart { flex: 1; min-width: 0; }
.ov-link { align-self: flex-start; margin-top: 14px; padding: 0; border: 0; background: none; color: var(--accent-ink); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ov-link:hover { text-decoration: underline; }
.ov-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.ov-keys { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 11.5px; color: var(--ink-2); }
.ov-scale { display: flex; align-items: center; gap: 6px; margin: 6px 0 12px; font-size: 10.5px; color: var(--ink-3); }
.ov-scale i { flex: 0 0 84px; height: 6px; border-radius: 3px; }
.ov-mix-head { margin-bottom: 2px; font-size: 11.5px; color: var(--ink-3); }
.ov-notes { display: flex; flex-direction: column; gap: 3px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--ink-2); }
.ov-notes li { padding-left: 12px; position: relative; }
.ov-notes li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); }
.ov-sources { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 0 4px; font-size: 11.5px; color: var(--ink-3); }
.ov-sources > span:first-child { font-weight: 600; color: var(--ink-2); }
.ov-sources .link { font-size: 11.5px; }
@media (max-width: 1180px) {
  .ov-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-tile:nth-child(3) { border-left: 0; }
  .ov-tile:nth-child(n + 3) { border-top: 1px solid var(--border); }
}
@media (max-width: 680px) {
  .ov-hero { padding: 18px 16px 16px; }
  .ov-answer { flex-direction: column; gap: 12px; }
  .ov-band { grid-template-columns: 1fr; }
  .ov-tile { border-left: 0; border-top: 1px solid var(--border); padding: 18px 16px; }
  .ov-tile:first-child { border-top: 0; }
  .ov-sub { font-size: 14px; }
}

/* ------------------------------------------------------------------ the 3D stages of the pages (src/scene/stage.js) */
.stage { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--page); }
.stage-canvas { position: absolute; inset: 0; }
.stage-canvas canvas.gl { display: block; width: 100%; height: 100%; outline: none; }
.stage-tags { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.stage-tag { position: absolute; left: 0; top: 0; will-change: transform; --k: #9aa3af; }
.stage-tag.pin { left: -5px; top: -5px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: var(--k); box-shadow: 0 1px 3px rgba(23, 32, 51, 0.4); }
.stage-tag.tag-box { display: flex; flex-direction: column; padding: 3px 8px 4px 7px; border: 1px solid var(--k); border-left-width: 3px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.96); box-shadow: 0 2px 8px rgba(23, 32, 51, 0.14); font-size: 11px; line-height: 1.25; white-space: nowrap; }
.stage-tag.stem { left: -0.75px; top: 0; width: 0; border-left: 1.5px solid var(--k); }
.stage-tag.tag-box > span { display: flex; flex-direction: column; }
.stage-tag b { font-family: var(--font-sign); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.stage-tag.keep { --k: #1baf7a; }
.stage-tag.give { --k: #e8930c; }
.stage-tag.freed { --k: #0ca30c; }
.stage-tag.tag-box.freed { background: #effaf2; }
.stage-tag.pin.active { left: -6px; top: -6px; width: 12px; height: 12px; }
.stage-tag.tag-box.active { box-shadow: 0 0 0 2px rgba(23, 32, 51, 0.2), 0 3px 10px rgba(23, 32, 51, 0.18); }
.stage-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 24px; padding: 2px 2px 0; }
.stage-id { flex: 1 1 320px; min-width: 0; }
.stage-title { display: flex; align-items: center; gap: 8px; }
.stage-part { font-family: var(--font-sign); font-size: 22px; font-weight: 600; letter-spacing: 0.005em; line-height: 1.15; }
.stage-desc { overflow: hidden; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.stage-sum { margin-top: 2px; color: var(--ink); font-size: 13px; }
.stage-caption { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 12px;
  border-radius: 8px; background: rgba(23, 32, 51, 0.86); color: #fff; font-size: 13px; pointer-events: none; }
.stage-caption:empty { display: none; }
.stage-caption .mono { font-family: var(--font-sign); font-weight: 600; letter-spacing: 0.02em; }
.stage-caption .flag { background: rgba(255, 255, 255, 0.16); color: #fff; }
.stage-caption .flag.good { background: #0ca30c; color: #fff; }
.stage-caption .flag.warn { background: var(--warning); color: var(--ink); }
.stage-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-bottom: 2px; color: var(--ink-2); font-size: 12px; }
.stage-swatch { width: 12px; height: 12px; border: 2px solid var(--k); border-radius: 2px; }
.stage-note { position: absolute; left: 12px; right: 12px; top: 45%; text-align: center; color: var(--ink-2); }
.stage-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.stage-controls .play { min-width: 104px; justify-content: center; }
.stage-transport { display: inline-flex; gap: 4px; }
.stage-range { display: flex; flex: 1; min-width: 140px; }
.stage-range input { width: 100%; }
.seg-group { display: inline-flex; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 6px; }
.seg-btn { padding: 3px 9px; border: 0; border-left: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; }
.seg-btn:first-child { border-left: 0; }
.seg-btn:hover { background: var(--surface-2); }
.seg-btn.active { background: var(--accent); color: #fff; }
.seg-btn:focus-visible, .chip-btn:focus-visible, .cons-item:focus-visible, .route-move:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.flag { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); font-size: 10.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.flag.warn { background: var(--warn-bg); color: var(--warn-text); }
.flag.good { background: var(--good-bg); color: var(--good-text); }
.chip-btn { padding: 3px 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; }
.chip-btn:hover { background: var(--surface-2); }
.chip-btn.active { border-color: var(--accent); background: var(--accent); color: #fff; }

/* ------------------------------------------------------------------ the Consolidation page */
.page-body.consol { gap: 16px; padding-top: 20px; }
.cons-head { align-items: flex-start; }
.cons-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.cons-basis .basis-bar, .fc-basis .basis-bar { gap: 4px; }
.cons-basis .basis-bar .f-label, .fc-basis .basis-bar .f-label { font-size: 11.5px; color: var(--ink-3); }
.cons-basis .basis-bar .seg, .fc-basis .basis-bar .seg { padding: 3px 10px; font-size: 11.5px; }
.cons-basis .basis-bar .seg .seg-sub, .fc-basis .basis-bar .seg .seg-sub { display: none; }
.cons-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.35fr); border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.cons-fig { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 14px 18px; border-left: 1px solid var(--border); }
.cons-fig:first-child { border-left: 0; }
.cons-fig-label { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.cons-fig-value { font-family: var(--font-sign); font-size: 28px; font-weight: 600; line-height: 1.1; color: var(--ink); }
.cons-fig-value .arrow { margin: 0 8px; color: var(--ink-3); font-size: 20px; }
.cons-fig-value .good { color: var(--good-text); }
.cons-fig-value.warn { color: var(--warn-text); }
.cons-fig-sub { color: var(--ink-3); font-size: 12px; line-height: 1.4; }
.cons-waves { margin-top: 6px; }
.cons-bench { display: grid; grid-template-columns: 330px minmax(0, 1fr); align-items: start; gap: 16px; }
.cons-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; max-height: calc(100vh - var(--header-h) - 40px); padding: 14px 14px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.cons-side-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; }
.cons-side-head h2 { margin: 0; font-size: 14px; }
.cons-search { width: 100%; }
.cons-wave-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cons-list-box { flex: 1; min-height: 0; margin: 0 -6px; padding: 0 6px; overflow: auto; }
.cons-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.cons-item { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ink);
  font: inherit; text-align: left; cursor: pointer; }
.cons-item:hover { background: var(--surface-2); }
.cons-item.active { border-color: #c5d8f2; background: var(--info-bg); }
.cons-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cons-part { font-family: var(--font-sign); font-size: 13.5px; font-weight: 600; letter-spacing: 0.01em; }
.cons-gain { font-family: var(--font-sign); font-size: 13.5px; font-weight: 600; color: var(--good-text); }
.cons-desc { overflow: hidden; color: var(--ink-2); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.cons-item-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 11.5px; }
.cons-more { margin: 8px 10px; font-size: 12px; }
.cons-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cons-stage { height: clamp(440px, 64vh, 660px); }
.cons-route { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.cons-route:empty { display: none; }
.cons-route h3 { margin: 0 0 8px; color: var(--ink-2); font-size: 13px; text-transform: none; letter-spacing: 0; }
.route-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px 16px; max-height: 320px; overflow: auto; }
.route-dest header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; padding-bottom: 4px; border-bottom: 2px solid #1baf7a; font-size: 12px; }
.route-dest header .mono { font-family: var(--font-sign); font-size: 13px; font-weight: 600; }
.route-dest ol { margin: 0; padding: 0; list-style: none; }
.route-move { display: flex; align-items: center; gap: 8px; width: 100%; padding: 3px 4px; border: 0; border-radius: 4px; background: none; color: var(--ink); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.route-move:hover { background: var(--surface-2); }
.route-k { width: 22px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.route-move .mono { font-family: var(--font-sign); font-weight: 600; }
.route-units { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.route-dest li.done .route-move { color: var(--ink-3); }
.route-dest li.now .route-move { background: var(--info-bg); }
.cons-insights { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cons-insight { padding: 16px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.cons-insight h2 { margin: 0; font-size: 14px; }
.cons-insight .muted.small { margin: 2px 0 10px; }
@media (max-width: 1100px) {
  .cons-bench { grid-template-columns: minmax(0, 1fr); }
  .cons-side { position: static; max-height: 440px; }
  .cons-strip { grid-template-columns: 1fr 1fr; }
  .cons-fig:nth-child(3) { border-left: 0; }
  .cons-fig:nth-child(n + 3) { border-top: 1px solid var(--border); }
}
@media (max-width: 680px) {
  .cons-strip { grid-template-columns: 1fr; }
  .cons-fig { border-left: 0; border-top: 1px solid var(--border); }
  .cons-fig:first-child { border-top: 0; }
  .cons-insights { grid-template-columns: 1fr; }
  .cons-stage { height: 400px; }
  .stage-part { font-size: 19px; }
  .cons-actions { justify-content: flex-start; }
}

/* ------------------------------------------------------------------ the Space forecast page */
.page-body.fc { gap: 16px; padding-top: 20px; }
.fc-head { align-items: flex-start; }
.fc-hero { display: flex; flex-direction: column; gap: 10px; }
.fc-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.fc-month { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label in" "bar bar" "empty sub"; align-items: baseline; gap: 5px 6px; min-width: 0;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.fc-month:hover { border-color: var(--border-strong); }
.fc-month:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.fc-month.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.fc-month.low { border-bottom: 4px solid var(--tape); }
.fc-m-label { grid-area: label; font-family: var(--font-sign); font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }
.fc-m-in { grid-area: in; color: var(--ink-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.fc-m-bar { grid-area: bar; display: flex; gap: 1px; height: 5px; overflow: hidden; border-radius: 3px; background: var(--surface-3); }
.fc-m-bar i { display: block; height: 100%; background: var(--k); }
.fc-m-empty { grid-area: empty; font-family: var(--font-sign); font-size: 19px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fc-m-sub { grid-area: sub; color: var(--ink-3); font-size: 11px; }
.fc-month.low .fc-m-sub { color: var(--warn-text); font-weight: 600; }
.fc-stage { height: clamp(420px, 60vh, 660px); }
.fc-controls .spacer { flex: 1; }
.fc-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink-2); font-size: 12px; }
.stage-caption.fc-caption { top: 12px; bottom: auto; max-width: min(760px, calc(100% - 24px)); }
.fc-caption .fc-cap-empty { font-weight: 600; }
.fc-caption .fc-cap-empty.low { color: var(--tape); }
.fc-keys { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -2px 0 10px; color: var(--ink-2); font-size: 12px; }
.fc-instruments { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.fc-card { padding: 16px 18px; border-radius: 10px; }
.fc-card .card-title h2 { font-size: 14px; }
.fc-details { display: flex; flex-direction: column; gap: 8px; }
details.fc-more { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
details.fc-more > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
details.fc-more > summary::-webkit-details-marker { display: none; }
details.fc-more > summary::before { content: ""; align-self: center; width: 7px; height: 7px; margin-right: 2px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2);
  transform: rotate(-45deg); transition: transform 160ms ease; }
details.fc-more[open] > summary::before { transform: rotate(45deg); }
details.fc-more[open] > summary { border-bottom: 1px solid var(--border); }
details.fc-more > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 10px; }
.fc-more-title { font-size: 14px; font-weight: 600; }
.fc-more-sub { color: var(--ink-3); font-size: 12.5px; }
details.fc-more > :not(summary) { margin: 12px 16px 16px; }
details.fc-more > .card { padding: 0; border: 0; }
@media (max-width: 1100px) {
  .fc-instruments { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .fc-months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fc-m-in { display: none; }
  .fc-m-empty { font-size: 15px; }
  .fc-stage { height: 380px; }
  .fc-legend { width: 100%; }
}
