/* Davis-Bacon WH-347 -- Architectural Blueprint & Reverse-Folio Drafting Table */
:root {
  --canvas: #CBD5E1;
  --paper: #F8FAFC;
  --drawer: #E2E8F0;
  --masthead: #0C2340;
  --masthead-ink: #F0F9FF;
  --masthead-soft: #BAE6FD;
  --ink: #0F172A;
  --muted: #334155;
  --primary: #0369A1;
  --primary-ink: #FFFFFF;
  --primary-press: #075985;
  --accent: #C2410C;
  --accent-deep: #9A3412;
  --hair: #64748B;
  --rule: 1.5px solid #475569;
  --hairline: 1px solid #64748B;
  --font-display: "Syne", "DM Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gap: 24px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable both-edges; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

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

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Title-block masthead ---------- */
.titleblock {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  background-color: #0C2340;
  color: #F0F9FF;
  border: var(--rule);
  border-top: 0;
  min-height: 48px;
  padding: 0 12px;
}
.titleblock :focus-visible { outline-color: var(--masthead-ink); }
.tb-cell { padding: 4px 12px; min-width: 0; }
.tb-brand { display: flex; flex-direction: row; align-items: baseline; gap: 10px; flex-shrink: 0; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  line-height: 1.15;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.wordmark-accent { color: #FDBA74; }
.tb-sub { font-size: 11px; color: var(--masthead-soft); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.tb-meta { display: flex; align-items: center; gap: 0; margin: 0; }
.tb-meta .tb-cell { display: flex; flex-direction: row; align-items: baseline; gap: 6px; padding: 4px 10px; border-left: 1px solid rgba(255,255,255,0.12); }
.tb-meta dt { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--masthead-soft); }
.tb-meta dd { margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--masthead-ink); white-space: nowrap; }
.tb-stamp dd { color: #FDBA74; }
.tb-cta { display: flex; align-items: center; padding: 3px 0 3px 12px; flex-shrink: 0; }
.btn-header { white-space: nowrap; min-height: 38px; max-height: 38px; padding: 6px 14px; font-size: 13px; }

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 0;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); border: 1.5px solid var(--primary); }
.btn-primary:hover { background: var(--primary-press); border-color: var(--primary-press); }
.btn-primary:active { transform: translateY(1px); background: #0C4A6E; }
.btn-secondary { background: var(--paper); color: var(--ink); border: var(--rule); }
.btn-secondary:hover { background: #FFFFFF; box-shadow: inset 0 -3px 0 var(--primary); }
.btn-secondary:active { transform: translateY(1px); background: var(--drawer); }
.btn-primary:disabled, .btn-secondary:disabled {
  background: var(--canvas);
  border-color: var(--hair);
  color: var(--muted);
  box-shadow: none;
  transform: none;
}

/* ---------- Workspace (drafting split workbench: left inspector, right sheet) ---------- */
.workspace {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(430px, 480px) minmax(0, 1fr);
  align-items: stretch;
  border-left: var(--rule);
  border-right: var(--rule);
  background: var(--paper);
}
.stage {
  min-width: 0;
  padding: 0 var(--gap) var(--gap);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(100, 116, 139, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 116, 139, 0.10) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  position: relative;
}
.stage-dock {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.stage-head-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
  flex: 1 1 auto;
}
.stage-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.live-pulse-cue {
  font-size: 11px;
  color: #0369A1;
  font-weight: 600;
}
.stage-head h1 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
}
.sheet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: var(--rule);
  background: var(--paper);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}
.kpi { padding: 8px 14px; border-right: var(--rule); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.kpi-value { font-size: 20px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; line-height: 1.3; }
.kpi-alert .kpi-value { color: var(--accent); }

/* ---------- Deliverable sheet ---------- */
#executive-deliverable {
  position: relative;
  background: var(--paper);
  border: var(--rule);
  padding: 20px 24px;
  box-shadow: 6px 6px 0 rgba(15, 23, 42, 0.12);
}
.dim-mark { position: absolute; width: 14px; height: 14px; pointer-events: none; }
.dim-tl { top: 6px; left: 6px; border-top: var(--rule); border-left: var(--rule); }
.dim-tr { top: 6px; right: 6px; border-top: var(--rule); border-right: var(--rule); }
.dim-bl { bottom: 6px; left: 6px; border-bottom: var(--rule); border-left: var(--rule); }
.dim-br { bottom: 6px; right: 6px; border-bottom: var(--rule); border-right: var(--rule); }

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: var(--rule);
  position: relative;
}
.sheet-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 5px;
  border-left: var(--rule);
  border-right: var(--rule);
}
.sheet-kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sheet-head h2 { font-size: 24px; font-weight: 700; line-height: 1.15; }
.sheet-draft-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 4px 8px;
  white-space: nowrap;
}

.meta-grid, .fringe-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0 0;
  border-top: var(--rule);
  border-left: var(--rule);
}
.fringe-grid { margin-top: 0; border-top: 0; }
.meta-cell { border-right: var(--rule); border-bottom: var(--rule); padding: 6px 12px; min-width: 0; }
.meta-wide { grid-column: span 3; }
.meta-grid .meta-cell:nth-child(7) { grid-column: span 1; }
.meta-grid .meta-cell:nth-child(8) { grid-column: span 2; }
.meta-wide dd, .fringe-grid dd { min-height: 1.4em; }
.meta-cell dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.meta-cell dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; min-height: 1.45em; }
.fringe-grid dd { text-align: right; }

.status-band {
  margin-top: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: var(--rule);
  border-left-width: 6px;
  padding: 8px 14px;
  min-height: 52px;
  background: var(--paper);
}
.status-flag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border: 1.5px solid currentColor;
  white-space: nowrap;
}
.status-text { font-size: 14px; }
.status-band[data-status="idle"], .status-band[data-status="incomplete"] { border-left-color: var(--hair); }
.status-band[data-status="idle"] .status-flag, .status-band[data-status="incomplete"] .status-flag { color: var(--muted); }
.status-band[data-status="ok"] { border-left-color: var(--primary); }
.status-band[data-status="ok"] .status-flag { color: #075985; }
.status-band[data-status="underpaid"], .status-band[data-status="invalid"] { border-left-color: var(--accent); }
.status-band[data-status="underpaid"] .status-flag, .status-band[data-status="invalid"] .status-flag { color: var(--accent); }

.schedule { margin-top: 14px; }
.schedule-pair-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 14px;
}
.schedule-pair-grid > .schedule { margin-top: 0; }
@media (min-width: 1024px) {
  .schedule-pair-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
  .schedule-pair-grid .audit-list li {
    grid-template-columns: 120px minmax(0, 1fr);
  }
}
.schedule h3, .certify h3 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  line-height: 1.2;
}
.step-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-ink);
  background: var(--primary);
  padding: 1px 6px;
  margin-right: 4px;
  letter-spacing: 0.04em;
}
.sched-no {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--drawer);
  border: 1.5px solid var(--hair);
  padding: 1px 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sched-unit { font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.certify-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.certify-head-row h3 { margin-bottom: 0; }
.certify-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.table-wrap { width: 100%; }
.sched-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border: var(--rule);
  font-size: 14px;
}
.sched-table th, .sched-table td {
  border: var(--hairline);
  padding: 5px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}
.sched-table td.num { white-space: nowrap; overflow-wrap: normal; }
.sched-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--drawer);
  border-bottom: var(--rule);
  font-weight: 700;
  white-space: nowrap;
}
.sched-table thead th:not(:first-child) { text-align: right; }
.sched-table tbody th { font-weight: 500; }
.sched-table td.num { text-align: right; }
.cols-4 col.c-label { width: 34%; }
.cols-2 col.c-label-wide { width: 66%; }
.row-total th, .row-total td { font-weight: 700; border-top: var(--rule); }
.row-sub th, .row-sub td { border-top: var(--rule); }
.row-alert th, .row-alert td { color: var(--accent); font-weight: 700; }
.cell-muted { color: var(--muted); }
td.is-short { color: var(--accent); font-weight: 700; }

.checks-table col.c-check { width: 36%; }
.checks-table col.c-result { width: 96px; }
.checks-table thead th:not(:first-child) { text-align: left; }
.checks-table td[data-check-detail] { font-size: 13px; line-height: 1.35; min-height: 0; }
.checks-table tbody tr { height: auto; }
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border: 1.5px solid #475569;
  background: var(--drawer);
  color: var(--muted);
  white-space: nowrap;
}
.pill[data-tone="pass"] { background: #E0F2FE; border-color: var(--primary); color: #0C4A6E; }
.pill[data-tone="review"] { background: #FFEDD5; border-color: var(--accent); color: var(--accent-deep); }
.pill[data-tone="flag"] { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }

.audit-list { list-style: none; margin: 0; padding: 0; border: var(--rule); counter-reset: step; }
.audit-list li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  border-bottom: var(--hairline);
}
.audit-list li:last-child { border-bottom: 0; }
.audit-key {
  padding: 5px 10px;
  border-right: var(--hairline);
  font-weight: 500;
  font-size: 13.5px;
}
.audit-key::before { content: "A" counter(step) " "; font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.audit-math { padding: 5px 10px; font-size: 13px; line-height: 1.35; min-height: 0; overflow-wrap: anywhere; }

/* ---------- Certification + stamp gate ---------- */
.certify { margin-top: 16px; }
.certify-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); border: var(--rule); }
.sign-cells { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); border-right: var(--rule); }
.sign-cell { padding: 8px 12px; border-bottom: var(--hairline); display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 52px; }
.sign-cell:last-child { border-bottom: 0; }
.sign-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.sign-line { display: block; border-bottom: 1.5px solid #475569; height: 1px; }
.seal-box { display: grid; padding: 12px; background: var(--paper); min-height: 168px; }
.seal-state { grid-area: 1 / 1; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 14px; align-items: start; }
.seal-state.is-off { visibility: hidden; }
.seal-mark {
  width: 104px;
  height: 104px;
  border: 3px double var(--accent);
  outline: 1.5px solid var(--accent);
  outline-offset: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 5px;
  transform: rotate(-4deg);
}
.seal-mark-pro { border-color: var(--primary); outline-color: var(--primary); color: #075985; transform: none; }
.seal-copy { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.seal-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.2; }
.seal-text { font-size: 14px; color: var(--muted); }
.profile-tools { display: grid; gap: 6px; width: 100%; }
.profile-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.profile-tools select {
  min-height: 44px;
  width: 100%;
  border: var(--rule);
  border-radius: 0;
  background: #FFFFFF;
  padding: 8px 10px;
  cursor: pointer;
}
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-actions .btn-secondary { padding: 8px 12px; }
.profile-msg { font-size: 13px; color: var(--muted); min-height: 1.5em; }

.sheet-footer { margin-top: 14px; border-top: var(--rule); padding-top: 10px; display: grid; gap: 6px; }
.legal-note { font-size: 13px; color: var(--muted); }
.free-watermark { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }

/* ---------- Inspector drawer (Tripartite Flex Column) ---------- */
.inspector {
  background: #E2E8F0;
  border-right: var(--rule);
  padding: 0;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: static;
  mask-image: none !important;
  -webkit-mask-image: none !important;
}

/* Tier 1: Pinned Left Inspector Top Dock */
.inspector-sticky-dock {
  flex: 0 0 auto;
  position: static;
  background: #FFFFFF;
  padding: 10px 16px;
  margin: 0;
  border-bottom: 1.5px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  z-index: 10;
}
.inspector-sticky-dock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.inspector-dock-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.inspector-dock-subcue {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Tier 2: Independently Scrollable Form Canvas */
.inspector-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 14px 18px 24px 18px;
  mask-image: linear-gradient(to bottom, black calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 24px), transparent 100%);
  transition: mask-image 0.2s ease, -webkit-mask-image 0.2s ease;
}
.inspector-scroll-body::-webkit-scrollbar {
  width: 8px;
}
.inspector-scroll-body::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-left: 1px solid #CBD5E1;
}
.inspector-scroll-body::-webkit-scrollbar-thumb {
  background: #94A3B8;
  border-radius: 4px;
  border: 2px solid #F1F5F9;
}
.inspector-scroll-body::-webkit-scrollbar-thumb:hover {
  background: #64748B;
}

/* Tier 3: Static end-of-form action shelf (in flow, never overlaps inputs) */
.inspector-bottom-shelf {
  position: static;
  margin: 18px 0 4px 0;
  padding: 14px 0 0 0;
  border-top: 1.5px solid var(--rule);
  display: flex;
  align-items: center;
}
.btn-dock-jump--shelf {
  width: 100%;
  height: 42px;
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary);
  border: 1.5px solid #093545;
  border-radius: var(--radius);
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(12, 74, 96, 0.25);
  transition: all 0.15s ease;
}
.btn-dock-jump--shelf:hover {
  background: #093545;
  box-shadow: 0 4px 10px rgba(12, 74, 96, 0.35);
  transform: translateY(-1px);
}
.btn-dock-jump-icon {
  font-size: 15px;
}
.btn-dock-jump-text {
  flex: 1;
  text-align: left;
  margin-left: 8px;
}
.btn-dock-jump-arrow {
  font-weight: 900;
  font-size: 16px;
  transition: transform 0.15s ease;
}
.btn-dock-jump--shelf:hover .btn-dock-jump-arrow {
  transform: translateX(4px);
}

.btn-return-sheet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 14px;
  background: rgba(12, 74, 96, 0.08);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  color: var(--primary);
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-return-sheet:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.insp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.insp-head h2 { font-size: 18px; font-weight: 700; line-height: 1.15; }
.insp-tag { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.preset-top-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.preset-caption { font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0; }
.btn-reset-top { padding: 8px 10px; min-height: 44px; font-size: 12px; }


.preset-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: var(--rule); margin-bottom: 18px; }
.chip {
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-right: var(--rule);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  position: relative;
}
.chip:nth-child(2n) { border-right: 0; }
.chip:nth-child(-n+2) { border-bottom: var(--rule); }
.chip:hover { background: #FFFFFF; box-shadow: inset 0 -3px 0 var(--primary); }
.chip:active { transform: translateY(1px); }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); box-shadow: inset 0 -4px 0 #0C2340; }

.insp-form { display: grid; gap: 16px; }
.prop-set { border: 0; margin: 0; padding: 0; min-width: 0; }
.prop-set legend {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.legend-tag { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }

/* ---------- Workflow Direction Bar & Role Badges ---------- */
.workflow-direction-bar {
  max-width: 1440px;
  margin: 0 auto;
  background: #0B1E36;
  border-left: var(--rule);
  border-right: var(--rule);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #94A3B8;
}
.wf-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.wf-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #F1F5F9;
}
.wf-step-input {
  color: #38BDF8;
  font-weight: 700;
}
.wf-step-input .wf-sub {
  font-size: 10px;
  font-weight: 400;
  color: #94A3B8;
}
.wf-step-engine {
  color: #FBBF24;
}
.wf-step-output {
  color: #34D399;
  font-weight: 700;
}
.wf-arrow {
  color: #94A3B8;
  font-weight: 700;
}
@media (max-width: 768px) {
  .workflow-direction-bar { padding: 5px 8px; font-size: 10px; }
  .wf-track { gap: 6px; justify-content: flex-start; }
  .wf-arrow { display: none; }
}

.role-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  line-height: 1;
}
.role-badge-in {
  background: #0369A1;
  color: #FFFFFF;
  border: 1px solid #0369A1;
}
.role-badge-out {
  background: #059669;
  color: #FFFFFF;
  border: 1px solid #047857;
  margin-right: 6px;
}
.insp-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.insp-subcue {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #475569;
  letter-spacing: 0.02em;
  margin: 4px 0 0;
  width: 100%;
}

.desktop-engine-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #065F46;
  border-radius: 2px;
  margin-top: 8px;
}
.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
}
.mobile-jump-btn { display: none; }
@media (max-width: 900px) {
  .desktop-engine-status { display: none; }
}

details.prop-collapsible {
  border: 0;
  margin: 0;
  padding: 0;
}
details.prop-collapsible > summary.prop-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: var(--paper);
  border: var(--rule);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
details.prop-collapsible > summary.prop-legend::-webkit-details-marker {
  display: none;
}
details.prop-collapsible > summary.prop-legend:hover {
  background: #FFFFFF;
  border-color: var(--primary);
}
details.prop-collapsible > summary.prop-legend:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
details.prop-collapsible[open] > summary.prop-legend {
  border-bottom: 0;
  background: #F1F5F9;
}
details.prop-collapsible .legend-toggle-icon {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: none;
  letter-spacing: 0;
}
details.prop-collapsible > summary .toggle-caret {
  display: inline-block;
  transition: transform 0.2s ease;
}
details.prop-collapsible[open] > summary .toggle-caret {
  transform: rotate(180deg);
}

/* Click-to-Edit Bridge Interactive Affordances */
[data-meta], [data-ded] {
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.meta-grid dd[data-meta]:hover {
  color: var(--primary);
  text-decoration: underline dotted var(--primary);
}
.sched-table td[data-ded]:hover {
  background-color: rgba(2, 132, 199, 0.08);
}
.prop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: var(--rule); border-left: var(--rule); }
.prop {
  border-right: var(--rule);
  border-bottom: var(--rule);
  background: var(--paper);
  padding: 8px 10px;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 5px;
  min-width: 0;
}
.prop-wide { grid-column: 1 / -1; }
.prop label { font-size: 13px; font-weight: 700; line-height: 1.3; }
.prop-input { position: relative; }
.prop-input input {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--hair);
  border-radius: 0;
  background: #FFFFFF;
  padding: 8px 10px;
  font-size: 16px;
  color: var(--ink);
}
.prop-input input::placeholder { color: #475569; }
.num-input input { font-family: var(--font-mono); text-align: right; padding-left: 28px; font-variant-numeric: tabular-nums; }
.unit {
  position: absolute;
  left: 1.5px;
  top: 1.5px;
  bottom: 1.5px;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  border-right: var(--hairline);
  pointer-events: none;
}
.prop-input input:focus { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 0; }
.prop-input input[aria-invalid="true"] { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.prop-note { display: grid; font-size: 12px; line-height: 1.35; min-height: calc(2 * 1.35em); }
.prop-note > * { grid-area: 1 / 1; }
.hint { color: var(--muted); }
.validation-cue { color: var(--accent-deep); font-weight: 700; visibility: hidden; }
.prop.is-invalid .validation-cue { visibility: visible; }
.prop.is-invalid .hint { visibility: hidden; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-note { font-size: 13px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1440px;
  margin: 0 auto;
  background: var(--masthead);
  color: var(--masthead-ink);
  border: var(--rule);
  padding: 14px 20px;
  font-size: 13px;
}

/* ---------- Guide Cue Link in Hero ---------- */
.guide-cue-link {
  display: inline-block;
  margin-left: 4px;
  color: #0369A1;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.guide-cue-link:hover {
  color: #075985;
}

/* ---------- Statutory Guide & FAQ Section ---------- */
.statutory-guide {
  max-width: 1440px;
  margin: 0 auto;
  background: #081B31;
  color: #E0F2FE;
  border: var(--rule);
  border-top: 2px solid #0284C7;
  padding: 48px 24px 56px;
  box-sizing: border-box;
}
.guide-container {
  max-width: 1140px;
  margin: 0 auto;
}
.guide-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 36px;
}
.guide-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(2, 132, 199, 0.2);
  color: #38BDF8;
  border: 1px solid rgba(2, 132, 199, 0.4);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.guide-header h2 {
  font-size: 26px;
  font-weight: 800;
  color: #F8FAFC;
  line-height: 1.25;
  margin: 0 0 10px;
}
.guide-intro {
  font-size: 15px;
  color: #94A3B8;
  line-height: 1.55;
  margin: 0;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.guide-card {
  background: #0C2340;
  border: 1px solid #1E3A8A;
  border-radius: 4px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
}
.guide-card-icon {
  font-size: 26px;
  margin-bottom: 10px;
}
.guide-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: #F8FAFC;
  margin: 0 0 10px;
  line-height: 1.3;
}
.guide-card p {
  font-size: 13.5px;
  color: #BAE6FD;
  line-height: 1.55;
  margin: 0 0 10px;
}
.guide-card p:last-child {
  margin-bottom: 0;
}
.guide-list {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 13px;
  color: #BAE6FD;
  line-height: 1.5;
}
.guide-list li {
  margin-bottom: 6px;
}
.guide-list li:last-child {
  margin-bottom: 0;
}
.guide-callout {
  margin-top: auto;
  padding: 8px 12px;
  background: rgba(2, 132, 199, 0.12);
  border-left: 3px solid #0284C7;
  font-size: 12.5px;
  color: #E0F2FE;
  line-height: 1.45;
  border-radius: 0 3px 3px 0;
}

.guide-faq-wrap {
  border-top: 1px solid #1E3A8A;
  padding-top: 36px;
  margin-bottom: 32px;
}
.guide-faq-wrap h3 {
  font-size: 22px;
  font-weight: 700;
  color: #F8FAFC;
  text-align: center;
  margin: 0 0 24px;
}
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
}
.faq-item {
  background: rgba(12, 35, 64, 0.6);
  border: 1px solid rgba(30, 58, 138, 0.6);
  border-radius: 4px;
  padding: 16px 18px;
}
.faq-item h4 {
  font-size: 14.5px;
  font-weight: 700;
  color: #F8FAFC;
  margin: 0 0 6px;
  line-height: 1.35;
}
.faq-item p {
  font-size: 13px;
  color: #94A3B8;
  line-height: 1.5;
  margin: 0;
}

.guide-action-bar {
  text-align: center;
  margin-top: 32px;
}
.guide-action-bar .btn-primary {
  min-height: 44px;
  padding: 10px 24px;
  font-size: 14px;
  background: #0369A1;
  color: #FFFFFF;
  border: 1px solid #38BDF8;
  border-radius: 3px;
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.25);
  text-decoration: none;
}
.guide-action-bar .btn-primary:hover {
  background: #075985;
}

@media (max-width: 900px) {
  .guide-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .faq-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .guide-header h2 {
    font-size: 21px;
  }
  .statutory-guide {
    padding: 32px 14px 40px;
    border-left: 0;
    border-right: 0;
  }
  .guide-action-bar {
    margin-bottom: 72px;
  }
}

/* ---------- Stamp gate dialog ---------- */
.pro-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: var(--rule);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  overflow: auto;
}
.pro-dialog::backdrop { background: rgba(12, 35, 64, 0.62); }
.dialog-frame { padding: 22px; display: grid; gap: 14px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-kicker { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.dialog-close {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  border: var(--rule);
  border-radius: 0;
  background: var(--paper);
  font-weight: 700;
}
.dialog-close:hover { background: var(--drawer); }
.dialog-close:active { transform: translateY(1px); }
.pro-dialog h2 { font-size: 24px; line-height: 1.15; }
.dialog-desc { color: var(--muted); }
.price-block { border: var(--rule); border-left: 6px solid var(--primary); padding: 10px 14px; display: grid; gap: 2px; }
.price-figure { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.15; }
.price-note { font-size: 13px; color: var(--muted); }
.pro-dialog .btn-primary[data-checkout] { justify-self: start; }

/* ---------- Unified 44px Toolbar (Blueprint Console) ---------- */
.unified-toolbar {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px 16px;
  padding: 5px 14px;
  background: #081B31;
  color: #E0F2FE;
  border-bottom: 1px solid #1E3A8A;
  border-left: var(--rule);
  border-right: var(--rule);
  min-height: 44px;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 60;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}
.unified-toolbar .mode-switch-deck {
  width: auto;
  margin: 0;
  flex-direction: row;
  align-items: center;
}
.unified-toolbar .mode-tabs {
  background: #051426;
  border: 1px solid #1E3A8A;
  border-radius: 3px;
  padding: 2px 4px;
  gap: 2px;
  display: flex;
}
.unified-toolbar .mode-tab {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #94A3B8;
  border-radius: 2px;
  background: transparent;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.unified-toolbar .mode-tab:hover {
  color: #F8FAFC;
}
.unified-toolbar .mode-tab.is-active {
  background: #0369A1;
  color: #FFFFFF;
}
.unified-toolbar .preset-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.unified-toolbar .preset-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94A3B8;
  white-space: nowrap;
}
.unified-toolbar .preset-row {
  display: flex;
  border: 1px solid #1E3A8A;
  border-radius: 3px;
  overflow: hidden;
  margin: 0;
}
.unified-toolbar .chip {
  background: #0C2340;
  color: #BAE6FD;
  border: 0;
  border-right: 1px solid #1E3A8A;
  border-radius: 0;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  height: 26px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;
}
.unified-toolbar .chip:last-child {
  border-right: 0;
}
.unified-toolbar .chip:hover {
  background: #1E3A8A;
  color: #FFFFFF;
}
.unified-toolbar .chip[aria-pressed="true"] {
  background: #0369A1;
  color: #FFFFFF;
}
.unified-toolbar .case-status-bar {
  margin: 0;
  padding: 3px 8px;
  font-size: 11px;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(2, 132, 199, 0.35);
  border-radius: 3px;
  color: #BAE6FD;
  gap: 6px;
  white-space: nowrap;
}
.unified-toolbar .case-status-bar.is-blank {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
  color: #94A3B8;
}
.unified-toolbar .status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38BDF8;
  flex-shrink: 0;
}
.unified-toolbar .status-text {
  font-size: 11px;
  color: inherit;
}
.unified-toolbar .recalc-timestamp {
  color: #38BDF8;
  font-size: 10.5px;
  font-family: var(--font-mono);
  margin-left: 4px;
}
.unified-toolbar .trust-reassurance-bar {
  margin: 0;
  padding: 2px 6px;
  background: transparent;
  border: 0;
  gap: 6px;
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.unified-toolbar .trust-badge {
  background: #0369A1;
  color: #FFFFFF;
  padding: 2px 5px;
  font-size: 9.5px;
  font-weight: 700;
  border-radius: 2px;
  white-space: nowrap;
}
.unified-toolbar .trust-text {
  font-size: 11px;
  color: #94A3B8;
  white-space: nowrap;
}

/* ---------- Mode Switch Deck & Case Status Bar ---------- */
.mode-switch-deck {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
}
.mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--paper);
  padding: 4px;
  border: var(--rule);
  width: fit-content;
}
.mode-tab {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.mode-tab:hover {
  color: var(--ink);
}
.mode-tab.is-active {
  background: var(--primary);
  color: #FFFFFF;
}
.case-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(12, 74, 96, 0.08);
  border: 1px solid rgba(12, 74, 96, 0.3);
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 8px;
}
.case-status-bar.is-blank {
  background: rgba(100, 116, 139, 0.1);
  border-color: rgba(100, 116, 139, 0.3);
  color: var(--muted);
}
.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.case-status-bar.is-blank .status-indicator-dot {
  background: var(--muted);
}
.recalc-timestamp {
  margin-left: auto;
  font-size: 11px;
  color: var(--primary);
  font-family: var(--font-mono);
}
.btn-update-calc {
  display: block;
  width: 100%;
  padding: 10px 14px;
  margin-top: 10px;
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13.5px;
  text-align: center;
  border: var(--rule);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.btn-update-calc:hover {
  background: #093545;
}
@keyframes flashGlow {
  0% { box-shadow: 0 0 0 0 rgba(12, 74, 96, 0.6); }
  50% { box-shadow: 0 0 14px 2px rgba(12, 74, 96, 0.35); }
  100% { box-shadow: none; }
}
.flash-recalc {
  animation: flashGlow 0.4s ease-out;
}

@keyframes spotlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(12, 74, 96, 0.7);
    outline: 2px solid var(--primary);
  }
  50% {
    box-shadow: 0 0 16px 4px rgba(12, 74, 96, 0.45);
    outline: 2px solid #0284C7;
  }
  100% {
    box-shadow: none;
    outline: 2px solid transparent;
  }
}

.spotlight-pulse {
  animation: spotlightPulse 0.9s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes msgFlash {
  0% { opacity: 0; transform: translateY(-3px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0.95; }
}

.action-msg {
  display: none;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 600;
  color: #065F46;
  background: #D1FAE5;
  border: 1px solid #6EE7B7;
  border-radius: 2px;
  padding: 4px 10px;
  margin: 6px 0 0;
  text-align: center;
}

.action-msg.msg-flash {
  display: block;
  animation: msgFlash 0.3s ease-out;
}

/* Mobile Sticky Result HUD */
.mobile-hud {
  display: none;
}
@media (max-width: 900px) {
  .mobile-hud {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: rgba(12, 35, 64, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 2px solid var(--primary);
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(0);
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  .mobile-hud.is-hud-hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
  }
  .hud-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
  }
  .hud-metric-block {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
  }
  .hud-value {
    font-size: 17px;
    font-weight: 800;
    color: #FFFFFF;
    font-family: var(--font-display);
  }
  .hud-sub {
    font-size: 13px;
    color: #94a3b8;
    font-family: var(--font-mono);
  }
  .hud-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--font-mono);
    border-radius: 2px;
  }
  .hud-badge--ok {
    background: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.5);
  }
  .hud-badge--alarm {
    background: rgba(220, 38, 38, 0.25);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.5);
  }
  .hud-jump-btn {
    flex-shrink: 0;
    background: #FFFFFF;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    font-family: var(--font-mono);
  }
  .hud-jump-btn:active {
    background: var(--paper);
  }
}

.trust-reassurance-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(12, 74, 96, 0.08);
  border: 1px solid rgba(12, 74, 96, 0.25);
  padding: 8px 12px;
  margin-top: 10px;
}
.trust-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--primary);
  color: #FFFFFF;
  padding: 3px 8px;
  white-space: nowrap;
}
.trust-text {
  font-size: 12px;
  color: var(--ink);
  line-height: 1.4;
}

.modal-pricing-callout {
  border: var(--rule);
  border-left: 6px solid var(--primary);
  background: #FFFFFF;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.modal-pricing-callout .price-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  color: var(--primary);
}
.modal-pricing-callout .price-cadence {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  text-transform: uppercase;
}
.modal-pricing-callout .price-sub {
  font-size: 12px;
  color: var(--ink);
}

.modal-table-wrap {
  overflow-x: auto;
  border: var(--rule);
  background: #FFFFFF;
}
.free-vs-pro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.free-vs-pro-table th,
.free-vs-pro-table td {
  padding: 10px 12px;
  border-bottom: var(--rule);
}
.free-vs-pro-table thead th {
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.free-vs-pro-table thead .th-free {
  color: var(--muted);
  width: 32%;
}
.free-vs-pro-table thead .th-pro {
  color: var(--primary);
  background: rgba(12, 74, 96, 0.06);
  width: 38%;
}
.free-vs-pro-table tbody th {
  font-weight: 600;
  color: var(--ink);
}
.free-vs-pro-table tbody td {
  color: var(--muted);
}
.free-vs-pro-table tbody td strong {
  color: var(--primary);
}
.badge-free {
  color: var(--muted);
}
.badge-pro {
  color: var(--primary);
  font-weight: 700;
}
.license-form { border-top: var(--rule); padding-top: 14px; display: grid; gap: 6px; }
.license-form label { font-weight: 700; font-size: 14px; }
.license-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.license-row input {
  min-height: 44px;
  min-width: 0;
  border: 1.5px solid var(--hair);
  border-radius: 0;
  background: #FFFFFF;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 16px;
  text-transform: uppercase;
}
.license-row input[aria-invalid="true"] { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.license-hint { font-size: 12px; color: var(--muted); }
.license-msg { font-size: 13px; font-weight: 700; min-height: 2.8em; color: #075985; }
.license-msg.validation-cue { visibility: visible; color: var(--accent-deep); }
.license-remove { justify-self: start; }

/* ---------- Responsive ---------- */
@media (max-width: 1380px) {
  .unified-toolbar {
    flex-wrap: wrap;
    padding: 6px 12px;
    gap: 6px 10px;
  }
  .toolbar-left, .toolbar-right {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .unified-toolbar .trust-reassurance-bar {
    margin-left: auto;
  }
}

@media (max-width: 1180px) {
  .tb-sub { display: none; }
  .prop-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1050px) {
  .tb-meta { display: none; }
  .unified-toolbar .trust-reassurance-bar { display: none; }
}

/* Option B+ Statutory Desktop Cockpit (100dvh Dual-Scrollpane) */
@media screen and (min-width: 901px) {
  html, body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  body {
    display: flex;
    flex-direction: column;
  }
  .app-header-stack {
    flex: 0 0 auto;
    width: 100%;
    z-index: 100;
  }
  .workspace {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border-bottom: 1.5px solid var(--rule);
  }
  .inspector,
  .stage {
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    mask-image: linear-gradient(to bottom, black calc(100% - 36px), transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 36px), transparent 100%);
    padding-bottom: 56px;
    transition: mask-image 0.2s ease, -webkit-mask-image 0.2s ease;
  }
  .inspector {
    position: static;
    border-right: var(--rule);
  }
  .stage {
    padding: 0 var(--gap) 56px;
  }
  .inspector::-webkit-scrollbar,
  .stage::-webkit-scrollbar {
    width: 9px;
  }
  .inspector::-webkit-scrollbar-track,
  .stage::-webkit-scrollbar-track {
    background: #F8FAFC;
    border-left: 1px solid #E2E8F0;
  }
  .inspector::-webkit-scrollbar-thumb,
  .stage::-webkit-scrollbar-thumb {
    background: #94A3B8;
    border-radius: 4.5px;
    border: 2px solid #F8FAFC;
  }
  .inspector::-webkit-scrollbar-thumb:hover,
  .stage::-webkit-scrollbar-thumb:hover {
    background: #64748B;
  }

  /* Cockpit Horizon Sill (Anchored 28px bottom shelf) */
  .cockpit-horizon-bar {
    flex: 0 0 28px;
    height: 28px;
    width: 100%;
    background: #0B192C;
    border-top: 1.5px solid #1E293B;
    display: flex;
    align-items: center;
    z-index: 100;
    user-select: none;
  }
  .cockpit-horizon-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 18px;
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    font-size: 11px;
    color: #94A3B8;
  }
  .horizon-telemetry {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .horizon-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #38BDF8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
  }
  .horizon-title {
    color: #F8FAFC;
    font-weight: 600;
  }
  .horizon-cue {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #FBBF24;
    font-weight: 600;
    letter-spacing: 0.01em;
  }
  .horizon-privacy {
    color: #94A3B8;
  }

  /* Pinned Dock Scroll Cue Button */
  .dock-scroll-cue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono, monospace);
    font-size: 11.5px;
    font-weight: 600;
    color: #0F172A;
    background: #F1F5F9;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #CBD5E1;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .dock-scroll-cue:hover {
    background: #E2E8F0;
    color: #0F172A;
    border-color: #94A3B8;
    transform: translateY(-1px);
  }
  .dock-scroll-arrow {
    font-size: 13px;
    transition: transform 0.15s ease;
  }
  .dock-scroll-cue:hover .dock-scroll-arrow {
    transform: translateY(2px);
  }

  .stage-dock {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--paper);
    padding: 10px 18px 10px;
    margin: 0 -18px 14px -18px;
    border-bottom: var(--rule);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  }
  .stage-dock .kpi-strip {
    position: static;
    margin-bottom: 0;
    box-shadow: none;
  }
}

@media (max-width: 900px) {
  html, body {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }
  body {
    display: block;
    font-size: 14px;
  }
  .workflow-direction-bar {
    display: none !important;
  }
  .preset-strip-inline {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
    padding: 2px 0;
  }
  .preset-strip-inline::-webkit-scrollbar {
    display: none;
  }
  .app-header-stack {
    position: static;
  }
  .inspector,
  .stage {
    mask-image: none !important;
    -webkit-mask-image: none !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
  }
  .cockpit-horizon-bar,
  .dock-scroll-cue {
    display: none !important;
  }
  .stage-dock {
    display: contents;
  }
  .titleblock { display: flex; align-items: center; justify-content: space-between; border-left: 0; border-right: 0; padding: 6px 10px; }
  .tb-brand { padding: 0; }
  .tb-sub { display: none; }
  .tb-meta { display: none; }
  .wordmark { font-size: 15px; }
  .tb-cta { padding: 0; }
  .btn-header { font-size: 11.5px; padding: 4px 8px; min-height: 30px; max-height: 30px; }
  .unified-toolbar {
    position: static;
    padding: 6px 10px;
    gap: 6px 10px;
    flex-wrap: wrap;
  }
  .toolbar-left, .toolbar-right {
    width: 100%;
    gap: 8px;
  }
  .unified-toolbar .mode-switch-deck {
    width: 100%;
  }
  .unified-toolbar .mode-tabs {
    width: 100%;
  }
  .unified-toolbar .mode-tab {
    flex: 1;
    text-align: center;
    padding: 6px 8px;
    font-size: 12px;
  }
  .unified-toolbar .preset-controls {
    width: 100%;
    flex-wrap: wrap;
  }
  .unified-toolbar .preset-controls .preset-label {
    flex: 0 0 100%;
  }
  .unified-toolbar .preset-controls #reset-btn.btn-reset-top {
    flex: 0 0 100%;
    width: 100%;
    justify-content: center;
  }
  .unified-toolbar .preset-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .unified-toolbar .chip {
    min-height: 32px;
    font-size: 11.5px;
    padding: 4px 6px;
    justify-content: center;
  }
  .unified-toolbar .case-status-bar {
    width: 100%;
    font-size: 11.5px;
  }
  .unified-toolbar .trust-reassurance-bar {
    display: none;
  }

  .workspace { grid-template-columns: minmax(0, 1fr); border: 0; align-items: stretch; }
  .stage, .stage-head { display: contents; }
  .stage-head h1 { order: 1; font-size: 19px; margin: 12px 12px 0; }
  .stage-lede { order: 1; font-size: 13px; margin: 4px 12px 10px; color: var(--muted); line-height: 1.4; }
  .inspector { order: 2; position: static; max-height: none; overflow-y: visible; border-right: 0; border-top: var(--rule); border-bottom: var(--rule); padding: 8px 10px; display: block; height: auto; }
  .inspector-scroll-body {
    overflow-y: visible;
    max-height: none;
    min-height: 0;
    padding: 0;
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }
  .inspector-bottom-shelf {
    display: block;
    margin: 16px 0 20px 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .btn-dock-jump--shelf {
    height: 44px;
    font-size: 14px;
  }
  .kpi-strip { order: 3; position: static; box-shadow: none; margin: 12px 12px 0; }
  .sheet-actions { order: 4; margin: 12px 12px 0; display: flex; flex-direction: column; gap: 8px; }
  .sheet-actions button { width: 100%; white-space: normal; text-align: center; padding: 8px 12px; font-size: 13px; }
  #executive-deliverable { order: 5; margin: 12px; padding: 16px 12px; box-shadow: none; }
  .statutory-guide { order: 6; margin: 12px; }
  .inspector-sticky-dock {
    position: static;
    margin: 0 0 10px 0;
    padding: 0 0 8px 0;
    border-bottom: 1.5px solid var(--rule);
    box-shadow: none;
  }
  .kpi { padding: 6px 8px; }

  .kpi-label { font-size: 10px; letter-spacing: 0.04em; }
  .kpi-value { font-size: 15px; }

  .insp-head { margin-bottom: 8px; }
  .insp-head h2 { font-size: 16px; }
  .preset-row { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 8px; }
  .preset-row .chip:nth-child(2n) { border-right: 0; }
  .preset-row .chip:nth-child(-n+2) { border-bottom: var(--rule); }
  .chip { font-size: 12px; padding: 6px 8px; min-height: 38px; }
  .btn-update-calc { display: none; }
  .case-status-bar { padding: 6px 10px; font-size: 12px; margin-bottom: 6px; }
  .trust-reassurance-bar { padding: 6px 10px; font-size: 12px; margin-bottom: 6px; }
  .prop-grid { grid-template-columns: minmax(0, 1fr); }

  .sheet-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .sheet-head h2 { font-size: 20px; }
  .meta-grid, .fringe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-wide, .meta-grid .meta-cell:nth-child(7), .meta-grid .meta-cell:nth-child(8) { grid-column: span 2; }
  .meta-cell dd { min-height: 1.5em; }
  .fringe-grid .meta-cell:last-child { grid-column: span 2; }
  .fringe-grid dd { min-height: 1.5em; }
  .status-band { grid-template-columns: minmax(0, 1fr); gap: 6px; min-height: 100px; align-content: start; }
  .status-flag { justify-self: start; }
  .sched-table { font-size: 13px; }
  .sched-table th, .sched-table td { padding: 6px 4px; }
  .sched-table td.num { font-size: 11.5px; }
  .sched-table thead th { font-size: 10px; letter-spacing: 0.01em; }
  .cols-4 col.c-label { width: 35%; }

  .checks-table colgroup { display: none; }
  .checks-table thead { display: none; }
  .checks-table, .checks-table tbody, .checks-table tr { display: block; }
  .checks-table tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr); border-bottom: var(--hairline); height: auto; }
  .checks-table tbody tr:last-child { border-bottom: 0; }
  .checks-table th, .checks-table td { border: 0; display: block; }
  .checks-table tbody th { grid-column: 1 / -1; padding-bottom: 0; font-weight: 700; }
  .checks-table td[data-check-detail] { min-height: calc(3 * 1.4em + 12px); }

  .audit-list li { grid-template-columns: minmax(0, 1fr); }
  .audit-key { border-right: 0; padding-bottom: 0; }
  .audit-math { min-height: calc(3 * 1.4em + 14px); }

  .certify-grid { grid-template-columns: minmax(0, 1fr); }
  .sign-cells { border-right: 0; border-bottom: var(--rule); }
  .seal-box { min-height: 260px; padding: 12px; }
  .seal-state { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
  .seal-mark { width: 74px; height: 74px; font-size: 11px; }

  .site-footer { border-left: 0; border-right: 0; }
  .dialog-frame { padding: 16px; }
  .pro-dialog h2 { font-size: 20px; }
  .license-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 400px) {
  .prop-grid { grid-template-columns: minmax(0, 1fr); }
  .prop { padding: 6px 7px; }
  .prop label { font-size: 12px; }
  .tb-meta dd { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Print: deliverable only ---------- */
@media print {
  @page { margin: 12mm; }
  html, body { background: #FFFFFF !important; color: #111827 !important; }
  .titleblock, .inspector, .site-footer, .statutory-guide, .pro-dialog, .stage-head, .sheet-actions,
  nav, button, dialog, .seal-copy .btn-primary, .profile-tools, .dim-mark,
  .app-header-stack, .workflow-direction-bar, form, input, select, textarea, label,
  body > footer, .trust-footer, .cockpit-horizon-bar, .stage-dock, .mobile-hud, .modal-backdrop,
  [role="dialog"], [role="alertdialog"], [data-open-pro] { display: none !important; }
  html, body { height: auto !important; overflow: visible !important; scrollbar-gutter: auto; }
  .stage { height: auto !important; max-height: none !important; overflow: visible !important; mask-image: none !important; -webkit-mask-image: none !important; }
  .workspace { display: block; border: 0; background: #FFFFFF; max-width: none; }
  .stage { display: block; padding: 0; background: #FFFFFF; }
  #executive-deliverable {
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    background: #FFFFFF;
    color: #111827;
  }
  #executive-deliverable * { color: #111827 !important; background: #FFFFFF !important; box-shadow: none !important; border-color: #111827 !important; outline-color: #111827 !important; }
  #executive-deliverable .pill { border-color: #111827; }
  .sched-table th, .sched-table td, .meta-cell, .audit-list li { break-inside: avoid; }
  .certify, .sheet-footer { break-inside: avoid; }
  .free-watermark { display: block; font-weight: 700; }
  #executive-deliverable::after {
    content: "DRAFT";
    position: fixed;
    top: 40%;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-display);
    font-size: 120px;
    font-weight: 800;
    color: rgba(17, 24, 39, 0.08);
    transform: rotate(-24deg);
    pointer-events: none;
  }
  html.is-pro .free-watermark { display: none !important; }
  html.is-pro #executive-deliverable::after { content: none; }
  .seal-state.is-off { display: none; }
}

/* Fleet sweep 2026-10-18 additions */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.66);
}
.modal-backdrop[hidden] { display: none; }
#reset-btn.btn-reset-top { display: inline-flex; min-height: 44px; align-items: center; }
.trust-footer {
  padding: 16px 20px;
  font-size: 13px;
  color: #cbd5e1;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.trust-footer .trust-link { color: #7dd3fc; display: inline-block; padding: 4px 0; }
.mode-tab, .preset-chip { min-height: 44px; }
.preset-strip-inline { flex-wrap: wrap; max-width: 100%; }
/* contrast: sample chip + badge text measured 4.10:1 / 3.77:1 */
.preset-chip { color: #e2e8f0; }
.role-badge, [class*="role-badge"] { color: #FFFFFF; }
.role-badge-out { background: #047857; border-color: #065F46; }
.trust-footer { background: var(--masthead); color: #E2E8F0; }
.btn-return-sheet { background: var(--paper); color: var(--primary-press); }

/* Sticky chrome clearance for jump targets. */
#payroll-form, .compliance-grid, #statutory-guide { scroll-margin-top: 110px; }

/* Hidden overlays must never intercept pointer events */
.modal-backdrop[hidden], [hidden].modal-backdrop { display: none !important; }
@media (max-width: 900px) {
  #header-pro-btn.btn-header, .btn-header { min-height: 44px; }
  .chip, .preset-chip, [class*="chip"] { min-height: 44px !important; height: auto !important; padding-top: 6px; padding-bottom: 6px; }
}

/* Modal backdrops must not trap synthetic or stray clicks: the dark area
   passes pointer events through; the sheet itself stays interactive. */
.modal-backdrop, #confirm-backdrop { pointer-events: none !important; }
.modal-backdrop > *, #confirm-backdrop > * { pointer-events: auto !important; }

/* Reviewer round 2026-10-18: tap floors, chip padding, legend clearance */
@media (max-width: 900px) {
  button.chip, .chip { min-height: 44px !important; padding-top: 8px !important; padding-bottom: 8px !important; }
  #btn-dock-jump, button.btn-dock-jump, #btn-dock-jump-deliverable { min-height: 44px !important; padding: 8px 12px !important; }
  legend, .field-legend { position: static !important; float: none !important; margin-bottom: 6px !important; }
  .fieldset legend + *, fieldset > *:not(legend) { clear: both; }
  #btn-return-sheet { display: none !important; }  /* linear mobile flow: the form is one scroll away */
}

/* Layout-facts remediation (2026-10-18): collapsed details must hide content,
   chrome padding floors, spacing floors, control padding floors. */
details:not([open]) > *:not(summary) { display: none !important; }
header.titleblock { padding-top: 8px !important; padding-bottom: 8px !important; }
nav.preset-bar { padding-top: 8px !important; padding-bottom: 8px !important; }
.toolbar-left { padding-top: 8px !important; padding-bottom: 8px !important; }
article#executive-deliverable { padding-left: 16px !important; padding-right: 16px !important; }
section#statutory-guide.statutory-guide, section.statutory-guide { padding-left: 16px !important; padding-right: 16px !important; }
button#header-pro-btn.btn-primary { padding-top: 6px !important; padding-bottom: 6px !important; }
p.sheet-kicker { margin-bottom: 6px !important; }
.certify-head-row { margin-bottom: 12px !important; }
