/* Home Inspector Report Assembly - artisan estimator workbench */
:root {
  --canvas: #E4E4E7;
  --paper: #FFFFFF;
  --ink: #18181B;
  --muted: #3F3F46;
  --primary: #0F766E;
  --primary-ink: #FFFFFF;
  --primary-dark: #115E59;
  --accent: #B45309;
  --line: #A1A1AA;
  --hairline: #D4D4D8;
  --wash: #F4F4F5;
  --danger: #B91C1C;
  --danger-wash: #FEF2F2;
  --warn: #B45309;
  --warn-wash: #FFFBEB;
  --ok: #166534;
  --ok-wash: #F0FDF4;
  --hold: #9A3412;
  --hold-wash: #FFF7ED;
  --radius: 4px;
  --font-head: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --header-h: 60px;
  --toolbar-h: 46px;
  --flow-h: 30px;
  --horizon-h: 28px;
}

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

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

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

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0; color: var(--ink); }
p { margin: 0; }
abbr[title] { text-decoration: none; color: var(--danger); font-weight: 700; }
.tabular, .tabular * { font-variant-numeric: tabular-nums; }

.visually-hidden,
.visually-hidden-input {
  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: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #FFFFFF; padding: 10px 14px; border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }

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

/* ---------- buttons ---------- */
button, .btn-primary, .btn-secondary, .btn-ghost, .btn-outline, .btn-pro, .file-trigger {
  font: inherit;
  cursor: pointer;
}

.btn-primary, .btn-secondary, .btn-ghost, .btn-outline, .btn-pro, .file-trigger, .preset-chip, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; line-height: 1.25;
  text-decoration: none;
  white-space: normal;
  text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary, .file-trigger { background: var(--paper); color: var(--ink); }
.btn-secondary:hover, .file-trigger:hover { border-color: var(--ink); background: var(--wash); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--wash); }
.btn-outline { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--wash); }
.btn-pro { background: var(--paper); color: var(--ink); border-color: var(--ink); max-height: 50px; white-space: nowrap; }
.btn-pro:hover { background: var(--wash); }
.btn-link {
  background: none; border: 0; color: var(--primary); font-weight: 700; text-decoration: underline;
  text-underline-offset: 3px; min-height: 44px; padding: 6px 4px;
}
.icon-btn { padding: 6px 10px; background: var(--paper); color: var(--ink); }

.btn-primary:active, .btn-secondary:active, .btn-ghost:active, .btn-outline:active,
.btn-pro:active, .preset-chip:active, .file-trigger:active, .icon-btn:active, .btn-link:active {
  transform: translateY(1px);
}
button:active { filter: brightness(0.97); }

/* ---------- role badges ---------- */
.role-badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid;
  white-space: nowrap;
  font-family: var(--font-body);
}
.role-badge-in { background: #F0FDFA; color: #134E4A; border-color: #0F766E; }
.role-badge-out { background: #18181B; color: #FFFFFF; border-color: #18181B; }

/* ---------- header stack ---------- */
.app-header-stack { flex: 0 0 auto; background: var(--paper); border-bottom: 1px solid var(--line); }

header.masthead {
  background-color: #FFFFFF;
  color: #18181B;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--header-h);
  padding: 8px 20px;
  border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { flex: 0 0 auto; color: var(--primary); }
.brand-text { min-width: 0; }
.wordmark {
  font-size: 19px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2;
  white-space: nowrap; max-height: 52px;
}
.subtitle { font-size: 13px; color: var(--muted); line-height: 1.35; }
.masthead-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.status-pill, .dock-verdict, .hud-status {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; border: 1px solid var(--line);
  font-weight: 700; white-space: nowrap;
}
.status-pill { padding: 5px 12px; font-size: 13px; background: var(--wash); color: var(--ink); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }

[data-tone="danger"].status-pill, [data-tone="danger"].dock-verdict, [data-tone="danger"].hud-status { background: var(--danger-wash); color: var(--danger); border-color: var(--danger); }
[data-tone="warn"].status-pill, [data-tone="warn"].dock-verdict, [data-tone="warn"].hud-status { background: var(--warn-wash); color: #92400E; border-color: var(--warn); }
[data-tone="hold"].status-pill, [data-tone="hold"].dock-verdict, [data-tone="hold"].hud-status { background: var(--hold-wash); color: var(--hold); border-color: var(--hold); }
[data-tone="ok"].status-pill, [data-tone="ok"].dock-verdict, [data-tone="ok"].hud-status { background: var(--ok-wash); color: var(--ok); border-color: var(--ok); }
[data-tone="danger"] .status-dot { background: var(--danger); }
[data-tone="warn"] .status-dot { background: var(--warn); }
[data-tone="hold"] .status-dot { background: var(--hold); }
[data-tone="ok"] .status-dot { background: var(--ok); }

.toolbar {
  display: flex; align-items: center; gap: 18px;
  height: var(--toolbar-h);
  padding: 0 20px;
  border-bottom: 1px solid var(--hairline);
  font-size: 13px; color: var(--muted);
  overflow: hidden;
}
.toolbar-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.live-cue { color: var(--primary); font-weight: 700; }
.toolbar-counts { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--ink); }

.workflow-bar { height: var(--flow-h); padding: 0 20px; display: flex; align-items: center; background: var(--wash); }
.flow-steps { display: flex; align-items: center; gap: 8px; list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.flow-step { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.flow-num { font-family: var(--font-mono); font-weight: 600; color: var(--primary); }
.flow-step-out .flow-num { color: var(--ink); }
.flow-sep { display: inline-flex; color: var(--line); }

/* ---------- workbench split ---------- */
.workbench { display: block; }

.workbench, .inspector-scroll-body, .deliverable-zone { position: relative; }
.inspector-pane { background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }

.pane-dock { flex: 0 0 auto; padding: 10px 20px 10px; border-bottom: 1px solid var(--hairline); background: var(--paper); }
.scenario-strip { display: flex; flex-direction: column; gap: 8px; }
.scenario-caption-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.scenario-caption { font-size: 13px; font-weight: 600; color: var(--muted); }
.sample-badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border: 1px dashed var(--accent); color: #92400E; background: var(--warn-wash);
  border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.sample-badge[hidden] { display: none; }
.chip-row, .reset-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.preset-chip { background: var(--paper); color: var(--ink); padding: 8px 10px; font-size: 13.5px; }
.preset-chip:hover { border-color: var(--primary); }
.preset-chip[aria-pressed="true"] { background: #F0FDFA; border-color: var(--primary); color: #134E4A; box-shadow: inset 0 0 0 1px var(--primary); }
.reset-row .btn-ghost { font-weight: 600; }
.undo-note { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink); background: var(--wash); border-radius: var(--radius); padding: 0 4px 0 10px; }
.undo-note[hidden] { display: none; }

.inspector-scroll-body {
  padding: 12px 20px 64px;
  scrollbar-width: thin;
}

.trust-reassurance-bar {
  display: block;
  padding: 6px 12px;
  border-left: 3px solid var(--primary);
  background: #F0FDFA;
  font-size: 13px; color: #134E4A; line-height: 1.35;
}
.trust-badge { font-weight: 800; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; margin-right: 8px; }
.trust-reassurance-bar p { display: inline; }

.form-section { border: 0; margin: 0; padding: 0; min-width: 0; }
.form-section + .form-section { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.section-heading {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%;
  font-family: var(--font-head); font-size: 15px; font-weight: 800; color: var(--ink);
  padding: 10px 0 6px; float: none;
}
legend.section-heading { padding: 10px 0 6px; }
.required-hint { font-family: var(--font-body); font-size: 12px; font-weight: 600; color: var(--muted); }
.section-help { font-size: 13px; color: var(--muted); margin-bottom: 10px; }

.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; margin-bottom: 8px; }
.field label, .evidence-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.optional { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 4px; }

input[type="text"], input[type="date"], select, textarea {
  width: 100%;
  min-width: 180px;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit; font-size: 15px; line-height: 1.35;
}
textarea { resize: vertical; min-height: 64px; }
select { cursor: pointer; appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233F3F46' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
::placeholder { color: #71717A; opacity: 1; }

.validation-cue, [aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: inset 0 0 0 1px var(--danger); }
.field-error { font-size: 12.5px; font-weight: 600; color: var(--danger); }
.field-error::before { content: "! "; font-weight: 800; }
.field-error[hidden] { display: none; }

.money-input { display: flex; align-items: stretch; min-width: 180px; }
.money-prefix {
  flex: 0 0 auto; display: inline-flex; align-items: center; padding: 0 10px;
  border: 1px solid var(--line); border-right: 0; border-radius: var(--radius) 0 0 var(--radius);
  background: var(--wash); font-family: var(--font-mono); font-weight: 600; color: var(--muted);
}
.money-input input { min-width: 0; flex: 1 1 auto; border-radius: 0 var(--radius) var(--radius) 0; font-family: var(--font-mono); }

.prop-collapsible { border-top: 1px solid var(--hairline); margin-top: 4px; }
.prop-collapsible > .field-pair { padding-top: 6px; }
.step-tab {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 0; cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 700; color: var(--ink);
}
.step-tab::-webkit-details-marker { display: none; }
.step-tab::before {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform 0.15s ease; margin-right: 2px;
}
details[open] > .step-tab::before { transform: rotate(45deg); }
.pro-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 1px 8px; border: 1px solid var(--ink); border-radius: 999px; color: var(--ink);
}
.locked-field input { background: var(--wash); cursor: pointer; }
.lock-note { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding-bottom: 10px; }

/* ---------- findings ledger ---------- */
.findings-ledger { display: flex; flex-direction: column; }
.finding-row { padding: 12px 0 14px; border-top: 1px solid var(--hairline); }
.finding-row:first-child { border-top: 0; padding-top: 0; }
.finding-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.finding-title { font-family: var(--font-head); font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.finding-state { font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.finding-state[data-state="ok"] { color: var(--ok); border-color: var(--ok); }
.finding-state[data-state="warn"] { color: #92400E; border-color: var(--warn); }
.btn-remove { font-size: 13px; padding: 6px 10px; color: var(--muted); }
.btn-remove[hidden] { display: none; }

.evidence-block { padding-top: 4px; }
.evidence-label.is-gap { color: #92400E; }
.photo-list { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.photo-list:empty { display: none; }
.photo-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 0 0 8px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); font-size: 13px; min-height: 44px; max-width: 100%;
}
.photo-chip img { width: 32px; height: 32px; object-fit: cover; border-radius: 2px; }
.photo-name { font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.photo-owner { font-size: 11px; color: var(--muted); border-left: 1px solid var(--hairline); padding-left: 6px; white-space: nowrap; }
.photo-remove { min-width: 44px; min-height: 44px; padding: 6px; border: 0; border-left: 1px solid var(--hairline); background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.photo-remove:hover { color: var(--danger); }
.evidence-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.file-trigger { position: relative; }
.file-trigger:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.ref-entry { display: flex; gap: 8px; flex: 1 1 280px; min-width: 0; }
.ref-entry input { flex: 1 1 auto; min-width: 0; }
.ref-entry .btn-secondary { flex: 0 0 auto; }

.evidence-ownership { list-style: none; margin: 0; padding: 0; }
.ownership-item {
  display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--hairline);
  font-size: 13px; cursor: pointer;
}
.ownership-item:first-child { border-top: 0; }
.ownership-item:hover strong { text-decoration: underline; }
.ownership-item .is-gap { color: #92400E; font-weight: 600; }

.dock-jump-shelf { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--line); background: var(--paper); }

/* ---------- deliverable rail ---------- */
.deliverable-zone { min-width: 0; background: var(--canvas); }

.deliverable-dock {
  position: sticky; top: 0; z-index: 30;
  display: flex; flex-direction: column; gap: 6px;
  padding: 6px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.dock-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.dock-verdict { padding: 4px 12px; font-size: 13px; }
.verdict-icon { width: 10px; height: 10px; flex: 0 0 auto; border: 2px solid currentColor; border-radius: 50%; }
[data-tone="danger"] .verdict-icon { border-radius: 1px; transform: rotate(45deg); background: currentColor; }
[data-tone="warn"] .verdict-icon, [data-tone="hold"] .verdict-icon { border-radius: 1px; }
[data-tone="ok"] .verdict-icon { background: currentColor; }
.verdict-banner[data-tone="idle"] .verdict-icon { display: none; }
.dock-kpis { display: flex; gap: 16px; margin: 0 0 0 auto; }
.kpi { display: flex; flex-direction: column; align-items: flex-start; cursor: pointer; min-width: 52px; }
.kpi dt { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.kpi dd { margin: 0; font-family: var(--font-mono); font-size: 17px; font-weight: 600; line-height: 1.2; }
.kpi:hover dd { color: var(--primary); }
.dock-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.deliverable-sheet { padding: 14px 20px 24px; scroll-margin-top: 112px; outline: none; }
.report-doc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px 20px;
  color: var(--ink);
}
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.doc-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.doc-title { font-size: 22px; font-weight: 800; line-height: 1.2; cursor: pointer; overflow-wrap: anywhere; }
.doc-marker {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 8px; border: 1px solid var(--ink); border-radius: var(--radius); white-space: nowrap;
}
.doc-marker[data-state="hold"], .doc-marker[data-state="danger"] { color: var(--danger); border-color: var(--danger); }
.doc-marker[data-state="warn"] { color: #92400E; border-color: var(--warn); }
.doc-marker[data-state="ok"] { color: var(--ok); border-color: var(--ok); }

.verdict-banner {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 14px; border-left: 4px solid var(--line); background: var(--wash);
}
.verdict-main { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.verdict-main .verdict-icon { margin-top: 6px; }
.verdict-title { font-family: var(--font-head); font-size: 17px; font-weight: 800; }
.verdict-hold { font-weight: 700; font-size: 14px; color: var(--hold); }
.verdict-hold[hidden] { display: none; }
.verdict-guidance { font-size: 14px; color: var(--muted); margin-top: 2px; }
.verdict-banner[data-tone="danger"] { border-left-color: var(--danger); background: var(--danger-wash); }
.verdict-banner[data-tone="danger"] .verdict-title, .verdict-banner[data-tone="danger"] .verdict-icon { color: var(--danger); }
.verdict-banner[data-tone="warn"] { border-left-color: var(--warn); background: var(--warn-wash); }
.verdict-banner[data-tone="warn"] .verdict-title, .verdict-banner[data-tone="warn"] .verdict-icon { color: #92400E; }
.verdict-banner[data-tone="hold"] { border-left-color: var(--hold); background: var(--hold-wash); }
.verdict-banner[data-tone="hold"] .verdict-title, .verdict-banner[data-tone="hold"] .verdict-icon { color: var(--hold); }
.verdict-banner[data-tone="ok"] { border-left-color: var(--ok); background: var(--ok-wash); }
.verdict-banner[data-tone="ok"] .verdict-title, .verdict-banner[data-tone="ok"] .verdict-icon { color: var(--ok); }
.verdict-jump { text-align: left; font-size: 13px; }
.verdict-jump[hidden] { display: none; }

.conflict-banner {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 10px; padding: 10px 14px; border: 1px solid var(--danger); border-radius: var(--radius);
  color: var(--danger); background: var(--paper);
}
.conflict-banner[hidden] { display: none; }
.conflict-banner svg { flex: 0 0 auto; margin-top: 2px; }
.conflict-title { font-weight: 800; }
.conflict-body { color: var(--ink); font-size: 14px; }

.doc-section { margin-top: 22px; min-width: 0; }
.doc-heading {
  font-size: 12px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted);
  padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid var(--hairline);
}

.identity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.identity-grid > div { cursor: pointer; min-width: 0; }
.identity-grid dt { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.identity-grid dd { margin: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.identity-grid > div:hover dd { text-decoration: underline; text-decoration-color: var(--primary); }

.is-missing { color: var(--danger) !important; font-weight: 700; }

table { border-collapse: collapse; width: 100%; }
.counter-table th, .counter-table td { border: 1px solid var(--hairline); padding: 6px 6px; text-align: center; }
.counter-table th { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; background: var(--wash); }
.counter-table td { font-family: var(--font-mono); font-size: 16px; font-weight: 600; cursor: pointer; }
.counter-table td:hover { background: #F0FDFA; }

.findings-table th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 8px; border-bottom: 1px solid var(--ink); }
.findings-table td { vertical-align: top; padding: 9px 8px; border-bottom: 1px solid var(--hairline); font-size: 13.5px; }
.findings-table .is-editable { cursor: pointer; }
.findings-table tr:hover td { background: #FAFAFA; }
.cell-item { width: 26%; }
.item-no { font-family: var(--font-mono); font-weight: 600; margin-right: 6px; }
.item-location { display: block; color: var(--muted); font-size: 12.5px; }
.cell-sev { width: 18%; }
.cell-evidence { width: 24%; }
.sev-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; }
.sev-shape { width: 10px; height: 10px; flex: 0 0 auto; border: 2px solid var(--muted); }
.sev-badge[data-severity="safety"] { color: var(--danger); }
.sev-badge[data-severity="safety"] .sev-shape { border-color: var(--danger); background: var(--danger); transform: rotate(45deg); }
.sev-badge[data-severity="repair"] { color: #92400E; }
.sev-badge[data-severity="repair"] .sev-shape { border-color: var(--warn); background: var(--warn); }
.sev-badge[data-severity="monitor"] .sev-shape { border-color: var(--ink); border-radius: 50%; }
.sev-badge[data-severity="info"] .sev-shape { border-radius: 50%; border-style: dotted; }
.sev-badge[data-severity="none"] { color: var(--danger); }
.obs { font-weight: 500; }
.rec { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.rec[hidden] { display: none; }
.ev { font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.res { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.empty-line { color: var(--muted); font-size: 14px; padding: 8px 0; }
.empty-line[hidden] { display: none; }

.paired-schedules { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; scroll-margin-top: 112px; }
.schedule-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.schedule-list li { padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.schedule-list li:last-child { border-bottom: 0; }
.schedule-list li.is-editable { cursor: pointer; }
.schedule-list li.is-editable:hover { color: var(--primary); }
.schedule-list li.muted { color: var(--muted); }
.schedule-list li.tone-danger strong { color: var(--danger); }
.schedule-list li.tone-warn strong { color: #92400E; }
.schedule-list.numbered { counter-reset: step; }
.schedule-list.numbered li { counter-increment: step; display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 4px; }
.schedule-list.numbered li::before { content: counter(step) "."; font-family: var(--font-mono); font-weight: 600; color: var(--muted); grid-row: span 2; }
.schedule-list.numbered li.muted::before { content: ""; }
.schedule-list.plain li { color: var(--muted); }

.doc-foot { margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.disclaimer { font-size: 12.5px; color: var(--muted); }
.free-watermark { margin-top: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; }

.seal-block {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 8px 20px 64px; padding: 16px 0 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--muted);
}
.seal-block > div { flex: 1 1 260px; min-width: 0; }
.seal-icon { color: var(--ink); flex: 0 0 auto; }
.seal-heading { font-size: 15px; font-weight: 800; color: var(--ink); margin-bottom: 2px; }

.flash-recalc { animation: flash-recalc 1.1s ease-out; }
@keyframes flash-recalc {
  0% { background-color: #CCFBF1; box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.35); }
  100% { background-color: var(--paper); box-shadow: 0 0 0 0 rgba(15, 118, 110, 0); }
}

/* ---------- horizon + HUD ---------- */
.cockpit-horizon-bar { display: none; }
.mobile-hud { display: none; }

/* ---------- dialogs ---------- */
.modal {
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; color: var(--ink); background: var(--paper);
}
.modal::backdrop { background: rgba(24, 24, 27, 0.55); }
.modal-small { width: min(460px, calc(100vw - 24px)); }
.modal h2 { font-size: 20px; line-height: 1.2; }
.modal p { margin-top: 8px; font-size: 14.5px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.price-line { font-family: var(--font-head); font-size: 20px; }
.free-vs-pro-table { margin-top: 12px; font-size: 13.5px; }
.free-vs-pro-table th, .free-vs-pro-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; color: var(--ink); }
.free-vs-pro-table thead th { background: var(--ink); color: #FFFFFF; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.free-vs-pro-table tbody th { background: var(--wash); font-weight: 700; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.modal-fine { font-size: 12.5px !important; color: var(--muted); }

/* ---------- desktop cockpit ---------- */
@media (min-width: 901px) {
  html,
  body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  body { display: flex; flex-direction: column; }
  .app-header-stack { flex: 0 0 auto; }
  .workbench {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: start;
  }
  .inspector-pane.inventory { height: 100%; min-height: 0; overflow: hidden; }
  .inspector-scroll-body.inventory-scroll-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding-bottom: 64px;
    -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%);
  }
  .dock-jump-shelf.inventory-bottom-shelf { flex: 0 0 auto; }
  .deliverable-zone {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding-bottom: 56px;
    -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%);
  }
  .inspector-scroll-body.is-at-end,
  .deliverable-zone.is-at-end { -webkit-mask-image: none; mask-image: none; }

  .cockpit-horizon-bar {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 20px;
    height: 28px; min-height: 28px; max-height: 28px;
    padding: 0 20px;
    background: var(--paper); border-top: 1px solid var(--line);
    font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden;
  }
  .horizon-item:first-child { font-family: var(--font-mono); color: var(--primary); font-weight: 600; }
  .horizon-item:last-child { margin-left: auto; }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .deliverable-dock, .deliverable-sheet { padding-left: 16px; padding-right: 16px; }
  .kpi-wide { display: none; }
  .dock-kpis { gap: 12px; }
  .subtitle { font-size: 12px; }
  .status-pill { font-size: 12px; }
  .flow-steps { font-size: 11.5px; }
  .identity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .horizon-item:last-child { display: none; }
  .report-doc { padding: 18px 18px 16px; }
}

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  html, body { height: auto; overflow: visible; }
  body { padding-bottom: 64px; }
  header.masthead { flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .wordmark { font-size: 17px; white-space: normal; }
  .masthead-actions { width: 100%; justify-content: space-between; }
  .toolbar { padding: 0 14px; gap: 12px; }
  .toolbar #save-state { display: none; }
  .workflow-bar { display: none; }
  .workbench { display: flex; flex-direction: column; }
  .inspector-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .pane-dock { padding: 12px 14px; }
  .inspector-scroll-body { padding: 12px 14px 24px; -webkit-mask-image: none; mask-image: none; }
  .dock-jump-shelf { padding: 12px 14px; }
  .deliverable-zone { -webkit-mask-image: none; mask-image: none; }
  .deliverable-dock { position: static; padding: 12px 14px; }
  .deliverable-sheet { padding: 12px 12px 16px; scroll-margin-top: 12px; }
  .paired-schedules { scroll-margin-top: 12px; }
  .seal-block { margin: 8px 14px 24px; }
  .mobile-hud {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    height: 60px; padding: 8px 14px;
    background: var(--paper); border-top: 1px solid var(--line);
    box-shadow: 0 -2px 8px rgba(24, 24, 27, 0.08);
    white-space: nowrap;
  }
  .hud-status { padding: 4px 12px; font-size: 13px; white-space: nowrap; overflow: hidden; }
  .hud-btn { flex: 0 0 auto; white-space: nowrap; }
}

@media (max-width: 680px) {
  fieldset [class*="grid"],
  form [class*="grid"],
  .field-pair,
  .prop-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .paired-schedules { grid-template-columns: minmax(0, 1fr); }
  .identity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  input[type="text"], input[type="date"], select, textarea { min-width: 0; }
  .money-input { min-width: 0; }
}

@media (max-width: 640px) {
  .pane-dock, .inspector-scroll-body, .dock-jump-shelf, .deliverable-dock, .trust-reassurance-bar, .verdict-banner, .conflict-banner { padding-left: 12px; padding-right: 12px; }
  .report-doc { padding: 14px 12px; }
  .dock-row { flex-wrap: wrap; gap: 8px; }
  .dock-kpis { margin-left: 0; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
  .kpi { min-width: 0; }
  .kpi dt { font-size: 0.68rem; }
  .kpi dd { font-size: 0.88rem; }
  .dock-actions, .chip-row, .reset-row, .scenario-caption-row, .modal-actions, .evidence-actions { flex-wrap: wrap; }
  .dock-actions > * { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .toolbar { font-size: 12px; }
  .doc-head { flex-direction: column; }
  .doc-marker { white-space: normal; }
  .counter-table th { font-size: 0.62rem; padding: 6px 2px; letter-spacing: 0; }
  .counter-table td { font-size: 0.88rem; padding: 6px 2px; }
  .findings-table thead { display: none; }
  .findings-table, .findings-table tbody, .findings-table tr, .findings-table td { display: block; width: 100%; }
  .findings-table tr { padding: 8px 0; border-bottom: 1px solid var(--hairline); }
  .findings-table td { border: 0; padding: 3px 6px; }
  .ref-entry { flex-basis: 100%; }
  .photo-owner { display: none; }
  .free-vs-pro-table { font-size: 12.5px; }
  .free-vs-pro-table th, .free-vs-pro-table td { padding: 6px; }
  .modal { padding: 16px 14px; }
}

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

/* ---------- print ---------- */
@media print {
  @page { margin: 14mm; }
  html, body { height: auto !important; overflow: visible !important; background: #FFFFFF !important; color: #111827 !important; padding: 0 !important; }
  .app-header-stack, header.masthead, nav, .inspector-pane, .deliverable-dock, .seal-block, .cockpit-horizon-bar,
  .mobile-hud, dialog, .skip-link, button, input, select, textarea, #live-region, .verdict-jump { display: none !important; }
  .workbench, .deliverable-zone { display: block !important; height: auto !important; overflow: visible !important; background: #FFFFFF !important; -webkit-mask-image: none !important; mask-image: none !important; padding: 0 !important; }
  #executive-deliverable { display: block !important; padding: 0 !important; }
  .report-doc { border: 0; padding: 0; color: #111827; background: #FFFFFF; }
  .report-doc * { color: #111827 !important; background: #FFFFFF !important; box-shadow: none !important; }
  .doc-marker { border: 2px solid #111827 !important; font-weight: 700; }
  .verdict-banner { border: 1px solid #111827; border-left-width: 4px; }
  .findings-table tr, .schedule-list li { break-inside: avoid; }
  .free-watermark { display: block !important; font-size: 10pt; border-top: 1px solid #111827; padding-top: 6px; }
}

/* Review fix (2026-10-19): input width + verdict height stability */
#report-name { min-width: 300px; }
@media (min-width: 901px) {
  #verdict-banner { min-height: 148px; }
}

/* Review fix (2026-10-19): mobile masthead */
@media (max-width: 600px) {
  .masthead { padding-top: 6px; padding-bottom: 6px; gap: 6px; }
  .masthead .subtitle { display: none; }
}

/* Review fix (2026-10-19): live-cue contrast */
span.toolbar-item.live-cue, .toolbar-item.live-cue { color: #0d6a63 !important; }


/* 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: skip-link */
.skip-link { min-height: 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; }
}

/* accessibility-guard: cockpit grid safety (2026-10-22) */
@media (min-width: 901px) {
  .workbench > .related-tools-grid { display: none !important; }
}
