:root {
  --paper: #fafaf7;
  --paper-deep: #f2f3ec;
  --ink: #202820;
  --muted: #637066;
  --green: #225c42;
  --green-dark: #173b2d;
  --lime: #ddeb9e;
  --sage: #edf1e4;
  --line: #d9ddd3;
  --white: #ffffff;
  --error: #9a3b32;
  --shadow: 0 22px 55px -42px rgba(25, 50, 32, 0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.site-header {
  width: min(1320px, calc(100% - 40px));
  min-height: 76px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 34px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
.brand-mark {
  width: 31px; height: 31px; display: grid; place-items: center;
  color: var(--paper); background: var(--ink); border-radius: 9px; font-size: 15px;
}
.brand-name { font-size: 14px; line-height: 1; }
.site-header nav { display: flex; gap: 26px; margin-left: auto; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.site-header nav a:hover { color: var(--ink); }
.research-badge, .mode-pill, .result-mode {
  border: 1px solid var(--line); border-radius: 999px; font: 600 10px/1 ui-monospace, monospace;
  letter-spacing: .08em; padding: 9px 12px; white-space: nowrap;
}
.research-badge { color: var(--muted); }

.hero { padding: 88px 0 82px; text-align: center; }
.eyebrow {
  margin: 0; color: var(--green); font: 600 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .16em; text-transform: uppercase;
}
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--green); }
.hero h1 {
  max-width: 900px; margin: 25px auto 22px; font-size: clamp(54px, 8vw, 92px); line-height: .93;
  letter-spacing: -.072em; font-weight: 650;
}
.hero h1 span { color: var(--green); }
.hero-copy { max-width: 660px; margin: 0 auto; color: var(--muted); font-size: 18px; line-height: 1.75; }
.hero-actions { display: flex; justify-content: center; align-items: center; gap: 19px; margin-top: 27px; }
.primary-link {
  display: inline-flex; align-items: center; gap: 18px; padding: 14px 22px;
  color: white; background: var(--green); border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 700;
}
.primary-link:hover { background: var(--green-dark); }
.secondary-link { color: var(--green); font-size: 13px; font-weight: 700; text-underline-offset: 4px; }
.pattern {
  margin: 40px auto 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 11px;
  color: var(--muted); font: 12px/1.4 ui-monospace, monospace;
}
.pattern b { font-weight: 400; color: #9aa399; }
.pattern strong { padding: 6px 10px; border-radius: 4px; color: var(--green); background: var(--sage); font-weight: 600; }

.workflow-section { padding: 62px; border: 1px solid #d7ded0; border-radius: 18px; background: #f0f4e9; box-shadow: var(--shadow); }
.workflow-heading { display: grid; grid-template-columns: 1.15fr .85fr; align-items: end; gap: 80px; }
.workflow-heading h2 { max-width: 620px; margin: 12px 0 0; font-size: clamp(36px, 5vw, 58px); line-height: .98; letter-spacing: -.055em; }
.workflow-heading > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.workflow-board { display: grid; grid-template-columns: minmax(210px,.9fr) 72px minmax(285px,1.18fr) 72px minmax(190px,.78fr); align-items: center; margin-top: 48px; }
.state-card, .action-card { min-width: 0; padding: 25px; border: 1px solid #ccd5c5; border-radius: 12px; background: rgba(255,255,255,.78); }
.diagram-label { margin: 0; color: var(--green); font: 600 9px/1.4 ui-monospace, monospace; letter-spacing: .16em; }
.state-card h3, .action-card h3 { margin: 13px 0 10px; font-size: 20px; letter-spacing: -.025em; }
.state-card > p:not(.diagram-label), .action-card > p:not(.diagram-label) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.state-card ul { list-style: none; margin: 21px 0 0; padding: 0; border-top: 1px solid var(--line); }
.state-card li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.state-card li span { color: var(--muted); }
.fanout { position: relative; height: 80%; min-height: 235px; }
.fanout span { position: absolute; left: 0; top: 50%; width: 100%; height: 1px; background: #9cb09b; }
.fanout span::after { content: ""; position: absolute; right: -1px; top: -4px; width: 7px; height: 7px; border-top: 1px solid #769174; border-right: 1px solid #769174; transform: rotate(45deg); }
.fanout i { position: absolute; right: 0; width: 42%; height: 1px; background: #9cb09b; transform-origin: right; }
.fanout i:nth-of-type(1) { top: 12%; transform: rotate(-39deg); }
.fanout i:nth-of-type(2) { top: 38%; transform: rotate(-18deg); }
.fanout i:nth-of-type(3) { top: 62%; transform: rotate(18deg); }
.fanout i:nth-of-type(4) { top: 88%; transform: rotate(39deg); }
.question-stack { display: grid; gap: 8px; }
.question-card { display: flex; justify-content: space-between; align-items: center; min-height: 54px; gap: 15px; padding: 11px 14px; border: 1px solid #d3dacd; border-radius: 8px; background: rgba(255,255,255,.84); }
.question-card > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.question-card > div span { color: #829181; font: 9px ui-monospace, monospace; }
.question-card > div strong { font-size: 12px; line-height: 1.35; }
.question-card p { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.question-card p b { color: var(--green); font: 700 9px ui-monospace, monospace; letter-spacing: .08em; }
.question-card p em { min-width: 36px; color: var(--green); font: normal 700 12px ui-monospace, monospace; text-align: right; }
.question-card.uncertain { border-style: dashed; background: #f6f7ef; }
.action-card { position: relative; grid-column: 5; border-color: var(--green); background: var(--green); color: white; }
.action-card .diagram-label { color: var(--lime); }
.policy-rule { margin: 16px 0 0; color: #edf4e9; font: 600 10px/1.65 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.policy-rule span { color: var(--lime); }
.unknown-rule { margin-top: 16px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.2); }
.unknown-rule span { display: block; color: #b9c9bd; font: 9px/1.4 ui-monospace, monospace; }
.unknown-rule strong { display: block; margin-top: 5px; color: var(--lime); font-size: 10px; }
.action-arrow { position: absolute; left: -52px; top: 50%; color: var(--green); font-size: 23px; transform: translateY(-50%); }
.workflow-note { max-width: 760px; margin: 24px 0 0; color: #758075; font-size: 10px; line-height: 1.6; }

.playground-section { padding: 104px 0 100px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; }
.section-heading h2, .numbers-heading h2 { margin: 12px 0 0; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.045em; }
.mode-pill { display: inline-flex; align-items: center; color: var(--green); background: white; font-family: Arial, sans-serif; letter-spacing: 0; font-size: 12px; }
.mode-pill .status-dot { margin-right: 7px; width: 6px; height: 6px; }
.mode-pill.recorded .status-dot { background: #a7a05a; }
.section-intro { max-width: 680px; margin: 18px 0 28px; color: var(--muted); line-height: 1.75; }

.preset-grid {
  display: flex; gap: 8px; margin-bottom: 10px; padding-bottom: 3px; overflow-x: auto;
  scrollbar-width: thin; scrollbar-color: #c8d1c2 transparent;
}
.preset-card {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 13px;
  text-align: left; cursor: pointer; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.58); transition: border-color .15s, background .15s, transform .15s;
}
.preset-card:hover { border-color: #a8b8a5; }
.preset-card.active { border-color: #a9bd9f; background: var(--sage); }
.preset-card small { color: var(--green); font: 600 9px/1.4 ui-monospace, monospace; letter-spacing: .1em; }
.preset-card strong { font-size: 12px; line-height: 1.3; }
.preset-summary { min-height: 20px; margin: 0 0 19px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.workspace { display: grid; grid-template-columns: 1.08fr 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); }
.input-panel, .output-panel { min-width: 0; padding: 32px; }
.output-panel { background: #f3f6ed; border-left: 1px solid var(--line); }
.panel-kicker { min-height: 27px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font: 600 10px/1.4 ui-monospace, monospace; letter-spacing: .15em; }
.text-button { border: 0; padding: 4px; background: transparent; color: var(--muted); cursor: pointer; font: 12px Arial, sans-serif; }
.text-button:hover { color: var(--ink); }
.field-heading { display: flex; align-items: end; justify-content: space-between; }
.field-label { display: flex; align-items: center; gap: 8px; margin: 22px 0 9px; font-size: 14px; font-weight: 700; }
.field-label span { color: var(--muted); font: 11px ui-monospace, monospace; }
textarea, input {
  width: 100%; color: var(--ink); background: #fcfcfa; border: 1px solid #cdd3ca; border-radius: 7px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: none; height: 108px; min-height: 108px; padding: 11px 14px; line-height: 1.55; }
textarea.expanded { height: 240px; resize: vertical; }
input { height: 44px; padding: 0 13px; }
textarea:focus, input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(34,92,66,.1); }
.choice-heading { display: flex; align-items: end; justify-content: space-between; }
.choice-heading .field-label { margin-bottom: 9px; }
.choice-count { margin-bottom: 9px; color: var(--muted); font: 11px ui-monospace, monospace; }
.choices { display: grid; gap: 8px; }
.choice-row { border: 1px solid #cdd3ca; border-radius: 7px; background: #fcfcfa; overflow: hidden; }
.choice-main { display: grid; grid-template-columns: 32px minmax(110px,1fr) auto 32px; align-items: center; }
.choice-letter { display: grid; place-items: center; color: var(--muted); font: 11px ui-monospace, monospace; }
.choice-row input { height: 43px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.choice-details { padding: 0 9px 9px 32px; border-top: 1px solid #e5e8e1; }
.choice-details input { height: 40px; margin-top: 8px; border: 1px solid #e0e4dc; border-radius: 5px; background: white; }
.choice-detail-toggle { padding: 7px 8px; border: 0; border-radius: 5px; color: var(--green); background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; }
.choice-detail-toggle:hover { background: #eef2e9; }
.choice-remove { height: 32px; width: 32px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.choice-remove:hover { background: #eef0e9; color: var(--ink); }
.choice-actions { min-height: 40px; display: flex; align-items: center; }
.secondary-button { border: 0; background: transparent; color: var(--green); cursor: pointer; padding: 10px 0; font-size: 12px; font-weight: 700; }
.secondary-button:disabled { opacity: .4; cursor: default; }
.run-button {
  width: 100%; height: 48px; display: flex; justify-content: space-between; align-items: center; padding: 0 18px;
  border: 0; border-radius: 7px; color: white; background: var(--green); cursor: pointer; font-weight: 700;
}
.run-button:hover { background: var(--green-dark); }
.run-button:disabled { opacity: .68; cursor: wait; }
.form-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.result-mode { color: var(--muted); background: rgba(255,255,255,.55); border-radius: 4px; padding: 7px 9px; font-size: 9px; }
.empty-result { padding-top: 38px; }
.empty-result p, .result-label { margin: 0; color: var(--muted); font-size: 13px; }
.empty-result h3 { margin: 10px 0 44px; font-size: 32px; letter-spacing: -.04em; }
.empty-lines { display: grid; gap: 22px; }
.empty-lines i { height: 5px; border-radius: 5px; background: #dfe6d7; }
.empty-lines i:nth-child(1) { width: 96%; }
.empty-lines i:nth-child(2) { width: 72%; }
.empty-lines i:nth-child(3) { width: 84%; }
.empty-lines i:nth-child(4) { width: 48%; }
.decision-result { padding-top: 26px; }
.winner-row { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-top: 8px; padding-bottom: 24px; border-bottom: 1px solid #dbe2d5; }
.winner-row h3 { margin: 0; font-size: clamp(27px, 3.5vw, 42px); line-height: 1.05; letter-spacing: -.045em; text-transform: capitalize; overflow-wrap: anywhere; }
.winner-row strong { color: var(--green); font-size: 32px; letter-spacing: -.04em; }
.probabilities { display: grid; gap: 15px; padding: 24px 0; border-bottom: 1px solid #dbe2d5; }
.probability-row { display: grid; grid-template-columns: minmax(120px,.8fr) 1.3fr 48px; gap: 12px; align-items: center; }
.probability-row span { font-size: 13px; text-transform: capitalize; overflow-wrap: anywhere; }
.probability-row b { text-align: right; font: 600 12px ui-monospace, monospace; }
.bar { height: 7px; overflow: hidden; background: #dce4d5; border-radius: 999px; }
.bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .65s cubic-bezier(.2,.8,.2,1); }
.probability-row.winner .bar i { background: #9aaf43; }
.receipt-title { margin: 23px 0 9px; color: var(--green); font: 600 10px ui-monospace, monospace; letter-spacing: .13em; text-transform: uppercase; }
.receipt { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; border-top: 1px solid #dbe2d5; }
.receipt div { display: grid; gap: 4px; padding: 9px 8px 9px 0; border-bottom: 1px solid #dbe2d5; }
.receipt div:nth-child(odd) { border-right: 1px solid #dbe2d5; }
.receipt div:nth-child(even) { padding-left: 12px; }
.receipt dt { color: var(--muted); font-size: 12px; }
.receipt dd { margin: 0; font: 600 12px ui-monospace, monospace; text-transform: capitalize; }
.result-note { margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.error-result { margin-top: 34px; padding: 18px; color: var(--error); background: #fff1ed; border: 1px solid #edcbc4; border-radius: 8px; font-size: 14px; line-height: 1.6; }

.numbers-section { padding: 78px 0; color: #edf4e9; background: var(--green-dark); }
.eyebrow.light { color: var(--lime); }
.numbers-heading { display: flex; justify-content: space-between; align-items: end; gap: 40px; }
.numbers-heading h2 { max-width: 540px; color: white; }
.numbers-heading p { max-width: 430px; margin: 0; color: #b9c9bd; line-height: 1.7; }
.number-grid { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 54px; border-top: 1px solid rgba(255,255,255,.16); border-bottom: 1px solid rgba(255,255,255,.16); }
.number-grid article { min-height: 138px; padding: 28px 20px; border-right: 1px solid rgba(255,255,255,.16); }
.number-grid article:first-child { padding-left: 0; }
.number-grid article:last-child { border-right: 0; }
.number-grid strong { display: block; color: var(--lime); font-size: clamp(30px, 4vw, 48px); letter-spacing: -.045em; }
.number-grid span { display: block; margin-top: 10px; color: #b9c9bd; font-size: 12px; line-height: 1.45; }
.numbers-note { margin: 16px 0 0; color: #91a296; font-size: 11px; }
.evidence-spec { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; color: #91a296; font: 10px/1.4 ui-monospace, monospace; }
.evidence-spec b { color: #6f8374; font-weight: 400; }
.evidence-spec strong { padding: 5px 8px; color: var(--lime); background: rgba(255,255,255,.07); border-radius: 4px; }
.use-case-section { padding: 78px 0 86px; }
.use-case-heading { display: grid; grid-template-columns: .82fr 1.18fr; gap: 90px; align-items: start; margin-bottom: 31px; }
.use-case-heading h2 { max-width: 700px; margin: -5px 0 0; font-size: clamp(29px, 4vw, 43px); letter-spacing: -.045em; }
.use-case-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.use-case-grid article { min-height: 190px; padding: 27px; border-right: 1px solid var(--line); }
.use-case-grid article:first-child { padding-left: 0; }
.use-case-grid article:last-child { border-right: 0; }
.use-case-grid span { color: var(--green); font: 10px ui-monospace, monospace; }
.use-case-grid h3 { margin: 28px 0 10px; font-size: 18px; }
.use-case-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.site-footer { min-height: 92px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }

[hidden] { display: none !important; }
@media (max-width: 900px) {
  .site-header nav { display: none; }
  .research-badge { margin-left: auto; }
  .workflow-section { padding: 44px 32px; }
  .workflow-heading { grid-template-columns: 1fr; gap: 22px; }
  .workflow-heading > p { max-width: 620px; }
  .workflow-board { grid-template-columns: 1fr 46px 1.3fr; align-items: stretch; }
  .action-card { grid-column: 1 / 4; margin-top: 20px; }
  .action-arrow { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .output-panel { min-height: 0; border-left: 0; border-top: 1px solid var(--line); }
  .numbers-heading { display: block; }
  .numbers-heading p { margin-top: 20px; }
  .number-grid { grid-template-columns: repeat(2, 1fr); }
  .number-grid article:nth-child(even) { border-right: 0; }
  .number-grid article:first-child { padding-left: 20px; }
  .use-case-heading { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 600px) {
  .shell, .site-header { width: min(100% - 28px, 1160px); }
  .site-header { min-height: 66px; }
  .research-badge { display: none; }
  .hero { padding: 48px 0 42px; }
  .hero h1 { font-size: 52px; }
  .hero-copy { font-size: 16px; }
  .hero-actions { gap: 14px; }
  .workflow-section { width: 100%; padding: 42px 20px; border-right: 0; border-left: 0; border-radius: 0; box-shadow: none; }
  .workflow-heading { gap: 14px; }
  .workflow-heading h2 { font-size: 37px; }
  .workflow-heading > p { font-size: 13px; line-height: 1.55; }
  .workflow-board { display: block; margin-top: 27px; }
  .fanout { width: 1px; height: 34px; min-height: 0; margin-left: 24px; background: #9cb09b; }
  .fanout span, .fanout i { display: none; }
  .question-stack { position: relative; }
  .question-stack::before { content: ""; position: absolute; left: 24px; top: -34px; width: 1px; height: calc(100% + 34px); background: #9cb09b; z-index: 0; }
  .question-card { position: relative; z-index: 1; margin-left: 12px; }
  .action-card { margin-top: 18px; }
  .playground-section { padding: 54px 0 60px; }
  .section-heading { display: block; }
  .mode-pill { margin-top: 18px; }
  .input-panel, .output-panel { padding: 22px 18px; }
  .choice-main { grid-template-columns: 28px minmax(100px,1fr) auto 30px; }
  .choice-details { padding-left: 28px; }
  .decision-result { padding-top: 18px; }
  .winner-row { padding-bottom: 17px; }
  .probabilities { gap: 10px; padding: 17px 0; }
  .receipt-title { margin-top: 18px; }
  .probability-row { grid-template-columns: 1fr 44px; }
  .probability-row .bar { grid-column: 1 / 3; grid-row: 2; }
  .winner-row { display: block; }
  .winner-row strong { display: block; margin-top: 10px; }
  .numbers-section { padding: 58px 0; }
  .number-grid { grid-template-columns: repeat(2, 1fr); margin-top: 36px; }
  .number-grid article { min-height: 102px; padding: 21px 15px !important; border-bottom: 1px solid rgba(255,255,255,.16); }
  .number-grid article:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.16); }
  .number-grid article:nth-child(even) { border-right: 0; }
  .number-grid article:last-child { grid-column: 1 / 3; border-right: 0; }
  .use-case-section { padding: 58px 0 64px; }
  .use-case-grid { grid-template-columns: 1fr; }
  .use-case-grid article { min-height: 0; padding: 26px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .use-case-grid article:last-child { border-bottom: 0; }
  .use-case-grid h3 { margin-top: 16px; }
  .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}
