/* Case-site design system: neutral, enterprise, one accent. Change tokens, not components. */
:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5b6675;
  --border: #dde2e8;
  --accent: #135d73;
  --accent-contrast: #ffffff;
  --ok: #1e7b4f;
  --warn: #9a5b00;
  --risk: #a3312a;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 8%);
  --wrap: 1120px;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a;
    --surface: #161d25;
    --text: #e6eaef;
    --muted: #9aa5b1;
    --border: #2a3440;
    --accent: #7cc6dc;
    --accent-contrast: #0f141a;
    --ok: #5cc28f;
    --warn: #e0a84a;
    --risk: #ef8a82;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; font-size: 17px; }
a { color: var(--accent); }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
img, svg { max-width: 100%; height: auto; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: 68ch; }

.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.site-header nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.site-header nav a:hover { color: var(--text); }

.hero { padding: 72px var(--gutter) 40px; }
.eyebrow { color: var(--muted); font-size: 14px; letter-spacing: .02em; margin: 0 0 8px; }
h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.01em; }
h2 { font-size: clamp(22px, 3vw, 28px); margin: 0 0 16px; }
h3 { font-size: 18px; margin: 8px 0 4px; }
.lede { font-size: clamp(18px, 2.4vw, 21px); color: var(--muted); max-width: 60ch; margin: 0 0 28px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-block; padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.btn.primary { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

.section { padding: 40px var(--gutter); border-top: 1px solid var(--border); }

.grid { display: grid; gap: 16px; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card p { margin: 0; color: var(--muted); }

.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.chip.ok { color: var(--ok); } .chip.warn { color: var(--warn); } .chip.risk { color: var(--risk); }

.checklist { padding-left: 1.2em; }
.journey { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.journey a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); font-weight: 600; }
.step-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); font-size: 13px; flex: none; }

.diagram { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; }
.diagram figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; }

.kpi-value { font-size: 32px; font-weight: 700; color: var(--text) !important; }
.note { font-size: 14px; color: var(--muted); font-style: italic; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }

.site-footer { border-top: 1px solid var(--border); padding: 32px 0 48px; color: var(--muted); font-size: 14px; }

/* Guided tour (assets/tour.js) */
.hidden { display: none !important; }
.tour { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 760px; margin: 0 auto; background: var(--text); color: var(--bg); border-radius: var(--radius); padding: 12px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; box-shadow: 0 6px 24px rgb(0 0 0 / 25%); }
.tour p { margin: 0; font-size: 15px; max-width: 70ch; }
.tour .tour-step { display: block; font-size: 12px; opacity: .7; }
.tour-actions { display: flex; gap: 8px; }
.tour button { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; }
.tour button:disabled { opacity: .4; cursor: default; }
.tour-flash { animation: tour-flash 1.4s ease-out; }
@keyframes tour-flash { 0% { box-shadow: 0 0 0 4px var(--accent); } 100% { box-shadow: 0 0 0 4px transparent; } }

@media print {
  .site-header, .cta-row, .tour { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section { break-inside: avoid; padding: 16px 0; }
  .card { box-shadow: none; }
  a { color: #000; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .tour-flash { animation: none; outline: 3px solid var(--accent); } }

/* --- Case-specific: Corlaan mailbox demo -------------------------------------------------------- */
.label-sim { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--warn); border: 1px solid currentColor; border-radius: 999px; padding: 1px 8px; }
.demo-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 16px 0 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--border); margin: 8px 0 20px; }
.tabs button { font: inherit; font-size: 15px; font-weight: 600; padding: 8px 12px; border: 1px solid transparent; border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; background: none; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); background: var(--surface); border-color: var(--border); margin-bottom: -1px; }
.tabs button:focus-visible, .btn-sm:focus-visible, .mail-list button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.panel { display: none; } .panel.active { display: block; }
.btn-sm { font: inherit; font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.btn-sm[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.seg span { font-size: 13px; color: var(--muted); margin-right: 4px; }

.inbox { display: grid; gap: 16px; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
@media (max-width: 860px) { .inbox { grid-template-columns: 1fr; } }
.mail-list { list-style: none; margin: 0; padding: 0; max-height: 640px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
@media (max-width: 860px) { .mail-list { max-height: 300px; } }
.mail-list li + li { border-top: 1px solid var(--border); }
.mail-list button { display: block; width: 100%; text-align: left; font: inherit; background: none; border: 0; padding: 10px 12px; color: var(--text); cursor: pointer; }
.mail-list button[aria-current="true"] { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.mail-list .from { font-size: 13px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list .subj { font-size: 14px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list .meta { display: flex; gap: 6px; margin-top: 4px; align-items: center; }
.out { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor; }
.out.auto { color: var(--ok); } .out.draft { color: var(--warn); } .out.route { color: var(--risk); } .out.ignore { color: var(--muted); }
.mail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.mail h3 { margin: 0 0 4px; }
.mail .hdr { font-size: 13px; color: var(--muted); margin: 0 0 10px; word-break: break-all; }
.mail pre, .reply pre { white-space: pre-wrap; word-wrap: break-word; font-family: var(--font); font-size: 14.5px; margin: 0; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 14px 0; display: grid; gap: 6px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 26px 110px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 14px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); font-size: 12px; font-weight: 700; }
.steps b { color: var(--muted); font-weight: 600; }
@media (max-width: 560px) { .steps li { grid-template-columns: 26px minmax(0, 1fr); } .steps li span { grid-column: 2; } }
.verdict { border-radius: var(--radius); padding: 12px 14px; border: 1.5px solid currentColor; margin: 12px 0; }
.verdict.auto { color: var(--ok); } .verdict.draft { color: var(--warn); } .verdict.route { color: var(--risk); } .verdict.ignore { color: var(--muted); }
.verdict strong { font-size: 16px; }
.verdict p { color: var(--text); margin: 4px 0 0; font-size: 14px; }
.reply { background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius); padding: 12px 14px; }
.reply.naive { border-color: var(--risk); }
.harm { color: var(--risk); font-weight: 700; font-size: 13px; }
.cols-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) 48px; gap: 10px; align-items: center; font-size: 14px; }
@media (max-width: 560px) { .bar-row { grid-template-columns: minmax(0, 1fr) 40px; } .bar-row .track { grid-column: 1 / -1; grid-row: 2; } }
.track { height: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; display: flex; }
.fill { height: 100%; }
.fill.naive { background: var(--risk); } .fill.guarded { background: var(--ok); }
.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
td.pass { color: var(--ok); font-weight: 700; } td.fail { color: var(--risk); font-weight: 700; }
td code, .rules code { font-family: var(--mono); font-size: 12.5px; }

.sliders { display: grid; gap: 14px; }
.slider label { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.slider input { width: 100%; accent-color: var(--accent); }
.slider output { font-weight: 700; font-variant-numeric: tabular-nums; }
.tornado { display: grid; gap: 8px; }
.tornado-row { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr); gap: 10px; align-items: center; font-size: 13px; }
@media (max-width: 560px) { .tornado-row { grid-template-columns: 1fr; } }
.tornado-track { position: relative; height: 18px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; }
.tornado-bar { position: absolute; top: 2px; bottom: 2px; background: var(--accent); border-radius: 3px; opacity: .85; }
.tornado-base { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); }
.ladder { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ladder li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.ladder li strong { display: block; }
.ladder li p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
