/* Electric Closeout — architectural blueprint drafting workbench */
:root {
  --canvas: #CBD5E1;
  --paper: #F8FAFC;
  --white: #FFFFFF;
  --mast: #0C2340;
  --mast-ink: #F0F9FF;
  --mast-muted: #B9CCE0;
  --ink: #0F172A;
  --muted: #334155;
  --primary: #0369A1;
  --primary-dark: #075985;
  --primary-ink: #FFFFFF;
  --hold: #C2410C;
  --hold-ink: #9A3412;
  --hold-tint: #FFF7ED;
  --critical: #991B1B;
  --error: #B91C1C;
  --error-tint: #FEF2F2;
  --ok: #166534;
  --ok-tint: #F0FDF4;
  --open-tint: #F1F5F9;
  --grid: #64748B;
  --hair: rgba(100, 116, 139, 0.45);
  --draft: 1.5px solid #475569;
  --font-display: 'Syne', 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --hud-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
}

h1, h2, h3 { line-height: 1.15; }

a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }

button { font: inherit; color: inherit; }

button, a, label[for], .evidence-drop, summary, [data-source-field], select { cursor: pointer; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  background: var(--white);
  color: var(--ink);
  padding: 10px 14px;
  border: var(--draft);
  min-height: 44px;
}
.skip-link:focus { top: 8px; }

/* ---------- masthead title block ---------- */

.title-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: stretch;
  background-color: #0C2340;
  color: #F0F9FF;
  border-bottom: var(--draft);
}

.tb-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2px 16px;
  min-width: 0;
  border-right: 1px solid rgba(240, 249, 255, 0.18);
}
.tb-cell:last-child { border-right: 0; }

.tb-brand { flex-direction: row; align-items: center; justify-content: flex-start; }

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  max-height: 52px;
}

.tb-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mast-muted);
}

.tb-value { font-size: 13px; font-weight: 600; }

.tb-status .tb-value { font-variant-numeric: tabular-nums; }

.tb-stamp { padding: 2px 12px; }

.pro-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-height: 50px;
  padding: 6px 14px;
  background: transparent;
  color: var(--mast-ink);
  border: 1.5px dashed rgba(240, 249, 255, 0.55);
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pro-stamp:hover { border-style: solid; background: rgba(240, 249, 255, 0.08); }
.pro-stamp:active { transform: translateY(1px); }

/* ---------- toolbar & workflow bar ---------- */

.unified-toolbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 20px;
  padding: 4px 16px;
  min-height: 28px;
  line-height: 18px;
  background: #E2E8F0;
  border-bottom: 1px solid var(--grid);
  font-size: 12.5px;
}

.tbar-item { margin: 0; min-width: 0; font-variant-numeric: tabular-nums; }

.tbar-key {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

.tbar-project { font-weight: 600; overflow-wrap: anywhere; }

.tbar-mini { display: none; gap: 6px; flex-wrap: wrap; }

.mini-kpi {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1px 6px;
  border: 1px solid var(--grid);
  background: var(--white);
}

.tbar-save { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }

.save-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grid); flex: 0 0 auto; }
body[data-save="saved"] .save-dot { background: var(--ok); }
body[data-save="partial"] .save-dot, body[data-save="failed"] .save-dot { background: var(--hold); }

.workflow-bar {
  display: flex;
  align-items: stretch;
  background: var(--paper);
  border-bottom: var(--draft);
  padding: 0 4px;
  scrollbar-width: thin;
}

.wf-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-right: 1px solid var(--hair);
  white-space: nowrap;
}
.wf-link:hover { background: #EEF2F7; color: var(--ink); }
.wf-link:active { background: #E2E8F0; }

.wf-num { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }

.wf-report { margin-left: auto; border-right: 0; border-left: 1px solid var(--hair); color: var(--primary); }

/* ---------- buttons ---------- */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
  border: 1.5px solid var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--primary-ink); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: var(--white);
  color: var(--ink);
  border: 1.5px solid #475569;
}
.btn-secondary:hover { background: #EEF2F7; }
.btn-secondary:active { transform: translateY(1px); background: #E2E8F0; }

.btn-compact { padding: 6px 12px; font-size: 13.5px; }

.btn-link {
  min-height: 44px;
  padding: 6px 6px;
  background: none;
  border: 0;
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover { color: var(--primary-dark); }
.btn-link:active { transform: translateY(1px); }

/* ---------- workbench topology ---------- */

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  align-items: start;
  gap: 12px;
  padding: 0 12px;
}

.inspector-pane,
.deliverable-zone {
  background: var(--paper);
  border: var(--draft);
  border-top: 0;
  min-width: 0;
}

.inspector-pane { display: flex; flex-direction: column; }

.inspector-head {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 18px 10px;
  border-bottom: 1px solid var(--hair);
}

.app-lede {
  flex: 1 1 100%;
  margin: 2px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.4;
}

.role-badge,
.role-badge-in,
.role-badge-out {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}
.role-badge-in { background: #0C2340; color: #F0F9FF; border: 1.5px solid #0C2340; }
.role-badge-out { background: #FFFFFF; color: #0C2340; border: 1.5px solid #0C2340; }

.io-tag { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }

.live-cue { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: live 2.4s ease-in-out infinite; }
@keyframes live { 50% { opacity: 0.35; } }

.inspector-scroll-body { padding: 12px 18px 64px; }

/* scenario strip */
.scenario-caption-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.scenario-caption {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.sample-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 8px;
  border: 1px dashed var(--hold);
  color: var(--hold-ink);
  background: var(--hold-tint);
}

.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.preset-chip {
  min-height: 44px;
  padding: 8px 14px;
  background: var(--white);
  border: 1.5px solid #475569;
  border-radius: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
}
.preset-chip:hover { background: #EEF2F7; }
.preset-chip:active { transform: translateY(1px); }
.preset-chip[aria-pressed="true"] { background: var(--mast); color: var(--mast-ink); border-color: var(--mast); box-shadow: inset 0 -3px 0 #7DD3FC; }

.reset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.undo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--grid);
  border-left: 3px solid var(--mast);
  background: var(--white);
  max-width: 100%;
}
.undo-bar[hidden] { display: none; }
.undo-text { margin: 0; flex: 1 1 220px; font-size: 13px; color: var(--muted); }

.trust-reassurance-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 4px;
  padding: 8px 12px;
  background: var(--white);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--ok);
}
.trust-reassurance-bar p { margin: 0; font-size: 13px; color: var(--muted); }
.trust-badge {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: var(--ok-tint);
  color: var(--ok);
  border: 1px solid var(--ok);
}

/* form sections */
.workpaper-form { margin: 0; }

.step-section {
  margin: 14px 0 0;
  padding: 0 0 14px;
  border: 0;
  border-top: var(--draft);
  min-width: 0;
}

.step-legend {
  float: left;
  width: 100%;
  padding: 12px 0 10px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}
.step-legend + * { clear: both; }

.prop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.prop-field { min-width: 0; border-radius: 0; }
.prop-field-wide { grid-column: 1 / -1; margin-top: 12px; }
.prop-field-span { grid-column: 1 / -1; }

.prop-field label,
.field-label {
  display: block;
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.req, .opt {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 4px;
  white-space: nowrap;
}
.req { color: var(--hold-ink); }
.opt { color: var(--muted); }

input[type="text"],
input[type="date"],
textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1.5px solid var(--grid);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.35;
}
textarea { resize: vertical; min-height: 64px; }
input::placeholder, textarea::placeholder { color: #5B6B80; }
input:hover, textarea:hover { border-color: #475569; }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }

input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); background: var(--error-tint); }

.unit-input { display: flex; align-items: stretch; max-width: 340px; }
.unit-input input { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.unit {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1.5px solid var(--grid);
  border-left: 0;
  background: #EEF2F7;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.validation-cue {
  margin: 4px 0 0;
  padding-left: 18px;
  position: relative;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--error);
}
.validation-cue::before {
  content: '!';
  position: absolute;
  left: 0;
  top: 1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--error);
  color: var(--white);
  font-size: 10px;
  line-height: 13px;
  text-align: center;
}
.validation-cue[hidden] { display: none; }

.section-hint { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.threshold-note {
  margin: 0 0 6px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--white);
  border: 1px dashed var(--grid);
}

/* collapsible */
.prop-collapsible { margin-top: 12px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.prop-collapsible > .prop-grid, .prop-collapsible > .prop-field { padding-bottom: 12px; }
.step-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 0;
  font-size: 13.5px;
  font-weight: 600;
  list-style: none;
}
.step-tab::-webkit-details-marker { display: none; }
.step-tab svg { transition: transform 0.15s ease; flex: 0 0 auto; }
.prop-collapsible[open] > .step-tab svg { transform: rotate(90deg); }
.step-tab:hover { color: var(--primary); }

/* system ledger */
.ledger { counter-reset: sys; }

.sys-entry { padding: 14px 0 16px; border-top: 1px solid var(--grid); }
.sys-entry:first-child { border-top: 1px solid var(--hair); }

.sys-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.sys-title { margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 15px; min-width: 0; }
.sys-idx { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); text-transform: uppercase; }
.sys-name-echo { font-family: var(--font-display); font-weight: 700; overflow-wrap: anywhere; }
.btn-remove { margin-left: auto; color: var(--muted); }

.row-state, .state-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 7px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
[data-state="ready"].row-state, .state-tag[data-state="ready"] { color: var(--ok); background: var(--ok-tint); }
[data-state="held"].row-state, .state-tag[data-state="held"] { color: var(--hold-ink); background: var(--hold-tint); }
[data-state="incomplete"].row-state, .state-tag[data-state="incomplete"] { color: var(--muted); background: var(--open-tint); border-style: dashed; }

.seg-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.seg-group-wide { grid-column: 1 / -1; }
.seg-legend { padding: 0; margin: 0 0 4px; font-size: 13px; font-weight: 600; line-height: 1.3; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg-group-wide .seg { max-width: 420px; }

.seg-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  opacity: 0;
  pointer-events: none;
}

.seg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 8px;
  border: 1.5px solid var(--grid);
  background: var(--white);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.seg-btn + .seg-input + .seg-btn { border-left: 0; }
.seg-btn:hover { background: #EEF2F7; }
.seg-btn:active { transform: translateY(1px); }
.seg-input:focus-visible + .seg-btn { outline: 2px solid var(--primary); outline-offset: 1px; position: relative; z-index: 1; }
.seg-input:checked + .seg-pass { background: var(--ok); border-color: var(--ok); color: var(--white); }
.seg-input:checked + .seg-fail { background: var(--hold); border-color: var(--hold); color: var(--white); }
.seg-input:checked + .seg-neutral { background: var(--mast); border-color: var(--mast); color: var(--mast-ink); }
.seg-group.is-invalid .seg-btn { border-color: var(--error); background: var(--error-tint); }

.check-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  align-items: end;
}

.evidence-field { margin-top: 12px; min-width: 0; }
.evidence-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.evidence-drop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1.5px dashed #475569;
  background: var(--white);
  font-size: 13.5px;
  font-weight: 600;
}
.evidence-drop:hover { background: #EEF2F7; }
.evidence-drop:active { transform: translateY(1px); }
.evidence-drop:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.evidence-field.is-invalid .evidence-drop { border-color: var(--error); background: var(--error-tint); }
.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.evidence-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ev-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  max-width: 100%;
  border: 1px solid var(--grid);
  background: var(--open-tint);
  font-size: 12.5px;
}
.ev-name { overflow-wrap: anywhere; min-width: 0; }
.ev-size, .ev-lost { font-family: var(--font-mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.ev-empty { font-size: 12.5px; color: var(--muted); }
.chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 6px;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--hair);
  color: var(--muted);
}
.chip-btn:hover { color: var(--ink); background: #E2E8F0; }
.chip-btn:active { transform: translateY(1px); }
.ev-status { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); min-height: 0; }
.ev-status:empty { display: none; }

.btn-add { margin-top: 4px; }

/* evidence register */
.evidence-register { margin-top: 14px; }
.sub-label { margin: 0 0 4px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.register-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.register-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 4px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hair);
  text-align: left;
  font-size: 13px;
}
.register-row:hover { background: #EEF2F7; }
.register-row:active { background: #E2E8F0; }
.reg-name { font-weight: 600; overflow-wrap: anywhere; }
.reg-files { color: var(--muted); overflow-wrap: anywhere; }

.disclaimer {
  margin: 8px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--hair);
  font-size: 12.5px;
  color: var(--muted);
}

.guide-links { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 4px 0 0; }
.guide-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 0; font-size: 13px; font-weight: 600; }

.dock-jump-shelf {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 8px 18px;
  border-top: var(--draft);
  background: #EEF2F7;
}
.shelf-status { margin: 0; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- deliverable ---------- */

.deliverable-zone { padding: 0 18px 64px; }

.deliverable-dock {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "verdict kpis" "blocker actions";
  align-items: center;
  gap: 4px 14px;
  padding: 4px 0;
  background: var(--paper);
  border-bottom: var(--draft);
}

.dock-verdict { grid-area: verdict; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 40px; }

.state-pill {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border: 1.5px solid currentColor;
  white-space: nowrap;
}
.state-pill[data-state="ready"] { color: var(--ok); background: var(--ok-tint); }
.state-pill[data-state="held"] { color: var(--hold-ink); background: var(--hold-tint); }
.state-pill[data-state="incomplete"], .state-pill[data-state="awaiting"] { color: var(--muted); background: var(--open-tint); border-style: dashed; }

.dock-verdict-text { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; min-width: 0; font-variant-numeric: tabular-nums; }

.kpi-strip { grid-area: kpis; display: grid; grid-template-columns: repeat(3, minmax(68px, auto)); border: var(--draft); background: var(--white); }
.kpi { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px 12px; border-left: 1px solid var(--hair); min-height: 40px; }
.kpi:first-child { border-left: 0; }
.kpi:hover { background: #EFF6FF; }
.kpi:focus-visible { outline-offset: -2px; }
.kpi-num { font-family: var(--font-mono); font-weight: 700; font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
body[data-release-state="held"] .kpi-held .kpi-num { color: var(--hold-ink); }

.blocker-jump {
  grid-area: blocker;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  padding: 6px 12px;
  border: 1.5px solid var(--hold);
  border-radius: 0;
  background: var(--hold-tint);
  color: var(--hold-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
}
.blocker-jump svg { flex: 0 0 auto; }
.blocker-jump .icon-ok, .blocker-jump[data-tone="ok"] .icon-alert { display: none; }
.blocker-jump[data-tone="ok"] .icon-ok { display: block; }
.blocker-jump[data-tone="ok"] { border-color: var(--ok); background: var(--ok-tint); color: var(--ok); }
.blocker-jump:hover { filter: brightness(0.97); text-decoration: underline; }
.blocker-jump:active { transform: translateY(1px); }

.dock-actions { grid-area: actions; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dock-actions .btn-primary, .dock-actions .btn-secondary { white-space: nowrap; }

.dock-status {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--white);
  font-size: 12.5px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.dock-status.is-visible { opacity: 1; }

/* Reserved from first paint; clear/undo additionally pin the measured height so the record restores in place. */
[data-results] { min-height: 100vh; min-width: 0; }

.deliverable-sheet {
  position: relative;
  margin-top: 4px;
  padding: 18px;
  background-color: var(--white);
  background-image:
    linear-gradient(rgba(100, 116, 139, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 116, 139, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  border: var(--draft);
}
.deliverable-sheet:focus { outline: none; }
.deliverable-sheet:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

.corner-mark { position: absolute; width: 14px; height: 14px; border-color: #475569; border-style: solid; border-width: 0; }
.cm-tl { top: 6px; left: 6px; border-top-width: 1.5px; border-left-width: 1.5px; }
.cm-tr { top: 6px; right: 6px; border-top-width: 1.5px; border-right-width: 1.5px; }
.cm-bl { bottom: 6px; left: 6px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.cm-br { bottom: 6px; right: 6px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

.sheet-titleblock { border: var(--draft); background: var(--paper); }
.stb-head { display: grid; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--grid); }
.sheet-title { margin: 4px 0 0; font-family: var(--font-display); font-size: 21px; font-weight: 700; line-height: 1.15; }
.sheet-form { margin: 0; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }

.stb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.stb-cell { padding: 8px 12px; border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); min-width: 0; }
.stb-cell:nth-child(3n) { border-right: 0; }
.stb-cell:nth-last-child(-n+3) { border-bottom: 0; }
.stb-cell:hover { background: #EEF2F7; }
.stb-cell dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.stb-cell dd { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }

.conflict-banner {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1.5px solid var(--hold);
  background: var(--hold-tint);
  color: #7C2D12;
}
.conflict-banner[hidden] { display: none; }
.conflict-banner svg { flex: 0 0 auto; margin-top: 2px; }
.conflict-title { margin: 0; font-weight: 700; }
.conflict-list { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; }
.conflict-rows { font-weight: 600; }

.verdict-banner {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--hair);
  border-left: 6px solid var(--grid);
  background: var(--open-tint);
}
.verdict-banner[data-state="ready"] { border-left-color: var(--ok); background: var(--ok-tint); }
.verdict-banner[data-state="held"] { border-left-color: var(--hold); background: var(--hold-tint); }
.vb-state { margin: 0; font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.verdict-banner[data-state="ready"] .vb-state { color: var(--ok); }
.verdict-banner[data-state="held"] .vb-state { color: var(--hold-ink); }
.vb-sentence { margin: 2px 0 0; font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; min-height: 1.3em; }
.vb-action { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.print-stamp { display: none; }

.sheet-section { padding: 14px 0 0; min-width: 0; }
.sheet-h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.sheet-note { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }

.table-wrap { width: 100%; overflow-x: auto; }

.schedule-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.schedule-table th {
  padding: 6px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  border-top: var(--draft);
  border-bottom: var(--draft);
  background: var(--paper);
}
.schedule-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--hair);
  font-family: var(--font-mono);
  font-size: 12.5px;
  vertical-align: top;
}
.schedule-table .col-num { width: 28px; color: var(--muted); }
.schedule-table .col-read { text-align: right; padding-right: 10px; }
.schedule-table th.col-read { text-align: right; }
.sched-row:hover td { background: #EFF6FF; }
.sched-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.sched-row td[data-source-field]:hover { text-decoration: underline; }
.col-sys { min-width: 120px; }
.sys-cell-name { display: block; font-family: var(--font-body); font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.sys-cell-scope { display: block; font-family: var(--font-body); font-size: 12px; color: var(--muted); }
.res-pass { color: var(--ok); }
.res-fail { color: var(--hold-ink); font-weight: 700; }
.res-missing { color: var(--muted); font-style: italic; }
.res-invalid { color: var(--error); font-weight: 700; text-decoration: underline wavy; text-underline-offset: 3px; }
.cell-flag { display: inline-block; font-family: var(--font-body); font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; text-decoration: none; }
.sched-empty td { font-family: var(--font-body); color: var(--muted); padding: 14px 6px; }

.sheet-subgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
  border-top: var(--draft);
}
.sheet-subgrid > .sheet-section { padding: 12px 12px 4px 0; }
.sheet-subgrid > .sheet-section + .sheet-section { padding: 12px 0 4px 12px; border-left: 1px solid var(--hair); }

.mini-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mini-table th, .mini-table td { padding: 6px 4px; border-bottom: 1px solid var(--hair); text-align: right; font-size: 12.5px; }
.mini-table th:first-child, .mini-table th[scope="row"] { text-align: left; }
.mini-table thead th { font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.mini-table td { font-family: var(--font-mono); }
.mini-table tbody tr:hover { background: #EFF6FF; }
.num-alert { color: var(--hold-ink); font-weight: 700; }

.line-list, .audit-list { list-style: none; margin: 0; padding: 0; }
.line-btn, .audit-btn {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 6px 4px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hair);
  text-align: left;
  font-size: 13px;
  line-height: 1.35;
}
.line-btn:hover, .audit-btn:hover { background: #EFF6FF; }
.line-btn:active, .audit-btn:active { background: #DBEAFE; }
.line-label { font-weight: 700; overflow-wrap: anywhere; }
.line-text { overflow-wrap: anywhere; }
.tone-hold .line-label { color: var(--hold-ink); }
.tone-ok .line-label { color: var(--ok); }
.tone-open .line-label { color: var(--muted); }
.tone-muted .line-text { color: var(--muted); }
.line-print, .audit-print { display: none; }
.line-static, .audit-static { padding: 8px 4px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--hair); }
.audit-static { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; }
.audit-btn { grid-template-columns: 52px minmax(0, 1fr); }
.audit-time { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.audit-text { overflow-wrap: anywhere; }
.line-list.plain li { padding: 6px 0; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--hair); line-height: 1.45; }

.math-details {
  margin-top: 16px;
  border: 1.5px dashed var(--hold);
  background: var(--white);
}
.math-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 14px;
  color: var(--hold-ink);
  list-style: none;
}
.math-summary::-webkit-details-marker { display: none; }
.math-summary:hover { background: var(--hold-tint); }
.math-body { padding: 0 14px 12px; border-top: 1px solid var(--hair); }
.math-rules { margin: 10px 0 8px; font-size: 13px; color: var(--muted); }
.math-list { margin: 0; padding-left: 20px; font-family: var(--font-mono); font-size: 12px; line-height: 1.55; }
.math-list li { padding: 3px 0; }
.math-name { font-family: var(--font-body); font-weight: 700; font-size: 13px; }

.signoff { margin-top: 16px; padding-top: 12px; border-top: var(--draft); }
.sig-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 8px; }
.sig { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sig-line { display: block; height: 32px; border-bottom: 1.5px solid var(--ink); }
.sig-name { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.free-watermark {
  margin: 16px 0 0;
  padding-top: 8px;
  border-top: 1px dashed var(--grid);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet-disclaimer { margin: 6px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

.cert-seal {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
  padding: 14px;
  border: var(--draft);
  border-left: 4px solid var(--mast);
  background: var(--paper);
}
.seal-mark {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--mast);
  border-radius: 50%;
  color: var(--mast);
}
.seal-body p { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.seal-license { color: var(--ok) !important; font-weight: 600; }
.seal-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* click-to-edit pulse */
.flash-recalc { animation: flash-recalc 1.2s ease-out; }
@keyframes flash-recalc {
  0% { box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.45); background-color: rgba(3, 105, 161, 0.1); }
  100% { box-shadow: 0 0 0 3px rgba(3, 105, 161, 0); background-color: transparent; }
}

/* ---------- horizon sill, HUD, toast ---------- */

.cockpit-horizon-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 28px;
  padding: 0 14px;
  background: var(--mast);
  color: #DCE7F3;
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
}
.hz-item { flex: 0 0 auto; font-variant-numeric: tabular-nums; }

.mobile-hud { display: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(520px, calc(100vw - 24px));
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  font-size: 13.5px;
  border-left: 4px solid #7DD3FC;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.25);
}
.toast[hidden] { display: none; }

/* ---------- dialogs ---------- */

.ec-dialog {
  width: min(660px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0 20px 18px;
  border: var(--draft);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  overflow-y: auto;
}
.ec-dialog::backdrop { background: rgba(12, 35, 64, 0.55); }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -20px 12px;
  padding: 10px 12px 10px 20px;
  background: var(--mast);
  color: var(--mast-ink);
}
.dialog-head h2 { margin: 0; font-family: var(--font-display); font-size: 19px; line-height: 1.2; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 6px;
  background: transparent;
  border: 1px solid rgba(240, 249, 255, 0.4);
  color: var(--mast-ink);
}
.icon-btn:hover { background: rgba(240, 249, 255, 0.1); }
.icon-btn:active { transform: translateY(1px); }
.dialog-lead { margin: 0 0 12px; font-size: 14.5px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dialog-fine { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }

.free-vs-pro-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.free-vs-pro-table th, .free-vs-pro-table td { padding: 8px 8px; border-bottom: 1px solid var(--hair); text-align: left; vertical-align: top; }
.free-vs-pro-table thead th { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom: var(--draft); }
.free-vs-pro-table th[scope="row"] { font-weight: 700; }

/* ---------- desktop cockpit (≥ 901px) ---------- */

@media (min-width: 901px) {
  .cockpit-horizon-bar { display: flex; }
}

@media (min-width: 901px) and (min-height: 561px) {
  html,
  body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  body { display: flex; flex-direction: column; }
  .app-header-stack { flex-shrink: 0; }
  .workbench {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    padding-bottom: 0;
  }
  .inspector-pane,
  .deliverable-zone { height: 100%; max-height: 100%; }
  .inspector-pane { overflow: hidden; }
  .inspector-scroll-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .deliverable-zone {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .inspector-scroll-body,
  .deliverable-zone {
    -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 36px), transparent 100%);
    mask-image: linear-gradient(to bottom, black calc(100% - 36px), transparent 100%);
    padding-bottom: 64px;
  }
  .inspector-scroll-body.is-scroll-end,
  .deliverable-zone.is-scroll-end {
    -webkit-mask-image: none;
    mask-image: none;
  }
  .cockpit-horizon-bar { flex: 0 0 28px; }
}

/* natural-scroll fallback for short desktop windows */
@media (min-width: 901px) and (max-height: 560px) {
  .app-header-stack { display: contents; }
  .inspector-pane {
    position: sticky;
    top: 46px;
    max-height: calc(100vh - 46px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .deliverable-dock { top: 46px; }
  .cockpit-horizon-bar { display: none; }
}

@media (min-width: 901px) and (max-width: 1239px) {
  .kpi { padding: 2px 8px; }
  .kpi-strip { grid-template-columns: repeat(3, minmax(58px, auto)); }
  .dock-actions { gap: 6px; }
  .dock-actions .btn-compact { padding: 6px 10px; }
  .dock-scroll-cue .cue-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dock-scroll-cue { min-width: 44px; }
  .cockpit-horizon-bar { font-size: 10px; gap: 12px; }
  .dock-verdict-text { font-size: 13px; }
  .dock-verdict { gap: 8px; }
}

@media (min-width: 1240px) {
  .tb-cell { padding: 2px 20px; }
  .sys-entry .seg-group-wide { grid-column: auto; }
}

@media (max-width: 1239px) {
  .ir-field { grid-column: 1 / -1; }
}

/* ---------- tablet & mobile (≤ 900px) ---------- */

@media (max-width: 900px) {
  .tb-meta:not(.tb-status) { display: none; }
  .tb-stamp { display: none; }
  .title-block { padding: 4px 12px; }

  .app-header-stack { display: contents; }
  .title-block { grid-template-columns: minmax(0, 1fr) auto; }
  .tb-brand { grid-column: 1; padding: 6px 14px; }
  .tb-stamp { grid-column: 2; grid-row: 1; }
  .tb-meta { grid-row: 2; padding: 4px 14px 6px; border-top: 1px solid rgba(240, 249, 255, 0.18); }
  .tb-meta:not(.tb-status) { grid-column: 1; }
  .tb-status { grid-column: 2; border-right: 0; }
  .tbar-mini { display: flex; }
  .workflow-bar { overflow-x: auto; }
  .wf-report { margin-left: 0; }
  .workbench { display: block; padding: 0; }
  .inspector-pane, .deliverable-zone { border-left: 0; border-right: 0; }
  .inspector-scroll-body { padding-bottom: 20px; }
  .deliverable-zone { margin-top: 12px; border-top: var(--draft); padding: 0 16px 24px; }
  .deliverable-dock { position: static; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "verdict verdict" "kpis kpis" "blocker blocker" "actions actions"; }
  .kpi-strip { justify-self: start; }
  .dock-actions { justify-content: flex-start; }
  .cockpit-horizon-bar { display: none; }
  .mobile-hud {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--hud-h);
    padding: 6px 12px;
    background: var(--mast);
    color: var(--mast-ink);
    white-space: nowrap;
    overflow: hidden;
  }
  .hud-status { min-width: 0; overflow: hidden; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .hud-btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 6px 14px;
    background: var(--primary);
    color: var(--primary-ink);
    border: 0;
    border-radius: 0;
    font-weight: 700;
    font-size: 14px;
  }
  .hud-btn:active { transform: translateY(1px); }
  body { padding-bottom: calc(var(--hud-h) + 8px); }
  .toast { bottom: calc(var(--hud-h) + 12px); }
  .ec-dialog { margin: 12px auto auto; max-height: calc(100dvh - var(--hud-h) - 24px); }
}

@media (max-width: 680px) {
  fieldset [class*="grid"],
  form [class*="grid"],
  .field-pair,
  .prop-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .check-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prop-field input[type="text"] { padding-left: 8px; padding-right: 8px; }
  .stb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stb-cell:nth-child(3n) { border-right: 1px solid var(--hair); }
  .stb-cell:nth-child(2n) { border-right: 0; }
  .stb-cell:nth-last-child(-n+3) { border-bottom: 1px solid var(--hair); }
  .stb-cell:nth-last-child(-n+2) { border-bottom: 0; }
  .sheet-subgrid { grid-template-columns: minmax(0, 1fr); }
  .sheet-subgrid > .sheet-section,
  .sheet-subgrid > .sheet-section + .sheet-section { padding: 12px 0 4px; border-left: 0; }
  .sheet-subgrid > .sheet-section + .sheet-section { border-top: 1px solid var(--hair); }
}

@media (max-width: 640px) {
  .title-block .wordmark { font-size: 18px; }
  .tb-meta .tb-value { font-size: 12px; }
  .unified-toolbar { gap: 4px 8px; padding: 5px 12px; }
  .tbar-item:not(.tbar-project):not(.tbar-mini):not(.tbar-save) { display: none; }
  .tbar-project { flex: 1 1 100%; font-size: 12px; }
  .tbar-mini, .tbar-save { max-width: 100%; }
  .tbar-mini .mini-kpi { max-width: 48%; }
  .tbar-save { margin-left: 0; font-size: 11.5px; }
  .inspector-head { padding: 10px 12px; }
  .live-cue { margin-left: 0; }
  .role-badge { max-width: 100%; white-space: normal; }
  .inspector-scroll-body { padding: 10px 12px 20px; }
  .chip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .reset-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reset-row .btn-secondary { white-space: normal; }
  .trust-reassurance-bar { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .dock-jump-shelf { padding: 8px 12px; }
  .deliverable-zone { padding: 0 12px 24px; }
  .dock-verdict { flex-wrap: wrap; }
  .kpi-strip { justify-self: stretch; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi { padding: 2px 6px; }
  .blocker-jump { width: 100%; }
  .dock-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dock-actions .btn-primary, .dock-actions .btn-secondary { white-space: normal; }
  .dock-scroll-cue { grid-column: 1 / -1; }
  .deliverable-sheet { padding: 12px; }
  .stb-cell { padding: 8px; }
  .sheet-title { font-size: 19px; }

  .schedule-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .schedule-table, .schedule-table tbody { display: block; }
  .schedule-table tr.sched-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 10px 6px;
    border-bottom: 1px solid var(--grid);
    min-width: 0;
  }
  .schedule-table tr.sched-row td {
    display: block;
    padding: 0 6px 0 0;
    border: 0;
    font-size: 0.82rem;
    min-width: 0;
  }
  .schedule-table tr.sched-row td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .schedule-table tr.sched-row td.col-num { display: none; }
  .schedule-table td.col-sys { grid-column: 1 / 3; }
  .schedule-table td.col-state { grid-column: 3; text-align: right; }
  .schedule-table .col-read { text-align: left; padding-right: 6px; }
  .schedule-table tr.sched-empty, .schedule-table tr.sched-empty td { display: block; }

  .line-btn { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .sig-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cert-seal { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .seal-actions .btn-primary, .seal-actions .btn-secondary { flex: 1 1 100%; }
  .dialog-actions .btn-primary, .dialog-actions .btn-secondary { flex: 1 1 100%; }
  .ec-dialog { padding: 0 14px 14px; }
  .dialog-head { margin: 0 -14px 12px; padding-left: 14px; }
  .free-vs-pro-table { font-size: 12.5px; }
  .free-vs-pro-table th, .free-vs-pro-table td { padding: 6px 4px; }
}

@media (max-width: 420px) {
  .tb-brand { grid-column: 1 / -1; grid-row: 1; padding: 8px 12px 4px; border-right: 0; }
  .tb-meta:not(.tb-status) { grid-column: 1; grid-row: 2; padding: 4px 12px 6px; }
  .tb-stamp { grid-column: 2; grid-row: 2; padding: 4px 8px; border-top: 1px solid rgba(240, 249, 255, 0.18); }
  .tb-status { grid-column: 1 / -1; grid-row: 3; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 4px 12px 6px; }
  .pro-stamp { padding: 6px 10px; font-size: 11px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- print ---------- */

@media print {
  @page { margin: 12mm; }
  html, body { height: auto !important; overflow: visible !important; background: #FFFFFF !important; color: #111827 !important; }
  body { display: block !important; padding: 0 !important; }
  .app-header-stack, .title-block, .unified-toolbar, .workflow-bar, .inspector-pane, .deliverable-dock,
  .cockpit-horizon-bar, .mobile-hud, .toast, dialog, .skip-link, .cert-seal, .corner-mark, .sheet-note,
  button, [role="button"], .btn-primary, .btn-secondary, .math-summary svg { display: none !important; }
  .workbench { display: block !important; padding: 0 !important; }
  .deliverable-zone { display: block !important; height: auto !important; overflow: visible !important; border: 0 !important; padding: 0 !important; margin: 0 !important; -webkit-mask-image: none !important; mask-image: none !important; background: #FFFFFF !important; }
  #executive-deliverable { display: block !important; border: 0; padding: 0; margin: 0; background: #FFFFFF !important; color: #111827 !important; }
  #executive-deliverable * { color: #111827 !important; background: transparent !important; box-shadow: none !important; }
  .sheet-titleblock, .verdict-banner, .sheet-subgrid, .schedule-table th { border-color: #111827 !important; }
  .print-stamp { display: block !important; margin: 8px 0 0; padding: 4px 10px; border: 2px solid #111827; font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.1em; width: fit-content; }
  .print-stamp[hidden] { display: none !important; }
  .table-wrap { overflow: visible !important; }
  .schedule-table { display: table !important; }
  .schedule-table thead { display: table-header-group !important; position: static !important; width: auto !important; height: auto !important; clip: auto !important; }
  .schedule-table tbody { display: table-row-group !important; }
  .schedule-table tr, .schedule-table tr.sched-row { display: table-row !important; break-inside: avoid; page-break-inside: avoid; }
  .schedule-table td, .schedule-table tr.sched-row td { display: table-cell !important; padding: 5px 6px !important; border-bottom: 1px solid #9CA3AF !important; font-size: 10.5pt !important; }
  .schedule-table td::before { content: none !important; }
  .schedule-table td.col-num { display: table-cell !important; }
  .sheet-subgrid { break-inside: avoid; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .line-print, .audit-print { display: grid !important; gap: 8px; padding: 3px 0; border-bottom: 1px solid #9CA3AF; font-size: 10.5pt; line-height: 1.35; break-inside: avoid; }
  .line-print { grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr); }
  .audit-print { grid-template-columns: 52px minmax(0, 1fr); }
  .math-details { border: 1px solid #111827 !important; }
  .math-details:not([open]) { display: none !important; }
  .stb-head .role-badge, .stb-head .io-tag { display: none !important; }
  .free-watermark { display: block !important; font-size: 10pt; border-top: 1px dashed #111827 !important; }
  a { text-decoration: none; }
}

/* mobile masthead compaction (reviewer 2026-10-19) */

@media (max-width: 600px) {
  .title-block { padding-top: 6px !important; padding-bottom: 6px !important; }
  .title-block .tb-cell { padding-top: 2px; padding-bottom: 2px; }
  .title-block .nav-tools-link { min-height: 22px; padding: 2px 8px !important; font-size: 11px; }
  .title-block button, .title-block .btn { margin-top: 2px; }
}
