:root {
  --ink: #121718;
  --paper: #ffffff;
  --linen: #f6f3ef;
  --parchment: #e4e0dd;
  --graphite: #2f2f2f;
  --honey: #ffcd6d;
  --apricot: #ffe2aa;
  --muted: #5c5c58;
  --line: rgb(18 23 24 / 14%);
  --line-dark: rgb(255 255 255 / 20%);
  --danger: #7d302b;
  --danger-soft: #f7e4df;
  --focus: 0 0 0 3px rgb(255 205 109 / 82%);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--parchment);
  line-height: 1.45;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--parchment); }
button, input, select, textarea { font: inherit; }
.wrap { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: inherit; letter-spacing: -0.025em; line-height: 1.1; }
h1 { font-size: clamp(1.55rem, 2.7vw, 2.15rem); font-weight: 650; }
h2 { font-size: 1.25rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
[hidden] { display: none !important; }

.skip { position: absolute; z-index: 20; left: -9999px; top: 10px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); border-radius: 8px; padding: 10px 14px; }
.skip:focus { left: 16px; }
:focus-visible { outline: none; box-shadow: var(--focus); }

.site-header { padding: 20px 0 0; }
.header-row { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 11px 12px 11px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.brand-block { display: grid; gap: 1px; }
.eyebrow, .small-h { margin: 0; color: var(--muted); font-size: .75rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
nav { display: flex; align-items: center; gap: 8px; }
nav a { color: var(--ink); padding: 10px 12px; border-radius: 8px; font-size: .92rem; font-weight: 550; text-decoration: none; }
nav a:hover { background: var(--linen); }
.intro-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(250px, .7fr); gap: 20px; align-items: stretch; padding: 38px 2px 28px; }
.intro { max-width: 630px; margin: 0; font-size: clamp(1.35rem, 2.4vw, 2rem); font-weight: 520; letter-spacing: -.035em; line-height: 1.14; }
.demo-label { margin: 0; padding: 12px 14px; border-radius: var(--radius); background: var(--apricot); font-size: .85rem; line-height: 1.42; }

main { padding: 20px 0 52px; }
.examples { margin-bottom: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--linen); }
.examples .small-h { margin-bottom: 12px; }
.example-row { display: flex; flex-wrap: wrap; gap: 8px; }

.grid { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(330px, .84fr); gap: 18px; align-items: start; }
.side { display: grid; gap: 18px; }
.panel { min-width: 0; padding: clamp(20px, 3vw, 30px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.req-id { margin-left: 6px; color: var(--muted); font-size: .85rem; font-weight: 500; letter-spacing: 0; }
.help, .muted { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.help { margin: 5px 0 8px; }
.tag { display: inline-block; margin-left: 7px; padding: 3px 9px; border-radius: 999px; background: var(--apricot); color: var(--ink); font-size: .72rem; font-weight: 650; letter-spacing: .02em; vertical-align: middle; }

.btn { min-height: 44px; border: 1px solid var(--ink); border-radius: 10px; padding: 10px 15px; background: var(--paper); color: var(--ink); cursor: pointer; font-size: .92rem; font-weight: 600; line-height: 1; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease; }
.btn:hover { background: var(--linen); }
.btn:active { background: var(--parchment); }
.btn.primary { border-color: var(--honey); background: var(--honey); color: var(--ink); }
.btn.primary:hover { border-color: #f2bc52; background: #f2bc52; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--linen); }
.btn.link { min-height: auto; padding: 0; border: 0; border-radius: 0; color: inherit; background: transparent; font-size: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.btn.example { min-height: 40px; border-color: var(--line); background: var(--paper); padding: 9px 13px; font-size: .87rem; }
.btn.example:hover { border-color: var(--ink); background: var(--apricot); }
.btn:disabled, .mode:disabled { cursor: not-allowed; opacity: .48; }

.mode-toggle { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--linen); }
.mode { min-height: 38px; border: 0; border-radius: 7px; padding: 7px 11px; background: transparent; color: var(--ink); cursor: pointer; font-size: .85rem; font-weight: 600; }
.mode[aria-pressed="true"] { background: var(--graphite); color: var(--paper); }
.lock-note { margin: -8px 0 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--linen); font-size: .9rem; }

fieldset { min-width: 0; margin: 0 0 26px; padding: 0; border: 0; }
legend { margin-bottom: 12px; padding: 0; font-size: 1.08rem; font-weight: 650; letter-spacing: -.02em; }
.step-count { margin: 0 0 8px; color: var(--muted); font-size: .8rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.field { margin-bottom: 16px; }
.field label, .field .label { display: block; margin: 0 0 5px; font-size: .92rem; font-weight: 650; }
.field .help { margin-top: 0; }
input[type="text"], input[type="date"], select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid rgb(18 23 24 / 34%); border-radius: 9px; background: var(--paper); color: var(--ink); line-height: 1.35; }
textarea { min-height: 86px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.err { min-height: 0; margin: 5px 0 0; color: var(--danger); font-size: .83rem; font-weight: 550; }
.err:empty { display: none; }
.err:not(:empty)::before { content: "! "; font-weight: 750; }
.radio { display: flex; align-items: center; gap: 9px; margin: 7px 0; }
.radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--graphite); }
.radio label { margin: 0; font-weight: 450; }
.review { margin-bottom: 24px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--linen); }
.review h3 { margin-bottom: 12px; }
.review dl { display: grid; grid-template-columns: minmax(112px, .55fr) minmax(0, 1.45fr); gap: 7px 16px; margin: 0; font-size: .92rem; }
.review dt { color: var(--muted); }
.review dd { margin: 0; overflow-wrap: anywhere; }
.review dd.missing { color: var(--danger); font-weight: 650; }
.form-msg { margin: 0 0 10px; color: var(--danger); font-weight: 650; }
.form-msg:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.route { border-color: var(--graphite); background: var(--graphite); color: var(--paper); }
.route h2 { color: var(--paper); }
.route .small-h, .route .meta { color: rgb(255 255 255 / 64%); }
.status { display: flex; align-items: center; gap: 9px; margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line-dark); border-radius: 10px; background: rgb(255 255 255 / 8%); color: var(--paper); font-weight: 650; }
.status .icon { display: inline-grid; width: 24px; height: 24px; place-items: center; border: 1px solid currentColor; border-radius: 50%; background: transparent; font-size: .8rem; }
.status.waiting { border-color: rgb(255 205 109 / 50%); background: rgb(255 205 109 / 14%); }
.status.done { background: rgb(255 255 255 / 15%); }
.status.stop { border-color: rgb(247 184 174 / 55%); background: rgb(125 48 43 / 52%); }
.status.exception { border-color: rgb(255 226 170 / 60%); background: rgb(255 226 170 / 16%); }
.next { margin: 0 0 16px; color: var(--paper); font-weight: 550; }
.stages { margin: 0 0 22px; padding: 0; list-style: none; border-left: 1px solid var(--line-dark); }
.stage { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 9px; align-items: center; min-height: 36px; margin-left: -10px; padding: 5px 0; }
.stage .dot { width: 19px; height: 19px; border: 2px solid rgb(255 255 255 / 42%); border-radius: 50%; background: var(--graphite); }
.stage .name { font-size: .91rem; }
.stage .st { padding: 3px 8px; border-radius: 999px; background: rgb(255 255 255 / 10%); color: rgb(255 255 255 / 70%); font-size: .71rem; font-weight: 650; white-space: nowrap; }
.stage.done .dot { border-color: var(--paper); background: var(--paper); box-shadow: inset 0 0 0 4px var(--graphite); }
.stage.done .st { background: rgb(255 255 255 / 16%); color: var(--paper); }
.stage.current .dot { border-color: var(--honey); background: var(--honey); box-shadow: inset 0 0 0 4px var(--graphite); }
.stage.current .name { font-weight: 700; }
.stage.current .st { background: var(--honey); color: var(--ink); }
.stage.skipped .name { color: rgb(255 255 255 / 52%); text-decoration: line-through; }
.stage.rejected .dot, .stage.stopped .dot { border-color: #f7b8ae; }
.stage.rejected .st, .stage.stopped .st { background: rgb(125 48 43 / 74%); color: var(--paper); }
.stages.exception { border-left-color: rgb(255 226 170 / 70%); }
.stages.exception .stage.current .dot { border-color: var(--apricot); background: var(--apricot); }
.stages.exception .stage.current .st { background: var(--apricot); }
.reasons { margin: 0 0 14px; padding-left: 19px; color: rgb(255 255 255 / 86%); font-size: .9rem; }
.reasons li { margin-bottom: 6px; }

.reviewer, .history { background: var(--linen); }
.reviewer label { display: block; margin: 10px 0 5px; font-size: .9rem; font-weight: 650; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.action-msg { margin: 12px 0 0; color: var(--ink); font-weight: 650; }
.action-msg:empty { display: none; }
.action-msg.blocked { color: var(--danger); }
.action-msg.blocked::before { content: "Blocked: "; font-weight: 750; }
.events { margin: 0; padding: 0; list-style: none; }
.event { display: grid; grid-template-columns: minmax(0, 1fr); margin-bottom: 5px; padding: 10px 0 10px 13px; border-left: 2px solid var(--ink); }
.event.reported { border-left-color: #bd8740; border-radius: 0 8px 8px 0; background: var(--apricot); }
.event .when { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.event .what { margin-top: 2px; font-weight: 650; }
.event .who, .event .why { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.earlier { margin-top: 9px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--muted); font-size: .84rem; }

.site-footer { margin-top: 8px; margin-bottom: 24px; padding: 21px 24px; border-radius: var(--radius); background: var(--graphite); color: rgb(255 255 255 / 74%); font-size: .82rem; }
.site-footer p { margin: 0; }

@media (max-width: 860px) {
  .intro-row, .grid { grid-template-columns: 1fr; }
  .intro-row { gap: 16px; padding: 28px 2px 22px; }
  .grid { gap: 14px; }
  .side { gap: 14px; }
}
@media (max-width: 580px) {
  .wrap { width: min(100% - 24px, 1200px); }
  .site-header { padding-top: 12px; }
  .header-row { align-items: flex-start; padding: 14px; }
  nav { align-items: flex-end; flex-direction: column; gap: 3px; }
  nav a { padding: 8px; }
  .panel, .examples { padding: 18px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .mode-toggle { width: 100%; }
  .mode { flex: 1; }
  .form-actions .btn { flex: 1; }
  .review dl { grid-template-columns: 1fr; gap: 2px; }
  .review dd { margin-bottom: 7px; }
  .stage { grid-template-columns: 20px minmax(0, 1fr); }
  .stage .st { grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
