:root {
  --ink: #14213d;
  --ink2: #4a5875;
  --mist: #eceff4;
  --card: #ffffff;
  --line: #d5dae3;
  --accent: #14213d;
  --good: #1f7a4d;
  --bad: #b3304a;
  --warn: #b26a00;
  --radius: 10px;
  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--mist); color: var(--ink); font: 16px/1.6 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.2rem; margin-top: 1.8rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 .9rem; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; outline: none; }
.muted { color: var(--ink2); }
.small { font-size: .88rem; }
.block { display: block; }
.good { color: var(--good); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }

/* header */
.top { background: var(--ink); color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding: .7rem 1.25rem; }
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.mark-logo { display: inline-flex; gap: 3px; align-items: flex-end; height: 26px; }
.mark-logo i { display: block; width: 7px; border-radius: 2px; background: #fff; }
.mark-logo i:nth-child(1) { height: 12px; background: #7fa0ff; }
.mark-logo i:nth-child(2) { height: 26px; }
.mark-logo i:nth-child(3) { height: 18px; background: #f2b04c; }
.brandtext { display: flex; flex-direction: column; line-height: 1.15; }
.brandtext b { font-family: var(--serif); font-weight: 500; font-size: 1.1rem; }
.brandtext small { opacity: .75; font-size: .8rem; }
.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; font-size: .92rem; }
.topnav a { color: #fff; text-decoration: none; opacity: .9; }
.topnav a:hover { text-decoration: underline; opacity: 1; }
.who { opacity: .8; }
.chip-sync { font-size: .78rem; padding: .1rem .55rem; border-radius: 99px; background: rgba(255,255,255,.14); }
.chip-sync.ok { background: #1f7a4d; }
.chip-sync.wait { background: #b26a00; }
button.link { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
main button.link { color: var(--ink2); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding: 1rem 1.25rem; font-size: .82rem; color: var(--ink2); border-top: 1px solid var(--line); }

/* generic */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.btn { display: inline-block; font: 600 .95rem var(--sans); padding: .6rem 1.15rem; border-radius: 8px; border: 1.5px solid var(--accent); background: #fff; color: var(--accent); cursor: pointer; text-decoration: none; }
.btn:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 8%, #fff); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.field { display: block; font-weight: 500; margin-bottom: 1rem; }
.field input[type=text], .field input:not([type]), .field input[type=password], .field textarea { display: block; width: 100%; margin-top: .3rem; padding: .6rem .75rem; font: inherit; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.field textarea { resize: vertical; }
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .88rem; color: var(--ink2); margin-bottom: 1rem; }
.crumbs i { font-style: normal; opacity: .5; }
.crumbs a { color: var(--ink2); }
.lede { font-size: 1.1rem; color: var(--ink2); max-width: 68ch; }
.chip { display: inline-block; font-size: .82rem; font-weight: 600; padding: .15rem .65rem; border-radius: 99px; background: color-mix(in srgb, var(--accent) 12%, #fff); color: var(--accent); margin-bottom: .6rem; }
.tablewrap { overflow-x: auto; margin: .5rem 0 1rem; }
table.data { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; }
table.data th, table.data td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data thead th { background: #f6f8fb; font-weight: 600; }
table.data .num, .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data small { color: var(--ink2); }
.note { background: color-mix(in srgb, var(--accent) 7%, #fff); border-left: 4px solid var(--accent); padding: .8rem 1rem; border-radius: 0 8px 8px 0; margin: 1rem 0; }
.callout { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.callout.warn { background: #fff6e5; border: 1px solid #f0cf8a; color: #5c3b00; font-weight: 400; }
.empty { text-align: center; padding: 2rem; }
.mark { font-weight: 700; margin-left: .3rem; }
.mark.good { color: var(--good); } .mark.bad { color: var(--bad); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin: 1rem 0; }
.kv > div { background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px; padding: .7rem .9rem; }
.kv b { display: block; font-size: .82rem; font-weight: 500; color: var(--ink2); }
.kv span { font-weight: 600; font-size: 1.02rem; }

/* join */
.join { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: center; padding-top: 2rem; }
.join h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.joinform h2 { margin-bottom: 1rem; }
@media (max-width: 760px) { .join { grid-template-columns: 1fr; gap: 1.5rem; } }

/* home */
.hero { padding: 1rem 0 1.5rem; }
.herostat { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin-top: 1rem; }
.herostat div { display: flex; flex-direction: column; max-width: 14rem; }
.herostat b { font: 500 2.2rem/1 var(--serif); }
.herostat span { font-size: .88rem; color: var(--ink2); }
.toollist { display: flex; flex-direction: column; gap: 1rem; }
.toolrow { display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem; background: var(--card); border: 1px solid var(--line); border-left: 10px solid var(--tc); border-radius: var(--radius); padding: 1.3rem 1.5rem; text-decoration: none; color: var(--ink); }
.toolrow:hover { border-color: var(--tc); box-shadow: 0 6px 18px rgba(20,33,61,.08); }
.toolrow h2 { color: var(--tc); margin-bottom: .2rem; font-size: 1.6rem; }
.toolrow .tq { font-weight: 600; margin-bottom: .4rem; }
.toolrow p:last-child { margin-bottom: 0; color: var(--ink2); max-width: 62ch; }
.tmeta { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: .3rem; font-size: .88rem; color: var(--ink2); text-align: right; min-width: 11rem; }
.dots { display: flex; gap: 5px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--tc); }
.dots i.on { background: var(--tc); }
.tavg { font-weight: 600; color: var(--ink); }
@media (max-width: 700px) { .toolrow { grid-template-columns: 1fr; } .tmeta { align-items: flex-start; text-align: left; } }

/* tool page */
.toolhead { margin-bottom: 1.5rem; }
.steps { padding-left: 1.2rem; color: var(--ink2); max-width: 62ch; }
.steps li { margin-bottom: .2rem; }
.caselist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.caserow { display: grid; grid-template-columns: 2.6rem 1fr auto; align-items: center; gap: 1rem; padding: .95rem 1.2rem; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.caserow:last-child { border-bottom: 0; }
.caserow:hover { background: color-mix(in srgb, var(--accent) 6%, #fff); }
.cno { font: 500 1.6rem var(--serif); color: var(--accent); }
.ctitle b { display: block; }
.ctitle small { color: var(--ink2); }
.cstat { font-size: .88rem; color: var(--ink2); }
.cstat.done { color: var(--good); font-weight: 600; }
@media (max-width: 600px) { .caserow { grid-template-columns: 2rem 1fr; } .cstat { grid-column: 2; } }

/* caselet */
.casehead { margin-bottom: 1.25rem; }
.casehead h1 { margin-bottom: .6rem; }
.work h3:first-child { margin-top: 0; }
.decision-box { background: color-mix(in srgb, var(--accent) 8%, #fff); border: 1.5px solid color-mix(in srgb, var(--accent) 40%, #fff); border-radius: 8px; padding: .9rem 1.1rem; margin-bottom: 1.2rem; }
.decision-box .label { display: block; font-size: .85rem; font-weight: 600; color: var(--accent); margin-bottom: .2rem; }
.decision-box p { margin: 0 0 .2rem; font-weight: 500; }
.decision-box p.muted { font-weight: 400; }
.submitbar { display: flex; align-items: center; gap: 1rem; margin: 1.25rem 0 2rem; flex-wrap: wrap; }
.msg { color: var(--bad); font-weight: 500; }
.live { min-height: 1.6rem; margin: .8rem 0 0; }
.help { margin-bottom: 1rem; }
.help summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.help dl { margin: .6rem 0 0; display: grid; grid-template-columns: 2rem 1fr; gap: .3rem .6rem; }
.help dt { font-weight: 700; color: var(--accent); }
.help dd { margin: 0; }

/* rapid */
.prows { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.prow { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.pinfo small { display: block; color: var(--ink2); }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: 600 .9rem var(--sans); padding: .45rem .8rem; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; min-width: 2.4rem; }
.seg button:last-child { border-right: 0; font-weight: 500; color: var(--ink2); }
.seg button.on { background: var(--accent); color: #fff; }
@media (max-width: 640px) { .prow { grid-template-columns: 1fr; } .seg { width: 100%; } .seg button { flex: 1; padding: .6rem 0; } }

/* weights and bars */
.weights { display: flex; flex-direction: column; gap: .4rem; }
.wrow { display: grid; grid-template-columns: minmax(8rem, 15rem) 1fr 2rem 3rem; align-items: center; gap: .75rem; }
.wrow.stress { grid-template-columns: minmax(8rem, 15rem) 1fr 6rem; }
.wname { font-weight: 500; }
.wval { text-align: right; font-weight: 700; }
.wshare { color: var(--ink2); font-size: .88rem; text-align: right; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.field .wrow { grid-template-columns: 1fr 4rem; margin-top: .3rem; }
@media (max-width: 640px) { .wrow, .wrow.stress { grid-template-columns: 1fr 2rem 3rem; } .wname { grid-column: 1 / -1; } .wrow.stress { grid-template-columns: 1fr 6rem; } }
.bars { display: flex; flex-direction: column; gap: .5rem; margin: .6rem 0 1rem; }
.barrow { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr 3.2rem; align-items: center; gap: .75rem; }
.bt { display: block; height: 18px; background: #e6eaf1; border-radius: 99px; overflow: hidden; }
.bt i { display: block; height: 100%; background: color-mix(in srgb, var(--accent) 45%, #fff); border-radius: 99px; transition: width .15s; }
.barrow.lead .bt i { background: var(--accent); }
.barrow.lead .bl { font-weight: 700; }
.bv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bt.split i.pos { background: var(--good); } .bt.split i.neg { background: var(--bad); }

/* tree */
.alts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0; }
.alt { border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 8px; padding: .9rem 1rem; background: #fcfdff; }
table.mini { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.mini td { padding: .25rem 0; border-bottom: 1px dashed var(--line); }
table.mini tr:last-child td { border-bottom: 0; }
#tree-run { margin-top: 1rem; }

/* choices and checks */
.choices, .checks { display: flex; flex-direction: column; gap: .5rem; margin: .6rem 0; }
.choice, .check { display: flex; align-items: flex-start; gap: .7rem; padding: .7rem .9rem; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; background: #fff; }
.choice:hover, .check:hover { border-color: var(--accent); }
.choice:has(input:checked), .check:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, #fff); }
.choice input, .check input { margin-top: .3rem; accent-color: var(--accent); }
.choice small, .check small { display: block; color: var(--ink2); font-size: .88rem; }
.check.dim { opacity: .5; cursor: not-allowed; }
.checks:has(input[name=bias]) { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* result */
.result { padding: 1.5rem; }
.scoreblock { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem 2.5rem; align-items: center; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.scoreblock .big { display: flex; flex-direction: column; }
.scoreblock .big span { font: 500 4.5rem/1 var(--serif); color: var(--accent); }
.scoreblock .big small { color: var(--ink2); }
.vrow { display: grid; grid-template-columns: 11rem 1fr 2.5rem; align-items: center; gap: .75rem; margin-bottom: .4rem; }
.vbar { display: block; height: 16px; background: #e6eaf1; border-radius: 99px; overflow: hidden; }
.vbar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.vrow.rnd .vbar i, .vbar.rnd i { background: #8c96a8; }
.vrow b { text-align: right; }
.vs p { margin: .6rem 0 0; }
@media (max-width: 640px) { .scoreblock { grid-template-columns: 1fr; } .vrow { grid-template-columns: 8rem 1fr 2.2rem; } }
.debrief { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.debrief h3 { margin-top: 0; }
.nextbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.4rem; }
.outcome { padding: 1rem 1.2rem; border-radius: 8px; margin-bottom: 1rem; }
.outcome.win { background: #e7f5ed; border: 1px solid #a8d8bc; }
.outcome.loss { background: #fbe9ed; border: 1px solid #efb4c1; }
.outcome p { margin: .3rem 0 0; }
.riskmap { list-style: none; padding: 0; margin: .5rem 0 1rem; display: flex; flex-direction: column; gap: .35rem; }
.riskmap li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.riskmap li.real { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, #fff); font-weight: 500; }
.riskmap li.mine:not(.real) { border-style: dashed; }
.riskmap em { font-style: normal; font-size: .85rem; color: var(--ink2); white-space: nowrap; }
.journal-entry { background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; }
.journal-entry p { margin: .3rem 0 0; }

/* facilitator */
.toolbar, .demobar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.pinform { max-width: 24rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 1rem 0 1.5rem; }
.kpis > div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; display: flex; flex-direction: column; }
.kpis b { font: 500 2.1rem/1.1 var(--serif); }
.kpis span { font-size: .85rem; color: var(--ink2); }
.kpis .up { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpis .up span { color: #cdd5e6; }
.bars.big { gap: .9rem; }
.trow { display: grid; grid-template-columns: 14rem 1fr 6rem; gap: .75rem; align-items: center; }
.trow .tn { font-weight: 600; color: var(--tc); }
.trow .tn small { display: block; font-weight: 400; color: var(--ink2); }
.trow .pair { display: flex; flex-direction: column; gap: 4px; }
.trow .vbar i { background: var(--tc); }
.trow .vbar.rnd i { background: #8c96a8; }
.trow b small { font-weight: 400; color: var(--ink2); }
@media (max-width: 640px) { .trow { grid-template-columns: 1fr; } }
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; margin: .8rem 0 1.5rem; }
.insight { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--tc); border-radius: 8px; padding: .9rem 1.1rem; }
.insight b { color: var(--tc); }
.insight p { margin: .3rem 0 0; font-size: .95rem; }
@media print { .top, .foot, .toolbar, .demobar, .submitbar { display: none; } body { background: #fff; } }
