:root {
  color-scheme: light;
  --white: #FFFFFF;
  --canvas: #F7F8FC;
  --wash: #F3EFFF;
  --lavender: #EDE9FE;
  --line: #D8CBEF;
  --ink: #45434A;
  --muted: #56535A;
  --outline: #706C75;
  font: 15px/1.45 system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 12px; }
body, h1, h2, h3, p, dl, dd, ul { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: var(--ink); }
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--outline); outline-offset: 3px; }
::selection { color: var(--ink); background: var(--line); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; z-index: 2; left: 8px; top: -100px; background: var(--white); padding: 10px; }
.skip:focus { top: 8px; }
.wrapper { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 20px; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: var(--ink); font-size: 22px; font-weight: 800; letter-spacing: -.04em; text-decoration: none; }
.brand span { padding-inline: 5px; border-radius: 6px; background: var(--lavender); }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; flex: 0 0 auto; white-space: nowrap; }
.brand .brand-wordmark { padding: 0; border-radius: 0; background: none; }
.brand-mark { display: block; width: 32px; height: 32px; flex: none; }
.site-nav { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; }
.site-nav a, .jump, .mobile-link {
  display: inline-flex; align-items: center; gap: 5px; min-height: 36px;
  padding: 6px 10px; border-radius: 7px; font-size: 14px; font-weight: 600;
}
.site-nav a[aria-current] { background: var(--wash); text-decoration: none; }
.site-nav a:hover, .jump:hover, .mobile-link:hover { background: var(--lavender); }
.version, .badge, .gate, .count {
  display: inline-flex; align-items: center; width: fit-content;
  padding: 3px 9px; border-radius: 20px; background: var(--wash); color: var(--muted);
  font-size: 12px; font-weight: 600; line-height: 1.4;
}
main.wrapper { padding-block: 17px 28px; }
h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; }
h1 { font-size: clamp(24px, 2.6vw, 30px); letter-spacing: -.04em; }
h2 { font-size: 19px; letter-spacing: -.025em; }
h3 { font-size: 16px; }
.intro, .title-line, .section-head, .blueprint-head, .outcome-line {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
}
.intro, .section-head, .blueprint-head, .outcome-line { justify-content: space-between; }
.intro { gap: 6px 14px; margin-bottom: 14px; }
.intro p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.badge { background: var(--lavender); }
.jump { padding-inline: 6px; }
.mobile-link { display: none; }
.workspace, .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workspace { gap: 12px; align-items: start; }
.column { display: grid; min-width: 0; align-content: start; gap: 12px; }
.panel { min-width: 0; padding: 15px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.section-head { min-height: 24px; margin-bottom: 10px; }
.fields { gap: 12px 14px; }
.field { min-width: 0; }
.field label, .format, .copy-fallback label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 650; }
input[type=text], select, textarea {
  width: 100%; min-width: 0; min-height: 40px; max-width: 100%; padding: 7px 9px;
  border: 1px solid var(--outline); border-radius: 7px; color: var(--ink); background: var(--white);
  font-size: 14px; line-height: 1.3;
}
select { cursor: pointer; }
input[type=text], .facts dd, .trace-id { font-variant-numeric: tabular-nums; }
.money { position: relative; }
.money span {
  position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .035em; pointer-events: none;
}
.money input { padding-inline-start: 45px; }
.hint, .scenario-note { color: var(--muted); font-size: 12px; }
.hint, .error { margin-top: 4px; }
.error { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
input[aria-invalid=true] { border: 2px dashed var(--outline); }
.record-options { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; font-size: 13px; cursor: pointer; }
.check input {
  appearance: none; display: grid; place-content: center; flex: 0 0 auto; width: 19px; height: 19px;
  margin: 0; border: 1px solid var(--outline); border-radius: 4px; color: var(--ink); background: var(--white);
  cursor: pointer;
}
.check input:checked { background: var(--line); }
.check input:checked::after {
  content: ""; width: 9px; height: 5px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: translateY(-1px) rotate(-45deg);
}
.history { margin-top: 7px; padding-top: 12px; border-top: 1px solid var(--line); }
button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px; max-width: 100%;
  padding: 6px 12px; border: 1px solid var(--outline); border-radius: 7px;
  background: var(--white); font-size: 13px; font-weight: 600; line-height: 1.3; cursor: pointer;
}
button:hover:enabled { background: var(--wash); }
button.primary { background: var(--lavender); }
button.primary:hover:enabled { background: var(--line); }
button:disabled { border-color: var(--line); background: var(--canvas); color: var(--outline); cursor: default; }
.text-button { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.section-head .text-button { min-height: 28px; padding: 3px 4px; }
.text-button:disabled { border-color: transparent; background: transparent; text-decoration: none; }
.outcome { padding: 12px 14px; border-left: 4px solid var(--line); border-radius: 4px 8px 8px 4px; background: var(--wash); }
.outcome h3 { font-size: clamp(21px, 2.2vw, 25px); letter-spacing: -.035em; }
.outcome p { margin-top: 4px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.gate { border: 1px solid var(--line); background: var(--white); white-space: nowrap; }
.facts { margin-block: 7px; font-size: 13px; }
.facts div { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; padding: 5px 0; }
.facts div + div { border-top: 1px solid var(--lavender); }
.facts dt { color: var(--muted); }
.facts dd { font-weight: 600; overflow-wrap: anywhere; }
.decisions, .scenarios, .export-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.decisions { margin-top: 8px; }
.section-note { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
#scenarios .section-head { margin-bottom: 3px; }
.scenarios { margin-top: 8px; }
.scenarios button { min-height: 32px; border-color: var(--line); }
.scenarios button[aria-pressed=true] { border-color: var(--outline); background: var(--lavender); }
.scenario-note:not(:empty) { margin-top: 7px; }
.blueprint { margin-top: 12px; }
.blueprint-head .section-note { margin-top: 4px; }
.export-tools { align-items: end; }
.format { display: flex; align-items: center; gap: 7px; margin: 0; }
.format select { width: auto; min-height: 36px; }
.feedback, .notice { color: var(--muted); font-size: 13px; }
.feedback:not(:empty), .notice, .copy-fallback { margin-top: 10px; }
.notice, .copy-fallback { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--wash); }
.copy-fallback textarea { display: block; resize: vertical; font: 13px/1.4 ui-monospace, monospace; }
.blueprint-sections { margin-top: 13px; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { display: list-item; min-height: 40px; padding: 9px 4px; font-size: 14px; font-weight: 650; cursor: pointer; }
summary:hover { background: var(--wash); }
summary::marker { color: var(--muted); }
.count { margin-left: 6px; padding: 1px 7px; vertical-align: 1px; font-size: 11px; }
.requirements, .tests, .items, .ordinary { padding: 0 5px 9px; font-size: 13px; }
.requirements, .tests, .items { list-style: none; }
.requirements li, .tests li, .items li { display: grid; align-items: baseline; gap: 2px 12px; padding: 6px 0; overflow-wrap: anywhere; }
.requirements li + li, .tests li + li, .items li + li { border-top: 1px solid var(--lavender); }
.requirements li { grid-template-columns: 60px minmax(0, 1fr) minmax(155px, .3fr); }
.trace-id { color: var(--ink); font-weight: 700; white-space: nowrap; }
.meta { color: var(--muted); font-size: 12px; }
.items li { grid-template-columns: minmax(0, 1fr) auto; }
.tests li { grid-template-columns: 90px minmax(0, 1fr) minmax(120px, .5fr) minmax(110px, .4fr); }
.tests .trace-id, .tests .meta { display: block; }
.ordinary { padding-left: 24px; }
.ordinary li { padding-block: 3px; overflow-wrap: anywhere; }
@media (max-width: 800px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .mobile-link { display: inline-flex; }
  .requirements li { grid-template-columns: 60px minmax(0, 1fr); }
  .requirements li .meta { grid-column: 2; }
}
@media (max-width: 600px) {
  .wrapper { padding-inline: 12px; }
  main.wrapper { padding-block: 12px 20px; }
  .topbar { gap: 1px 8px; padding-block: 5px; flex-wrap: wrap; }
  .site-nav { order: 1; width: 100%; justify-content: flex-start; gap: 1px; }
  .site-nav a { padding-inline: 6px; font-size: 13px; }
  .site-nav a, .brand, .jump, .mobile-link, button, .section-head .text-button,
  .scenarios button, input[type=text], select, .format select, .check, summary { min-height: 44px; }
  .brand { display: inline-flex; align-items: center; }
  .intro { margin-bottom: 10px; }
  .jump { padding: 4px 0; }
  .panel { padding: 12px; }
  .column, .workspace { gap: 10px; }
  .blueprint { margin-top: 10px; }
  .fields { gap: 10px; }
  input[type=text], select, textarea { font-size: 16px; }
  .format { flex-wrap: wrap; gap: 4px; }
  .tests li { grid-template-columns: 68px minmax(0, 1fr); }
  .tests li > :nth-child(n+3) { grid-column: 2; }
  .scenarios button { flex: 1 1 120px; }
}
@media (max-width: 420px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .title-line { gap: 4px 8px; }
  .outcome-line { align-items: start; gap: 4px; }
  .export-tools { width: 100%; }
  .format { width: 100%; }
  .format select { flex: 1; }
  .requirements li { grid-template-columns: minmax(0, 1fr); }
  .requirements li .meta { grid-column: 1; }
  .facts div { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .check input { appearance: auto; }
  .check input:checked::after { display: none; }
  .scenarios button[aria-pressed=true] { outline: 2px solid currentColor; outline-offset: -3px; }
}

.review-handoff { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; margin:10px 0; padding:10px 0; border-top:1px solid var(--line); }
.review-handoff .hint { flex:1 1 280px; }
.review-handoff [aria-disabled="true"] { color:var(--muted); text-decoration:none; cursor:default; }

.app-support { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.app-support a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
@media print { .app-support { display: none; } }
