/* Interactive examples: a light working surface inside the Studio palette. */
:root { --risk: #8e3b1f; --risk-bg: #f6e5dc; --warn: #74540c; --warn-bg: #f3ead2; --ok: #35552a; --ok-bg: #e3efd6; --surface: #fcfdf9; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-copy .hero-actions .button { margin-top: 0; }
.button.outline { background: transparent; color: var(--paper); border-color: #4d6146; }
.button.outline:hover { border-color: var(--lime); color: var(--lime); }

.examples-section { background: var(--paper); }
.question-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border-bottom: 1px solid var(--line); }
.question-tabs button { display: flex; gap: 16px; align-items: baseline; padding: 22px 12px 22px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #566650; text-align: left; font-size: var(--type-body); line-height: 1.4; letter-spacing: -.01em; position: relative; bottom: -1px; transition: color .2s, border-color .2s; }
.question-tabs button > span { font-size: var(--type-caption); color: #566650; }
.question-tabs button:hover { color: var(--ink); }
.question-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.question-panel { padding-top: 48px; }
.examples-more { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: var(--type-caption); color: var(--muted); }

.scenario { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .75fr); gap: 56px; align-items: start; }
.design-note { position: sticky; top: 28px; }
.design-note .eyebrow { color: #536650; }
.design-note h3 { font-size: var(--type-title); letter-spacing: -.035em; line-height: 1.3; margin: 14px 0 16px; }
.design-note > p { color: var(--muted); font-size: var(--type-body); line-height: 1.7; }
.yours { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.yours small, .draft small, .diagnosis small, .next-step small, .trace small, .score small { display: block; font-size: var(--type-caption); color: var(--muted); letter-spacing: .02em; }
.yours ul { list-style: none; margin: 12px 0 0; padding: 0; }
.yours li { position: relative; padding: 7px 0 7px 22px; font-size: var(--type-ui); line-height: 1.5; }
.yours li::before { content: ''; position: absolute; left: 0; top: 17px; width: 10px; height: 1px; background: #6e825c; }
.design-note details { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.design-note summary { cursor: pointer; font-size: var(--type-ui); font-weight: 600; padding: 6px 0; }
.design-note details p { margin-top: 8px; font-size: var(--type-ui); color: var(--muted); line-height: 1.65; }
.design-note .text-link { margin-top: 24px; }

.demo-frame { background: var(--surface); border: 1px solid #cdd7c7; box-shadow: 0 30px 60px -45px #10191866; position: relative; }
.frame-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: #e9eee3; font-size: var(--type-caption); }
.frame-scene { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .06em; color: #2f4229; }
.frame-scene .status-dot { background: #598b3b; }
.frame-note { color: var(--muted); text-align: right; }
.frame-body { padding: 26px; }
.frame-hint { font-size: var(--type-caption); line-height: 1.6; color: var(--muted); margin-bottom: 20px; max-width: 62ch; }
.frame-foot { margin: 20px 0 0; }

.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: #e7ece1; color: #3c4e37; font-size: var(--type-caption); font-weight: 650; line-height: 1.5; white-space: nowrap; }
.chip.risk { background: var(--risk-bg); color: var(--risk); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.row-id { font-size: var(--type-caption); font-weight: 700; letter-spacing: .04em; color: #4b5d45; font-variant-numeric: tabular-nums; }
.row-sub { display: block; font-size: var(--type-caption); color: var(--muted); line-height: 1.5; }
.row-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.demo-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-size: 15px; font-weight: 650; white-space: nowrap; transition: background .2s, color .2s, transform .2s; }
.demo-button:hover { background: #24342b; transform: translateY(-1px); }
.demo-button.ghost { background: transparent; color: var(--ink); border-color: #a9b7a1; }
.demo-button.ghost:hover { border-color: var(--ink); }
.done-note { margin-top: 12px; font-size: var(--type-ui); font-weight: 600; color: var(--ok); line-height: 1.5; }
.done-note:focus { outline: none; }

/* Order */
.order-demo { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-row { display: block; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid transparent; background: #fff; color: var(--ink); text-align: left; transition: border-color .2s, background .2s; }
.order-row:hover { border-color: #a9b7a1; }
.order-row[aria-pressed="true"] { background: #eef4e6; border-color: #9fb38f; border-left-color: var(--ink); }
.row-main { display: block; margin-top: 8px; font-size: var(--type-ui); font-weight: 650; line-height: 1.35; }
.row-done { display: block; margin-top: 6px; font-size: var(--type-caption); font-weight: 650; color: var(--ok); }
.order-detail { animation: rise .35s ease both; }
.trace { list-style: none; margin: 0 0 18px; padding: 0; }
.trace li { position: relative; display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 14px; padding: 9px 0 9px 22px; margin-left: 6px; border-left: 1px solid #c3d3b7; }
.trace li:last-child { border-left-color: transparent; }
.trace li::before { content: ''; position: absolute; left: -6px; top: 14px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 1px solid #7d9a68; }
.trace li.blocking::before { background: var(--risk); border-color: var(--risk); box-shadow: 0 0 0 4px #8e3b1f1f; }
.trace small { grid-row: span 2; padding-top: 1px; }
.trace b { font-size: var(--type-ui); font-weight: 650; line-height: 1.4; }
.trace span { font-size: var(--type-caption); color: var(--muted); line-height: 1.5; }
.trace li.blocking span { color: var(--risk); font-weight: 600; }
.diagnosis { padding: 16px 18px; background: #f2f5ed; border: 1px solid #dfe6d8; }
.diagnosis p { margin-top: 6px; font-size: var(--type-ui); line-height: 1.6; }
.next-step { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 18px; margin-top: 14px; padding: 16px 18px; border: 1px solid #cbd8bf; background: #fff; }
.next-step b { display: block; margin-top: 4px; font-size: var(--type-ui); line-height: 1.4; }
.next-step .done-note { margin-top: 0; }

/* Approval */
.approval-demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 24px; align-items: start; }
.request-card { padding: 18px 20px; border: 1px solid var(--line); background: #fff; }
.request-title { display: block; margin: 12px 0 4px; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.request-card p { margin: 14px 0 10px; font-size: var(--type-ui); line-height: 1.55; }
.request-card > small { font-size: var(--type-caption); color: var(--muted); }
.rule-controls { display: flex; flex-direction: column; gap: 20px; }
.range-control > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.range-control label, .segmented legend { font-size: var(--type-caption); color: var(--muted); }
.range-control output { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.range-control input { width: 100%; accent-color: #2c4626; height: 28px; cursor: pointer; }
.segmented { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.segmented legend { padding: 0; margin-bottom: 8px; }
.segmented > div { display: inline-flex; flex-wrap: wrap; border: 1px solid #b9c6b1; background: #fff; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 9px 16px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; border-right: 1px solid #d7dfd1; transition: background .2s, color .2s; }
.segmented label:last-child span { border-right: 0; }
.segmented input:checked + span { background: var(--ink); color: var(--paper); }
.segmented input:focus-visible + span { outline: 3px solid #648a3e; outline-offset: 2px; }
.rule-controls .segmented { margin: 0; }
.check { display: flex; align-items: center; gap: 12px; font-size: var(--type-ui); cursor: pointer; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: #2c4626; margin: 0; }
.route { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 28px 0 0; padding: 0; counter-reset: route; }
.route li { position: relative; padding: 22px 10px 0 0; transition: opacity .3s; }
.route li::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 1px; background: #9fb38f; }
.route li::after { content: ''; position: absolute; left: 0; top: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px var(--surface); transition: background .3s; }
.route li:last-child::before { right: auto; width: 0; }
.route b { display: block; font-size: 15px; font-weight: 650; line-height: 1.35; }
.route small { display: block; margin-top: 4px; font-size: var(--type-caption); color: var(--muted); line-height: 1.4; }
.route li.off b, .route li.off small { color: #5f6a5b; font-weight: 500; }
.route li.off::after { background: var(--surface); border: 1px dashed #8a9a82; box-sizing: border-box; }
.route li.off b { text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: #9aa894; }
.route li[data-step="gm"].on::after, .route li[data-step="finance"].on::after, .route li[data-step="manager"].on::after { background: #4f7a33; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px #b9d39d; }
.route-result { margin-top: 24px; padding: 16px 18px; border-left: 3px solid var(--lime); background: #f0f5e8; }
.route-result b { display: block; font-size: var(--type-ui); line-height: 1.5; }
.route-result p { margin-top: 6px; font-size: var(--type-caption); color: var(--muted); line-height: 1.6; }
.route-result p:empty { display: none; }

/* Priorities */
.priority-summary { display: flex; flex-wrap: wrap; gap: 8px 28px; padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: var(--type-caption); color: var(--muted); }
.priority-summary b { font-size: 22px; font-weight: 650; color: var(--ink); margin-right: 4px; font-variant-numeric: tabular-nums; }
.priority-list { list-style: none; margin: 0; padding: 0; }
.priority-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 18px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line); transition: opacity .25s; }
.score { display: block; padding: 8px 0; border: 1px solid #cbd8bf; background: #fff; text-align: center; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.score small { font-size: 12px; letter-spacing: .04em; }
.priority-copy > * { display: block; }
.priority-copy b { font-size: var(--type-ui); line-height: 1.4; }
.priority-copy .reason { margin-top: 4px; font-size: var(--type-caption); color: var(--muted); line-height: 1.5; }
.priority-copy .suggestion { margin-top: 8px; font-size: var(--type-ui); line-height: 1.5; }
.priority-copy em { font-style: normal; font-weight: 650; color: #3e5a2e; }
.priority-copy .decider { margin-top: 4px; font-size: var(--type-caption); color: var(--muted); }
.decision { display: flex; gap: 8px; }
.outcome { margin-top: 10px; padding: 10px 12px; font-size: var(--type-caption); line-height: 1.55; font-weight: 600; }
.priority-item[data-state="approved"] .outcome { background: var(--ok-bg); color: var(--ok); }
.priority-item[data-state="rejected"] .outcome { background: #eceee8; color: #4d5a48; }
.priority-item[data-state="approved"] .score { background: var(--ok-bg); border-color: #b4cd9c; }
.priority-item[data-state="rejected"] .priority-copy > b, .priority-item[data-state="rejected"] .suggestion { color: #6a7764; }
.priority-item[data-state="pending"]:first-child .score { border-color: var(--risk); color: var(--risk); }

/* Tables */
.demo-table { width: 100%; border-collapse: collapse; font-size: var(--type-caption); }
.demo-table th, .demo-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; line-height: 1.45; }
.demo-table thead th { font-weight: 600; color: var(--muted); padding-top: 0; }
.demo-table tbody th { font-weight: 700; letter-spacing: .03em; color: #4b5d45; white-space: nowrap; }
.demo-table td:nth-child(2) { font-size: 15px; color: var(--ink); }
.demo-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.demo-table tbody tr { transition: background .25s; }
.demo-table tbody tr.flagged { background: #fbf2ed; }
.draft { margin-top: 18px; padding: 18px 20px; border: 1px solid var(--line); background: #fff; animation: rise .35s ease both; }
.draft > b { display: block; margin-top: 8px; font-size: var(--type-ui); }
.draft > p { margin: 12px 0 14px; padding-left: 14px; border-left: 2px solid #cbd8bf; font-size: var(--type-ui); line-height: 1.65; color: #34433a; }
.draft .row-sub { margin-bottom: 14px; }
.capa > p { margin-top: 8px; }

/* Examples page */
.examples-hero h1 { max-width: 900px; }
.examples-index { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin-top: 44px; border-top: 1px solid #3b4c35; }
.examples-index a { display: flex; flex-direction: column; gap: 10px; padding: 20px 20px 4px 0; color: #c9d5c3; font-size: var(--type-ui); line-height: 1.4; transition: color .2s; }
.examples-index a span { font-size: var(--type-caption); color: var(--lime); }
.examples-index a:hover { color: var(--lime); }
.example-block { border-bottom: 1px solid var(--line); }
.example-block:nth-of-type(even) { background: #e9ede3; }
.example-head { display: flex; align-items: baseline; gap: 28px; margin-bottom: 40px; }
.example-head .step-number { font-size: var(--type-caption); color: #53684a; white-space: nowrap; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
  .scenario { grid-template-columns: 1fr; gap: 36px; }
  .design-note { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
  .design-note > .eyebrow, .design-note > h3, .design-note > p { grid-column: 1; }
  .design-note .yours { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; padding-top: 0; border-top: 0; }
  .design-note details, .design-note .text-link { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 900px) {
  .question-tabs { grid-template-columns: 1fr; gap: 0; }
  .question-tabs button { padding: 16px 0; border-bottom: 1px solid var(--line); bottom: 0; }
  .question-tabs button[aria-selected="true"] { border-bottom: 1px solid var(--ink); }
  .question-panel { padding-top: 32px; }
  .order-demo, .approval-demo { grid-template-columns: 1fr; }
  .examples-index { grid-template-columns: 1fr 1fr; }
  .examples-index a { padding-bottom: 12px; }
}
@media (max-width: 600px) {
  .frame-bar { flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 16px; }
  .frame-note { text-align: left; }
  .frame-body { padding: 18px 16px; }
  .design-note { display: block; }
  .design-note .yours { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
  .examples-more { flex-direction: column; align-items: flex-start; gap: 8px; }
  .trace li { grid-template-columns: 1fr; }
  .trace small { grid-row: auto; }
  .next-step { flex-direction: column; align-items: stretch; }
  .route { grid-template-columns: 1fr; gap: 0; margin-top: 24px; }
  .route li { padding: 0 0 14px 28px; }
  .route li::before { left: 6px; right: auto; top: 13px; bottom: 0; width: 1px; height: auto; }
  .route li:last-child::before { display: none; }
  .route li::after { top: 4px; }
  .priority-item { grid-template-columns: 52px minmax(0, 1fr); gap: 14px; }
  .decision { grid-column: 2; flex-wrap: wrap; }
  .score { font-size: 19px; }
  .segmented > div { display: flex; width: 100%; }
  .segmented label { flex: 1; }
  .segmented span { text-align: center; padding: 10px 6px; }
  .demo-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .demo-table, .demo-table tbody { display: block; }
  .demo-table tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 8px; border-bottom: 1px solid var(--line); }
  .demo-table th, .demo-table td { padding: 0; border: 0; }
  .demo-table tbody th { grid-row: 1; grid-column: 1; }
  .demo-table td:nth-child(2) { grid-row: 2; grid-column: 1 / -1; }
  .demo-table td { grid-row: 3; font-size: var(--type-caption); color: var(--muted); }
  [data-demo="sales"] .demo-table td:nth-child(3) { grid-column: 1 / span 2; }
  [data-demo="sales"] .demo-table td:nth-child(4) { grid-row: 1; grid-column: 3; justify-self: end; }
  [data-demo="sales"] .demo-table td:nth-child(5) { grid-row: 1; grid-column: 2; justify-self: end; color: var(--ink); font-weight: 600; }
  [data-demo="quality"] .demo-table td:nth-child(3) { grid-column: 1; }
  [data-demo="quality"] .demo-table td:nth-child(4) { grid-column: 2 / span 2; }
  [data-demo="quality"] .demo-table td:nth-child(5) { grid-row: 1; grid-column: 3; justify-self: end; }
  .example-head { flex-direction: column; gap: 8px; margin-bottom: 28px; }
  .examples-index { grid-template-columns: 1fr; }
  .examples-index a { flex-direction: row; gap: 14px; padding: 14px 0; border-bottom: 1px solid #2c3a2a; }
}
