:root {
  --base: var(--paper);
  --panel: var(--white);
  --inset: #f0f3ec;
  --accent: var(--forest);
  --accent-ink: var(--white);
  --amber: #7c3c0d;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
button, select, input { font: inherit; }
button, select, label:has(input) { cursor: pointer; }
button:disabled, select:disabled, label:has(input:disabled) { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(70rem, calc(100% - 2.5rem)); margin-inline: auto; }
.masthead { position: sticky; top: 0; z-index: 2; background: var(--base); }
.disclosure { background: #173630; border-block: 1px solid #527167; color: #f7f5ef; font-size: .83rem; padding-block: .45rem; }
.demo-hero { display: grid; grid-template-columns: 1fr minmax(15rem, .36fr); align-items: end; gap: 2rem; padding-block: 3.1rem 2.35rem; }
.demo-eyebrow { color: var(--accent); text-transform: uppercase; font-size: .73rem; font-weight: 780; letter-spacing: .12em; }
.dot { display: inline-block; background: var(--accent); width: .45rem; height: .45rem; border-radius: 50%; margin-right: .35rem; vertical-align: .11rem; }
h1 { font-size: clamp(2.65rem, 6vw, 4.95rem); line-height: 1.02; letter-spacing: -.045em; margin: .32rem 0 .65rem; }
h1 span { color: var(--accent); }
.intro { color: var(--muted); max-width: 35rem; font-size: 1.075rem; }
.demo-hero-note { border-left: 2px solid var(--line); padding: .1rem 0 .1rem .9rem; font-size: .9rem; color: var(--muted); }
.demo-hero-note p + p { margin-top: .3rem; }
.workbench { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 1.1rem; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: .85rem; padding: clamp(1rem, 2.1vw, 1.55rem); }
.panel-heading { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.step { border: 1px solid #9cad9f; background: #e7eee5; color: var(--accent); border-radius: .45rem; padding: .27rem .45rem; font: 700 .8rem/1.25 ui-monospace, monospace; }
h2 { font-family: var(--body); font-weight: 700; font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.2; letter-spacing: -.025em; }
h3 { font-size: 1rem; margin-bottom: .45rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .scenario label { font-weight: 700; font-size: .9rem; }
.trade-options { display: flex; gap: .45rem; margin: .3rem 0 .35rem; }
.trade-options label { position: relative; }
.trade-options input { position: absolute; opacity: 0; }
.trade-options span { display: block; padding: .4rem .95rem; border: 1px solid var(--line); border-radius: .4rem; font-size: .9rem; }
.trade-options input:checked + span { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 750; }
.trade-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.hint { color: var(--muted); font-size: .81rem; }
.rule { margin-top: .85rem; color: var(--muted); font-size: .86rem; }
.list-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem; border-top: 1px solid var(--line); padding-top: .75rem; margin: .85rem 0 .6rem; font-size: .84rem; }
.check { display: inline-flex; align-items: center; gap: .35rem; min-height: 2rem; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.estimate { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: .55rem; background: var(--inset); padding: .63rem .7rem; border: 1px solid var(--line); border-radius: .46rem; }
.estimate.excluded { grid-template-columns: 1fr auto; }
.estimate + .estimate { margin-top: .42rem; }
.estimate:has(input:checked) { border-color: var(--accent); background: #e7eee5; }
.estimate input { margin: .33rem 0 0; }
.record-name, .record-meta { display: block; }
.record-name { font-size: .91rem; font-weight: 740; }
.record-meta { font-size: .78rem; color: var(--muted); }
.record-reason { font-size: .78rem; color: var(--amber); margin-top: .22rem; grid-column: 1 / -1; }
.badge { font-size: .7rem; font-weight: 700; border-radius: .28rem; padding: .14rem .35rem; color: var(--accent); background: #d8ebdc; }
.excluded .badge { color: var(--amber); background: #f4e1ca; }
.message, .disposition { padding: .85rem .9rem; background: var(--inset); border: 1px solid var(--line); border-radius: .5rem; }
.message { margin-bottom: .65rem; }
.message .demo-eyebrow { margin-bottom: .35rem; }
.message dl { font-size: .83rem; margin: 0 0 .65rem; }
.message dl div { display: grid; grid-template-columns: 4rem 1fr; gap: .35rem; }
.message dt { color: var(--muted); }
.message dd { margin: 0; overflow-wrap: anywhere; }
.message-body { white-space: pre-wrap; font-size: .88rem; border-top: 1px solid var(--line); padding-top: .55rem; }
.empty { color: var(--muted); font-size: .9rem; }
.demo-button { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; border-radius: .42rem; border: 1px solid var(--line); color: var(--ink); font-weight: 740; font-size: .84rem; padding: .48rem .72rem; min-height: 2.3rem; }
.demo-button.secondary { background: #fffefa; }
.demo-button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.demo-button:disabled { background: #e5e9e1; color: var(--muted); border-color: var(--line); }
.demo-button:not(:disabled):hover { border-color: var(--accent); }
.scenario { border-top: 1px solid var(--line); margin-top: .95rem; padding-top: .85rem; }
.scenario select { display: block; width: 100%; color: var(--ink); background: var(--inset); border: 1px solid var(--line); border-radius: .4rem; padding: .5rem; margin: .32rem 0 .4rem; }
.scenario .demo-button { margin-top: .65rem; }
.report { margin-top: 1.1rem; }
.report-header { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: .4rem; }
.report-header .panel-heading { margin-bottom: .35rem; }
.report-disclosure { color: var(--muted); font-size: .86rem; }
.metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: .45rem; margin: .9rem 0 1.1rem; }
.metrics div { display: flex; flex-direction: column-reverse; justify-content: flex-end; background: var(--inset); border: 1px solid var(--line); border-radius: .45rem; padding: .55rem .65rem; }
.metrics dt { color: var(--muted); font-size: .77rem; }
.metrics dd { margin: 0; color: var(--accent); font-size: 1.35rem; font-weight: 750; line-height: 1.15; }
.report-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 1rem; }
.demo-timeline { list-style: none; padding: 0; margin: 0; }
.demo-timeline li { padding: .53rem 0 .53rem .8rem; border-left: 2px solid #9cad9f; font-size: .86rem; }
.demo-timeline time, .demo-timeline code { color: var(--muted); font-size: .74rem; }
.demo-timeline code { overflow-wrap: anywhere; }
.disposition p + p { margin-top: .45rem; }
.report-note { border-top: 1px solid var(--line); margin-top: .95rem; padding-top: .8rem; color: var(--muted); font-size: .83rem; }
.error { color: var(--amber); margin-block: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 760px) {
  .demo-hero, .workbench, .report-grid { grid-template-columns: 1fr; }
  .demo-hero { gap: 1rem; padding-block: 1.85rem 1.45rem; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 400px) {
  .wrap { width: calc(100% - 1.4rem); }
}
@media print {
  :root { color-scheme: light; --ink: #111; --muted: #333; --accent: #111; --line: #aaa; }
  body, .masthead, .disclosure, .panel, .metrics div, .disposition, .step { color: #111; background: white; }
  .wrap { width: 100%; }
  .masthead { position: static; }
  .demo-button, .workbench, .demo-hero-note { display: none; }
  .demo-hero { padding-block: 1rem; }
  h1 { font-size: 2rem; }
  .metrics div, .demo-timeline li { break-inside: avoid; }
}
.estimate.blocked .badge { color: var(--amber); background: #f4e1ca; }
.demo-button[aria-disabled="true"] { cursor: default; background: #e5e9e1; color: var(--muted); border-color: var(--line); }
.demo-button[aria-disabled="true"]:hover { border-color: var(--line); }

.demo-header-actions { display: flex; align-items: center; gap: .8rem; font-size: .84rem; }
.masthead .header-inner { min-height: 4.9rem; }
.site-footer { margin-top: 1.85rem; border-top: 1px solid var(--line); font-size: .8rem; }
.skip-link { z-index: 3; }
:focus-visible { outline-color: #996018; }
.demo-hero .demo-eyebrow { margin-bottom: .3rem; }
@media (max-width: 500px) {
  .demo-header-actions > a { display: none; }
  .masthead .shell { width: calc(100% - 1.4rem); }
  .masthead .header-inner { flex-wrap: nowrap; }
}
@media print { .site-footer, .demo-header-actions, .skip-link { display: none; } }
