/* Commercial Cleaning Scope Builder - manifest workbench */
:root {
  --canvas: #E2E8F0;
  --paper: #FFFFFF;
  --mast: #1E293B;
  --mast-ink: #F8FAFC;
  --ink: #0F172A;
  --muted: #334155;
  --cta: #B45309;
  --cta-ink: #FFFFFF;
  --accent: #0369A1;
  --grid: #64748B;
  --control: #475569;
  --tint: #F1F5F9;
  --hold: #B91C1C;
  --hold-ink: #7F1D1D;
  --hold-bg: #FEF2F2;
  --warn-ink: #78350F;
  --warn-bg: #FFFBEB;
  --ok-ink: #166534;
  --ok-bg: #F0FDF4;
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Mulish', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Cousine', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --gap: 0.5rem;
}

*,
*::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: 0.95rem;
  line-height: 1.5;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: 0.01em; }
p { margin: 0; }

.mono,
.kpi-value,
.ledger .num,
input.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 0.75rem; top: -60px; z-index: 100;
  background: var(--paper); color: var(--ink); padding: 0.6rem 0.9rem;
  border: 2px solid var(--mast);
}
.skip-link:focus { top: 0.5rem; }

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

/* ---------- Controls ---------- */
button,
[data-preset-chip],
.preset-chip,
label.dropzone-trigger,
a[data-checkout],
select,
input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 44px;
  padding-top: 6px;
  padding-bottom: 6px;
}

button,
a[data-checkout],
[role="button"],
summary,
select { cursor: pointer; }

button {
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding-left: 14px;
  padding-right: 14px;
  white-space: nowrap;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--control);
  transition: background-color 0.12s ease, box-shadow 0.12s ease, transform 0.06s ease;
}
button:hover { background: var(--tint); }
button:active { transform: translateY(1px); background: #E2E8F0; }

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid #475569;
  border-radius: 2px;
  padding-left: 10px;
  padding-right: 10px;
  width: 100%;
  min-width: 0;
}
textarea { padding: 8px 10px; resize: vertical; min-height: 88px; line-height: 1.45; }
select { padding-right: 2rem; }
input::placeholder, textarea::placeholder { color: #475569; opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
input:active, select:active { border-color: var(--accent); }

.btn-primary,
.btn-primary-solid {
  background: var(--cta);
  color: var(--cta-ink);
  border: 1.5px solid #92400E;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 18px;
  padding-right: 18px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 2px;
}
.btn-primary:hover,
.btn-primary-solid:hover { background: #92400E; }
.btn-primary:active,
.btn-primary-solid:active { background: #78350F; transform: translateY(1px); }

.btn-secondary { background: var(--paper); color: var(--ink); }
.btn-secondary:active { background: var(--tint); }

.btn-math {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFBEB;
  color: #92400E;
  border: 1.5px solid var(--cta);
  font-weight: 800;
  cursor: pointer;
}
.btn-math:hover { background: #FEF3C7; }
.btn-math:active { background: #FDE68A; }

.btn-ghost { background: var(--paper); }
.btn-ghost:active { background: var(--tint); }

.btn-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-left: 6px;
  padding-right: 6px;
}
.btn-link:hover { background: var(--tint); }
.btn-link:active { color: #075985; }

.btn-icon { padding-left: 10px; padding-right: 10px; }

/* ---------- Role badges ---------- */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.3;
}
.role-badge-in { background: #E0F2FE; color: #075985; border: 1.5px solid #0369A1; }
.role-badge-out { background: #1E293B; color: #F8FAFC; border: 1.5px solid #0F172A; }

/* ---------- Header stack ---------- */
.app-header-stack { flex-shrink: 0; position: relative; z-index: 40; }

header {
  background-color: #1E293B;
  color: #F8FAFC;
}

.manifest-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 2fr) auto;
  border-bottom: 2px solid #0F172A;
}
.mast-cell {
  padding: 8px 14px;
  border-right: 2px solid #475569;
  min-width: 0;
}
.mast-cell:last-child { border-right: 0; }
.mast-brand { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  max-height: 52px;
  line-height: 1.2;
}
.wordmark svg { flex: 0 0 auto; }
.mast-subtitle { font-size: 0.8rem; line-height: 1.4; color: #E2E8F0; }
.mast-meta {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-right: 2px solid #475569;
}
.mast-meta .mast-cell { display: flex; flex-direction: column; justify-content: center; }
.mast-meta .mast-cell:last-child { border-right: 0; }
.mast-meta dt {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #CBD5E1;
}
.mast-meta dd {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #F8FAFC;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mast-status dd { white-space: normal; overflow: visible; line-height: 1.25; }
.mast-gate { display: flex; align-items: center; }
.chip-short { display: none; }
.btn-gate {
  background: var(--cta);
  color: #FFFFFF;
  border: 1.5px solid #FDE68A;
  white-space: nowrap;
  max-height: 50px;
}
.btn-gate:hover { background: #92400E; }
.btn-gate:active { background: #78350F; }

.manifest-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 6px 14px;
  min-height: 46px;
  background: var(--paper);
  border-bottom: 1.5px solid var(--grid);
}
.scenario-strip,
.chip-row,
.reset-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.scenario-strip { gap: 6px 10px; }
.scenario-caption {
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.preset-chip {
  font-size: 0.84rem;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: 999px;
  background: var(--paper);
}
.preset-chip[aria-pressed="true"] {
  background: #0369A1;
  border-color: #0C4A6E;
  color: #FFFFFF;
}
.preset-chip[aria-pressed="true"]::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #FFFFFF;
}
.preset-chip:active { transform: translateY(1px); }
.sample-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1.5px dashed #92400E;
  color: #78350F;
  background: #FFFBEB;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sample-badge[hidden] { display: none; }
.reset-group button { font-size: 0.84rem; }

.workflow-bar {
  background: var(--tint);
  border-bottom: 2px solid var(--mast);
  padding: 0 14px;
}
.workflow-bar ol {
  list-style: none;
  margin: 0;
  padding: 5px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.workflow-bar li { display: inline-flex; align-items: center; gap: 6px; }
.workflow-bar .mono { color: var(--accent); font-weight: 700; }
.flow-arrow { color: var(--grid); }

/* ---------- Workspace ---------- */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: start;
}

.inspector-pane,
.inventory {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #FFFFFF;
  border-right: 2px solid var(--mast);
  min-width: 0;
}

.inventory-header-dock {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--grid);
  background: var(--paper);
}
.live-note { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.undo-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 2px 4px 2px 10px;
  border: 1.5px solid var(--accent);
  background: #F0F9FF;
  font-size: 0.82rem;
  color: #0C4A6E;
  font-weight: 700;
  max-width: 100%;
}
.undo-notice[hidden] { display: none; }
.btn-undo { min-height: 44px; font-size: 0.82rem; padding-left: 10px; padding-right: 10px; }

.inspector-scroll-body,
.inventory-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 12px 18px 64px;
}

.inventory-bottom-shelf,
.dock-jump-shelf {
  flex: 0 0 auto;
}
.inventory-bottom-shelf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 8px 18px;
  border-top: 2px solid var(--mast);
  background: var(--tint);
}
.shelf-status { font-size: 0.8rem; color: var(--muted); }

.trust-reassurance-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 7px 12px;
  margin-bottom: 14px;
  border: 1.5px solid #15803D;
  background: var(--ok-bg);
  color: #14532D;
}
.trust-badge {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: #166534;
  color: #FFFFFF;
  padding: 2px 8px;
  white-space: nowrap;
}
.trust-reassurance-bar p { font-size: 0.8rem; font-weight: 600; flex: 1 1 260px; min-width: 0; }

/* Instrument decks: open sections separated by hairlines, no nested boxes */
.deck {
  border: 0;
  border-top: 2px solid var(--mast);
  margin: 0 0 18px;
  padding: 10px 0 4px;
  min-width: 0;
  scroll-margin-top: 12px;
}
.deck-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 8px 0 0;
  margin-bottom: 8px;
  color: var(--ink);
}
.deck-help { font-size: 0.84rem; color: var(--muted); margin: 0 0 10px; }

.field-pair,
.prop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label,
.cell-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.req,
.opt {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.req { color: #9A3412; }
.opt { color: var(--muted); }
.field-hint { font-size: 0.78rem; color: var(--muted); line-height: 1.35; }

.validation-cue {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hold-ink);
}
.validation-cue[hidden] { display: none; }
.validation-cue::before { content: '!'; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--hold); color: #FFFFFF; font-size: 0.7rem; }
.is-missing,
input.is-missing,
select.is-missing,
[aria-invalid="true"] {
  border-color: var(--hold) !important;
  box-shadow: inset 0 0 0 1px var(--hold);
  background: #FFF7F7;
}

.prop-collapsible { margin-top: 12px; border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); }
.step-tab {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 2px;
  font-weight: 700;
  font-size: 0.86rem;
}
.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:active { background: var(--tint); }
.prop-collapsible .prop-grid { padding: 4px 0 14px; }
/* Collapsed rows leave layout entirely so they never sit under the next deck legend */
.prop-collapsible:not([open]) > .prop-grid { display: none; }

/* Money input: flex wrapper, prefix in normal flow */
.money-field {
  display: flex;
  align-items: stretch;
  border: 1.5px solid #475569;
  border-radius: 2px;
  background: var(--paper);
  min-width: 0;
}
.money-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink);
  background: var(--tint);
  border-right: 1.5px solid #475569;
}
.money-field input:not([type="checkbox"]):not([type="radio"]) { border: 0; flex: 1 1 auto; }
.money-field:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }
.money-field input:focus-visible { outline: none; }
.is-locked,
input[data-pro-locked] { background: #F8FAFC; }
.lock-note { display: flex; align-items: flex-start; gap: 6px; font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.lock-note svg { flex: 0 0 auto; margin-top: 1px; }

.rate-card { margin: 14px 0; padding: 10px 0; border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); }
.rate-card-title { font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.rate-grid { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; font-size: 0.8rem; }
.rate-grid div { min-width: 0; }
.rate-grid dt { color: var(--muted); font-family: var(--font-body); font-size: 0.74rem; font-weight: 700; }
.rate-grid dd { margin: 0; font-weight: 700; }
.rate-note { margin-top: 8px; font-size: 0.78rem; color: var(--muted); }

/* ---------- Area schedule (inline spreadsheet) ---------- */
.schedule-wrap { border: 2px solid var(--mast); min-width: 0; }
.manifest-schedule {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.manifest-schedule thead th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ink);
  background: var(--canvas);
  padding: 5px 8px;
  border: 1px solid var(--grid);
}
.manifest-schedule td,
.manifest-schedule tbody th {
  padding: 5px 6px;
  border: 1px solid var(--grid);
  vertical-align: top;
}
.manifest-schedule tbody.area-record { border-bottom: 2px solid var(--mast); }
.manifest-schedule tbody.area-record:last-child { border-bottom: 0; }
.manifest-schedule tbody th.line-cell { padding: 3px 6px 3px 10px; background: var(--tint); }
.line-cell { text-align: left; }
.line-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.line-no { font-family: var(--font-mono); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em; }
.btn-remove { display: inline-flex; align-items: center; gap: 6px; padding-left: 10px; padding-right: 12px; border-color: var(--control); cursor: pointer; }
.btn-remove:active { background: var(--hold-bg); }
.cell-label { display: block; margin-bottom: 3px; }
.manifest-schedule .validation-cue { margin-top: 3px; }
.manifest-schedule tr.flash-recalc td { animation: none; }

.restroom-line { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--grid); }
.restroom-title { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

.mobile-verdict-strip { display: none; }

/* ---------- Deliverable zone ---------- */
.deliverable-zone {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  min-width: 0;
  padding-bottom: 64px;
  background: var(--canvas);
  /* Scrolled-into-view targets land below the sticky verdict dock. */
  scroll-padding-top: calc(var(--verdict-dock-h, 240px) + 12px);
}
.deliverable-zone [data-source-field] { scroll-margin-top: 12px; scroll-margin-bottom: 12px; }

.verdict-dock {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 2px solid var(--mast);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.verdict-main { display: flex; flex-direction: column; gap: 8px; }
.verdict-state {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.3;
  border: 2px solid var(--control);
  border-left-width: 6px;
  background: var(--tint);
  color: var(--ink);
}
.state-icon { flex: 0 0 auto; }
.verdict-dock[data-state="incomplete"] .verdict-state { background: var(--hold-bg); color: var(--hold-ink); border-color: var(--hold); }
.verdict-dock[data-state="review"] .verdict-state { background: var(--hold-bg); color: var(--hold-ink); border-color: var(--hold); }
.verdict-dock[data-state="ready"] .verdict-state { background: var(--ok-bg); color: var(--ok-ink); border-color: #15803D; }

.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  border-left: 3px solid var(--accent);
  background: #F8FAFC;
  min-width: 0;
}
.kpi:hover { background: #F0F9FF; }
.kpi:active { background: #E0F2FE; }
.kpi-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-size: 1.15rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.kpi-sub { font-size: 0.72rem; color: var(--muted); }

.dock-actions { display: flex; flex-wrap: wrap; gap: var(--gap); }
.dock-guidance {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 0.84rem;
  color: var(--muted);
  border-top: 1px solid #CBD5E1;
  padding-top: 4px;
}
.guidance-text { flex: 1 1 auto; min-width: 0; }
.btn-link[hidden] { display: none; }

#executive-deliverable { position: static; padding: 16px 16px 0; }
.deliverable-sheet {
  position: static;
  background: var(--paper);
  border: 2px solid var(--mast);
  padding: 1.75rem 1.75rem 2.25rem;
  box-shadow: 4px 4px 0 rgba(15, 23, 42, 0.12);
}
.sheet-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.validity-stamp {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 2px solid var(--hold);
  color: var(--hold);
}
.validity-stamp[data-stamp="ready"] { border-color: var(--accent); color: #075985; }
.deliverable-sheet h2 { font-size: 1.45rem; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 14px; }
.deliverable-sheet h2:focus { outline: none; }
.deliverable-sheet h2:focus-visible { outline: 3px solid var(--accent); }

.title-block {
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 2px solid var(--mast);
  border-left: 1px solid var(--grid);
}
.title-block > div {
  padding: 6px 10px;
  border-right: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
  min-width: 0;
}
.title-block dt { font-family: var(--font-display); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.title-block dd { margin: 0; font-weight: 700; font-size: 0.88rem; overflow-wrap: anywhere; }

.notice-slot { min-height: 3.25rem; margin-bottom: 6px; display: flex; flex-direction: column; gap: 6px; }
.awaiting-banner {
  padding: 10px 12px;
  border: 1.5px dashed var(--control);
  background: var(--tint);
  font-weight: 700;
  color: var(--ink);
}
.awaiting-banner[hidden],
.hold-banner[hidden],
.warn-banner[hidden] { display: none; }
.hold-banner {
  padding: 10px 12px;
  border: 2px solid var(--hold);
  border-left-width: 6px;
  background: var(--hold-bg);
  color: var(--hold-ink);
  font-size: 0.86rem;
}
.warn-banner {
  padding: 8px 12px;
  border: 1.5px solid var(--cta);
  border-left-width: 4px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 0.84rem;
}
.hold-banner strong,
.warn-banner strong { display: block; font-weight: 800; }
.hold-banner ul,
.warn-banner ul { margin: 4px 0 0; padding-left: 1.1rem; }

.sheet-part { margin-top: 18px; min-width: 0; }
.sheet-part h3 {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-bottom: 5px;
  margin-bottom: 6px;
  border-bottom: 2px solid var(--mast);
}
.ledger { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.ledger th,
.ledger td { padding: 6px 8px; border-bottom: 1px solid #CBD5E1; text-align: left; vertical-align: top; }
.ledger thead th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1.5px solid var(--grid);
  white-space: nowrap;
}
.ledger tbody th { font-weight: 700; }
.ledger .num { text-align: right; white-space: nowrap; }
.ledger .basis { color: var(--muted); font-size: 0.8rem; }
.ledger .row-total th,
.ledger .row-total td { border-top: 2px solid var(--mast); border-bottom: 2px solid var(--mast); font-weight: 800; color: var(--ink); background: #F8FAFC; }
.ledger tfoot th,
.ledger tfoot td { border-top: 2px solid var(--mast); font-weight: 800; }
.ledger tr[tabindex]:hover,
[data-source-field][tabindex]:hover { background: #F0F9FF; }
.ledger tr[tabindex]:active,
[data-source-field][tabindex]:active { background: #E0F2FE; }
.ledger-scroll { overflow-x: auto; max-width: 100%; }
.ledger-lines { font-size: 0.82rem; table-layout: fixed; min-width: 672px; }
.ledger-lines thead th { white-space: normal; overflow-wrap: anywhere; }
.ledger-lines td,
.ledger-lines th { overflow-wrap: anywhere; }
.ledger-lines tbody td:nth-child(3) { white-space: normal; }
.ledger-lines thead th:nth-child(1) { width: 44px; }
.ledger-lines thead th:nth-child(3) { width: 84px; }
.ledger-lines thead th:nth-child(4) { width: 96px; }
.ledger-lines thead th:nth-child(5) { width: 72px; }
.ledger-lines thead th:nth-child(6) { width: 60px; }
.ledger-lines thead th:nth-child(7) { width: 96px; }
.ledger-lines th,
.ledger-lines td { padding: 6px 6px; }
.ledger-lines .area-cell { min-width: 9rem; }
.line-name { margin-bottom: 2px; }
.cat-chip { margin: 1px 0 2px; }
.cat-chip { display: inline-block; padding: 1px 7px; font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; border: 1.5px solid var(--control); }
.cat-chip[data-cond="heavy"] { border-color: var(--hold); color: var(--hold-ink); background: var(--hold-bg); }
.cat-chip[data-cond="moderate"] { border-color: var(--cta); color: var(--warn-ink); background: var(--warn-bg); }
.cat-chip[data-cond="light"] { border-color: var(--accent); color: #075985; background: #F0F9FF; }
.line-name { display: block; font-weight: 700; }
.line-note { display: block; font-size: 0.76rem; color: var(--muted); line-height: 1.35; }
.line-note[hidden] { display: none; }
.deliverable-sheet { display: flex; flex-direction: column; }
.deliverable-sheet > .sheet-foot { margin-top: 22px; }
.row-excluded td, .row-excluded th { color: var(--muted); font-style: italic; }

.sheet-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.ledger.compact td.num { width: 40%; }
.ledger-count { font-size: 0.84rem; font-weight: 800; margin-bottom: 4px; }
.open-items { margin: 0; padding-left: 1.2rem; font-size: 0.84rem; display: flex; flex-direction: column; gap: 4px; }
.open-items li[data-kind="blocker"]::marker { color: var(--hold); }
.open-items .item-tag { font-weight: 800; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.06em; margin-right: 4px; }
.open-items button { min-height: 44px; }

.proposal-notes { padding: 8px 10px; border-left: 3px solid var(--grid); background: #F8FAFC; font-size: 0.88rem; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 8px; }
.verify-list { margin: 0; padding-left: 1.2rem; font-size: 0.84rem; color: var(--ink); display: flex; flex-direction: column; gap: 3px; }
.sheet-foot { margin-top: 22px; padding-top: 12px; border-top: 2px solid var(--mast); display: flex; flex-direction: column; gap: 6px; }
.disclaimer { font-size: 0.78rem; color: var(--muted); }
.prepared-line { font-size: 0.78rem; color: var(--muted); }
.free-watermark {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1.5px dashed var(--grid);
  padding: 6px 10px;
  text-align: center;
}

.seal-preview {
  margin: 16px;
  padding: 1.25rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  border-top: 2px solid var(--mast);
  border-bottom: 1px solid var(--grid);
  font-size: 0.84rem;
  color: var(--ink);
}
.seal-mark { color: #92400E; flex: 0 0 auto; }
.seal-copy { flex: 1 1 240px; min-width: 0; }
.seal-title { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

.flash-recalc { animation: flash-recalc 0.9s ease-out; }
@keyframes flash-recalc {
  0% { box-shadow: 0 0 0 4px rgba(3, 105, 161, 0.55); background-color: #E0F2FE; }
  100% { box-shadow: 0 0 0 0 rgba(3, 105, 161, 0); }
}

/* ---------- Horizon bar and HUD ---------- */
.cockpit-horizon-bar {
  flex: 0 0 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  background: var(--mast);
  color: #E2E8F0;
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
}
.cockpit-horizon-bar span { display: inline-flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: clip; }
.mobile-report-hud { display: none; }

/* ---------- Dialogs ---------- */
.modal {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 20px 22px;
  border: 2px solid var(--mast);
  border-radius: 2px;
  color: var(--ink);
  background: var(--paper);
  overflow: auto;
}
.modal::backdrop { background: rgba(15, 23, 42, 0.62); }
.modal-small { width: min(460px, calc(100vw - 24px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal h2 { font-size: 1.3rem; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.04em; }
.modal-small h2 { margin-bottom: 8px; }
.modal-lede { font-size: 0.9rem; margin-bottom: 12px; }
.table-scroll { overflow-x: auto; }
.free-vs-pro-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; color: #0F172A; background: #FFFFFF; }
.free-vs-pro-table th,
.free-vs-pro-table td { border: 1px solid var(--grid); padding: 8px 10px; text-align: left; vertical-align: top; }
.free-vs-pro-table thead th { background: #1E293B; color: #F8FAFC; font-family: var(--font-display); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.74rem; }
.free-vs-pro-table tbody th { background: var(--tint); }
.modal-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.modal-fine { font-size: 0.78rem; color: var(--muted); flex: 1 1 220px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- Desktop cockpit ---------- */
@media (min-width: 901px) {
  html,
  body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  body { display: flex; flex-direction: column; }
  .workspace {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
  }
  .inspector-pane,
  .deliverable-zone { height: 100%; }

  [data-scroll-fade] {
    -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%);
  }
  [data-scroll-fade].is-at-end {
    -webkit-mask-image: none;
    mask-image: none;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select { min-width: 180px; }
  .seal-preview { padding-top: 1.5rem; padding-bottom: 2.5rem; }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .manifest-masthead { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.6fr) auto; }
  .wordmark { font-size: 0.98rem; letter-spacing: 0.03em; }
  .mast-subtitle { font-size: 0.76rem; }
  .rate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-pair { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Tablet & mobile: natural document flow ---------- */
@media (max-width: 900px) {
  html,
  body { height: auto; overflow: visible; }
  body { padding-bottom: 72px; }
  .workspace { display: block; }
  .inspector-pane,
  .inventory { height: auto; overflow: visible; border-right: 0; border-bottom: 2px solid var(--mast); }
  .inspector-scroll-body,
  .inventory-scroll-body { overflow: visible; padding-bottom: 16px; }
  .deliverable-zone { height: auto; overflow: visible; padding-bottom: 16px; scroll-padding-top: 0; }
  .verdict-dock { position: static; }
  .cockpit-horizon-bar { display: none; }
  .mobile-verdict-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 16px;
    padding: 12px;
    border: 2px solid var(--mast);
    background: var(--tint);
  }
  .mv-item { display: flex; flex-direction: column; min-width: 0; }
  .mv-label { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
  .mv-value { font-weight: 800; font-size: 0.9rem; overflow-wrap: anywhere; }
  .mobile-verdict-strip[data-state="incomplete"] .mv-state .mv-value,
  .mobile-verdict-strip[data-state="review"] .mv-state .mv-value { color: var(--hold-ink); }
  .mobile-verdict-strip[data-state="ready"] .mv-state .mv-value { color: var(--ok-ink); }
  .mobile-report-hud {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 10px;
    z-index: 60;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    white-space: nowrap;
    overflow: hidden;
    background: #1E293B;
    color: #F8FAFC;
    border: 2px solid #0F172A;
    font-family: var(--font-display);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.9rem;
  }
  .mobile-report-hud:hover { background: #0F172A; }
  .mobile-report-hud:active { background: #0F172A; transform: translateY(1px); }
  .workflow-bar { display: none; }
}

@media (max-width: 680px) {
  fieldset [class*="grid"],
  form [class*="grid"],
  .field-pair,
  .prop-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .mobile-verdict-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manifest-masthead { grid-template-columns: minmax(0, 1fr) auto; }
  .mast-brand { grid-column: 1 / -1; border-right: 0; border-bottom: 2px solid #475569; padding: 8px 12px; }
  .wordmark { font-size: 1rem; letter-spacing: 0.04em; }
  .mast-subtitle { font-size: 0.76rem; }
  .mast-meta { grid-template-columns: minmax(0, 1fr); }
  .mast-meta .mast-site,
  .mast-meta .mast-form { display: none; }
  .mast-status { flex-direction: row !important; flex-wrap: wrap; align-items: baseline !important; gap: 2px 8px; }
  .chip-long { display: none; }
  .chip-short { display: inline; }
  .scenario-caption { flex: 0 1 auto; }
  .mast-cell { padding: 6px 12px; }
  .mast-gate { padding: 6px 12px; }
  .btn-gate { padding-left: 10px; padding-right: 10px; font-size: 0.8rem; }
  .manifest-toolbar { padding: 6px 12px; }
  .scenario-strip,
  .reset-group { width: 100%; }
  .reset-group button { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; font-size: 0.8rem; white-space: normal; line-height: 1.2; }
  .preset-chip { font-size: 0.8rem; padding-left: 10px; padding-right: 10px; }
  .chip-row { flex: 1 1 100%; }
  .inventory-header-dock { padding: 6px 12px; }
  .inspector-scroll-body,
  .inventory-scroll-body { padding: 12px 12px 16px; }
  .inventory-bottom-shelf { padding: 8px 12px; }
  .trust-reassurance-bar { padding: 6px 12px; margin-bottom: 12px; }
  .trust-reassurance-bar { display: block; }
  .trust-reassurance-bar .trust-badge { display: inline-block; margin-right: 6px; }
  .trust-reassurance-bar p { display: inline; font-size: 0.76rem; }
  .undo-notice { margin-left: 0; }

  /* Schedule rows become labeled stacked records */
  .schedule-wrap { border-width: 2px; }
  .manifest-schedule,
  .manifest-schedule tbody,
  .manifest-schedule tr,
  .manifest-schedule td,
  .manifest-schedule tbody th { display: block; width: 100%; }
  .manifest-schedule thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .manifest-schedule tbody.area-record { padding: 0; border-bottom: 2px solid var(--mast); }
  .manifest-schedule td,
  .manifest-schedule tbody th { border: 0; border-bottom: 1px solid #CBD5E1; padding: 8px 12px; }
  .manifest-schedule tbody th.line-cell { padding: 6px 12px; }
  .cell-label.sr-only-desktop { position: static !important; width: auto; height: auto; margin: 0 0 3px; clip: auto; overflow: visible; white-space: normal; }

  .verdict-dock { padding: 12px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:first-child { grid-column: 1 / -1; }
  .dock-actions button { flex: 1 1 auto; }
  #executive-deliverable { padding: 12px 12px 0; }
  .deliverable-sheet { padding: 16px 12px 20px; }
  .deliverable-sheet h2 { font-size: 1.2rem; }
  .title-block { grid-template-columns: minmax(0, 1fr); }
  .sheet-pair { grid-template-columns: minmax(0, 1fr); }
  .seal-preview { margin: 12px; padding: 12px; }
  .modal { padding: 16px 12px; }
}

@media (min-width: 681px) {
  .cell-label.sr-only-desktop {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}

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

/* ---------- Print: only the deliverable ---------- */
@media print {
  @page { margin: 14mm; }
  html,
  body { height: auto !important; overflow: visible !important; background: #FFFFFF !important; color: #111827 !important; padding: 0 !important; display: block !important; }
  .app-header-stack,
  header,
  nav,
  .inspector-pane,
  .verdict-dock,
  .seal-preview,
  .cockpit-horizon-bar,
  .mobile-report-hud,
  .skip-link,
  dialog,
  .undo-notice,
  [data-mobile-verdict],
  .btn-link,
  button { display: none !important; }
  .workspace { display: block !important; }
  .deliverable-zone { height: auto !important; overflow: visible !important; padding: 0 !important; background: #FFFFFF !important; -webkit-mask-image: none !important; mask-image: none !important; }
  #executive-deliverable { padding: 0 !important; }
  .deliverable-sheet { border: 0; box-shadow: none; padding: 0; color: #111827; background: #FFFFFF; }
  .deliverable-sheet * { color: #111827 !important; background: #FFFFFF !important; box-shadow: none !important; }
  .role-badge-out { border-color: #111827; }
  .validity-stamp { border-color: #111827 !important; }
  .ledger-scroll { overflow: visible; }
  .ledger-lines { min-width: 0 !important; }
  .sheet-part { break-inside: avoid; }
  .free-watermark { border-color: #111827; }
}

/* Compact mobile header rhythm so Step 01 inputs start high on small screens */
@media (max-width: 680px) {
  .mast-brand { padding: 6px 12px; }
  .mast-cell,
  .mast-gate { padding-top: 3px; padding-bottom: 3px; }
  .manifest-toolbar { padding: 4px 12px; gap: 4px 12px; }
  .scenario-strip { gap: 4px 8px; }
  .inventory-header-dock { padding: 3px 12px; }
  .inspector-scroll-body,
  .inventory-scroll-body { padding-top: 8px; }
  .trust-reassurance-bar { padding: 5px 12px; margin-bottom: 8px; line-height: 1.35; }
  .trust-reassurance-bar p { font-size: 0.74rem; }
  .deck { padding-top: 6px; }
  .field label { line-height: 1.2; }
}

@media (max-width: 400px) {
  .inventory-header-dock { gap: 4px 8px; padding: 3px 10px; }
  .live-note { font-size: 0.72rem; }
  .role-badge { letter-spacing: 0.06em; }
  .mast-subtitle { font-size: 0.74rem; line-height: 1.35; }
  .trust-reassurance-bar { padding: 4px 10px; }
  .trust-reassurance-bar p { font-size: 0.72rem; }
  .deck-title { font-size: 0.9rem; }
}

.verdict-dock[data-state="awaiting"] .state-icon { display: none; }

/* Mobile masthead stays within a 100px band: drop the redundant subtitle line and header submit actions */
@media (max-width: 640px) {
  .mast-subtitle,
  .header-submit-btn { display: none; }
  .mast-brand { padding-top: 5px; padding-bottom: 5px; }
}

@media screen and (min-width: 901px) {
  main#workspace, main.workspace { flex: 1 1 0%; min-height: 0; overflow: hidden; }
}


/* accessibility-guard:2026-10-22 */
@media (max-width: 900px) {
  button,
  a.btn,
  [role="button"],
  select,
  input[type="button"],
  input[type="submit"],
  .masthead .nav-tools-link,
  a.nav-tools-link,
  .nav-tools-link,
  a.jump-tool-btn,
  .jump-tool-btn,
  .preset-chip,
  [data-preset-chip],
  .step-chip,
  .pro-link,
  a.pro-link,
  .checkout-btn,
  a.checkout-btn,
  .masthead-actions button,
  .masthead-actions a,
  .masthead-actions .btn,
  [class*="cookie"] button,
  [id*="cookie"] button,
  .header-brand,
  a.header-brand,
  .skip-link,
  .btn-remove-row,
  .icon-btn {
    min-height: 44px !important;
  }
  .btn-remove-row,
  .icon-btn {
    min-width: 44px !important;
  }
}

/* accessibility-guard: round2 */
@media (max-width: 900px) {
  a.btn-primary, .btn-primary, a.wordmark, .wordmark { min-height: 44px !important; }
  a.wordmark, .wordmark { min-width: 44px !important; }
}
