:root {
  color-scheme: light;
  --ink: #171818;
  --muted: #62665f;
  --paper: #fbfaf6;
  --panel: #fff;
  --line: #d9ddd3;
  --mist: #eef3ef;
  --teal: #0e706b;
  --amber: #815606;
  --pale-amber: #fff5de;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.5; }
button, input, select { font: inherit; }
a { color: var(--teal); }
h1, h2, h3, p { margin: 0; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible, pre:focus-visible, .table-wrap:focus-visible, [tabindex="-1"]:focus { outline: 3px solid var(--teal); outline-offset: 3px; }
.app-header { padding: 28px max(24px, calc((100vw - 1400px) / 2)); background: var(--panel); border-bottom: 1px solid var(--line); }
.back-link { display: inline-block; margin-bottom: 20px; font-size: .9rem; font-weight: 720; text-decoration: none; }
.header-row { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: end; gap: 32px; }
.eyebrow { color: var(--teal); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 760; }
h1 { margin-top: 8px; max-width: 850px; font-size: clamp(2rem, 3.8vw, 3.4rem); line-height: 1.08; }
.intro { max-width: 850px; margin-top: 16px; color: var(--muted); font-size: 1.05rem; }
.demo-label { display: grid; gap: 7px; padding: 18px; background: var(--mist); border: 1px solid var(--line); border-radius: 8px; font-size: .88rem; }
.demo-label strong { color: var(--teal); }
.review-shell { width: min(1400px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0 48px; }
.scenario-bar { display: grid; grid-template-columns: auto minmax(180px, 300px) auto; gap: 12px 18px; justify-content: start; align-items: center; padding: 18px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; }
.scenario-bar label { font-weight: 720; }
.scenario-bar p { grid-column: 1 / -1; max-width: 1000px; color: var(--muted); }
select, .review-field input { width: 100%; min-height: 44px; border: 1px solid #aeb6ac; border-radius: 6px; padding: 9px 10px; color: var(--ink); background: var(--panel); }
.live-status { min-height: 24px; margin: 14px 0; color: var(--muted); font-size: .9rem; }
.review-workspace { display: grid; grid-template-columns: minmax(360px, .85fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; }
.source-panel { position: sticky; top: 18px; overflow: hidden; }
.source-panel > summary { display: list-item; list-style-position: inside; padding: 16px 20px; color: var(--teal); font-weight: 760; border-bottom: 1px solid var(--line); }
.small-label { float: right; margin-left: 8px; color: var(--muted); font-size: .76rem; font-weight: 400; }
.evidence-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; background: var(--mist); }
.evidence-nav p { min-width: 0; font-size: .87rem; }
.evidence-nav button { flex-shrink: 0; }
.quote-scroll { max-height: calc(100vh - 190px); overflow: auto; padding: 18px; background: #f0eee8; }
.quote-paper { padding: 22px 18px; background: #fff; border: 1px solid #ddd7cd; box-shadow: 0 5px 16px #262b2410; }
.quote-kicker { margin-bottom: 18px; color: var(--muted); font-size: .75rem; font-weight: 720; text-transform: uppercase; letter-spacing: .08em; }
.quote-paper h2 { font-size: 1.35rem; }
.quote-meta { margin-top: 8px; font-size: .92rem; }
.quote-recipient { margin: 24px 0; color: var(--muted); font-size: .9rem; }
.table-wrap { overflow-x: auto; }
.quote-table { width: 100%; min-width: 365px; border-collapse: collapse; font-size: .82rem; }
.quote-table th, .quote-table td { padding: 12px 5px; border-top: 1px solid var(--line); text-align: right; }
.quote-table th:first-child, .quote-table td:first-child { text-align: left; }
.quote-table th { color: var(--muted); font-weight: 720; }
.source-totals { max-width: 280px; margin: 24px 0 0 auto; font-size: .9rem; }
.source-totals div, .calculation-summary dl div { display: flex; justify-content: space-between; gap: 18px; padding: 8px 0; }
.source-totals dd, .calculation-summary dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.source-totals .grand-total { margin-top: 8px; border-top: 1px solid var(--line); font-weight: 760; }
.source-active { background: #fff0ba; outline: 2px solid #a37419; outline-offset: 2px; }
.quote-footnote { margin-top: 28px; color: var(--muted); font-size: .78rem; }
.review-panel { padding: 24px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.panel-heading h2 { margin-top: 6px; font-size: clamp(1.35rem, 2vw, 1.7rem); line-height: 1.2; }
.status-badge { display: inline-block; padding: 7px 10px; border-radius: 6px; font-size: .8rem; font-weight: 720; }
.status-badge.warning { color: var(--amber); background: var(--pale-amber); }
.status-badge.ready, .status-badge.approved { color: #08554f; background: #e5f2eb; }
.validation-box { padding: 16px; border-left: 3px solid #b68122; background: var(--pale-amber); border-radius: 6px; margin-bottom: 24px; }
.validation-box.valid { border-color: var(--teal); background: var(--mist); }
h3 { font-size: 1rem; }
.validation-box ul { margin: 10px 0; padding-left: 20px; }
.validation-box li + li { margin-top: 7px; }
.validation-note, .field-help, .approval-note { color: var(--muted); font-size: .85rem; }
.text-button { min-height: 38px; padding: 2px 0; border: 0; color: var(--teal); background: transparent; font-weight: 720; text-decoration: underline; text-underline-offset: 3px; text-align: left; }
.validation-box .text-button { color: #60470b; font-weight: 500; }
fieldset { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
legend { padding: 0; margin-bottom: 12px; font-size: 1.12rem; font-weight: 760; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.review-field { min-width: 0; }
.field-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.field-heading label { font-size: .87rem; font-weight: 720; }
.source-button { min-height: 34px; padding: 3px 0; border: 0; background: transparent; color: var(--teal); font-size: .78rem; text-decoration: underline; text-underline-offset: 3px; }
.field-note { min-height: 1.5em; margin-top: 6px; color: var(--muted); font-size: .78rem; }
.needs-attention input { border-color: #96670b; background: #fffdf5; }
.needs-attention .field-note { color: var(--amber); }
.edited input { border-left: 3px solid var(--teal); }
.line-group { padding: 16px; border: 1px solid var(--line); border-radius: 7px; margin-top: 12px; }
.line-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.description-field { grid-column: 1 / -1; }
.line-total { margin-top: 12px; font-size: .85rem; font-weight: 720; }
.calculation-summary { padding: 18px; background: var(--mist); border-radius: 7px; }
.calculation-summary dl { margin: 10px 0 0; font-size: .9rem; }
.changes-section { margin-top: 20px; }
.changes-section summary, .output-panel summary { padding: 12px 0; color: var(--teal); font-weight: 720; }
.changes-section ul { padding-left: 20px; margin: 6px 0 20px; font-size: .9rem; overflow-wrap: anywhere; }
.changes-section li + li { margin-top: 8px; }
.approval-section { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.confirm-label { display: flex; align-items: start; gap: 10px; margin: 16px 0; font-size: .92rem; cursor: pointer; }
.confirm-label input { flex-shrink: 0; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--teal); }
.primary-button, .secondary-button { min-height: 44px; border: 1px solid var(--teal); border-radius: 7px; padding: 10px 14px; font-weight: 720; }
.primary-button { margin-top: 14px; background: var(--teal); color: #fff; }
.secondary-button { color: var(--teal); background: var(--panel); }
.approval-note { margin-top: 12px; }
.output-panel { padding: 24px; margin-top: 20px; }
#outputStatus { margin-top: 10px; color: var(--muted); font-size: .9rem; }
pre { max-height: 460px; overflow: auto; padding: 18px; margin: 0; border-radius: 7px; background: #1e2524; color: #e5f0ec; font: .85rem/1.5 "Cascadia Code", Consolas, monospace; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 980px) {
  .header-row { grid-template-columns: 1fr; gap: 20px; }
  .demo-label { max-width: 420px; }
  .review-workspace { grid-template-columns: 1fr; }
  .source-panel { position: static; }
  .quote-scroll { max-height: 420px; }
}
@media (max-width: 600px) {
  .app-header { padding: 22px 18px; }
  .review-shell { width: calc(100% - 24px); }
  .scenario-bar { grid-template-columns: 1fr; gap: 10px; padding: 16px; }
  .scenario-bar p { grid-column: auto; }
  .field-grid, .line-grid { grid-template-columns: 1fr; }
  .review-panel, .output-panel { padding: 16px; }
  .quote-scroll { padding: 10px; }
  .quote-paper { padding: 18px 12px; }
  .evidence-nav { flex-wrap: wrap; padding: 12px; }
  .source-panel > summary { padding: 14px 12px; }
  .line-group { padding: 12px; }
  .calculation-summary dl div { flex-wrap: wrap; gap: 4px 12px; }
  .primary-button { width: 100%; }
}

.prototype-note { max-width: 1440px; margin: 0 auto; padding: 0 20px 24px; color: var(--muted); font-size: 0.78rem; font-style: italic; line-height: 1.5; }
