:root {
  --sim-accent: #7656d8;
  --sim-accent-2: #00a8a8;
  --sim-wash: #eef1ff;
}
body.sim-page { min-height: 100vh; background: radial-gradient(circle at 92% 8%, color-mix(in srgb,var(--sim-accent) 14%,transparent),transparent 24%), linear-gradient(180deg,#f8faff,#fff 42%); }
.sim-site-header { position:sticky; top:0; z-index:50; backdrop-filter:blur(18px); background:rgba(255,255,255,.88); border-bottom:1px solid rgba(115,133,178,.2); }
.sim-nav { width:min(1220px,calc(100% - 32px)); min-height:70px; margin:auto; display:flex; align-items:center; justify-content:space-between; gap:20px; }
.sim-nav-actions { display:flex; align-items:center; gap:10px; }
.sim-nav-link { color:var(--navy); font-weight:800; padding:9px 13px; border-radius:999px; }
.sim-nav-link:hover { background:var(--soft-2); }
.sim-main { width:min(1220px,calc(100% - 32px)); margin:0 auto; padding:50px 0 84px; }
.sim-breadcrumb { display:flex; flex-wrap:wrap; align-items:center; gap:8px; color:var(--muted); font-size:.9rem; margin-bottom:22px; }
.sim-breadcrumb a { color:var(--sim-accent); font-weight:800; }
.sim-intro { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:30px; align-items:end; margin-bottom:30px; }
.sim-intro h1 { max-width:850px; margin:0; color:var(--navy); font-size:clamp(2.55rem,6vw,5.3rem); line-height:.96; letter-spacing:-.06em; }
.sim-intro p { max-width:760px; margin:18px 0 0; color:#53627d; font-size:1.08rem; }
.sim-stage-line { display:flex; flex-wrap:wrap; gap:7px; justify-content:flex-end; }
.sim-stage-line span { padding:7px 11px; border-radius:999px; background:white; border:1px solid var(--line); color:#4f5f79; font-size:.78rem; font-weight:850; }
.sim-stage-line span.active { color:white; border-color:transparent; background:linear-gradient(120deg,var(--sim-accent),var(--sim-accent-2)); }
.sim-workspace { display:grid; grid-template-columns:minmax(230px,.34fr) minmax(0,1fr); gap:18px; align-items:start; }
.sim-control-panel,.sim-viz-card,.sim-sense,.sim-apply,.math-panel { border:1px solid rgba(105,125,172,.18); background:rgba(255,255,255,.92); box-shadow:0 18px 55px rgba(25,43,92,.09); }
.sim-control-panel { position:sticky; top:92px; padding:24px; border-radius:28px 9px 28px 9px; }
.sim-step-label { margin:0 0 8px; color:var(--sim-accent); font-size:.73rem; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.sim-control-panel h2 { margin:0 0 10px; color:var(--navy); font-size:1.45rem; line-height:1.15; }
.sim-control-panel>p { color:var(--muted); font-size:.94rem; }
.sim-predict { display:grid; gap:8px; margin:18px 0; }
.sim-choice { width:100%; min-height:42px; padding:8px 13px; text-align:left; color:var(--navy); border:1px solid var(--line); border-radius:12px; background:#fff; font-weight:750; cursor:pointer; }
.sim-choice:hover,.sim-choice.selected { border-color:var(--sim-accent); background:var(--sim-wash); }
.sim-control { display:grid; gap:7px; margin-top:18px; color:var(--navy); font-weight:800; }
.sim-control output { color:var(--sim-accent); }
.sim-control input[type="range"] { width:100%; accent-color:var(--sim-accent); }
.sim-control select { width:100%; min-height:44px; border:1px solid var(--line); border-radius:12px; background:white; color:var(--navy); padding:0 11px; }
.sim-action-row { display:flex; flex-wrap:wrap; gap:9px; margin-top:20px; }
.sim-btn { min-height:42px; padding:0 15px; border:1px solid var(--line); border-radius:999px; background:white; color:var(--navy); font-weight:850; cursor:pointer; }
.sim-btn.primary { color:white; border-color:transparent; background:linear-gradient(120deg,var(--sim-accent),var(--sim-accent-2)); box-shadow:0 10px 24px color-mix(in srgb,var(--sim-accent) 24%,transparent); }
.sim-viz-card { min-height:480px; padding:clamp(20px,3vw,34px); border-radius:10px 34px 10px 34px; overflow:hidden; }
.sim-viz-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:18px; }
.sim-viz-head h2 { margin:0; color:var(--navy); font-size:1.55rem; }
.sim-live { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.sim-stat { min-width:94px; padding:8px 11px; border-radius:12px; background:var(--sim-wash); border:1px solid color-mix(in srgb,var(--sim-accent) 18%,white); }
.sim-stat span { display:block; color:var(--muted); font-size:.7rem; text-transform:uppercase; letter-spacing:.07em; font-weight:850; }
.sim-stat strong { color:var(--navy); font-size:1.13rem; }
.sim-viz { min-height:350px; display:grid; place-items:center; }
.sim-viz svg { width:100%; height:auto; max-height:410px; overflow:visible; }
.sim-axis { stroke:#aebbd0; stroke-width:1.4; }.sim-grid{stroke:#e2e8f3;stroke-width:1}.sim-label{fill:#67758d;font:700 12px Inter,system-ui,sans-serif}.sim-title{fill:#18213b;font:850 14px Inter,system-ui,sans-serif}
.sim-explain-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-top:18px; }
.sim-sense,.sim-apply { padding:24px; border-radius:22px; box-shadow:0 12px 40px rgba(25,43,92,.06); }
.sim-sense { border-left:5px solid var(--sim-accent); }.sim-apply { border-left:5px solid var(--sim-accent-2); }
.sim-sense h3,.sim-apply h3 { margin:0 0 8px; color:var(--navy); }.sim-sense p,.sim-apply p{margin:0;color:var(--muted)}
.math-panel { margin-top:18px; padding:0 22px; border-radius:18px; box-shadow:none; }
.math-panel summary { cursor:pointer; padding:17px 0; color:var(--navy); font-weight:850; }.math-panel p{color:var(--muted)}
.sim-next { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-top:36px; padding-top:24px; border-top:1px solid var(--line); }
.sim-next a { color:var(--sim-accent); font-weight:850; }
.sim-hub-hero { position:relative; overflow:hidden; padding:clamp(34px,7vw,76px); border-radius:42px 12px 42px 12px; color:white; background:radial-gradient(circle at 84% 12%,rgba(72,201,255,.32),transparent 25%),radial-gradient(circle at 12% 90%,rgba(239,106,103,.22),transparent 25%),linear-gradient(135deg,#111b4a,#2d3f9f 56%,#007f86); box-shadow:0 32px 90px rgba(28,43,108,.27); }
.sim-hub-hero .eyebrow{color:#91eee3}.sim-hub-hero h1{max-width:900px;margin:0;font-size:clamp(3rem,7vw,6.3rem);line-height:.92;letter-spacing:-.065em}.sim-hub-hero p{max-width:720px;color:#dce7ff;font-size:1.12rem}
.sim-lab-grid { display:grid; grid-template-columns:repeat(12,1fr); gap:18px; margin-top:28px; }
.sim-lab-card { grid-column:span 4; min-height:270px; display:flex; flex-direction:column; padding:26px; border:1px solid rgba(104,123,170,.18); border-radius:26px 9px 26px 9px; background:white; box-shadow:0 17px 50px rgba(24,42,91,.09); transition:transform .2s ease,box-shadow .2s ease; }
.sim-lab-card:nth-child(1),.sim-lab-card:nth-child(2){grid-column:span 6;min-height:310px}.sim-lab-card:hover{transform:translateY(-5px);box-shadow:0 26px 65px rgba(24,42,91,.15)}
.sim-card-number{color:var(--card-accent,var(--purple));font-size:.78rem;font-weight:900;letter-spacing:.13em}.sim-lab-card h2{margin:26px 0 10px;color:var(--navy);font-size:1.55rem;line-height:1.1}.sim-lab-card p{margin:0;color:var(--muted)}.sim-card-topics{margin-top:auto;padding-top:22px;color:var(--card-accent,var(--purple));font-size:.82rem;font-weight:800}
.population-grid{display:grid;grid-template-columns:repeat(20,1fr);gap:4px;width:100%}.population-grid i{aspect-ratio:1;border-radius:4px;background:#dce5f2}.population-grid i.hit{background:var(--sim-accent);box-shadow:0 2px 7px color-mix(in srgb,var(--sim-accent) 35%,transparent)}
.bayes-grid{display:grid;grid-template-columns:repeat(25,1fr);gap:3px;width:100%}.bayes-grid i{aspect-ratio:1;border-radius:2px;background:#dbe3ef}.bayes-grid i.positive{background:#ef6a67}.bayes-grid i.true-positive{background:#23a36d}
html[data-theme="dark"] body.sim-page{background:radial-gradient(circle at 92% 8%,color-mix(in srgb,var(--sim-accent) 14%,transparent),transparent 24%),#08111f}html[data-theme="dark"] .sim-site-header{background:rgba(8,17,31,.88)}html[data-theme="dark"] .sim-intro h1,html[data-theme="dark"] .sim-viz-head h2,html[data-theme="dark"] .sim-control-panel h2,html[data-theme="dark"] .sim-sense h3,html[data-theme="dark"] .sim-apply h3,html[data-theme="dark"] .sim-nav-link,html[data-theme="dark"] .sim-stat strong,html[data-theme="dark"] .sim-control,html[data-theme="dark"] .math-panel summary,html[data-theme="dark"] .sim-lab-card h2{color:#f4f7ff}html[data-theme="dark"] .sim-control-panel,html[data-theme="dark"] .sim-viz-card,html[data-theme="dark"] .sim-sense,html[data-theme="dark"] .sim-apply,html[data-theme="dark"] .math-panel,html[data-theme="dark"] .sim-lab-card{background:#101d30;border-color:#2c3d59}html[data-theme="dark"] .sim-stat,html[data-theme="dark"] .sim-choice:hover,html[data-theme="dark"] .sim-choice.selected{background:#192846}html[data-theme="dark"] .sim-choice,html[data-theme="dark"] .sim-btn,html[data-theme="dark"] .sim-control select{background:#0d192a;color:#eff5ff;border-color:#32435e}html[data-theme="dark"] .sim-label{fill:#aebbd0}html[data-theme="dark"] .sim-title{fill:#eef4ff}html[data-theme="dark"] .sim-grid{stroke:#263b58}
@media(max-width:900px){.sim-intro{grid-template-columns:1fr}.sim-stage-line{justify-content:flex-start}.sim-workspace{grid-template-columns:1fr}.sim-control-panel{position:static}.sim-lab-card,.sim-lab-card:nth-child(1),.sim-lab-card:nth-child(2){grid-column:span 6}}
@media(max-width:650px){.sim-main{width:min(100% - 22px,1220px);padding-top:28px}.sim-nav{width:min(100% - 22px,1220px)}.sim-nav .brand small{display:none}.sim-nav-link{display:none}.sim-intro h1{font-size:2.75rem}.sim-explain-grid{grid-template-columns:1fr}.sim-viz-head{display:block}.sim-live{justify-content:flex-start;margin-top:12px}.sim-lab-card,.sim-lab-card:nth-child(1),.sim-lab-card:nth-child(2){grid-column:1/-1;min-height:245px}.sim-hub-hero{border-radius:28px 8px 28px 8px}.population-grid{grid-template-columns:repeat(15,1fr)}.bayes-grid{grid-template-columns:repeat(20,1fr)}}
@media(prefers-reduced-motion:reduce){.sim-lab-card{transition:none}.sim-lab-card:hover{transform:none}}

/* Version 8: decision-focused simulation controls */
.decision-context {
  margin: 0 0 20px;
  padding: 15px 17px;
  border: 1px solid color-mix(in srgb, var(--sim-accent) 25%, white);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--sim-wash), rgba(255,255,255,.9));
}
.decision-context strong { display:block; color:var(--navy); margin-bottom:3px; }
.decision-context span { color:var(--muted); font-size:.9rem; }
.sim-segmented { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; margin:16px 0 6px; padding:5px; border:1px solid var(--line); border-radius:14px; background:var(--soft); }
.sim-segmented button { min-height:38px; border:0; border-radius:10px; color:var(--muted); background:transparent; font-weight:800; cursor:pointer; }
.sim-segmented button.active { color:white; background:linear-gradient(120deg,var(--sim-accent),var(--sim-accent-2)); box-shadow:0 8px 18px color-mix(in srgb,var(--sim-accent) 22%,transparent); }
.sim-segmented.four { grid-template-columns:repeat(4,1fr); }
.sim-segmented.two { grid-template-columns:repeat(2,1fr); }
.decision-readout { margin-top:18px; padding:20px; border-radius:18px 6px 18px 6px; color:white; background:linear-gradient(125deg,#142350,#243d91 58%,var(--sim-accent-2)); box-shadow:0 16px 34px rgba(24,42,91,.18); }
.decision-readout small { display:block; color:#bfeee8; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
.decision-readout strong { display:block; margin:7px 0 6px; font-size:1.2rem; line-height:1.25; }
.decision-readout p { margin:0; color:#dbe6ff; font-size:.92rem; }
.metric-explainer { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:16px; }
.metric-explainer div { padding:12px; border:1px solid var(--line); border-radius:13px; background:var(--soft); }
.metric-explainer strong { display:block; color:var(--navy); font-size:.9rem; }
.metric-explainer span { display:block; color:var(--muted); font-size:.78rem; line-height:1.4; }
.sim-legend { display:flex; flex-wrap:wrap; gap:12px; margin:5px 0 0; color:var(--muted); font-size:.82rem; font-weight:750; }
.sim-legend i { display:inline-block; width:10px; height:10px; margin-right:5px; border-radius:3px; vertical-align:middle; }
.sim-feedback { min-height:46px; margin-top:12px; padding:12px 14px; border-radius:12px; color:#40516d; background:var(--soft); border:1px solid var(--line); font-size:.88rem; }
.sim-feedback.correct { color:#12623f; background:#eaf8f0; border-color:#9fd9bb; }
.sim-feedback.caution { color:#7b4811; background:#fff6df; border-color:#ecd19c; }
.contingency-wrap { width:100%; overflow-x:auto; }
.contingency { width:100%; border-collapse:separate; border-spacing:7px; min-width:540px; }
.contingency th { padding:9px; color:var(--muted); font-size:.8rem; }
.contingency td { height:100px; padding:14px; text-align:center; border-radius:16px; background:var(--soft); border:1px solid var(--line); }
.contingency td strong { display:block; color:var(--navy); font-size:1.55rem; }
.contingency td span { color:var(--muted); font-size:.78rem; }
.contingency td.both { background:color-mix(in srgb,var(--sim-accent) 17%,white); border-color:color-mix(in srgb,var(--sim-accent) 35%,white); }
.contingency td.a-only { background:color-mix(in srgb,var(--sim-accent-2) 15%,white); }
.decision-options { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.decision-options button { flex:1 1 145px; min-height:42px; padding:8px 12px; border:1px solid var(--line); border-radius:12px; background:white; color:var(--navy); font-weight:800; cursor:pointer; }
.decision-options button:hover,.decision-options button.selected { border-color:var(--sim-accent); background:var(--sim-wash); }
html[data-theme="dark"] .decision-context,html[data-theme="dark"] .metric-explainer div,html[data-theme="dark"] .sim-feedback,html[data-theme="dark"] .sim-segmented{background:#14233a;border-color:#31445f}html[data-theme="dark"] .decision-context strong,html[data-theme="dark"] .metric-explainer strong,html[data-theme="dark"] .contingency td strong{color:#f2f6ff}html[data-theme="dark"] .contingency td{background:#14233a;border-color:#31445f}html[data-theme="dark"] .contingency td.both{background:#1b3d37}html[data-theme="dark"] .contingency td.a-only{background:#172f4a}html[data-theme="dark"] .decision-options button{background:#0d192a;color:#eff5ff;border-color:#32435e}
@media(max-width:650px){.metric-explainer{grid-template-columns:1fr}.sim-segmented,.sim-segmented.four{grid-template-columns:1fr 1fr}.decision-readout{padding:17px}}
.used-data { display:grid; grid-template-columns:1fr auto; gap:12px 18px; align-items:start; margin-top:18px; padding:20px; border:1px solid var(--line); border-radius:18px; background:var(--soft); }
.used-data h3 { margin:0; color:var(--navy); font-size:1.05rem; }
.used-data p:not(.sim-step-label) { margin:3px 0 0; color:var(--muted); font-size:.86rem; }
.used-data-values { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:7px; }
.used-data-values span { min-width:44px; padding:7px 9px; border:1px solid var(--line); border-radius:9px; background:white; color:var(--navy); text-align:center; font-size:.82rem; font-weight:750; }
html[data-theme="dark"] .used-data { background:#14233a; border-color:#31445f; }
html[data-theme="dark"] .used-data h3 { color:#f4f7ff; }
html[data-theme="dark"] .used-data-values span { background:#0d192a; color:#eff5ff; border-color:#32435e; }
.sim-how { display:grid; grid-template-columns:.8fr 1.2fr; gap:24px; margin:28px 0 6px; padding:22px 24px; border:1px solid rgba(104,123,170,.18); border-radius:24px 8px 24px 8px; background:rgba(255,255,255,.88); box-shadow:0 14px 42px rgba(24,42,91,.07); }
.sim-how>div strong { display:block; color:var(--navy); font-size:1.08rem; }
.sim-how>div span { display:block; margin-top:5px; color:var(--muted); font-size:.9rem; }
.sim-how ol { display:grid; grid-template-columns:repeat(4,1fr); gap:9px; margin:0; padding:0; list-style:none; }
.sim-how li { padding:11px 12px; border-radius:13px; background:var(--soft); border:1px solid var(--line); }
.sim-how b { display:block; color:var(--navy); font-size:.84rem; }
.sim-how li span { display:block; margin-top:3px; color:var(--muted); font-size:.76rem; line-height:1.35; }
.sim-lab-grid.four-environments .sim-lab-card { grid-column:span 6; min-height:285px; }
html[data-theme="dark"] .sim-how { background:#101d30; border-color:#2c3d59; }
html[data-theme="dark"] .sim-how>div strong,html[data-theme="dark"] .sim-how b { color:#f4f7ff; }
html[data-theme="dark"] .sim-how li { background:#14233a; border-color:#31445f; }
@media(max-width:900px){.sim-how{grid-template-columns:1fr}.sim-how ol{grid-template-columns:1fr 1fr}}
@media(max-width:650px){.sim-how ol{grid-template-columns:1fr}.sim-lab-grid.four-environments .sim-lab-card{grid-column:1/-1}}
