/* Copyright (c) Health Dynamics Consulting Ltd. All rights reserved. Proprietary: see LICENSE. */
/*
 * Layer 5 of 5: page styles. What belongs to one screen or one area. The shared layers come first:
 * tokens.css, base.css, components.css and layout.css. When a page is restyled to the design standard
 * (docs/design-standard.md), move it onto the shared patterns and delete its rules here.
 * Older token names (--cerise, --space-5 and so on) still work; new rules use --hd-* and --wfp-*.
 */

/* ------------------------------------------------------------------ phase 2: models and the model editor */

.main-inner.wide { max-width: none; }
.filters .filter-row { display: grid; grid-template-columns: 2fr repeat(3, 1fr) auto; gap: var(--space-4); align-items: end; }
.filters .field { margin-bottom: 0; }
.list-tools { justify-content: space-between; margin-bottom: var(--space-4); }
.list-tools a[aria-current="page"] { background: var(--oxford); color: var(--white); }
.model-card { display: block; text-decoration: none; color: var(--oxford); }
.model-card:hover { color: var(--oxford); }

.editor-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--space-4); margin-bottom: var(--space-4); }
.editor-head h1 { margin-bottom: var(--space-1); }
.editor-actions { gap: var(--space-2); }
.editor-status { color: var(--muted); font-size: 14px; min-height: 22px; margin-bottom: var(--space-2); }
/* A forecast's or scenario's tabs in four sections (D116); on a phone the sections are a dropdown. */
.section-bar { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
.section-btn { border: 1px solid var(--control-border); background: var(--white); color: var(--oxford); padding: 6px var(--space-4); border-radius: var(--radius-pill); font-family: var(--font-heading); font-weight: 700; font-size: 14px; cursor: pointer; }
.section-btn:hover { color: var(--cerise-dark); }
.section-btn[aria-pressed="true"] { background: var(--oxford); border-color: var(--oxford); color: var(--white); }
.section-pick { display: none; margin-bottom: var(--space-2); }
@media (max-width: 639px) {
  .section-bar { display: none; }
  .section-pick { display: block; }
}

.elements-toolbar { justify-content: space-between; margin-bottom: var(--space-4); }
.elements-toolbar input[type="search"] { max-width: 260px; }
.type-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.type-tab {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 0 var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--white); color: var(--oxford);
  font-family: var(--font-heading); font-weight: 700; font-size: 14px; cursor: pointer;
}
.type-tab:hover { background: var(--cerise-soft); }
.type-tab[aria-pressed="true"] { background: var(--cerise-soft); color: var(--cerise-dark); border-color: var(--cerise); }
.type-tab .count { background: var(--surface); border-radius: var(--radius-pill); padding: 0 var(--space-2); font-size: 12px; color: var(--oxford); }

.elements-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--space-5); align-items: start; }
.element-panel {
  position: sticky; top: calc(var(--header-height) + var(--space-4)); max-height: calc(100vh - var(--header-height) - 32px); overflow-y: auto;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-5); box-shadow: var(--shadow-sm);
}
.element-panel h2 { font-size: 20px; margin-bottom: var(--space-1); }
.element-panel h2:focus { outline: none; }
.element-panel .field { margin-bottom: var(--space-4); }
.panel-empty h2 { color: var(--oxford); }

table.data.editable td { padding: 4px; height: auto; }
table.data.editable td.status-cell, table.data.editable td.actions-cell { padding: 4px var(--space-2); white-space: nowrap; }
.cell-select { min-width: 120px; }
.cell-input, .cell-select { min-height: 32px; min-width: 90px; padding: 2px var(--space-2); font-size: 14px; border-color: transparent; background: transparent; }
.cell-input:hover, .cell-select:hover { border-color: var(--control-border); }
.cell-input:focus { border-color: var(--control-border); background: var(--white); }
.cell-input.mono { font-family: var(--font-mono); min-width: 160px; }
.cell-input.num { text-align: right; min-width: 70px; }
.cell-input.rate { min-width: 96px; }
.cell-select.wide { min-width: 220px; }
td.invalid .cell-input, td.invalid .cell-pick summary, td.invalid .cell-select { border: 2px solid var(--error); }
.cell-summary { white-space: nowrap; padding: 2px var(--space-2); }
.cell-pick { position: relative; }
.cell-pick summary { white-space: nowrap; list-style: none; cursor: pointer; min-height: 32px; min-width: 90px; padding: 4px var(--space-2); border: 1px solid transparent; border-radius: var(--radius-chip); }
.cell-pick summary::-webkit-details-marker { display: none; }
.cell-pick summary:hover, .cell-pick[open] summary { border-color: var(--control-border); background: var(--white); }
.cell-pick-menu { position: absolute; z-index: 5; display: grid; gap: var(--space-1); min-width: 180px; padding: var(--space-2); background: var(--white); border: 1px solid var(--control-border); border-radius: var(--radius-chip); box-shadow: 0 4px 12px rgb(0 0 0 / .12); }
.pairs-editor table { margin-bottom: var(--space-2); }
td.invalid .cell-input { border: 2px solid var(--error); background: var(--error-tint); }
.row-status { display: inline-flex; }
.row-status.error { color: var(--error); }
.row-status.warning { color: var(--warning); }
.row-status.ok { color: var(--success); opacity: .6; }
.btn-icon { background: none; border: 0; padding: 4px; border-radius: var(--radius-chip); cursor: pointer; color: var(--oxford); }
.btn-icon:hover { background: var(--cerise-soft); }

.diag-card { padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
.diag-card.has-errors { border-left: 4px solid var(--error); }
.diag-card summary { cursor: pointer; }
.diag-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; font-size: 14px; display: grid; gap: var(--space-2); }
.diag-list li { display: flex; gap: var(--space-2); align-items: flex-start; }
.diag-list .diag-error > .icon { color: var(--error); }
.diag-list .diag-warning > .icon { color: var(--warning); }
.diag-list .btn-link { font-family: var(--font-mono); white-space: nowrap; }

.eq-field { position: relative; }
.eq-box { position: relative; }
.eq-highlight, .eq-input {
  font-family: var(--font-mono); font-size: 14px; line-height: 1.5; padding: var(--space-2) var(--space-3);
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; margin: 0; border-radius: var(--radius-control); min-height: 64px;
}
.eq-highlight { position: absolute; inset: 0; border: 1px solid transparent; overflow: hidden; pointer-events: none; color: var(--oxford); }
.eq-input { position: relative; display: block; width: 100%; resize: vertical; border: 1px solid var(--control-border); background: transparent; color: transparent; caret-color: var(--oxford); }
.eq-input::selection { background: rgba(41, 171, 226, .3); color: transparent; }
.eq-input[aria-invalid="true"] { border: 2px solid var(--error); }
.tk-name { color: var(--oxford); }
.tk-fn { color: var(--deep-blue); font-weight: 700; }
.tk-num { color: var(--purple); }
.tk-op { color: var(--muted); }
.tk-str { color: var(--success); }
.tk-bad { color: var(--error); }
.tk-error { text-decoration: underline wavy var(--error); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.tk-end { display: inline-block; width: 1ch; }
.eq-suggest {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: var(--space-1); list-style: none;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-md); max-height: 240px; overflow-y: auto;
}
.eq-suggest li { padding: var(--space-1) var(--space-2); border-radius: var(--radius-chip); cursor: pointer; font-family: var(--font-mono); font-size: 14px; }
.eq-suggest li.active, .eq-suggest li:hover { background: var(--tint-sky); }
.eq-messages { display: grid; gap: var(--space-1); margin-top: var(--space-1); }
.eq-msg { display: flex; gap: var(--space-2); align-items: flex-start; font-size: 13px; margin: 0; }
.eq-msg .icon { width: 16px; height: 16px; margin-top: 2px; vertical-align: 0; }
.eq-error { color: var(--error); }
.eq-warning { color: var(--warning); }
.eq-info { color: var(--info); }
.conversion { display: flex; gap: var(--space-1); align-items: flex-start; }

.fn-reference { margin-top: var(--space-4); border-top: 1px solid var(--border); padding-top: var(--space-3); }
.fn-reference summary { cursor: pointer; font-family: var(--font-heading); font-weight: 700; }
.fn-list { list-style: none; padding: 0; margin: var(--space-3) 0 0; display: grid; gap: var(--space-2); max-height: 320px; overflow-y: auto; }
.fn-list p { margin: 0; }
.preview { border-top: 1px solid var(--border); padding-top: var(--space-3); }
.preview-values { display: grid; gap: 2px; }
.range { width: 100%; accent-color: var(--cerise); }

fieldset.dimension { margin-bottom: var(--space-4); }
.field-diag:empty { display: none; }

.results-head { margin-bottom: var(--space-4); }
.results-head .checkbox { margin: 0; }
.results-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.results-controls .field { margin-bottom: var(--space-3); }
.results-controls .checkbox { margin-bottom: var(--space-2); font-size: 14px; }
.element-picker { padding: var(--space-3); max-height: 420px; overflow-y: auto; }
.element-picker .checkbox { font-size: 14px; margin-bottom: var(--space-1); }
.element-picker .checkbox input { margin-top: 3px; }
.picker-group { font-family: var(--font-heading); font-weight: 700; font-size: 12px; color: var(--muted); margin: var(--space-2) 0 var(--space-1); }
.output-head { justify-content: space-between; }
.output-head h2 { margin: 0; }
.results-table { max-height: 520px; overflow: auto; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); font-size: 14px; }

.chart-card { padding: var(--space-4); }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.legend-item {
  display: inline-flex; align-items: center; gap: var(--space-2); padding: 2px var(--space-3); border: 1px solid var(--border);
  border-radius: var(--radius-pill); background: var(--white); color: var(--oxford); font-size: 13px; cursor: pointer;
}
.legend-item[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.chart-plot { position: relative; width: 100%; }
/* The shared chart module (charts.js, D131): ECharts draws into .chart-canvas as SVG. */
.chart-canvas { width: 100%; border-radius: var(--radius-chip); }
.chart-canvas:focus-visible { outline: var(--focus); outline-offset: 2px; }
.chart-tip-body { font-family: var(--font-body); font-size: 13px; min-width: 160px; max-width: 300px; white-space: normal; }
.chart-tip-body strong { display: block; margin-bottom: var(--space-1); }
.chart-tip-swatch { display: inline-block; width: 16px; vertical-align: middle; border-top: 3px solid var(--oxford); }
.chart-tip-dash { border-top-style: dashed; }
/* The data view switcher (7 Nov 2026): view settings on the left, then Chart and Table and one Download menu top right. */
.chart-view-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.chart-view-settings { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-3); margin-right: auto; }
.chart-view-settings .select { width: auto; min-height: 40px; font-size: .92rem; }
.chart-view-settings label { font-size: .88rem; font-weight: 700; margin-right: var(--space-1); }
.chart-view-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-left: auto; }
.chart-view-switch .seg-btn { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 36px; padding: 4px var(--space-3); }
.chart-view-switch .seg-btn .icon { width: 18px; height: 18px; }
.chart-download > summary { min-height: 36px; padding: 0 var(--space-3); }
.chart-download > summary .icon { width: 18px; height: 18px; }
.chart-download .menu-panel { min-width: 200px; }
.chart-view-chart[hidden], .chart-view-table[hidden], .chart-view-settings .chart-only[hidden] { display: none; }
.chart-view-settings .view-settings { margin: 0; }
.chart-setting { min-height: 36px; }
/* Control bars above a chart: filters (a plain bar, or the panel), then view settings, both compact. */
.chart-filters, .view-settings { margin-bottom: var(--space-3); gap: var(--space-2) var(--space-4); }
.chart-filters .select-compact, .view-settings .select-compact { width: auto; max-width: 100%; }
.chart-setting .select, .chart-filters .select, .view-settings .select { width: auto; max-width: 100%; }
.chart-setting { display: inline-flex; align-items: center; gap: var(--space-2); }
.chart-setting label { margin: 0; font-size: .88rem; font-weight: 700; }
.pick-field .field-label { margin: 0 0 var(--space-1); font-size: .88rem; font-weight: 700; }
.pick-menu > summary { min-height: 36px; font-family: var(--font-body); font-weight: 400; border-radius: var(--radius-chip, 6px); }
.pick-menu .menu-panel { left: 0; right: auto; min-width: 280px; max-height: 60vh; overflow: auto; }
.pick-menu-item { display: flex; gap: var(--space-2); align-items: flex-start; padding: var(--space-1) var(--space-2); }
.pick-menu-item label { margin: 0; font-weight: 400; font-size: .92rem; }
.pick-menu-item .checkbox { margin-top: 3px; }
.chart-key { cursor: default; }
.chart-key-item { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 13px; color: var(--oxford); }
.chart-key-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.diff-list { list-style: none; padding: 0; display: grid; gap: var(--space-2); font-size: 14px; }
.share-form { align-items: flex-end; }
.share-form .field { margin-bottom: 0; }
.danger-zone { border-left: 4px solid var(--error); }

@media (max-width: 1280px) {
  .elements-layout { grid-template-columns: minmax(0, 1fr); }
  .element-panel { position: static; max-height: none; }
}
@media (max-width: 899px) {
  .results-layout { grid-template-columns: minmax(0, 1fr); }
  .filters .filter-row { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------------ phase 3: workforce */
.type-tab[aria-selected="true"] { background: var(--cerise-soft); color: var(--cerise-dark); border-color: var(--cerise); }
.dict-panel { margin-top: var(--space-5); }
.register-toolbar { align-items: flex-end; }
.register-toolbar .field { margin-bottom: 0; }
.register-scroll { max-height: 64vh; overflow: auto; }
.register-table td { white-space: nowrap; }
.register-table tr.spacer td { padding: 0; border: 0; }
.register-table tr.spacer:hover { background: none; }
dialog.modal.modal-wide { max-width: 760px; }
/* Age bands (D183): a label, code or From made from the ages is shown as automatic, in muted italics with a hint (Q161.15). */
.input.is-auto { color: var(--muted); font-style: italic; }
.age-legend { font-size: 15px; padding: 0; margin-bottom: var(--space-2); }
.age-range-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.age-set + .age-set { border-top: 1px solid var(--border); margin-top: var(--space-4); padding-top: var(--space-4); }
.age-set h4 { margin: 0 0 var(--space-1); }
.age-set p { margin: 0; }
.age-set-bands { list-style: none; padding: 0; margin: var(--space-2) 0 var(--space-3); columns: 2; column-gap: var(--space-4); font-size: 14px; }
.age-map-new { list-style: none; padding: 0; margin: 0; }
.age-map-new .field { margin-bottom: var(--space-3); }
dialog.modal.age-map-dialog { max-height: 90vh; overflow: auto; }
@media (max-width: 639px) { .age-range-row { grid-template-columns: minmax(0, 1fr); } .age-set-bands { columns: 1; } }
.decide-form { margin-top: var(--space-4); border-top: 1px solid var(--border); padding-top: var(--space-4); }
.wf-status .stat { margin: 0; }
.rule-editor { border-top: 3px solid var(--cerise); margin-top: var(--space-5); padding-top: var(--space-4); }
.rule-section { margin-top: var(--space-5); }
.rule-section h4, .rule-section legend { font-family: var(--font-heading); font-weight: 700; margin-bottom: var(--space-2); }
.filter-box { border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--space-2) var(--space-3); background: var(--white); }
.filter-box summary { cursor: pointer; font-size: 14px; }
.filter-list { max-height: 200px; overflow-y: auto; display: grid; gap: var(--space-1); margin-top: var(--space-2); font-size: 14px; }
.filter-list.sens-vary { max-height: none; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.condition-row { margin-bottom: var(--space-2); }
.override-grid table.data th[scope="row"] { position: sticky; left: 0; background: var(--surface); min-width: 220px; white-space: normal; }
.override-grid .cell-input.num { min-width: 64px; width: 72px; }
.help.block { display: block; font-weight: 400; font-family: var(--font-body); text-transform: none; }
.est-line { border-top: 1px solid var(--border); padding-top: var(--space-4); margin-top: var(--space-4); }

/* ------------------------------------------------------------------ phase 4: scenarios */
.scn-list { position: sticky; top: calc(var(--header-height) + var(--space-4)); }
/* The scenario workspace: a bar to pick the scenario, the editing space, and live results that open beside it. */
.scn-bar { margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4); }
.scn-bar-main { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-4); }
.scn-bar .field { margin: 0; }
.scn-pick { min-width: 260px; max-width: 420px; }
.scn-facts { align-self: center; }
.scn-bar-results { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); border-top: 1px solid var(--border); margin-top: var(--space-3); padding-top: var(--space-2); }
.scn-summary { flex: 1 1 300px; }
.scn-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.scn-body.results-open { grid-template-columns: minmax(0, 1fr) 380px; }
.scn-side > .card { position: sticky; top: calc(var(--header-height) + var(--space-4)); max-height: calc(100vh - var(--header-height) - var(--space-6)); overflow: auto; }
.scn-fold > summary, .scn-notes > summary { cursor: pointer; font-family: var(--font-heading); font-weight: 700; color: var(--oxford); }
.scn-fold:not([open]) { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.scn-params td.scn-applies { min-width: 200px; }
.scn-window { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); }
.scn-window input[type="date"] { width: auto; }
.scn-items { display: grid; gap: var(--space-1); }
.scn-item { display: grid; gap: 2px; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: var(--radius-control); padding: var(--space-2); cursor: pointer; color: var(--oxford); font: inherit; }
.scn-item:hover { background: var(--tint-sky); }
.scn-item[aria-current="true"] { border-color: var(--cerise); background: var(--cerise-soft); }
.scn-name { font-family: var(--font-heading); font-weight: 700; }
.scn-settings { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.scn-setting { display: grid; gap: 2px; min-width: 140px; }
tr.group-row th { background: var(--surface); text-transform: none; font-size: 13px; }
table.data.nested { margin-top: var(--space-2); }
.block { display: block; }
.compare-controls .checkbox { margin-bottom: var(--space-1); }
@media (max-width: 1099px) { .scn-body.results-open { grid-template-columns: minmax(0, 1fr); } .scn-side > .card { position: static; max-height: none; } }
@media (max-width: 767px) { .scn-list { position: static; } .scn-pick { min-width: 0; width: 100%; } }

/* ------------------------------------------------------------------ phase 5: imports, calibration */
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); padding: 0; margin: 0 0 var(--space-5); }
.wizard-steps li { display: flex; align-items: center; gap: var(--space-2); color: var(--text-muted, #5a6472); }
.wizard-steps li .n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); font-family: var(--font-heading); font-weight: 700; font-size: 14px; }
.wizard-steps li[aria-current="step"] { color: var(--oxford); font-weight: 700; }
.wizard-steps li[aria-current="step"] .n { border-color: var(--cerise); background: var(--cerise); color: var(--white); }
.wizard-steps li.done .n { border-color: var(--oxford); }
/* Data and imports, hybrid design (8 Nov 2026): the import steps in the page toolbar, the journey's cards, the
   months of a monthly load, and the standard lists folded into a card. */
.page-toolbar .progress-steps { margin: 0; gap: var(--hd-space-1) var(--hd-space-5); }
.page-toolbar .progress-step .link-button { font: inherit; color: inherit; }
.import-journey { display: flex; flex-direction: column; gap: var(--hd-space-5); max-width: 960px; }
.import-journey > h2 { margin: 0; }
.import-journey > .card, .import-journey > .inline-notification { margin: 0; }
.import-journey .summary-card { padding-block: var(--hd-space-1); }
.import-journey .summary-card .summary-list { margin: 0; }
.import-journey .summary-card .summary-list-row:last-child { border-bottom: 0; }
.card-heading { font-size: 1.02rem; margin: 0 0 var(--hd-space-3); }
.import-progress { display: flex; flex-direction: column; gap: var(--hd-space-3); }
.import-progress-head { display: flex; align-items: center; gap: var(--hd-space-3); }
.import-progress-head h2 { margin: 0; }
.import-progress .btn-group { margin: 0; }
.month-status-grid { list-style: none; margin: 0 calc(-1 * var(--hd-space-6)) calc(-1 * var(--hd-space-6)); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.month-status-grid li { display: flex; align-items: center; justify-content: space-between; gap: var(--hd-space-2); min-height: 36px; padding: 0 var(--hd-space-4); border-top: 1px solid var(--hd-border); font-size: .88rem; }
.library-card > summary { cursor: pointer; list-style-position: outside; }
.library-card > summary .inline-heading { display: inline; font-size: 1.1rem; margin: 0; }
.library-card[open] > summary { margin-bottom: var(--hd-space-3); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--oxford); text-decoration: underline; cursor: pointer; }
.select-compact { min-height: 36px; padding-top: 4px; padding-bottom: 4px; font-size: 14px; }
.preview-wrap thead tr:last-child th { background: var(--surface); text-transform: none; font-weight: 400; }
.preview-wrap td { white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.stat-error { color: var(--error); }
.cal-table td input.cell-input { width: 88px; }
.cal-table tr.rejected td { opacity: 0.55; }
.rc-rows { display: grid; gap: var(--space-2); }
.rc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1fr) 40px; gap: var(--space-2); align-items: center; padding-bottom: var(--space-2); border-bottom: 1px solid var(--border); }
.rc-row .input, .rc-row .select { width: 100%; min-height: 36px; padding: 4px 8px; font-size: 14px; }
@media (max-width: 599px) { .rc-row { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------------ phase 6: sensitivity */
.sens-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.sens-main > .card { margin-bottom: var(--space-5); }
.sens-param { margin-bottom: var(--space-4); }
.sens-outputs { max-height: 260px; }
.radio { display: flex; gap: var(--space-3); align-items: flex-start; margin-bottom: var(--space-2); }
.radio input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--cerise); }
.space-between { justify-content: space-between; }
table.heat-table td.heat { background: color-mix(in srgb, var(--deep-blue) calc(var(--heat, 0) * 55%), var(--white)); }
@media (max-width: 899px) { .sens-layout { grid-template-columns: minmax(0, 1fr); } }
table.heat-table td.heat.heat-dark { color: var(--white); }
.client-logo-preview { max-height: 64px; max-width: 240px; }
.client-logo-thumb { max-height: 32px; max-width: 120px; }
.row > .grow { flex: 1 1 260px; }

/* ------------------------------------------------------------------ phase 6: reports */
.report-items { display: grid; gap: var(--space-4); margin-bottom: var(--space-5); }
.report-item { position: relative; }
.report-item.dragging { opacity: 0.5; }
.report-item.drop-target { outline: 3px dashed var(--cerise); outline-offset: 2px; }
.report-item-tools { justify-content: flex-end; gap: var(--space-2); margin-bottom: var(--space-3); }
.report-item-tools .small { margin-right: auto; }
.drag-handle { cursor: grab; color: var(--oxford); letter-spacing: -2px; font-weight: 700; user-select: none; touch-action: none; }
.rich-editor .ql-toolbar.ql-snow, .rich-editor .ql-container.ql-snow { border-color: var(--control-border); }
.rich-editor .ql-toolbar.ql-snow { border-radius: 8px 8px 0 0; }
.rich-editor .ql-container.ql-snow { border-radius: 0 0 8px 8px; font: inherit; }
.rich-editor .ql-editor { min-height: 6em; }
.rich-text h2, .rich-editor .ql-editor h2 { font-size: 20px; margin: var(--space-3) 0 var(--space-2); }
.rich-text h3, .rich-editor .ql-editor h3 { font-size: 17px; margin: var(--space-3) 0 var(--space-2); }
.rich-text ul, .rich-text ol { padding-left: 1.5em; }
.report-heading-input { font-family: var(--font-heading); font-weight: 800; font-size: 22px; }
.report-editor { border-bottom: 1px solid var(--border); padding-bottom: var(--space-4); margin-bottom: var(--space-4); }
.report-preview .chart-host { margin-bottom: var(--space-4); }
.template-card form { margin-top: var(--space-4); border-top: 1px solid var(--border); padding-top: var(--space-4); }
.template-pack { margin-top: var(--space-6, 2rem); }
.template-pack > h2 { margin-bottom: var(--space-2); }
.template-pack > p { max-width: 72ch; }

/* ------------------------------------------------------------------ phase 6: diagram */
.diagram-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--white); max-height: 70vh; cursor: grab; }
svg.diagram { display: block; max-width: none; font-family: var(--font-body); touch-action: pinch-zoom; }
.diagram-wrap.is-panning { cursor: grabbing; user-select: none; }
.diagram-wrap:focus-visible { outline: 3px solid var(--sky-blue, #29ABE2); outline-offset: 2px; }
.diagram-tools { gap: var(--space-2); align-items: center; margin-bottom: var(--space-2); flex-wrap: wrap; }
.diagram-zoom-level { min-width: 3.5em; text-align: center; font-variant-numeric: tabular-nums; }
.diagram-view:fullscreen { background: var(--white); padding: var(--space-4); display: flex; flex-direction: column; }
.diagram-view:fullscreen .diagram-wrap { max-height: none; flex: 1; }
svg.diagram .dg-node { cursor: pointer; }
svg.diagram .dg-node:focus { outline: none; }
svg.diagram .dg-node:focus-visible rect, svg.diagram .dg-node:focus-visible circle { stroke: var(--sky-blue, #29ABE2); stroke-width: 4; }
.dg-stock { fill: var(--tint-sky, #E4F4FB); stroke: var(--deep-blue); stroke-width: 2; }
.dg-aux { fill: var(--white); stroke: var(--purple, #9E278B); stroke-width: 2; }
.dg-input { fill: var(--white); stroke: var(--orange, #F69323); stroke-width: 2; }
.dg-workforce { fill: var(--surface); stroke: var(--oxford); stroke-dasharray: 4 3; }
.dg-valve { fill: var(--white); stroke: var(--cerise); stroke-width: 2.5; }
.dg-pipe { fill: none; stroke: var(--cerise); stroke-width: 3; }
.dg-arrowhead { fill: var(--cerise); }
.dg-link { fill: none; stroke: var(--oxford); stroke-width: 1.2; stroke-dasharray: 4 3; opacity: 0.55; }
.dg-link-head { fill: var(--oxford); opacity: 0.55; }
.dg-cloud { fill: var(--white); stroke: var(--oxford); stroke-width: 1.5; }
.dg-label { fill: var(--oxford); font-size: 14px; font-weight: 700; }
.dg-label.small { font-size: 12px; font-weight: 500; }
.diagram-legend { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; margin-top: var(--space-3); }
.legend-entry { display: inline-flex; gap: var(--space-2); align-items: center; }
.legend-entry svg { overflow: visible; }
.report-item-title { font-size: 20px; }
.help-body > .card { margin-bottom: var(--space-5); scroll-margin-top: calc(var(--header-height) + var(--space-4)); }
.report-items > * { min-width: 0; }
.report-preview .chart-host, .report-preview .tornado-wrap { overflow-x: auto; }
@media (max-width: 639px) { .report-item { padding: var(--space-4); } }

/* ------------------------------------------------------------------ phase 7: AI assistant */
.ai-card { border-left: 3px solid var(--deep-blue); }
.ai-label { margin: var(--space-3) 0 var(--space-2); }
.ai-draft summary { cursor: pointer; font-weight: 600; }
.ai-items { border: 0; padding: 0; margin: var(--space-2) 0; }
.ai-item { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--space-1); align-items: start; padding: 6px 0; border-top: 1px solid var(--control-border); }
.ai-item input { margin-top: 4px; width: 18px; height: 18px; }
.ai-item .ai-reason { grid-column: 2; margin: 0; }
.ai-item.has-problem label { color: var(--muted); }
/* Phase 18b: what a draft does, before and after, and review. */
.ai-left-out { margin: var(--space-1) 0; }
.ai-left-out ul { margin: 4px 0 0; }
.ai-preview { margin: var(--space-2) 0; padding: var(--space-2); border: 1px solid var(--control-border); border-radius: 6px; }
.ai-preview h3 { margin: 0 0 4px; }
.ai-preview-table caption { text-align: left; }
.ai-preview-table td.changed, .ai-preview-years td.changed { font-weight: 600; }
.ai-preview-years { margin-top: var(--space-1); }
.ai-accept { margin-top: var(--space-2); }
.ai-review-entry { padding: var(--space-2) 0; border-top: 1px solid var(--control-border); }
.ai-review-entry:first-of-type { border-top: 0; }
.ai-review-entry h3 { margin: 0 0 4px; }
.ai-badge { margin-left: 6px; }
.ai-example { margin: 2px 0; text-transform: none; font-weight: 400; text-align: left; }
.ai-text p, .ai-text ul { max-width: 72ch; }
tr.ai-row td { background: var(--surface); }

/* Demand and capacity panels on the workforce tab */
.capacity-section { border-top: 1px solid var(--border); padding-top: var(--space-4); margin-top: var(--space-4); }
.capacity-section:first-of-type { border-top: 0; }
.capacity-section h3 { margin-top: 0; }
.cap-line { border-left: 3px solid var(--border); padding-left: var(--space-4); margin-bottom: var(--space-4); }

/* Cohort intake editor: month names stay readable in narrow columns */
.intake-editor .cell-select { min-width: 9.5rem; }
.intake-editor .table-wrap { overflow-x: auto; }

/* Workforce build plan: the model's focus and its steps */
.build-plan .plan-head { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: flex-start; }
.build-plan .plan-head > div { flex: 1 1 280px; }
.focus-switch { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.focus-switch legend { font-weight: 600; font-size: 14px; margin-bottom: var(--space-2); }
.focus-option { position: relative; }
.focus-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.focus-option label { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-4); border: 1px solid var(--control-border); border-radius: var(--radius-control); cursor: pointer; background: var(--white); min-width: 200px; }
.focus-option.selected label { border: 2px solid var(--cerise); background: var(--cerise-soft); padding: calc(var(--space-2) - 1px) calc(var(--space-4) - 1px); }
.focus-option input:focus-visible + label { outline: var(--focus); outline-offset: 2px; }
.focus-option input:disabled + label { cursor: default; }
.focus-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); }
.focus-option-large label { padding: var(--space-4); min-height: 100%; gap: var(--space-2); }
.focus-option-large.selected label { padding: calc(var(--space-4) - 1px); }
.focus-option-large strong { font-size: 18px; }
.plan-steps { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-2); }
.plan-link { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px var(--space-2); width: 100%; height: 100%; text-align: left; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.plan-link:hover { border-color: var(--control-border); background: var(--white); }
.plan-link:focus-visible { outline: var(--focus); outline-offset: 2px; }
.plan-link .badge { grid-column: 2; justify-self: start; }
.plan-num { grid-row: span 2; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--white); border: 1px solid var(--control-border); font-weight: 700; font-size: 14px; }
.plan-done .plan-num { background: var(--success-tint); border-color: var(--success); color: var(--success); }
.plan-error .plan-num { background: var(--error-tint); border-color: var(--error); color: var(--error); }
.plan-next .plan-link { border: 2px solid var(--cerise); background: var(--white); }
.plan-body { display: flex; flex-direction: column; min-width: 0; }
.plan-title { font-weight: 600; }
.plan-summary { color: var(--oxford-soft); overflow-wrap: anywhere; }
.plan-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-top: var(--space-4); }
.plan-foot p { margin: 0; }
.card-quiet { background: var(--surface); box-shadow: none; }
.card-quiet > h2 { color: var(--oxford); }

/* Results: quick views */
.result-views { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.result-views p { margin: 0; width: 100%; }
.member-values-list { display: grid; gap: var(--space-1); }
.member-values-item summary { cursor: pointer; padding: var(--space-1) 0; }
.member-values-item[open] { padding-bottom: var(--space-2); }
.label-like { font-weight: 600; margin: 0 0 var(--space-2); }
.locked-value { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; margin: 0; padding: var(--space-2) 0; }
.total-row th, .total-row td { font-weight: 700; border-top: 2px solid var(--border); }
.narrative-lead { font-size: 17px; font-weight: 600; }
.narrative-table td ul { margin: 0; }
.narrative-table td li { display: flex; gap: var(--space-2); align-items: flex-start; margin-bottom: 4px; }
.narrative-table .icon { flex: none; margin-top: 2px; }
.rota-grid .cell-input { min-width: 2.6rem; padding-left: 4px; padding-right: 4px; }
.rota-grid th, .rota-grid td { padding: 2px; }
.rota-editor { margin-top: var(--space-4); }
.maxw-120 { max-width: 120px; }
.heatmap td { background: color-mix(in srgb, var(--cerise) calc(var(--heat, 0) * 55%), var(--white)); }
.heatmap td, .heatmap th { padding: 3px 8px; }
.profile-stats { margin-bottom: var(--space-4); }
dialog.modal.rota-dialog { width: min(1400px, 96vw); max-width: 96vw; }

/* ------------------------------------------------------------------ terminology */
.terms-table { table-layout: fixed; width: 100%; }
.terms-table th[scope="col"]:first-child { width: 50%; }
.terms-table th[scope="row"] { font-weight: 400; text-transform: none; white-space: normal; overflow-wrap: anywhere; }
.terms-table .input { width: 100%; }
.terms-table .term-default { font-weight: 600; }
.terms-table th[scope="row"] p { margin: var(--space-1, 4px) 0 0; }

/* ------------------------------------------------------------------ comments */
.comment-head { align-items: center; gap: var(--space-3, 12px); }
.comment-head h2 { margin: 0; }
.comment-head .field-inline { margin-left: auto; display: flex; align-items: center; gap: var(--space-2, 8px); }
.comment-head .comment-count:empty { display: none; }
.comment-composer { margin: var(--space-3, 12px) 0; }
.comment-composer textarea { width: 100%; }
.comment-thread { border-top: 1px solid var(--border); padding: var(--space-3, 12px) 0; }
.comment-thread.is-resolved .comment-body { color: var(--muted); }
.comment-replies { margin-left: var(--space-5, 24px); border-left: 3px solid var(--border); padding-left: var(--space-3, 12px); }
.comment { margin: 0 0 var(--space-2, 8px); }
.comment-meta { margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2, 8px); align-items: center; }
.comment-body { white-space: pre-wrap; margin: var(--space-1, 4px) 0; overflow-wrap: anywhere; }
.comment-actions { gap: var(--space-1, 4px); }

/* ------------------------------------------------------------------ user guide */
.guide-steps { padding-left: 1.4em; }
.guide-steps li { margin-bottom: var(--space-2, 8px); }
.guide-tips { background: var(--surface-muted, #f6f7fb); border-radius: var(--radius, 8px); padding: var(--space-3, 12px) var(--space-4, 16px); }
.guide-tips ul { margin: 0; padding-left: 1.2em; }
/* The darker cerise keeps links above 4.5:1 on the muted surface. */
.guide-tips a { color: var(--cerise-dark, #C40976); }

/* Workforce plan: five steps from the workforce today to the options */
.plan-journey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.plan-journey > li { min-width: 0; }
.plan-stage-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.plan-stage-head h2 { margin: 0; }
.plan-stage-next { border: 2px solid var(--cerise); }
.plan-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-3); margin: 0 0 var(--space-4); }
.plan-facts div { background: var(--surface); border-radius: var(--radius-control); padding: var(--space-2) var(--space-3); }
.plan-facts dt { font-size: 13px; color: var(--oxford-soft); }
.plan-facts dd { margin: 0; font-family: var(--font-heading); font-weight: 700; font-size: 20px; }
.plan-bars { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: grid; gap: var(--space-1); max-width: 560px; }
.plan-bars li { display: grid; grid-template-columns: 110px 1fr 60px; align-items: center; gap: var(--space-2); }
.plan-bar { width: 100%; height: 14px; }
.plan-bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.plan-needed td.gap-short { color: var(--error); font-weight: 600; }
.grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 767px) { .grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Population page: area search and age group presets */
.pop-hits { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0; }
.pop-presets { margin-bottom: var(--space-2); }
/* Scenario policies */
.policy-list { display: grid; gap: var(--space-2); margin: var(--space-3) 0; }
.policy { border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--space-2) var(--space-3); }
.policy[open] { padding-bottom: var(--space-3); }
.policy > summary { cursor: pointer; font-weight: 600; }
.policy-checks .row { flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.policy-add { align-items: flex-end; }
.policy-add .field { margin: 0; }

/* Model editor: collaboration sections (versions, details and sharing, comments) that open and close. */
.collab-section > summary { cursor: pointer; list-style-position: outside; }
.collab-section > summary h2 { display: inline; margin: 0; }
.collab-section[open] > summary { margin-bottom: var(--space-3, 12px); }
.collab-section + .collab-section { margin-top: var(--space-3, 12px); }
/* Where to start in an empty model. */
.signposts { display: grid; gap: 10px; padding-left: 1.2em; max-width: 70ch; margin: 12px 0 0; }
.signposts .btn { margin-left: 6px; }
/* Favourite stars on models and reports. */
.favourite { background: none; border: 0; padding: 2px 4px; font-size: 1.25rem; line-height: 1; color: var(--muted, #6b6b80); cursor: pointer; border-radius: 6px; }
.favourite[aria-pressed="true"] { color: var(--cerise); }
.favourite:hover { background: var(--surface, #f4f4f8); }
.favourite:focus-visible { outline: 3px solid var(--deep-blue); outline-offset: 1px; }
.card-with-star { position: relative; }
.card-with-star > .card { display: block; height: 100%; padding-right: 48px; }
.card-with-star > .favourite { position: absolute; top: 14px; right: 12px; }
.scn-item-row { display: flex; align-items: stretch; gap: 4px; }
.scn-item-row > .scn-item { flex: 1; min-width: 0; }
.saved-runs { margin-top: var(--space-5, 20px); }
.saved-runs > summary { cursor: pointer; }
.saved-runs > summary h2 { display: inline; }

/* Job logs on the jobs page */
.job-log summary { cursor: pointer; }
.job-log-lines { list-style: none; margin: var(--space-2) 0 0; padding: 0; max-height: 12rem; overflow-y: auto; }
.job-log-lines li { margin: 0; }
/* Workforce plan: supply options (recruitment by staff group and date, pipelines). */
.plan-details { margin: 10px 0; }
.plan-details > summary { cursor: pointer; font-weight: 600; }
.plan-details[open] > summary { margin-bottom: 8px; }
.plan-details .plan-details { margin-left: 4px; }
.plan-supply .table select, .plan-supply .table .input { min-width: 0; }
.plan-pipeline-form fieldset .row { flex-wrap: wrap; gap: 6px 14px; }
.plan-pipeline-form fieldset .row .select { width: auto; min-width: 200px; max-width: 320px; }
.plan-dialog { width: min(760px, 96vw); max-height: 90vh; overflow: auto; }
.plan-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.plan-dialog-head h2 { margin: 0; }
.plan-dialog-remove { margin-top: 12px; border-top: 1px solid var(--border, #e2e2ea); padding-top: 12px; }
.plan-pipelines h3 { margin: 16px 0 4px; font-size: 1rem; }
.plan-service-filter { align-items: flex-end; gap: 8px; margin: 0 0 12px; }
.plan-service-filter .field { margin: 0; }
.fill-cell { display: flex; flex-wrap: wrap; gap: 4px; }
.fill-cell .select { max-width: 200px; }
.fill-as > .field, .fill-as > .grid { margin-left: 28px; }
.alert-info a, .alert-info .btn-link, .alert-warning a, .alert-error a, .alert-success a { color: inherit; text-decoration: underline; font-weight: 600; }

/* Click to edit: a cue only where a value can be changed. */
.ie { display: inline-block; max-width: 100%; vertical-align: middle; }
.ie-view { display: inline-flex; align-items: center; gap: var(--space-2); background: none; border: 1px dashed transparent; border-radius: var(--radius-chip); padding: 2px var(--space-1); margin: -3px 0; font: inherit; color: inherit; text-align: left; cursor: text; max-width: 100%; }
.ie-view .ie-text { overflow-wrap: break-word; }
.ie-view .ie-cue { width: 16px; height: 16px; flex: none; opacity: 0; color: var(--muted); transition: opacity var(--motion); }
.ie-view:hover, .ie-view:focus-visible { border-color: var(--control-border); background: var(--white); }
.ie-view:hover .ie-cue, .ie-view:focus-visible .ie-cue { opacity: 1; }
.ie-view:focus-visible { outline: var(--focus); outline-offset: 2px; }
.ie-control { min-height: 34px; padding: 2px var(--space-2); font-size: 14px; width: auto; min-width: 140px; max-width: 100%; }
.ie-control.ie-number { width: 110px; min-width: 0; }
.ie-control[aria-busy="true"] { opacity: .6; }
textarea.ie-control { min-width: 280px; }
.ie-error { font-size: 13px; margin: var(--space-1) 0 0; }
.ie-static { overflow-wrap: break-word; }
.ie-shares { display: grid; gap: var(--space-2); padding: var(--space-2); border: 1px solid var(--control-border); border-radius: var(--radius-chip); background: var(--white); max-width: 100%; }
.ie-shares-rows { display: grid; gap: var(--space-1); }
.ie-shares-row { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; }
.ie-shares-row .ie-control:first-child { flex: 1 1 180px; }
.ie-shares-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.ie-shares-total { margin-right: auto; font-size: 13px; }

/* Posts screens. */
/* Lists of cases (prototype revision): the forecasts and scenarios lists' filter bar, groups and actions. */
.case-list-bar { margin-bottom: var(--space-3); }
.case-list-bar .field { flex: 0 1 200px; min-width: 150px; }
.case-list-bar .field:first-child { flex: 1 1 240px; }
/* In the page toolbar (hybrid app design, 8 Nov 2026): pills sized to their content. */
.page-toolbar .case-list-bar .field { flex: 0 1 auto; min-width: 0; }
.page-toolbar .case-list-bar .field:first-child .input { width: 14rem; max-width: 40vw; }
.case-list-actions { margin: 0 0 var(--space-4); justify-content: flex-start; }
.case-group + .case-group { margin-top: var(--space-5); }
.case-group-head { font-size: 16px; margin: 0 0 var(--space-2); }
.case-table td .badge { white-space: nowrap; }
.posts-totals { font-size: 14px; color: var(--muted); margin: 0 0 var(--space-3); }
.state-badge { white-space: nowrap; }
.state-proposed { background: var(--tint-blue); color: var(--deep-blue); }
.state-established { background: var(--success-tint); color: var(--success); }
.state-frozen { background: var(--warning-tint); color: var(--warning); }
.state-closed { background: var(--surface); color: var(--muted); }
.unit-cell { display: flex; align-items: center; gap: var(--space-2); }
.unit-toggle { background: none; border: 0; padding: 2px; cursor: pointer; color: var(--oxford); border-radius: var(--radius-chip); }
.unit-toggle .icon { width: 16px; height: 16px; transition: transform var(--motion); }
.unit-toggle[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.unit-toggle:focus-visible { outline: var(--focus); }
.unit-spacer { display: inline-block; width: 20px; flex: none; }
.level-tag { font-size: 12px; color: var(--muted); white-space: nowrap; }
.row-actions { display: flex; gap: var(--space-1); justify-content: flex-end; white-space: nowrap; }
.post-card-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.post-card-grid > * { min-width: 0; }
.post-card-grid dl.facts { font-size: 14px; row-gap: var(--space-3); }
.post-state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.post-warnings { margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.post-warnings li { display: flex; gap: var(--space-2); align-items: flex-start; background: var(--warning-tint); color: var(--warning); padding: var(--space-2) var(--space-3); border-radius: var(--radius-chip); margin-bottom: var(--space-2); font-size: 14px; }
.history { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.history li { display: grid; grid-template-columns: 76px 1fr auto; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); align-items: start; }
.history li:last-child { border-bottom: 0; }
.history .when { font-weight: 700; font-family: var(--font-heading); }
.inline-panel { background: var(--surface); border-radius: var(--radius-card); padding: var(--space-4); margin-top: var(--space-3); }
.inline-panel .field { margin-bottom: var(--space-3); }
.inline-panel .grid { gap: var(--space-3); }
@media (max-width: 900px) {
  .post-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .post-card-grid dl.facts { grid-template-columns: 1fr; row-gap: var(--space-1); }
  .post-card-grid dl.facts dd { margin-bottom: var(--space-2); }
  .history li { grid-template-columns: 1fr auto; }
  .history .when { grid-column: 1 / -1; }
}
.post-card-grid .card h3 { margin-top: var(--space-5); }
.post-card-grid .card h2 + h3, .post-card-grid .card .field + div > h3 { margin-top: var(--space-4); }
.card-quiet a:not(.btn) { color: var(--cerise-dark); }

/* Toast with an action (undo). */
.toast .toast-action { color: var(--deep-blue); text-decoration: underline; font-weight: 700; padding: 0 2px; }

/* Zoomable picture. */
.zv-view { position: relative; }
.zv-tools { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; margin-bottom: var(--space-2); }
.zv-tools [data-tip]:hover::after, .zv-tools [data-tip]:focus-visible::after { top: auto; bottom: calc(100% + 8px); }
/* Hybrid app design (8 Nov 2026): on the structure page the picture fills the space on a dotted canvas, with zoom
   floating bottom right, the key bottom left and the overview map top right. */
.zv-view.is-canvas .zv-wrap { height: calc(100vh - var(--wfp-topbar-height) - var(--wfp-toolbar-height) - var(--wfp-scrub-height) - 150px); min-height: 420px; background-color: var(--hd-bg); background-image: radial-gradient(#d3d6e2 1px, transparent 1px); background-size: 20px 20px; }
.zv-view.is-canvas .zv-tools { position: absolute; right: 16px; bottom: 16px; z-index: 5; margin: 0; gap: 2px; padding: 4px; background: var(--hd-surface); border: 1px solid var(--hd-border); border-radius: var(--hd-radius); box-shadow: 0 12px 32px rgba(16, 17, 49, .10); }
.zv-view.is-canvas .zv-map { top: 12px; bottom: auto; }
.canvas-key { left: 16px; bottom: 16px; max-width: min(420px, calc(100% - 32px)); }
.canvas-key > summary { display: flex; align-items: center; gap: var(--hd-space-2); min-height: var(--wfp-control); padding: 0 14px; cursor: pointer; list-style: none; font-family: var(--font-heading); font-weight: 700; font-size: .85rem; }
.canvas-key > summary::-webkit-details-marker { display: none; }
.canvas-key[open] { padding-bottom: var(--hd-space-3); }
.canvas-key .pic-legend { padding: 0 14px; max-height: 40vh; overflow-y: auto; }
.canvas-key .pic-legend ul { margin-top: 0; flex-direction: column; gap: var(--space-2); }
/* The month as a thin slider under the page toolbar. */
.page-scrub .month-bar { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; margin: 0; padding: 2px 0; background: none; border-radius: 0; gap: 10px; font-size: .76rem; }
.page-scrub .month-bar input[type="range"] { min-width: 80px; }
.page-scrub .month-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.page-scrub .month-bar > * { flex-shrink: 0; }
.page-scrub .month-bar > input[type="range"], .page-scrub .month-bar > .month-note { flex-shrink: 1; }
.page-scrub .month-bar > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-scrub .month-bar input[type="range"] { height: 16px; margin: 0; }
.page-scrub .month-bar .month-label { font-family: var(--font-heading); font-weight: 800; font-size: .85rem; color: var(--hd-text); }
.page-scrub .month-bar .btn-small { min-height: 28px; padding: 0 10px; font-size: .78rem; border-width: 1px; }
.page-scrub .month-bar .btn-link { font-size: .78rem; }
@media (max-width: 639px) { .page-scrub .month-note, .page-scrub .month-bar > .muted { display: none; } }
.zv-level { min-width: 3.5em; text-align: center; font-variant-numeric: tabular-nums; }
.zv-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--white); height: 68vh; min-height: 360px; cursor: grab; }
.zv-wrap.is-panning { cursor: grabbing; user-select: none; }
.zv-wrap:focus-visible { outline: var(--focus); outline-offset: 2px; }
.zv-sizer { position: relative; }
.zv-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; width: max-content; padding: var(--space-5); }
.zv-view:fullscreen { background: var(--white); padding: var(--space-4); display: flex; flex-direction: column; }
.zv-view:fullscreen .zv-wrap { height: auto; flex: 1; }

/* Structure screen toolbar. */
.structure-toolbar .posts-bar { margin-bottom: var(--space-3); }
.month-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); background: var(--surface); border-radius: var(--radius-card); }
.month-bar input[type="range"] { flex: 1 1 240px; accent-color: var(--cerise); min-width: 160px; }
.month-label { font-family: var(--font-heading); font-weight: 800; min-width: 6.5em; }
.month-note { flex-basis: 100%; color: var(--muted); }

/* The org chart: nested lists joined by lines. */
.org ul { display: flex; justify-content: center; margin: 0; padding: 22px 0 0; position: relative; list-style: none; }
.org > ul { padding-top: 0; }
.org li { position: relative; padding: 22px 8px 0; display: flex; flex-direction: column; align-items: center; }
.org li::before, .org li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid var(--control-border); }
.org li::after { right: auto; left: 50%; border-left: 2px solid var(--control-border); }
.org li:only-child::before, .org li:only-child::after { display: none; }
.org li:only-child { padding-top: 0; }
.org > ul > li:only-child { padding-top: 0; }
.org li:first-child::before, .org li:last-child::after { border: 0; }
.org li:last-child::before { border-right: 2px solid var(--control-border); border-radius: 0 6px 0 0; }
.org li:first-child::after { border-radius: 6px 0 0 0; }
.org ul ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--control-border); }
.org > ul > li::before, .org > ul > li::after { display: none; }
.org > ul > li { padding-top: 0; }

.unit-box { background: var(--white); border: 1px solid var(--control-border); border-top: 4px solid var(--deep-blue); border-radius: 10px; padding: var(--space-2) var(--space-3) var(--space-3); width: 248px; text-align: left; box-shadow: var(--shadow-sm); }
.unit-box.is-over, .line-card.is-over, .line-top.is-over { outline: 3px dashed var(--cerise); outline-offset: 3px; background: var(--cerise-soft); }
.unit-box-head { display: flex; align-items: center; gap: var(--space-2); }
.unit-name { background: none; border: 0; padding: 0; font: inherit; font-family: var(--font-heading); font-weight: 800; font-size: 15px; color: var(--oxford); text-align: left; cursor: pointer; flex: 1; overflow-wrap: anywhere; }
.unit-name:hover { color: var(--cerise-dark); text-decoration: underline; }
.unit-name:focus-visible, .post-sq:focus-visible, .line-open:focus-visible, .unit-more:focus-visible { outline: var(--focus); outline-offset: 2px; }
.unit-totals { font-size: 12px; color: var(--muted); margin: var(--space-1) 0 var(--space-2); line-height: 1.4; }
.post-squares { display: flex; flex-wrap: wrap; gap: 8px; } /* 18px squares 26px apart: the WCAG 2.2 target spacing */
.post-sq { width: 18px; height: 18px; border-radius: 3px; border: 2px solid var(--c); background: var(--c); padding: 0; cursor: pointer; flex: none; }
.post-sq.is-part { background: linear-gradient(135deg, var(--c) 50%, var(--white) 50%); }
.post-sq.is-closed { background: var(--white); border-style: dashed; }
.post-sq[draggable="true"] { cursor: grab; }
.post-sq.is-key { display: inline-block; vertical-align: -3px; margin-right: 6px; cursor: default; }
.unit-more { display: inline-flex; align-items: center; gap: 4px; margin-top: var(--space-2); background: none; border: 0; padding: 2px 0; font: inherit; font-size: 12px; color: var(--deep-blue); cursor: pointer; }
.unit-more .icon { width: 14px; height: 14px; transition: transform var(--motion); }
.unit-more[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.is-dragging .unit-box, .is-dragging .line-card { transition: background var(--motion); }

.line-card { position: relative; background: var(--white); border: 1px solid var(--control-border); border-left: 6px solid var(--c); border-radius: 8px; padding: var(--space-2) var(--space-3); width: 210px; text-align: left; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); }
.line-card[draggable="true"] { cursor: grab; }
.line-card.is-closed { border-left-style: dashed; opacity: .75; }
.line-open { background: none; border: 0; padding: 0; text-align: left; font: inherit; cursor: pointer; color: var(--oxford); }
.line-ref { display: block; font-family: var(--font-heading); font-weight: 800; font-size: 13px; }
.line-title { display: block; font-size: 14px; }
.line-meta, .line-unit { font-size: 12px; color: var(--muted); }
.line-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: 12px; }
.line-actions .btn-link { font-size: 12px; margin: 0; }
.line-top { border: 2px dashed var(--border); border-radius: 10px; padding: var(--space-2) var(--space-4); margin: 0 auto var(--space-4); width: max-content; font-size: 13px; color: var(--muted); }
.pic-empty { padding: var(--space-6); }

.pic-legend ul { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); list-style: none; padding: 0; margin: var(--space-3) 0 0; font-size: 14px; }
.structure-list { font-size: 15px; line-height: 1.6; }
.structure-list ul { margin: var(--space-1) 0 var(--space-2); }

/* The side panel for a post. */
.pic-panel { position: fixed; top: 84px; right: var(--space-4); bottom: var(--space-4); width: min(400px, calc(100vw - 32px)); overflow: auto; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-md); padding: var(--space-4) var(--space-5); z-index: 50; }
.pic-panel-head { display: flex; align-items: flex-start; gap: var(--space-3); }
.pic-panel-head h2 { flex: 1; font-size: 19px; margin: 0; }
.pic-panel-head h2:focus { outline: none; }
.pic-panel dl.facts { font-size: 14px; row-gap: var(--space-3); grid-template-columns: 1fr; }
.pic-panel dl.facts dt { margin-top: var(--space-1); }
@media print {
  .structure-toolbar, .pic-panel, .zv-tools { display: none !important; }
}
.month-bar .btn-link, .structure-toolbar .btn-link { color: var(--cerise-dark); margin: 0; }
.org ul.leaf-stack { flex-direction: column; align-items: center; gap: 6px; }
.org ul.leaf-stack > li { padding: 0; }
.org ul.leaf-stack > li::before, .org ul.leaf-stack > li::after { display: none; }
.org ul.leaf-stack > li:first-child { margin-top: 0; }

/* Profiles and competencies. */
.profiles-grid { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 2.4fr); gap: var(--space-5); align-items: start; }
.profiles-grid > * { min-width: 0; }
.profile-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; max-height: 60vh; overflow: auto; }
.profile-pick { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-left: 3px solid transparent; padding: var(--space-2) var(--space-3); font: inherit; cursor: pointer; color: var(--oxford); border-radius: 0 var(--radius-chip) var(--radius-chip) 0; }
.profile-pick:hover { background: var(--tint-sky); }
.profile-pick[aria-current="true"] { border-left-color: var(--cerise); background: var(--cerise-soft); }
.profile-pick:focus-visible { outline: var(--focus); outline-offset: 2px; }
.compact-list { margin: 0 0 var(--space-3); padding-left: var(--space-5); font-size: 14px; line-height: 1.6; }
.compact-list .btn-link { margin: 0 0 0 var(--space-2); font-size: 13px; color: var(--cerise-dark); }
table.data tr.is-removed td { color: var(--muted); }
.req-add .grid { align-items: end; }
.away-row td { background: var(--surface); font-size: 13px; padding-top: var(--space-1); padding-bottom: var(--space-1); height: auto; }
.away-row .compact-list { margin: 0; }
.matrix-wrap { max-height: 70vh; }
table.matrix th.matrix-head { vertical-align: bottom; height: 160px; white-space: nowrap; padding: var(--space-2) 4px; }
table.matrix th.matrix-head span { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; text-transform: none; font-weight: 600; }
table.matrix td.matrix-cell { text-align: center; padding: 4px; height: 34px; }
.matrix-mark { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--deep-blue); color: var(--deep-blue); font-weight: 700; font-size: 12px; }
.matrix-mark.is-essential { background: var(--deep-blue); color: var(--white); }
.cmp-score { font-size: 17px; }
@media (max-width: 900px) {
  .profiles-grid { grid-template-columns: 1fr; }
}
.profile-detail h3, #h-reqs ~ h3 { margin-top: var(--space-5); }

/* Forecast */
.forecast-summary { margin-top: 0; }
.forecast-stats { margin-bottom: var(--space-3); }
.forecast-stat .stat { margin: var(--space-1) 0; }
.forecast-flows { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-bottom: var(--space-5); }
.forecast-body section { margin-bottom: var(--space-5); }
.forecast-body table.data caption { text-align: left; padding: var(--space-2) var(--space-3); }
table.data td.forecast-gap { color: var(--warning); font-weight: 700; }
/* Combining scenarios (D123): a setting with no recommendation is amber, and says so in words. */
table.data.combine-table tr.combine-open > * { background: var(--warning-tint); color: var(--warning); }
table.data.combine-table tr.combine-open > th:first-child { box-shadow: inset 4px 0 0 var(--amber); }
table.data tr.forecast-total th, table.data tr.forecast-total td { font-weight: 700; background: var(--surface); }
.forecast-depth-1 { padding-left: calc(var(--space-3) + 16px) !important; font-weight: 400; }
.forecast-depth-2 { padding-left: calc(var(--space-3) + 32px) !important; font-weight: 400; }
.forecast-depth-3, .forecast-depth-4, .forecast-depth-5 { padding-left: calc(var(--space-3) + 48px) !important; font-weight: 400; }
.forecast-unit-pick { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.forecast-unit-pick .select { width: auto; max-width: 320px; min-width: 0; flex: 0 1 auto; }
.forecast-unit-pick { flex-wrap: wrap; max-width: 100%; }
.forecast-assumptions th .small { font-weight: 400; }
.forecast-assumptions .cell-input { max-width: 120px; }
.forecast-pathway legend { padding: 0 var(--space-2); }
.forecast-pathway .cell-select { max-width: 320px; }
.forecast-body .results-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); margin-bottom: var(--space-4); }
.forecast-month .select { width: auto; flex: 0 0 auto; }
.forecast-head { align-items: flex-start; gap: var(--space-4); }
.skill-check { margin-top: var(--space-1); }
.fieldset-plain legend { font-family: var(--font-heading); font-weight: 700; margin-bottom: var(--space-1); }
select.select[multiple] { height: auto; padding: var(--space-1); }
.unit-tree-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.unit-tree-field legend { font-family: var(--font-heading); font-weight: 700; font-size: 14px; padding: 0; margin-bottom: var(--space-2); }
.run-progress { max-width: 40rem; }
.calc-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin: 0 0 var(--space-2); }
.calc-line-chip { display: inline-flex; margin: 0; }
.calc-chip { position: relative; }
.calc-chip > summary { cursor: pointer; list-style: none; }
.calc-chip > summary::-webkit-details-marker { display: none; }
.calc-chip-panel { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; min-width: 18rem; max-width: min(32rem, 90vw); padding: var(--space-2) var(--space-3); background: var(--hd-surface); border: 1px solid var(--hd-border); border-radius: var(--hd-radius); box-shadow: var(--hd-shadow-md); }
.calc-chip-panel .tag { white-space: normal; max-width: 100%; }
.views-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin: 0 0 var(--space-2); }
.views-bar .select, .views-bar .input { width: auto; max-width: 16rem; }
.run-progress-row { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(8rem, 2fr) auto; gap: var(--space-2); align-items: center; margin-top: var(--space-1); }
.run-progress progress { width: 100%; }
.unit-tree { max-height: 16rem; overflow: auto; border: 1px solid var(--control-border); border-radius: var(--radius-control); padding: var(--space-1); background: var(--white); }
.unit-tree:focus { outline: 3px solid var(--sky); }
.unit-tree[aria-invalid="true"] { border-color: var(--error); }
.unit-tree-list { list-style: none; margin: 0; padding: 0; }
.unit-tree-list .unit-tree-list { padding-left: 1.25rem; }
.unit-tree-row { display: flex; align-items: center; gap: 0.35rem; min-height: 1.9rem; }
.field .unit-tree-row label { display: inline; font-family: var(--font-body); font-weight: 400; font-size: 15px; margin: 0; cursor: pointer; }
.unit-tree-toggle, .unit-tree-spacer { width: 1.5rem; height: 1.5rem; flex: none; }
.unit-tree-toggle { border: 0; background: none; padding: 0; cursor: pointer; font-size: 1rem; line-height: 1; color: inherit; border-radius: 4px; }
.unit-tree-toggle:hover { background: var(--surface); }
.unit-tree-all { margin: 0 0 var(--space-1); }
.tick-list-summary { margin: 0 0 var(--space-1); }
.tick-list-box { max-height: 12rem; }
.calibration-out { margin-top: var(--space-3); }
.calibration-out td.num { white-space: nowrap; }
.calibration-flag { color: var(--warning); font-weight: 700; }
.rule-add { margin-top: var(--space-3); }
.rule-add > summary { cursor: pointer; font-weight: 700; color: var(--cerise-dark); margin-bottom: var(--space-2); }
.calibration-out table.data { font-size: var(--text-dense); }
.calibration-out table.data th, .calibration-out table.data td { padding-left: var(--space-2); padding-right: var(--space-2); }
.need-shift { border-top: 1px solid var(--border); padding-top: var(--space-3); margin-top: var(--space-3); }
.need-shift-remove { align-self: end; }
.close-gap h3 { margin-top: 0; }

/* Phase 7: data quality on the posts table. */
.quality-card { margin: var(--space-3) 0; }
.quality-card > summary { cursor: pointer; }
.quality-card > summary:focus-visible { outline: var(--focus); outline-offset: 2px; }
.quality-card ul { margin-top: var(--space-3); }

/* The posts screen: by unit as a tree, or as a list a page at a time. */
.posts-view-bar { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-3) 0; }
.posts-tree .tree-name { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; }
.posts-tree .tree-row.is-closed .tree-name { font-weight: 400; color: var(--muted, #5b6170); }
.tree-toggle { width: 28px; height: 28px; flex: none; border: 1px solid var(--control-border); border-radius: 4px; background: var(--white); color: var(--oxford); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.tree-toggle:hover { border-color: var(--oxford); }
.tree-toggle-space { width: 28px; flex: none; }
.tree-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.tree-tools .select, .pager .select, .posts-view-bar .seg { width: auto; }
.tree-posts-row > td { background: var(--surface, #f7f7fa); }
.tree-posts .table-wrap { margin: var(--space-2) 0; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; }
.pager-size { display: inline-flex; align-items: center; gap: var(--space-2); }
.tree-posts .btn-link { color: var(--cerise-dark); }
.seasonal-table .month-input { width: 4.5rem; min-width: 4.5rem; }
.seasonal-table select { min-width: 9rem; }
.seasonal-table td, .seasonal-table th { padding-inline: 0.35rem; white-space: nowrap; }
.calibration-season-strong { font-weight: 700; }

/* A block that takes a whole row of a grid. */
.grid > .span-all { grid-column: 1 / -1; }

/* Staff on duty by hour of the week: darker is more. */
.duty-table th, .duty-table td { padding: 0.25rem 0.3rem; font-size: 0.8rem; }
.duty-cell { background: rgb(232 0 112 / calc(var(--v, 0) * 0.45)); min-width: 2rem; }
.rota-week td { border-top: 1px dashed rgb(0 0 0 / 0.12); }
.need-duty .select { width: auto; min-width: 9rem; }
.need-shift-staff .day-input { width: 4rem; min-width: 4rem; }

/* Why it changes (phase 18c) and provenance of assistant changes (phase 18f). */
.explain-card > summary { cursor: pointer; display: flex; gap: var(--space-2); align-items: baseline; flex-wrap: wrap; }
.explain-card th.indent { padding-left: var(--space-5); font-weight: 400; }
.explain-card tr.total th, .explain-card tr.total td { border-top: 2px solid var(--control-border); }
.explain-card .explain-words { margin-top: var(--space-4); }
.provenance-list { margin: 0 0 var(--space-3); }
.provenance-list > summary { cursor: pointer; }
.provenance-list ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); }
.provenance-list li { margin-bottom: var(--space-1); }

/* Quick questions (phase 19f) */
details.card > summary { cursor: pointer; list-style-position: outside; }
.calc-question { display: inline; font-size: 18px; margin: 0; text-transform: none; }
.calc-answer:not(:empty) { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.calc-figures { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: var(--space-4) 0; }
.calc-figures dt { color: var(--muted); }
.calc-figures dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* The guided assistant (phase 18e) */
.guide-goal { text-transform: none; margin: var(--space-4) 0; }
.guide-plan { margin: 0; padding-left: 1.4em; }
.guide-plan > li + li { margin-top: var(--space-3); }
.guide-step-title { font-weight: 700; }
.guide-step.is-current .guide-step-title { color: var(--cerise-dark); }
.guide-step.is-skipped .guide-step-title { text-decoration: line-through; color: var(--muted); }
.guide-messages { display: grid; gap: var(--space-3); margin-bottom: var(--space-4); }
.guide-msg { padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: 8px; }
.guide-msg.is-person { background: var(--cerise-soft); }
.guide-banner { margin-bottom: var(--space-4); }
.guide-skip { margin-top: var(--space-4); }
/* On the narrowest phones the header keeps to the screen: the demo badge beside the organisation menu goes (the menu is unchanged). */
@media (max-width: 420px) {
  .menu > summary .badge { display: none; }
}
/* Example requests wrap on narrow screens rather than run off them. */
.btn.ai-example { white-space: normal; height: auto; min-height: 32px; text-align: left; max-width: 100%; }

/* Add to model (phase 18d): a draft's new and changed parts on the diagram, the draft's items and preview. */
svg.diagram .dg-highlight rect, svg.diagram .dg-highlight circle { stroke: var(--sky-blue, #29ABE2); stroke-width: 5; }
.dg-key-highlight { display: inline-block; width: 1.4em; height: 0.9em; border: 3px solid var(--sky-blue, #29ABE2); border-radius: 3px; vertical-align: middle; }
.blocks-diagram .diagram-wrap { max-height: 420px; }
.blocks-items { padding-left: 1.2em; }
.blocks-item { margin-bottom: 0.6rem; }
.blocks-item.has-problem > span { color: var(--error, #B3261E); }
.blocks-inputs { margin-top: 0.5rem; }
.input-unit { display: flex; align-items: center; gap: 0.4rem; }
.input-unit .input { flex: 1 1 auto; min-width: 0; }
.blocks-preview td.changed { font-weight: 700; }
.blocks-preview .table-wrap { overflow-x: auto; }

/* Links stacked in a list are 24px targets with room between them (WCAG 2.2 target size). */
.model-links li + li { margin-top: var(--space-2); }
.model-links li a { display: inline-block; min-height: 24px; padding: 2px 0; }
details.new-model-panel > summary { cursor: pointer; min-height: 24px; }
.views-bar { margin-top: var(--space-3); }

/* ------------------------------------------------------------------ 0.34.0: large structures and other ways to show them */

.structure-views .seg + .seg { margin-left: var(--space-4); }

/* B: a bar of posts split by the colour scheme, with the count. */
.sum-bar { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0; min-width: 0; }
.sum-bar-track { display: flex; flex: 1; height: 12px; border-radius: var(--radius-pill); overflow: hidden; background: var(--surface); outline: 1px solid var(--border); min-width: 60px; }
.sum-bar-part { display: block; height: 100%; min-width: 2px; }
.sum-bar-text { font-size: 12px; color: var(--muted); white-space: nowrap; }
.when-far, .unit-far-note { display: none; }

/* B: a folded unit's units as small tiles. */
.unit-folded { margin-top: var(--space-2); border-top: 1px solid var(--border); padding-top: var(--space-2); }
.mini-tiles { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.org ul.mini-tiles { display: grid; padding: 0; justify-content: stretch; }
.org ul.mini-tiles::before, .org ul.mini-tiles > li::before, .org ul.mini-tiles > li::after { display: none; }
.org ul.mini-tiles > li { padding: 0; display: block; }
.mini-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 44px; padding: 6px 8px; text-align: left; border: 1px solid var(--control-border); border-left: 6px solid var(--shade, var(--surface)); border-radius: 8px; background: var(--white); cursor: pointer; font: inherit; color: var(--oxford); }
.mini-tile:hover { background: var(--cerise-soft); }
.mini-tile .sum-bar { width: 100%; margin: 2px 0 0; }
.mini-tile .sum-bar-text { display: none; }
.mini-name { font-family: var(--font-heading); font-weight: 700; font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.mini-meta { font-size: 11px; color: var(--muted); }
.mini-more { border-left-color: var(--oxford); justify-content: center; }

/* C: a wide row cut to the largest twelve, and units with nothing below them wrapped into a grid. */
.org ul.unit-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), 248px); gap: var(--space-3); justify-content: center; padding-top: 22px; }
.org ul.unit-grid > li { padding: 0; }
.org ul.unit-grid > li::before, .org ul.unit-grid > li::after { display: none; }
.unit-more-tile { display: flex; flex-direction: column; gap: 2px; align-items: center; justify-content: center; width: 248px; min-height: 80px; border: 2px dashed var(--control-border); border-radius: 10px; background: var(--white); cursor: pointer; font: inherit; color: var(--oxford); }
.unit-more-tile:hover { background: var(--cerise-soft); border-color: var(--cerise-dark); }

/* F: what find matched. */
.unit-box.is-match, .line-card.is-match, .outline-row.is-match { box-shadow: 0 0 0 3px var(--cerise); }
.post-sq.is-match { outline: 3px solid var(--cerise); outline-offset: 1px; }

/* A: the trail, up one level, units beside this one, and the starting point. */
.crumb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-3); }
.crumb-bar .crumbs { margin: 0; }
.crumb-peers .select { width: auto; display: inline-block; }

/* E: zoomed out, the picture shows names and vacancy rates in place of squares and long totals,
   with names drawn larger so they stay readable; further out, the folded units' tiles go too. */
.zv-far .post-squares, .zv-far .unit-totals, .zv-far .unit-box .btn-link.small { display: none; }
.zv-far .when-far, .zv-far .unit-far-note { display: block; }
.zv-far .unit-box { background: var(--shade, var(--white)); }
.zv-far .unit-box .unit-name, .zv-far .unit-box .unit-far-note, .zv-far .unit-box .unit-more { color: var(--shade-ink, var(--oxford)); }
.zv-far .unit-name { font-size: min(calc(13px * var(--zv-inv, 1)), 34px); line-height: 1.15; overflow-wrap: break-word; hyphens: auto; }
.zv-far .unit-far-note { font-size: min(calc(11px * var(--zv-inv, 1)), 28px); margin: 2px 0; }
.zv-far .level-tag, .zv-far .unit-box .btn-icon, .zv-far .unit-box .sum-bar-text { display: none; }
.zv-far .unit-folded { background: var(--white); border-radius: 6px; padding: 4px; border-top: 0; }
.zv-farther .unit-folded, .zv-farther .unit-more, .zv-farther .when-far { display: none; }

/* G: the overview map. */
.zv-map { position: absolute; right: var(--space-3); bottom: var(--space-3); background: rgba(255, 255, 255, .94); border: 1px solid var(--control-border); border-radius: 8px; padding: 4px; box-shadow: var(--shadow-md); cursor: crosshair; line-height: 0; }
.zv-view:fullscreen .zv-map { bottom: calc(var(--space-4) + var(--space-3)); right: calc(var(--space-4) + var(--space-3)); }
.zv-map-shape { fill: var(--tint-blue); stroke: var(--deep-blue); stroke-width: .5; }
.zv-map-view { fill: rgba(226, 11, 136, .12); stroke: var(--cerise-dark); stroke-width: 1.5; }

/* H: posts with no manager, grouped by unit. */
.line-group { width: 248px; background: var(--white); border: 1px solid var(--control-border); border-top: 4px solid var(--purple); border-radius: 10px; padding: var(--space-2) var(--space-3); text-align: left; box-shadow: var(--shadow-sm); }
.line-group-name { font-family: var(--font-heading); font-weight: 800; font-size: 14px; margin: 0 0 2px; }
.line-group .small { margin: 0; }
.zv-far .line-group .small, .zv-far .line-card .line-meta { display: none; }
.zv-far .line-group-name { font-size: min(calc(13px * var(--zv-inv, 1)), 34px); line-height: 1.15; }
.zv-far .line-group .sum-bar-text { display: none; }
.zv-farther .line-group .unit-more { display: none; }

/* D: the outline. */
.outline, .outline ul { list-style: none; margin: 0; padding: 0; }
.outline ul { margin-left: 22px; border-left: 2px solid var(--border); padding-left: 10px; }
.outline-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-3); padding: 6px var(--space-2); border-radius: 8px; }
.outline-row:hover { background: var(--surface); }
.outline-toggle { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--control-border); border-radius: 6px; background: var(--white); cursor: pointer; color: var(--oxford); padding: 0; }
.outline-toggle .icon { width: 16px; height: 16px; }
.outline-spacer { display: inline-block; width: 28px; }
.outline-name { font-family: var(--font-heading); font-weight: 700; }
.outline-posts { flex-basis: 100%; padding-left: 36px; }
.outline-posts .sum-bar { max-width: 520px; }
.outline-totals { font-size: 13px; }

/* The charts (structure-views.js). */
.sv-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); margin-bottom: var(--space-3); }
.sv-controls .select { width: auto; }
.sv-chart { width: 100%; height: auto; display: block; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--white); }
.sv-cell { stroke: var(--white); stroke-width: 1.5; }
.sv-link { cursor: pointer; }
.sv-link:hover .sv-cell, .sv-link:focus-visible .sv-cell { stroke: var(--oxford); stroke-width: 2.5; }
.sv-link:focus-visible { outline: none; }
.sv-label { font-family: var(--font-body); font-size: 13px; pointer-events: none; }
.sv-strong { font-family: var(--font-heading); font-weight: 700; }
.sv-key { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin: var(--space-3) 0; font-size: 13px; }
.sv-key-item { display: inline-flex; align-items: center; gap: 6px; }
.sv-swatch { display: inline-block; width: 18px; height: 14px; border-radius: 3px; border: 1px solid var(--control-border); }
.sv-table { margin: var(--space-4) 0; }
.sv-table > summary { cursor: pointer; font-family: var(--font-heading); font-weight: 700; min-height: 24px; }
.sv-heat-wrap { max-height: 70vh; }
.sv-heatmap th.num { white-space: normal; min-width: 80px; vertical-align: bottom; }
.sv-heatmap td.sv-heat { font-variant-numeric: tabular-nums; border-left: 1px solid var(--white); }
.sv-mix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.sv-mix { margin: 0; padding: var(--space-4); }
.sv-mix-whole { border-top: 4px solid var(--deep-blue); }
.sv-mix h3 { margin-bottom: 2px; }
.sv-bars { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: 4px; }
.sv-bars li { display: grid; grid-template-columns: 7.5em 1fr 3.5em; align-items: center; gap: var(--space-2); font-size: 13px; }
.sv-bars-wide li { grid-template-columns: minmax(9em, 14em) 1fr minmax(7em, auto); }
.sv-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.sv-bar-track { display: block; height: 12px; background: var(--surface); border-radius: var(--radius-pill); overflow: hidden; }
.sv-bar { display: block; height: 100%; background: var(--deep-blue); border-radius: var(--radius-pill); }
.sv-bar.sv-up { background: var(--success); }
.sv-bar.sv-down { background: var(--amber); }
.sv-bar-value { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sv-stats { margin-bottom: var(--space-4); }
.sv-stat { margin: 0; padding: var(--space-4); }
.sv-stat .small { margin: 0; }
.sv-stat .stat { margin: 0; font-size: 1.6rem; }
.sv-flow { fill: none; stroke: var(--deep-blue); stroke-opacity: .35; }
.sv-flow:hover { stroke-opacity: .7; }
.sv-node { fill: var(--oxford); }
.sv-body .card h3 { margin-top: 0; }
@media (max-width: 899px) {
  .org ul.unit-grid, .org-line ul.unit-grid { grid-template-columns: repeat(2, 248px); }
  .sv-bars-wide li { grid-template-columns: 1fr; }
}
/* Staffing flows and volumes in the changes chart: coloured by where each post ends, from the state tokens. */
.sv-flow-filled { stroke: var(--state-filled); }
.sv-flow-vacant { stroke: var(--state-vacant); }
.sv-flow-proposed { stroke: var(--state-proposed); }
.sv-flow-none { stroke: var(--state-closed); }
.sv-swatch-filled { background: var(--state-filled); }
.sv-swatch-vacant { background: var(--state-vacant); }
.sv-swatch-proposed { background: var(--state-proposed); }
.sv-swatch-gone { background: var(--state-closed); }
.sv-axis { fill: var(--muted); font-size: 12px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { margin: var(--space-2) 0; }
.sv-flow.sv-flow-filled, .sv-flow.sv-flow-vacant, .sv-flow.sv-flow-proposed, .sv-flow.sv-flow-none { stroke-opacity: .5; }

/* ------------------------------------------------------------------ 0.35.0: plan money */
table.data td.from-history .cell-input { border-color: var(--info); background: var(--info-tint); }
.from-history-mark { display: inline-block; margin-left: var(--space-1, 4px); color: var(--info); font-size: 0.75rem; font-weight: 700; }
.pay-card-list .row { align-items: flex-end; gap: var(--space-2, 8px); }
.outturn-helper { margin: var(--space-2, 8px) 0 var(--space-3, 12px); }
.outturn-helper > summary { cursor: pointer; }
tr.baseline-row th, tr.baseline-row td { background: var(--surface); font-style: italic; }

/* ------------------------------------------------------------------ 0.36.0: compare and test */
table.data td.heat-over { box-shadow: inset 0 0 0 2px var(--warning); color: var(--oxford); font-weight: 700; }
/* The comparison: option names stay in view as the table scrolls, and differences keep their sign beside the figure. */
table.cmp-table .forecast-diff, table.cmp-table td.num { white-space: nowrap; }
table.data.cmp-table tbody th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--white); min-width: 11rem; }
table.data.cmp-table tr.forecast-total th[scope="row"] { background: var(--surface); }
table.data.cmp-table td.cmp-limits { min-width: 10rem; }

/* ------------------------------------------------------------------ 0.37.0: monitor */
table.data td.pa-diff { white-space: nowrap; font-weight: 600; }
.sv-scroll { overflow-x: auto; }
.sv-sankey-multi { min-width: 760px; }
.sv-col-head { font-weight: 700; }
.sv-label-halo { paint-order: stroke; stroke: var(--white); stroke-width: 4px; stroke-linejoin: round; }
.sv-flow.sv-flow-other { stroke: var(--text-muted, #5a6472); stroke-opacity: .35; stroke-dasharray: 4 3; }
.sv-dates { flex-wrap: wrap; gap: .5rem; }
.sv-date { display: inline-flex; align-items: center; gap: .25rem; }
.normal-weight { font-weight: 400; }

/* D33: the structure explorer in a forecast's or option's structure tab. */
.structure-tab .forecast-banner-note { margin: 0 0 var(--space-4); }
.results-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); margin-bottom: var(--space-4); }

/* Home (D135): Tools are a small strip of links under the core cards. */
.card > ul + p, .card > ol + p, .card > dl + p { margin-top: var(--space-3); }


/* Home (prototype revision, C15): the figures for what exists are links into each list. */
.home-glance { margin: var(--space-5) 0; }
.home-tile { display: block; color: inherit; text-decoration: none; }
.home-tile:hover, .home-tile:focus-visible { border-color: var(--cerise-dark); }
/* Home (D219 piece E, as the prototype): the meter of the share of funded WTE that is contracted; home.js sets the width. */
.home-meter { height: 8px; border-radius: var(--radius-pill); background: var(--surface); overflow: hidden; margin: var(--space-2) 0 var(--space-1); }
.home-meter-fill { display: block; height: 100%; width: 0; background: var(--deep-blue); }

/* Report builder, Add section (prototype revision, C12): each choice of step 1 is a button with its help below. */
.report-chooser .report-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; height: auto; text-align: left; white-space: normal; }
.report-chooser { margin-bottom: 1rem; }
.report-add .report-all-items { margin-top: 0.5rem; }
/* Report builder views (prototype revision, C12): find and show by kind, fold sections, the contents, sortable tables, the steps. */
.report-view-bar .report-filter { margin-bottom: var(--space-3); }
.report-view-bar .report-filter .field { min-width: 200px; }
.report-view-count { margin: 0 0 0 auto; align-self: center; }
.report-outline { margin-bottom: var(--space-4); }
.report-outline > summary { cursor: pointer; font-family: var(--font-heading); font-weight: 700; }
.report-create { align-items: flex-end; }
.report-meta .btn-group { align-items: center; }
.report-item-tools .seg { margin-right: var(--space-2); }
.report-item-folded { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.report-item-folded .report-item-tools { margin-bottom: 0; }
.report-table-filter { margin-bottom: var(--space-2); }
.report-table-filter .field { min-width: 200px; }
.report-table .th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; text-align: inherit; }
.report-table .th-sort:focus-visible { outline: var(--focus); outline-offset: 2px; }
.report-table tr.total td { font-weight: 700; border-top: 2px solid var(--control-border); }
.report-steps { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); list-style: none; margin: 0 0 var(--space-2); padding: 0; font-size: 14px; }
.report-steps li { color: var(--muted); }
.report-steps li[aria-current="step"] { color: inherit; font-weight: 700; }
.report-steps li.done { color: inherit; }
.report-step-n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--control-border); font-size: 12px; }
.report-steps li[aria-current="step"] .report-step-n, .report-steps li.done .report-step-n { background: var(--oxford); border-color: var(--oxford); color: var(--white); }
.standard-report { display: flex; flex-direction: column; gap: var(--space-2); }
.standard-report .btn { align-self: flex-start; margin-top: auto; }
.report-list-bar .field { min-width: 170px; }
.report-list-bar [data-report-count] { margin: 0 0 0 auto; align-self: center; }

/* Known changes and parameter rules (prototype revision, C3, C4): filters, grouping, the compare summary, ties and the timeline. */
.known-filters .field, .rule-view .field { min-width: 140px; flex: 1 1 150px; max-width: 240px; }
.known-filters .field .small, .rule-view .field .small { margin: 0 0 var(--space-1); }
.known-filters .date-input { flex-wrap: nowrap; }
.case-table .case-desc { white-space: normal; min-width: 16rem; max-width: 28rem; }
.known-count { flex: 1 1 auto; }
.known-bulk { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.known-summary { margin-bottom: var(--space-4); }
.known-summary > summary { cursor: pointer; min-height: 32px; font-weight: 600; }
.known-summary .btn-link { margin: 0; color: var(--cerise-dark); }
.known-table td.center, .known-table th.center { text-align: center; }
.input-compact { min-height: 36px; padding-top: 4px; padding-bottom: 4px; font-size: 14px; }
.rule-values { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.rule-value .cell-input { width: 6.5em; display: inline-block; }
.rule-tie { margin-top: var(--space-1); max-width: 40ch; }
.rule-explain-differs th, .rule-explain-differs td { background: var(--info-tint); }
.rule-timeline { display: grid; gap: var(--space-1); margin-bottom: var(--space-4); }
.rt-row { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: var(--space-3); align-items: center; min-height: 28px; }
.rt-axis { min-height: 22px; border-bottom: 1px solid var(--border); }
.rt-label { overflow-wrap: anywhere; }
.rt-track { position: relative; height: 22px; background: var(--surface); border-radius: 4px; }
.rt-axis .rt-track { background: none; }
.rt-tick { position: absolute; top: 2px; padding-left: 3px; border-left: 1px solid var(--border); white-space: nowrap; }
.rt-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; background: var(--deep-blue); }
.rt-bar.rt-derived { background: repeating-linear-gradient(135deg, var(--deep-blue) 0 6px, var(--tint-blue) 6px 10px); }
.rt-marker { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--cerise); }
@media (max-width: 639px) {
  .rt-row { grid-template-columns: 1fr; gap: 2px; }
  .known-filters .field, .rule-view .field { max-width: none; }
}

/* A view switch made of links (from the prototype's page styles): the current view as a pressed button, as Temporary staffing's Recorded and budgets and Bank contracts (D219 piece F). */
a.seg-btn { display: inline-flex; align-items: center; text-decoration: none; color: var(--hd-text); }
a.seg-btn[aria-current="page"] { background: var(--hd-oxford); color: #fff; border-color: var(--hd-oxford); }

/* ------------------------------------------------------------------ WFP styles the prototype does not have (D219 piece A): Help's contents, the chart table and the Tools strip */
.chart-table { margin-top: var(--space-3); }
.chart-table summary { cursor: pointer; font-size: var(--text-small); }
.help-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.help-toc { position: sticky; top: calc(var(--header-height) + var(--space-4)); }
@media (max-width: 899px) { .help-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 899px) { .help-toc { position: static; } }
.guide-toc { padding-left: 1.4em; }
.tools-strip { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.tools-strip .h-small { font-size: 1rem; margin-bottom: var(--space-2); }
.tools-strip ul { gap: var(--space-2) var(--space-5); }

/* ------------------------------------------------------------------ WFP's changes since the prototype's fork (D219 piece A) */
/* F27: the words in the header buttons share the form label class but not its margin or size, so they centre with the icon and count at 14px. */
.site-header .label { margin: 0; font-size: 14px; }
/* F27: the menu link words share the form label class but not its margin or size, so they centre at the links' 15px and each link is 40px tall (the drawer's account buttons too). */
.rail a .label, .rail .rail-account-button .label { margin: 0; font-size: inherit; }
/* F28: the header fits every width: in the compact top bar Help, Notifications and Jobs are icon buttons and the account
   menu shows initials (D219 piece B), so only the organisation's name shortens; the account button is never cut off. */
/* F28: up to 899px, while the menu is a drawer, the organisation switcher and account menu are in the drawer, not the header. */
@media (max-width: 899px) {
  .rail-account { display: block; border-bottom: 1px solid var(--border); margin-bottom: var(--space-3); }
  .header-actions .header-org, .header-actions .header-account { display: none; }
}
/* D203: the two-factor QR code is also a link to its otpauth address. */
.qr-link { display: inline-block; line-height: 0; border-radius: var(--radius-control); }
/* D198 (EH20, 7z17 answer 7): the working indicator, shown when a request has not answered within about a second; bottom left,
   so toasts can sit bottom right (D219, B4 answer a; moved in piece A, master session for Steve, 21 Nov 2026). */
.working-indicator { position: fixed; left: var(--space-4); bottom: var(--space-4); z-index: 91; display: flex; align-items: center; gap: var(--space-2);
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-md); padding: var(--space-2) var(--space-3); font-size: 15px; color: var(--oxford); }
.working-indicator[hidden] { display: none; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--deep-blue); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media print { .working-indicator { display: none; } }
/* EH20: the offline banner sits at the top of the page's content. */
.offline-banner { margin-bottom: var(--space-4); }
/* The error summary (D198, EH23), WFP's own: at the top of the main content, the problems linked to their fields; red border
   and text with a heading and icon, so colour is never the only signal (WCAG 1.4.1). */
.error-summary { border: 4px solid var(--error); border-radius: var(--radius-control); padding: var(--space-4); margin-bottom: var(--space-4); background: var(--white); }
.error-summary:focus { outline: var(--focus); outline-offset: 2px; }
.error-summary-title { display: flex; gap: var(--space-2); align-items: center; margin: 0 0 var(--space-2); font-size: 1.25rem; color: var(--oxford); }
.error-summary-title .icon { color: var(--error); }
.error-summary-list { margin: 0; padding-left: 1.25rem; }
.error-summary-list a { color: var(--error); font-weight: 600; text-decoration: underline; }
/* A figure hidden for a small group (D213 decided 11): a # or £ with a line through it; its explanation on hover or focus. */
.hidden-figure { position: relative; text-decoration: line-through; text-decoration-thickness: 2px; cursor: help; }
.hidden-figure:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.hidden-figure[data-note]:hover::after, .hidden-figure[data-note]:focus::after {
  content: attr(data-note); position: absolute; z-index: 20; right: 0; top: 100%; width: max-content; max-width: 18rem;
  padding: 0.4rem 0.6rem; border-radius: 4px; background: var(--oxford); color: #fff; font-size: 0.8rem; line-height: 1.35;
  text-align: left; text-decoration: none; white-space: normal; font-weight: 400;
}

/* ------------------------------------------------------------------ the app shell (D219 piece B) */

/* ------------------------------------------------------------------ the page restyle (D219 piece D), from the prototype's app.css */
/* The system model editor's header: the save state beside the version, and the undo and redo icons. */
.editor-state { display: flex; align-items: center; gap: var(--hd-space-2); flex-wrap: wrap; }
.icon-flip .icon { transform: scaleX(-1); }
/* A small form in a page toolbar (a choice and its button on one line). */
.toolbar-form { display: flex; align-items: center; gap: var(--hd-space-2); margin: 0; }
.toolbar-form .select-compact { width: auto; max-width: 18rem; }

/* ---- Structure (D219 piece D, group 5), from the prototype */
/* The structure canvas: the picture fills the page, with zoom and the key floating on it (the rules for .is-canvas,
   .canvas-key and the thin month slider in .page-scrub are above). */
.canvas-float { position: absolute; z-index: 5; background: var(--hd-surface); border: 1px solid var(--hd-border); border-radius: var(--hd-radius); box-shadow: 0 12px 32px rgba(16, 17, 49, .10); }
/* On a phone the zoom controls take the width, so the key floats above them. */
@media (max-width: 639px) {
  .zv-view.is-canvas .zv-tools { right: 8px; bottom: 8px; }
  .zv-view.is-canvas .canvas-key { left: 8px; bottom: calc(var(--wfp-control) + 24px); }
}
