/* Fulcrum web shell. Every colour and size is a token in css/tokens.css,
   generated from VisualTokens.qml under web/theme.json (IBM Carbon g100).
   Controls are flat: tabs mark the active choice with a selection rule,
   panes are separated by hairlines rather than boxed. */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/IBMPlexSans-Regular.ttf") format("truetype");
  font-weight: 400;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/IBMPlexSans-Bold.ttf") format("truetype");
  font-weight: 700;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular.ttf") format("truetype");
  font-weight: 400;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Bold.ttf") format("truetype");
  font-weight: 700;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--field);
  color: var(--text-primary);
  font-family: var(--font-ui), sans-serif;
  font-size: var(--type-body);
}

#app {
  position: fixed;
  inset: 0;
  min-width: 960px;
  min-height: 620px;
}

/* Below the 960x620 floor the shell keeps the floor size and the page
   scrolls to reach the rest of it. At or above the floor the shell stays
   fixed: in the page flow, Chromium anti-aliases its text and frame corners
   differently. */
@media not all and (min-width: 960px) and (min-height: 620px) {
  html,
  body { overflow: visible; }
  #app {
    position: relative;
    inset: auto;
    height: 100%;
    overflow: hidden;
  }
}

/* ---- text roles (VC7) and helpers ---- */

/* Qt labels keep the line breaks inside their text and only wrap where the
   QML sets wrapMode: Text.WordWrap (class ww). */
.t-label, .t-body, .t-title, .t-lead, .t-stat { white-space: pre; }
/* Qt sets each text line at the font's line spacing (IBM Plex: 1.3em) rounded
   up to a whole pixel, which css/tokens.css carries per type role (--line-*);
   Chromium's own line height rounds ascent and descent separately, which
   comes out a pixel shorter at 11, 12, and 16px. */
.t-label, .t-body, .t-title, .t-lead, .t-stat, .chip { line-height: var(--role-line); }
.ww { white-space: pre-wrap; }
.t-label { font-size: var(--type-label); --role-line: var(--line-label); }
.t-body { font-size: var(--type-body); --role-line: var(--line-body); }
.t-title { font-size: var(--type-title); --role-line: var(--line-title); letter-spacing: var(--letter-spacing-title); }
.t-lead { font-size: var(--type-lead); --role-line: var(--line-lead); }
.t-stat { font-size: var(--type-stat); --role-line: var(--line-stat); }
.spaced { letter-spacing: var(--letter-spacing-label); }
.mono { font-family: var(--font-mono), monospace; }
.bold { font-weight: 700; }
.semibold { font-weight: 600; }
.italic { font-style: italic; }
.right { text-align: right; }
.center { text-align: center; }
.pre { white-space: pre-wrap; }
.pre-line { white-space: pre-line; }
/* Text.WrapAnywhere: wrap inside a word, as hashes and paths need. */
.break-all { white-space: pre-wrap; word-break: break-all; }
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.clamp-2,
.clamp-3 {
  display: -webkit-box;
  overflow: hidden;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
}
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }
.clickable { cursor: pointer; }
.c-primary { color: var(--text-primary); }
.c-secondary { color: var(--text-secondary); }
.c-muted { color: var(--text-muted); }
.c-accent { color: var(--accent); }
.c-accent-muted { color: var(--accent-muted); }
.c-warning { color: var(--warning); }
.c-evidence { color: var(--evidence); }
.c-failure { color: var(--failure); }
.body-size { font-size: var(--type-body); }
.gap-top { margin-top: var(--space-sm); }
.gap-top-xs { margin-top: var(--space-xs); }

/* Fill items never shrink below text that cannot wrap, as in the native layouts. */
.fill { flex: 1 1 0; }
/* qt_layout.js reads natural widths under this class, then weights the fills. */
.qt-measuring .fill { flex: none !important; width: max-content !important; }
.qt-measuring.grid-2,
.qt-measuring .grid-2 { grid-template-columns: max-content max-content !important; }
.row-xs, .row-sm, .row-md, .row-lg { display: flex; align-items: center; }
.row-xs { gap: var(--space-xs); }
.row-sm { gap: var(--space-sm); }
.row-md { gap: var(--space-md); }
.row-lg { gap: var(--space-lg); }
.top { align-items: flex-start; }
.wrap { flex-wrap: wrap; }
.stack-xs, .stack-sm, .stack-md, .column { display: flex; flex-direction: column; }
.stack-xs { gap: var(--space-xs); }
.stack-sm { gap: var(--space-sm); }
.stack-md { gap: var(--space-md); }
.fill-height { flex: 1 1 auto; min-height: 0; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--space-sm);
  row-gap: var(--space-xs);
  align-items: baseline;
}

/* ---- scroll areas ---- */

/* A Fusion ScrollView: the view scrolls at the area's full width with its own
   bar hidden, and Fusion's ScrollBar (ScrollBar.qml) overlays the right edge:
   2px padding round a 6px handle in the palette's mid (dark while pressed),
   at 0.75 opacity while active, fading out over 200ms once it has been idle
   for 450ms. Main.qml maps mid to --border and dark to --field. */
.scroll-area {
  --fusion-scroll-padding: 2px;
  --fusion-scroll-handle: 6px;
  --fusion-scroll-opacity: 0.75;
  --fusion-scroll-pause: 450ms;
  --fusion-scroll-fade: 200ms;
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}
.scroll-view {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden auto;
  scrollbar-width: none;
}
.scroll-view::-webkit-scrollbar { display: none; }
.scroll-bar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: calc(var(--fusion-scroll-handle) + 2 * var(--fusion-scroll-padding));
  padding: var(--fusion-scroll-padding);
  pointer-events: none;
  touch-action: none;
  user-select: none;
}
.scroll-bar[data-scrollable] { pointer-events: auto; }
.scroll-handle {
  border-radius: calc(var(--fusion-scroll-handle) / 2);
  background: var(--border);
  opacity: 0;
  transition: opacity var(--fusion-scroll-fade) linear var(--fusion-scroll-pause);
}
.scroll-bar[data-active] > .scroll-handle {
  opacity: var(--fusion-scroll-opacity);
  transition: none;
}
.scroll-bar[data-pressed] > .scroll-handle { background: var(--field); }

/* ---- controls ---- */

/* A flat button: text on the pane, a faint wash on hover. The highlighted
   button is the active tab, marked by a selection rule along its foot. */
.btn,
.combo {
  --hover-wash: color-mix(in srgb, var(--text-primary) 8%, transparent);
  min-width: 0;
  min-height: 28px;
  padding: 0 var(--space-md);
  border: 0;
  border-radius: var(--radius-panel);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui), sans-serif;
  font-size: var(--type-body);
  letter-spacing: var(--letter-spacing-title);
  line-height: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.btn:hover { background: var(--hover-wash); color: var(--text-primary); }
.btn:active { background: color-mix(in srgb, var(--text-primary) 14%, transparent); }
.btn.highlighted {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-primary) 5%, transparent);
  box-shadow: inset 0 calc(-1 * var(--stroke-strong)) 0 var(--selection);
}
.btn.highlighted:hover { background: var(--hover-wash); }
/* KeyboardFocus.qml marks any control holding active focus, however it got it. */
.btn:focus,
.clickable[role="button"]:focus,
select:focus,
input:focus {
  outline: var(--stroke-strong) solid var(--selection);
  outline-offset: calc(-1 * var(--stroke-strong));
}

select,
input.filter {
  font-family: var(--font-ui), sans-serif;
  font-size: var(--type-body);
  color: var(--text-primary);
}

/* ---- claim chip (VC2) ---- */

.chip-row { display: inline-flex; align-items: center; gap: var(--space-xs); flex: none; }
/* A status word in its tone with a dot before it: quiet enough that a list of
   rows can each carry one. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--chip-tone);
  font-size: var(--type-label);
  --role-line: var(--line-label);
  letter-spacing: var(--letter-spacing-label);
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chip-tone);
}
.tone-evidence { --chip-tone: var(--evidence); }
.tone-failure { --chip-tone: var(--failure); }
.tone-warning { --chip-tone: var(--warning); }
.tone-accent { --chip-tone: var(--accent); }
.tone-accentMuted { --chip-tone: var(--accent-muted); }

/* ---- shell chrome (VC6) ---- */

/* Header, stage rail, and status bar run edge to edge on the page ground,
   each divided from the workspace by one hairline. */

.shell {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: var(--shell-chrome-gap);
  padding: var(--shell-margin);
}

/* The header keeps its height in the cockpit; its controls overlap the
   thicker border there, as in Main.qml. */
.shell-header {
  flex: 0 0 var(--shell-header-height);
  min-height: 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-md);
  background: var(--field);
  border-bottom: var(--stroke-hairline) solid var(--border);
}
.shell-header.cockpit { box-shadow: inset 0 calc(-1 * var(--stroke-strong)) 0 var(--selection); }
.shell-header .btn { height: 32px; }
.case-picker {
  flex: 1 1 auto;
  max-width: 560px;
  height: 32px;
  padding: 0;
  background: var(--surface-raised);
  border-bottom: var(--stroke-hairline) solid var(--border-strong);
}
/* A field with a chevron cell on the right; the text is clipped, as in the
   native ComboBox. */
.combo {
  text-overflow: clip;
  padding: 0 calc(20px + var(--space-sm)) 0 var(--space-md);
  appearance: none;
  color: var(--text-primary);
  background:
    linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%) right 13px center / 5px 5px no-repeat,
    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%) right 8px center / 5px 5px no-repeat,
    transparent;
}
.combo:hover { background-color: var(--hover-wash); }
.case-picker .combo { width: 100%; height: 100%; }

.orientation-kit {
  flex: 0 0 var(--shell-kit-height);
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 var(--space-sm);
  overflow: hidden;
  background: var(--field);
  border-bottom: var(--stroke-hairline) solid var(--border);
}
.orientation-kit .btn { height: auto; padding: 0 var(--space-md); }
.orientation-kit > .t-label,
.orientation-kit > .t-body,
.orientation-kit > div:not(.stage-rail) { align-self: center; }
.stage-rail { flex: 1 1 auto; display: flex; align-self: stretch; min-width: 0; }
.stage-rail .summary { flex: none; padding: 0 var(--space-sm); }
.stage-rail .stage { flex: 1 1 auto; min-width: 0; }
.beat-title { flex: 0 1 140px; min-width: 0; max-width: 160px; font-weight: 700; }
.where {
  flex: 0 1 120px;
  min-width: 0;
  max-width: 140px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
.orientation-kit .next-action { flex: 0 1 180px; min-width: 0; max-width: 200px; padding: 0 var(--space-sm); }

.status-bar {
  flex: 0 0 var(--shell-status-height);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: 0 var(--space-md);
  background: var(--field);
  border-top: var(--stroke-hairline) solid var(--border);
}
.status-text { min-width: 0; overflow: hidden; white-space: pre; text-overflow: ellipsis; }

.key-strip {
  flex: 0 0 auto;
  display: flex;
  background: var(--field);
  border-bottom: var(--stroke-hairline) solid var(--border);
}
.key-cell {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-sm) var(--space-md);
}
.key-cell + .key-cell { border-left: var(--stroke-hairline) solid var(--border); }

/* ---- case desk inspector ---- */

.path-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-xs); }
.path-relation { display: block; padding-left: calc(var(--space-lg) + var(--space-xs)); }
.path-ordinal { flex: 0 0 var(--space-lg); }
.path-step.clickable { padding: 2px var(--space-xs); }
.path-step.clickable:hover { background: color-mix(in srgb, var(--text-primary) 4%, transparent); }
.path-step.selected {
  background: var(--surface-raised);
  box-shadow: inset var(--stroke-strong) 0 0 var(--selection);
}
.cost-line.total { padding-top: var(--space-xs); border-top: var(--stroke-hairline) solid var(--border); }

/* ---- workspace and tiling ---- */

.workspace-frame { position: relative; flex: 1 1 auto; min-height: 240px; }
.workspace-host {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.inventory { display: flex; flex-direction: column; gap: var(--space-xs); }
.tiling-root { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.empty-hint { margin: auto; }

.split { display: flex; flex: 1 1 auto; min-width: 0; min-height: 0; }
.axis-horizontal { flex-direction: row; }
.axis-vertical { flex-direction: column; }
.holder { position: relative; display: flex; min-width: 0; min-height: 0; overflow: hidden; }
/* A split handle draws as one hairline between panes; its grab area reaches
   a few pixels either side. */
.handle {
  position: relative;
  z-index: 1;
  flex: 0 0 var(--stroke-hairline);
  background: var(--border);
  cursor: col-resize;
  touch-action: none;
}
.handle::after { content: ""; position: absolute; inset: 0 calc(-1 * var(--space-xs)); }
.axis-vertical > .handle { cursor: row-resize; }
.axis-vertical > .handle::after { inset: calc(-1 * var(--space-xs)) 0; }
.handle:hover { background: var(--selection); }

.stack { display: flex; flex: 1 1 auto; flex-direction: column; gap: var(--space-xs); min-width: 0; }
.stack-tabs { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.stack-tabs.column { flex-direction: column; flex-wrap: nowrap; }
.stack-content { display: flex; flex: 1 1 auto; min-height: 0; }

.tile {
  container-type: inline-size;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
  padding: 0 var(--tile-padding) var(--tile-padding);
  overflow: hidden;
  background: var(--surface);
}
.tile.marked { box-shadow: inset 0 var(--stroke-strong) 0 var(--selection); }
.tile-head {
  display: flex;
  flex: 0 0 36px;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
  margin: 0 calc(-1 * var(--tile-padding));
  padding: 0 var(--space-xs) 0 var(--tile-padding);
  border-bottom: var(--stroke-hairline) solid var(--border);
}
.tile-head .btn { min-height: 28px; padding: 0 var(--space-sm); font-size: var(--type-label); }
.tile-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.tile-tools { display: inline-flex; gap: var(--space-xs); }
/* Below 420px the split/move buttons yield to the title and Close. */
@container (max-width: 419px) {
  .tile-tools { display: none; }
}
.tile-body { position: relative; display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.pending { padding: var(--space-sm) 0; }
/* A control a QML column leaves at its implicit width rather than filling. */
.hug { align-self: flex-start; }

/* ---- row cards ---- */

/* A row card is a ruled row, not a box: a hairline under it, and the
   selected row carries a wash and a selection rule down its leading edge. */
.row-card {
  --card-pad: var(--space-md);
  flex: none;
  padding: var(--card-pad) var(--space-sm);
  background: transparent;
  border-bottom: var(--stroke-hairline) solid var(--border);
}
.row-card.clickable:hover { background: color-mix(in srgb, var(--text-primary) 4%, transparent); }
.row-card.selected {
  background: var(--surface-raised);
  box-shadow: inset var(--stroke-strong) 0 0 var(--selection);
}
.row-card.pad-sm { --card-pad: var(--space-sm); }
.row-card.on-surface { background: transparent; }
.evidence-card { content-visibility: auto; contain-intrinsic-size: auto 400px; }
.support-count { flex: none; min-width: calc(var(--type-stat) * 3); }

/* ---- strategies tile ---- */

.row-card.rationale { box-shadow: inset var(--stroke-strong) 0 0 var(--accent); }
/* A ruled data table: a header row on the raised layer, hairlines between
   rows, and the selected row marked as a row card is. */
.data-table { display: flex; flex-direction: column; }
.table-row {
  display: grid;
  align-items: center;
  column-gap: var(--space-md);
  min-height: 32px;
  padding: var(--space-xs) var(--space-sm);
  border-bottom: var(--stroke-hairline) solid var(--border);
}
.table-row > * { min-width: 0; }
.table-head { min-height: 28px; background: var(--surface-raised); }
.table-row.clickable:hover { background: color-mix(in srgb, var(--text-primary) 4%, transparent); }
.table-row.selected {
  background: var(--surface-raised);
  box-shadow: inset var(--stroke-strong) 0 0 var(--selection);
}
.strategy-table .table-row { grid-template-columns: 20px minmax(0, 0.8fr) minmax(0, 1.7fr) 72px 112px; }
.path-table .table-row { grid-template-columns: minmax(0, 1fr) 88px 64px; }
.slate-table .table-row { grid-template-columns: 72px minmax(0, 1fr) 112px; }
.score-cell { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-sm); }
.score-track { flex: 0 0 48px; height: var(--space-xs); background: var(--border); }
.score-bar { height: 100%; background: var(--text-secondary); }
.score-bar.lead { background: var(--accent); }

/* ---- hover card ---- */

.hover-card-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}
.hover-card {
  position: fixed;
  width: min(440px, 100vw - 16px);
  padding: var(--space-md);
  background: var(--surface-raised);
  border: var(--stroke-hairline) solid var(--border-strong);
  border-radius: var(--radius-panel);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--field) 70%, transparent);
}
.card-facts {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  column-gap: var(--space-md);
  row-gap: var(--space-xs);
  align-items: baseline;
}
.card-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.card-list > li::before { content: "– "; color: var(--text-muted); }
.card-foot { padding-top: var(--space-sm); border-top: var(--stroke-hairline) solid var(--border); }

/* ---- impact tile ---- */

.impact-score { flex: none; min-width: calc(var(--type-stat) * 4); }

/* ---- network tile ---- */

.network { height: 100%; }
.lead-size { font-size: var(--type-lead); line-height: var(--line-lead); }
.map-box {
  flex: 1 1 420px;
  min-height: 220px;
  padding: 0;
  overflow: hidden;
  background: var(--field);
  border: var(--stroke-hairline) solid var(--border);
  border-radius: var(--radius-inset);
}
.hop-list,
.affected-list { display: flex; flex-direction: column; gap: var(--space-xs); }
.hop-area { flex: 0 0 200px; }
.affected-area { flex: 0 0 72px; }
.ordinal { flex: none; min-width: var(--type-stat); }
.map-stop { transition: opacity 180ms cubic-bezier(0.33, 1, 0.68, 1); }
.map-stop.unrevealed { opacity: 0; }
/* With the system's reduced-motion setting nothing fades: map stops show at
   once, and an idle scroll handle still waits out its pause, then hides. */
@media (prefers-reduced-motion: reduce) {
  .scroll-handle,
  .map-stop,
  .map-label { transition-duration: 0s; }
}

/* ---- forecast chart (VC10) ---- */

.forecast { height: 100%; }
.figures { column-gap: var(--space-md); }
.chart-frame {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--space-xs);
  min-height: 240px;
  padding: calc(var(--space-xs) - var(--stroke-hairline));
  background: var(--field);
  border: var(--stroke-hairline) solid var(--border);
  border-radius: var(--radius-inset);
  cursor: pointer;
}
.chart-frame.selected { border-color: var(--selection); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.legend-item { display: inline-flex; align-items: center; gap: var(--space-xs); }
.swatch { display: inline-block; width: 14px; height: 8px; }
.swatch.overlay-band { background: var(--accent); opacity: var(--chart-overlay-band-opacity); }
.swatch.held-band { background: var(--evidence); opacity: var(--chart-held-band-opacity); }
.swatch.stressed-line { height: 2px; background: var(--accent); }
.swatch.history-line { height: 1px; background: var(--text-primary); }
.swatch.miss-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--failure); }
.swatch.baseline-line {
  width: 16px;
  height: 2px;
  background: linear-gradient(90deg, var(--text-muted) 0 6px, var(--field) 6px 10px, var(--text-muted) 10px 16px);
}
.canvas-box { position: relative; flex: 1 1 auto; min-height: 0; }
.canvas-box > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---- path map ---- */

.path-map { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--surface-inset); }
.path-map.empty { display: flex; align-items: center; justify-content: center; padding: var(--space-lg); }
.map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-stops { position: absolute; inset: 0; pointer-events: none; }
.map-stop,
.stop-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(var(--space-lg) + var(--space-xs));
  height: calc(var(--space-lg) + var(--space-xs));
  padding: 0 calc(var(--space-sm) * 0.75 - var(--stroke-strong));
  border: var(--stroke-strong) solid var(--accent);
  border-radius: calc((var(--space-lg) + var(--space-xs)) / 2);
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-mono), monospace;
  font-size: var(--type-label);
  font-weight: 700;
  white-space: nowrap;
}
.map-stop { position: absolute; transform: translate(-50%, -50%); }
.map-stop.endpoint,
.stop-badge.endpoint { background: var(--accent); color: var(--field); }
.map-stop.selected { box-shadow: 0 0 0 var(--stroke-strong) var(--selection); }
/* A stop's names on a halo of the map's sea colour, so they stay legible
   over land and links. */
.map-label {
  position: absolute;
  color: var(--text-primary);
  font-size: var(--type-label);
  line-height: var(--line-label);
  white-space: nowrap;
  text-shadow:
    0 0 2px var(--surface-inset),
    0 0 2px var(--surface-inset),
    0 0 4px var(--surface-inset);
  transition: opacity 180ms cubic-bezier(0.33, 1, 0.68, 1);
}
.map-label.unrevealed,
.map-label.crowded { opacity: 0; }
.stop-badge { flex: none; }

/* ---- executive summary ---- */

.executive-summary {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--field);
}
.summary-scroll {
  position: absolute;
  inset: calc(var(--space-lg) - var(--stroke-hairline));
}
.summary-page {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: calc(var(--space-lg) * 1.75);
  width: min(100%, 1360px);
  margin: 0 auto;
  padding-bottom: var(--space-lg);
}
/* ExecutiveSummary.qml spaces only its eyebrows; its 13px labels keep the
   font's own spacing. */
.summary-page .t-title { letter-spacing: normal; }
/* Qt's proportional lineHeight (--qt-k) multiplies each line's own height,
   the font's line spacing rounded up to a whole pixel, and puts all of the
   extra space below the line's text. CSS splits leading above and below,
   flooring the half above to a whole pixel, so the text is lifted by that
   floored half, floor((k - 1) x line / 2) for the class's type role
   (--qt-lift), and sits where it would at lineHeight 1; the box keeps Qt's
   height. */
.question,
.loose,
.note,
.body-copy {
  position: relative;
  top: calc(-1 * var(--qt-lift));
  line-height: calc(var(--qt-k) * var(--role-line));
}
.question { --qt-k: 1.2; --qt-lift: 3px; max-width: calc(1040px + 120px); }
.reading { max-width: 1040px; }
.reading-wider { max-width: calc(1040px + 200px); }
.loose { --qt-k: 1.4; --qt-lift: 4px; }
.note { --qt-k: 1.3; --qt-lift: 2px; }
.body-copy { --qt-k: 1.35; --qt-lift: 3px; }
.bottom-line {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg) calc(var(--space-lg) * 1.5);
  background: var(--surface-raised);
  border-radius: var(--radius-panel);
}
.bottom-line::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--stroke-strong) * 2);
  background: var(--accent);
}
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
@container (min-width: 1000px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--surface-raised);
  border-radius: var(--radius-panel);
}
.figure-row { display: flex; gap: var(--space-md); }
.figure-row > .card { flex: 1 1 0; min-width: 0; }
.shock-row { display: flex; gap: var(--space-lg); align-items: stretch; }
/* The QML map frame is max(420, the steps' height) with its one-line caption
   hung below it, so the steps column carries the caption's room and the
   stretched map column ends where Qt's does. */
.shock-row > .steps {
  padding-bottom: calc(var(--space-xs) + var(--line-label));
}
.summary-map { display: flex; flex-direction: column; gap: var(--space-xs); }
.map-frame {
  flex: 1 1 auto;
  min-height: 420px;
  padding: 0;
  overflow: hidden;
  background: var(--surface-inset);
  border: var(--stroke-hairline) solid var(--border);
  border-radius: var(--radius-panel);
}
.steps { display: flex; flex-direction: column; }
.step { display: flex; flex-direction: column; }
.step-relation { display: flex; gap: var(--space-sm); align-items: stretch; }
.step-relation > .t-body { padding: calc(var(--space-sm) / 2) 0; }
.step-rail {
  flex: 0 0 calc(var(--space-lg) + var(--space-xs));
  display: flex;
  justify-content: center;
}
.step-rail::before { content: ""; width: var(--stroke-strong); background: var(--accent-muted); }
.score .track {
  position: relative;
  flex: 1 1 auto;
  height: var(--space-xs);
  border-radius: calc(var(--space-xs) / 2);
  background: var(--border);
}
.score .bar { height: 100%; border-radius: calc(var(--space-xs) / 2); background: var(--text-secondary); }
.score .bar.lead { background: var(--accent); }
.score { margin: var(--space-xs) 0; }
.top-align { align-self: flex-start; }
.rule { height: var(--stroke-hairline); background: var(--border); }
.proof-label { padding: var(--space-sm) var(--space-sm) 0 0; }

/* ---- popups ---- */

.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fusion-top-shadow);
}
.popup {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: calc(var(--space-sm) - var(--stroke-hairline));
  background: var(--surface-raised);
  border: var(--stroke-hairline) solid var(--border);
  border-radius: var(--radius-panel);
}
.briefing-detail { width: min(100vw - 2 * var(--space-lg), 720px); height: min(100vh - 2 * var(--space-lg), 640px); }
.palette {
  align-self: flex-start;
  gap: var(--space-xs);
  width: min(100vw - 2 * var(--space-lg), 640px);
  height: min(100vh - 2 * var(--space-lg), 520px);
  margin-top: calc((100vh - min(100vh - 2 * var(--space-lg), 520px)) / 3);
  padding: calc(var(--space-sm) - var(--stroke-strong));
  border: var(--stroke-strong) solid var(--selection);
}
.inset {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: calc(var(--space-sm) - var(--stroke-hairline));
  background: var(--surface-inset);
  border: var(--stroke-hairline) solid var(--border);
  border-radius: var(--radius-inset);
}
input.filter {
  height: 28px;
  padding: 0 var(--space-sm);
  background: var(--surface-inset);
  border: var(--stroke-hairline) solid var(--fusion-field-outline);
  border-radius: var(--radius-panel);
}
input.filter::placeholder { color: var(--text-muted); }
.command-list { display: flex; flex-direction: column; }
.btn.command { display: flex; flex: none; align-items: center; gap: var(--space-xs); width: 100%; text-align: left; }

.load-failure { padding: var(--space-lg); }
/* The system sans-serif paints at once; IBM Plex would hide the line until
   the font arrives, and fetching it this early shifts the anti-aliasing of
   the shell's first text. */
.loading-line { margin: 0; padding: var(--space-lg); font-family: sans-serif; }
