/* Interactive Improvement Plan for a Trust Company — styles
   Institutional navy / slate / bronze palette. Generic: no company branding. No external fonts or assets. */

:root {
  /* Institutional navy / slate / bronze. Bronze is for accents, focus and active states only. */
  --navy: #0E223E;
  --navy-2: #1B3558;
  --navy-soft: #E9EEF5;
  --bronze: #9A7B34;
  --bronze-text: #765D22;   /* darker bronze for small text, AA contrast on paper and white */
  --bronze-soft: #F1EAD8;
  --ink: #17202C;
  --ink-2: #4B5868;
  --paper: #F7F8FA;
  --card: #FFFFFF;
  --line: #D7DEE8;
  --rule-2: #E4E9F0;
  --track: #EDF0F4;
  --green: #2E6146;
  --green-soft: #E5EEE9;
  --yellow: #7D6118;
  --yellow-soft: #F4EEDC;
  --red: #85322C;
  --red-soft: #F3E5E3;
  --focus: #9A7B34;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --radius: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 150px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3 { font-family: var(--serif); color: var(--navy); font-weight: 600; line-height: 1.25; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin: .2em 0 .4em; }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin: 0 0 .3em; }
h3 { font-size: 1.08rem; margin: 0 0 .6em; }
p { margin: 0 0 .8em; }
a { color: var(--navy-2); }
strong { color: inherit; }
.small { font-size: .86rem; color: var(--ink-2); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- Sticky header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy); color: #fff;
  border-bottom: 2px solid var(--bronze);
  box-shadow: none;
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 10px 20px 6px;
  display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.brand { display: flex; flex-direction: column; min-width: 240px; }
.brand-title { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; letter-spacing: .01em; }
.brand-sub { font-size: .76rem; color: #c9d3e4; }
.summary { display: flex; gap: 18px; margin: 0; flex-wrap: wrap; }
.summary div { display: flex; flex-direction: column; }
.summary dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #c9d3e4; }
.summary dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; font-size: .98rem; }
.summary dd.ok { color: #9fd3ae; }
.summary dd.warn { color: #E2CC8E; }
.secnav {
  max-width: 1240px; margin: 0 auto; padding: 2px 14px 8px;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin;
}
.secnav a {
  color: #dfe6f2; text-decoration: none; font-size: .8rem; padding: 3px 8px; border-radius: 4px; white-space: nowrap;
}
.secnav a:hover, .secnav a.is-active { background: rgba(255,255,255,.12); color: #fff; }

/* ---------- Layout ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 0 20px 40px; }
.section { padding: 40px 0 16px; border-top: 1px solid var(--line); }
.sec-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.sec-num {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  background: var(--navy); color: var(--bronze-soft); font-family: var(--serif); font-weight: 600;
  display: grid; place-items: center; font-size: 1.05rem; margin-top: 2px;
}
.sec-intro { max-width: 860px; color: var(--ink-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px;
}
.grid-2 > .card, .grid-2 > .principle { margin-bottom: 0; }

/* ---------- Hero ---------- */
.hero { padding: 36px 0 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .76rem; color: var(--bronze-text); font-weight: 600; margin: 0; }
.lede { font-size: 1.08rem; max-width: 880px; color: var(--ink); }
.principle {
  border-left: 3px solid var(--bronze); background: var(--navy-soft);
  padding: 12px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 18px 0;
}
.principle p { margin: 0; }
.principle-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--bronze-text); font-weight: 700; margin-bottom: 2px; }
.principle-inline { margin: 0 0 18px; }
.card .principle-inline { margin: 12px 0 0; }
.lanes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.lane { border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--line); background: var(--card); border-top-width: 5px; }
.lane h2 { font-size: 1.1rem; margin-bottom: 2px; }
.lane p { margin: 0 0 4px; font-size: .93rem; }
.lane-promise { font-weight: 600; }
.lane-green { border-top-color: var(--green); }
.lane-green .lane-promise { color: var(--green); }
.lane-yellow { border-top-color: #A88A3E; }
.lane-yellow .lane-promise { color: var(--yellow); }
.lane-red { border-top-color: var(--red); }
.lane-red .lane-promise { color: var(--red); }
.legend { font-size: .84rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.legend-title { font-weight: 600; color: var(--ink); }
.legend .tag { margin-left: 8px; }

/* ---------- Tags ---------- */
.tag {
  display: inline-block; font-family: var(--sans); font-size: .68rem; font-weight: 600; letter-spacing: .03em;
  padding: 1px 7px; border-radius: 3px; vertical-align: middle; white-space: nowrap; border: 1px solid transparent;
}
.tag-fact { background: var(--navy-soft); color: var(--navy); border-color: #C7D1DF; }
.tag-assume { background: var(--track); color: #3F4A59; border-color: #CBD3DE; }
.tag-output { background: var(--bronze-soft); color: #664F1C; border-color: #DDD0AC; }
.tag-entered { background: #e1f0f0; color: #1d5a5a; border-color: #b6d6d6; }
.tag-floor { background: #ece6f3; color: #4b3a6b; border-color: #d2c7e2; }
.tag-green { background: var(--green-soft); color: var(--green); border-color: #BCD2C4; }
.tag-yellow { background: var(--yellow-soft); color: var(--yellow); border-color: #DDCFA6; }
.tag-red { background: var(--red-soft); color: var(--red); border-color: #DCBDB9; }
h2 .tag, h3 .tag { margin-left: 6px; }

/* ---------- Buttons & forms ---------- */
.btn {
  font: inherit; font-size: .88rem; padding: 7px 14px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--navy); background: #fff; color: var(--navy);
}
.btn:hover { background: var(--navy-soft); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.form-row.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
label { font-size: .86rem; font-weight: 600; color: var(--ink); }
select, input[type=number], textarea {
  font: inherit; font-size: .9rem; padding: 6px 8px; border: 1px solid #A9B3C1; border-radius: 4px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; }
legend { font-size: .82rem; font-weight: 600; color: var(--ink-2); padding: 0 4px; }

.seg { display: inline-flex; border: 1px solid var(--navy); border-radius: 4px; overflow: hidden; }
.seg-btn { font: inherit; font-size: .88rem; padding: 7px 14px; border: 0; background: #fff; color: var(--navy); cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--navy); }
.seg-btn.is-on { background: var(--navy); color: #fff; }
.seg-sm .seg-btn { font-size: .8rem; padding: 5px 10px; }

/* ---------- Section 1 ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tab { font: inherit; font-size: .84rem; padding: 5px 11px; border-radius: 3px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.tab[aria-selected=true] { background: var(--navy); border-color: var(--navy); color: #fff; }
.tab .tier { font-size: .68rem; opacity: .75; margin-left: 4px; }
.role-prompts ol { margin: 0; padding-left: 1.2em; }
.role-prompts li { margin-bottom: 6px; }
.heat-wrap { overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: .8rem; }
.heat th { font-weight: 600; color: var(--ink-2); text-align: left; padding: 2px 4px; vertical-align: bottom; }
.heat thead th { text-align: center; font-size: .74rem; line-height: 1.2; }
.heat td { text-align: center; padding: 7px 2px; border-radius: 3px; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 46px; }
.heat td.na { color: #6B7685; font-weight: 400; background: #EEF1F5; }
.heat-legend { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--ink-2); margin-top: 6px; }
.heat-legend span.sw { width: 18px; height: 12px; border-radius: 2px; display: inline-block; }
.add-response summary { cursor: pointer; font-weight: 600; color: var(--navy); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.survey-form { margin-top: 14px; }
.ratings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 16px; }
.ratings-grid .form-row { margin: 0; }
.ratings-grid label { font-weight: 500; font-size: .84rem; }
.quotes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.quotes li { border-left: 3px solid var(--line); padding: 4px 12px; font-size: .9rem; }
.quotes li .who { display: block; font-size: .74rem; color: var(--ink-2); margin-top: 2px; }
.quotes li.added { border-left-color: var(--bronze-text); }

/* ---------- Section 2 ---------- */
.facts, .unknowns, .waits, .record { margin: 0 0 10px; padding-left: 0; list-style: none; }
.facts li { margin-bottom: 10px; }
.facts li .tag { margin-right: 6px; }
.unknowns li { padding: 4px 0 4px 22px; position: relative; }
.unknowns li::before { content: "?"; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--navy-soft); color: var(--navy); font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.record li { padding: 5px 0; border-bottom: 1px dotted var(--line); }

/* ---------- Section 3 ---------- */
.flow { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 26px 26px; counter-reset: flow; }
.flow li {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px 12px; font-size: .88rem; counter-increment: flow; min-height: 96px;
}
.flow li::before { content: counter(flow); display: inline-block; font-family: var(--serif); font-weight: 700; color: var(--bronze-text); margin-right: 6px; }
.flow li strong { color: var(--navy); }
.flow li .who { display: block; font-size: .74rem; color: var(--ink-2); margin-top: 4px; }
.flow li::after { content: "→"; position: absolute; right: -20px; top: 50%; transform: translateY(-50%); color: var(--bronze-text); font-size: 1.1rem; }
.flow li:nth-child(5n)::after, .flow li:last-child::after { content: ""; }
.flow li .waits-inline { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.flow li.branch { border-style: dashed; }
.wait-chip {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--red-soft); color: var(--red); border: 1px solid #DCBDB9; padding: 0 6px; border-radius: 3px;
}
.waits li { padding: 4px 0; }
.waits .wait-chip { margin-right: 6px; }
.callout { border-left: 4px solid var(--navy); }

/* ---------- Section 4: model ---------- */
.model-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 8px; }
.mode-note { margin-bottom: 14px; }
.model-grid { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 20px; align-items: start; }
.inputs { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px 12px; position: sticky; top: 140px; max-height: calc(100vh - 160px); overflow-y: auto; }
.in-group h4 { font-family: var(--serif); color: var(--navy); font-size: .95rem; margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.ctl { padding: 6px 0 8px; border-bottom: 1px dotted var(--rule-2); }
.ctl:last-child { border-bottom: 0; }
.ctl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ctl-top label { font-weight: 500; font-size: .84rem; }
.ctl-val { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .86rem; color: var(--navy); white-space: nowrap; }
.ctl-row { display: flex; align-items: center; gap: 8px; }
.ctl input[type=range] { flex: 1; accent-color: var(--navy); min-width: 0; }
.ctl input[type=number] { width: 96px; display: none; font-size: .84rem; padding: 3px 6px; }
body.mode-yours .ctl input[type=number] { display: block; }
.ctl .tag { font-size: .62rem; }
.ctl-note { font-size: .74rem; color: var(--ink-2); margin-top: 2px; }
.toggle { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px dotted var(--rule-2); }
.toggle input { margin-top: 4px; accent-color: var(--navy); width: 16px; height: 16px; }
.toggle label { font-weight: 500; font-size: .84rem; }
.toggle .ctl-note { display: block; }

.outputs .card { margin-bottom: 16px; }
.gauge-wrap { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: 16px; align-items: center; }
#gauge { width: 100%; height: auto; }
.gauge-read .big { font-family: var(--serif); font-size: 2.6rem; color: var(--navy); line-height: 1; font-variant-numeric: tabular-nums; }
.gauge-read .gap { font-weight: 600; margin: 8px 0 4px; }
.gauge-read .gap.ok { color: var(--green); }
.gauge-read .gap.warn { color: var(--yellow); }
.gauge-read .gap.bad { color: var(--red); }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; font-size: .84rem; }
.bar-label { font-weight: 600; }
.bar-pair { display: grid; gap: 3px; }
.bar { position: relative; height: 18px; background: var(--track); border-radius: 3px; overflow: hidden; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.bar em { z-index: 1; padding: 0 3px; background: rgba(255,255,255,.55); border-radius: 2px; position: absolute; left: 6px; top: 0; font-style: normal; font-size: .74rem; line-height: 18px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar.cur > span { background: #B6C0CD; }
.bar.mod.green > span { background: #8DB09B; }
.bar.mod.yellow > span { background: #D3BF84; }
.bar.mod.red > span { background: #C9A09B; }
.bar-target { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--navy); }

.stack { display: flex; height: 22px; border-radius: 3px; overflow: hidden; background: var(--track); margin-bottom: 10px; }
.stack span { display: block; height: 100%; }
.sw-dms { background: var(--navy-2); }
.sw-ai { background: var(--bronze); }
.sw-coord { background: #7d8ea8; }
.kv { width: 100%; border-collapse: collapse; font-size: .88rem; }
.kv th, .kv td { padding: 6px 4px; border-bottom: 1px solid var(--rule-2); text-align: left; vertical-align: top; }
.kv td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.kv th { font-weight: 500; }
.kv .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.kv tr.total th, .kv tr.total td { border-top: 2px solid var(--navy); font-weight: 700; }
.kv .sub { display: block; font-size: .74rem; color: var(--ink-2); font-weight: 400; }

.sens { list-style: none; padding: 0; margin: 12px 0 8px; }
.sens li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 6px 0; border-bottom: 1px solid var(--rule-2); font-size: .86rem; }
.sens .s-name { font-weight: 600; }
.sens .s-name .tag { font-size: .62rem; margin-left: 4px; }
.sens .s-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.sens .s-bar { grid-column: 1 / -1; height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; }
.sens .s-bar span { display: block; height: 100%; background: var(--navy-2); }
.sens li.off .s-bar span { background: #B6C0CD; }
.sens .s-detail { grid-column: 1 / -1; font-size: .74rem; color: var(--ink-2); }

.mbt { list-style: none; padding: 0; margin: 0; }
.mbt li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule-2); font-size: .88rem; align-items: start; }
.mbt .ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; margin-top: 2px; }
.mbt li.ok .ic { background: var(--green-soft); color: var(--green); }
.mbt li.no .ic { background: var(--yellow-soft); color: var(--yellow); }
.mbt .m-val { font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--ink-2); white-space: nowrap; }

.formulas summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.formula-body { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; font-size: .88rem; }
.formula-body h4 { font-family: var(--serif); color: var(--navy); margin: 8px 0 4px; font-size: .95rem; }
.formula-body ul { margin: 0; padding-left: 1.1em; }
.formula-body li { margin-bottom: 4px; }
.formula { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .82rem; background: var(--navy-soft); padding: 8px 10px; border-radius: 4px; color: var(--navy); }
.example .tag { margin-right: 6px; }

/* ---------- Section 6: AI panel ---------- */
.steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; counter-reset: st; }
.steps li { counter-increment: st; background: var(--navy); color: #fff; font-size: .8rem; padding: 8px 10px; border-radius: 4px; position: relative; }
.steps li::before { content: counter(st) "  "; color: var(--bronze-soft); font-weight: 700; }
.steps li:nth-child(5), .steps li:nth-child(6) { background: var(--bronze); }
.panel-mock { border: 1px solid #C7D1DF; border-radius: 4px; background: #FFFFFF; margin-bottom: 18px; overflow: hidden; }
.pm-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--navy-soft); padding: 8px 14px; font-size: .82rem; border-bottom: 1px solid #C7D1DF; }
.pm-head strong { color: var(--navy); }
.pm-body { display: grid; grid-template-columns: 200px 1fr 1.25fr; }
.pm-col { padding: 14px; border-right: 1px solid #e1e6ef; font-size: .85rem; }
.pm-col:last-child { border-right: 0; }
.pm-col h4 { margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-family: var(--sans); }
.pm-drop { border: 2px dashed #b8c3d6; border-radius: 4px; padding: 16px 10px; text-align: center; color: var(--ink-2); font-size: .8rem; margin-bottom: 10px; }
.pm-file { background: #fff; border: 1px solid #dde3ee; border-radius: 4px; padding: 6px 8px; font-size: .78rem; margin-bottom: 6px; }
.pm-dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; }
.pm-dl dt { color: var(--ink-2); font-size: .78rem; }
.pm-dl dd { margin: 0; font-size: .82rem; }
.risk { border: 1px solid #e1e6ef; border-left-width: 4px; border-radius: 4px; padding: 7px 10px; margin-bottom: 7px; background: #fff; }
.risk.red { border-left-color: var(--red); }
.risk.yellow { border-left-color: #A88A3E; }
.risk.green { border-left-color: var(--green); }
.risk .r-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: .82rem; }
.risk .cite { font-family: ui-monospace, Menlo, monospace; font-size: .72rem; color: var(--navy-2); white-space: nowrap; }
.risk p { margin: 3px 0 0; font-size: .78rem; color: var(--ink-2); }
.risk .r-read { font-size: .72rem; margin-top: 4px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.pm-foot { border-top: 1px solid #C7D1DF; padding: 10px 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .82rem; background: #fff; }
.pm-foot .btn { font-size: .8rem; padding: 5px 10px; }

/* ---------- Section 7: demo ---------- */
.demo-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.demo-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; }
.doc-body { max-height: 460px; overflow-y: auto; font-family: var(--serif); font-size: .9rem; border: 1px solid var(--rule-2); border-radius: 4px; padding: 6px 14px; background: #FBFCFD; }
.prov { padding: 8px 0; border-bottom: 1px dotted var(--rule-2); transition: background .3s; }
.prov:last-child { border-bottom: 0; }
.prov .p-ref { font-family: var(--sans); font-size: .72rem; color: var(--ink-2); display: flex; justify-content: space-between; }
.prov .p-title { font-weight: 700; color: var(--navy); }
.prov.hl-red { background: var(--red-soft); margin: 0 -14px; padding: 8px 14px; }
.prov.hl-yellow { background: var(--yellow-soft); margin: 0 -14px; padding: 8px 14px; }
.prov.missing { color: var(--ink-2); font-style: italic; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--rule-2); font-size: .86rem; align-items: center; }
.checklist .ic { width: 18px; height: 18px; border-radius: 50%; background: var(--track); display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: #6B7685; }
.checklist li.running .ic { background: var(--navy-soft); color: var(--navy); }
.checklist li.pass .ic { background: var(--green-soft); color: var(--green); }
.checklist li.yellow .ic { background: var(--yellow-soft); color: var(--yellow); }
.checklist li.red .ic { background: var(--red-soft); color: var(--red); }
.memo { border-top: 5px solid var(--navy); }
.memo-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.memo-head h3 { margin: 0; font-size: 1.25rem; }
.memo-stamp { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--red); font-weight: 700; border: 1.5px solid var(--red); padding: 2px 8px; border-radius: 3px; align-self: flex-start; }
.memo-lane { display: flex; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 4px; margin: 10px 0 14px; }
.memo-lane.green { background: var(--green-soft); }
.memo-lane.yellow { background: var(--yellow-soft); }
.memo-lane.red { background: var(--red-soft); }
.memo-lane .ln { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
.memo-lane.green .ln { color: var(--green); }
.memo-lane.yellow .ln { color: var(--yellow); }
.memo-lane.red .ln { color: var(--red); }
.memo table { width: 100%; border-collapse: collapse; font-size: .86rem; margin-bottom: 14px; }
.memo th, .memo td { text-align: left; vertical-align: top; padding: 7px 6px; border-bottom: 1px solid var(--rule-2); }
.memo th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 600; }
.memo td.cite { font-family: ui-monospace, Menlo, monospace; font-size: .76rem; white-space: nowrap; color: var(--navy-2); }
.memo .decision { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 6px; }
.memo .decided { font-weight: 600; color: var(--navy); }

/* ---------- Section 8: roadmap ---------- */
.roadmap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.phase { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; border-top: 4px solid var(--navy); }
.phase:nth-child(4) { border-top-color: var(--bronze-text); }
.phase-when { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--bronze-text); font-weight: 700; margin: 0 0 2px; }
.phase ul { margin: 0; padding-left: 1.1em; font-size: .88rem; }
.phase li { margin-bottom: 5px; }

/* ---------- Section 9 ---------- */
.reqs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.req { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.req h3 { margin-bottom: 4px; }
.req p { font-size: .88rem; flex: 1; }
.req .metric { font-size: .78rem; color: var(--ink-2); border-top: 1px dotted var(--line); padding-top: 6px; margin-bottom: 8px; }
.req textarea { font-size: .82rem; width: 100%; }
.req label { font-size: .76rem; font-weight: 500; color: var(--ink-2); }

.foot { max-width: 1240px; margin: 0 auto; padding: 20px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--ink-2); display: flex; justify-content: space-between; gap: 20px; align-items: center; flex-wrap: wrap; }
.foot p { margin: 0; max-width: 900px; }
.print-only { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .model-grid { grid-template-columns: 1fr; }
  .inputs { position: static; max-height: none; }
  .pm-body { grid-template-columns: 1fr 1fr; }
  .pm-body .pm-col:first-child { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid #e1e6ef; display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
  .roadmap { grid-template-columns: 1fr 1fr; }
  .reqs { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: repeat(3, 1fr); }
  .flow li:nth-child(5n)::after { content: "→"; }
  .flow li:nth-child(3n)::after, .flow li:last-child::after { content: ""; }
  .steps { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 120px; }
  .summary { gap: 10px 14px; }
  .summary dd { font-size: .88rem; }
  .brand-sub { display: none; }
  .grid-2, .lanes, .demo-grid, .formula-body, .roadmap, .reqs, .pm-body { grid-template-columns: 1fr; }
  .pm-col { border-right: 0; border-bottom: 1px solid #e1e6ef; }
  .flow { grid-template-columns: 1fr; gap: 22px; }
  .flow li::after, .flow li:nth-child(5n)::after, .flow li:nth-child(3n)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -21px; transform: translateX(-50%); }
  .flow li:last-child::after { content: ""; }
  .gauge-wrap { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .sec-head { gap: 10px; }
  .sec-num { width: 30px; height: 30px; font-size: .9rem; }
  main { padding: 0 14px 30px; }
}
@media (max-width: 760px) and (max-height: 900px) {
  .topbar { position: static; }
  html { scroll-padding-top: 10px; }
}

/* ---------- Print ---------- */
@media print {
  @page { margin: 14mm 12mm; }
  html { scroll-behavior: auto; }
  body { background: #fff; font-size: 10.5pt; color: #000; }
  .topbar { position: static; box-shadow: none; background: #fff; color: var(--navy); border-bottom: 2px solid var(--navy); }
  .brand-sub, .summary dt { color: var(--ink-2); }
  .summary dd.ok, .summary dd.warn { color: var(--navy); }
  .secnav, .skip, .no-print, .btn, .seg, .add-response, #runDemo, .model-bar select, .pm-foot .btn, .req textarea:placeholder-shown, .mode-note { display: none !important; }
  .print-only { display: block; }
  .model-bar { display: block; }
  .inputs { position: static; max-height: none; overflow: visible; columns: 2; column-gap: 20px; }
  .in-group { break-inside: avoid; }
  .ctl input[type=range], .ctl input[type=number] { display: none !important; }
  .model-grid, .grid-2, .demo-grid { display: block; }
  .card, .phase, .req, .lane, .principle, .flow li, .risk, .bar-row, .mbt li, .sens li { break-inside: avoid; }
  .section { padding-top: 18px; break-before: auto; }
  #model, #dms, #demo, #roadmap { break-before: page; }
  .doc-body { max-height: none; overflow: visible; }
  details.formulas > *:not(summary) { display: block; }
  details { display: block; }
  .card { border-color: #C5CDD8; }
  a { color: inherit; text-decoration: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* Let grid children shrink so wide tables scroll inside their card instead of widening the page. */
.grid-2 > *, .model-grid > *, .demo-grid > *, .outputs > *, .gauge-wrap > * { min-width: 0; }
.memo { overflow-x: auto; }
@media (max-width: 760px) {
  .memo table { min-width: 620px; }
}
select { max-width: 100%; }
.form-row.inline { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.form-row.inline select { min-width: 0; flex: 1 1 200px; }
@media (max-width: 760px) {
  .bar-row { grid-template-columns: 1fr; gap: 4px; }
  .bar em { white-space: normal; position: relative; display: block; line-height: 1.3; padding: 1px 3px; }
  .bar { height: auto; min-height: 18px; }
}

/* Print overrides (after the responsive rules so they win on the ~720px print page). */
@media print {
  html { font-size: 13px; }
  .brand-sub { display: inline; }
  .grid-2, .demo-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px; }
  .lanes { grid-template-columns: repeat(3, 1fr); }
  .roadmap { grid-template-columns: repeat(2, 1fr); }
  .reqs { grid-template-columns: repeat(3, 1fr); }
  .pm-body { grid-template-columns: 150px 1fr 1.3fr; }
  .pm-col { border-bottom: 0; border-right: 1px solid #e1e6ef; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .flow { grid-template-columns: repeat(5, 1fr); gap: 10px 18px; }
  .flow li { min-height: 0; font-size: .8rem; padding: 6px 8px; }
  .flow li::after { content: "→"; right: -15px; left: auto; top: 50%; bottom: auto; transform: translateY(-50%); }
  .flow li:nth-child(5n)::after, .flow li:last-child::after { content: ""; }
  .outputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .outputs .card { margin: 0; }
  .gauge-wrap { grid-template-columns: 1fr; }
  #gauge { max-width: 260px; }
  .bar-row { grid-template-columns: 70px 1fr; }
  .bar em { white-space: nowrap; position: absolute; background: none; }
  .bar { height: 18px; }
  .formula-body { grid-template-columns: 1fr 1fr; }
  .card { padding: 12px 14px; margin-bottom: 12px; }
  .sec-head { margin-bottom: 10px; }
  .doc-body { font-size: .82rem; }
  .memo table { min-width: 0; }
  .add-response { display: none !important; }
}
@media print {
  #listen .grid-2 { grid-template-columns: 1fr; }
  .heat-wrap { overflow: visible; }
  .pm-body .pm-col:first-child { grid-column: auto; display: block; border-bottom: 0; }
  .foot { break-before: avoid; }
}

/* Second pass */
.fragile { border-left: 3px solid #A88A3E; padding: 4px 10px; background: var(--yellow-soft); color: var(--ink); border-radius: 0 4px 4px 0; margin-top: 10px; }
.playbook { border-left: 4px solid var(--bronze); }
.playbook-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; font-size: .9rem; }
.playbook-grid ol { margin: 0 0 10px; padding-left: 1.4em; }
.playbook-grid li { margin-bottom: 3px; }
@media (max-width: 760px) { .playbook-grid { grid-template-columns: 1fr; } }

/* Horizon: distribution background reports */
.horizon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.horizon-grid .card { margin: 0; border-top: 4px solid var(--bronze); }
.horizon-grid ul.tight { margin: 0 0 10px; padding-left: 1.1em; font-size: .9rem; }
.horizon-grid ul.tight li { margin-bottom: 3px; }
@media (max-width: 1080px) { .horizon-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .horizon-grid { grid-template-columns: 1fr; } }
@media print { .horizon-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; } }

/* Final pass: flatter, print/legal feel */
.card, .phase, .req, .lane, .panel-mock, .flow li { box-shadow: none; }
.lane { border-top-width: 3px; }
.phase { border-top-width: 3px; }
.memo { border-top-width: 3px; }
.horizon-grid .card { border-top-width: 3px; }
.tag { border-radius: 2px; letter-spacing: .02em; }
.seg, .btn { border-radius: 3px; }
.sec-num { background: var(--navy); color: #fff; border: 1px solid var(--navy); }
.steps li:nth-child(5), .steps li:nth-child(6) { background: var(--navy-2); border-left: 3px solid var(--bronze); }
.fragile { background: var(--yellow-soft); border-left-color: var(--bronze); }
.secnav a.is-active { box-shadow: inset 0 -2px 0 var(--bronze); }

/* ---------- Simplified six-step story ---------- */
.start-here { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin: 18px 0; }
.start-here h2 { font-size: 1.05rem; margin: 0 0 8px; }
.start-story { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.story { margin: 0; padding-left: 1.3em; font-size: .93rem; }
.story li { margin-bottom: 4px; color: var(--ink-2); }
.story a { color: var(--navy); text-decoration: none; }
.story a:hover { text-decoration: underline; }
.start-paths { display: flex; flex-direction: column; gap: 8px; }
.path {
  display: block; text-align: left; font: inherit; cursor: pointer; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--navy); border-radius: var(--radius); padding: 9px 14px;
}
.path:hover { border-left-color: var(--bronze); background: var(--navy-soft); }
.path strong { display: block; color: var(--navy); font-size: .95rem; }
.path span { font-size: .82rem; color: var(--ink-2); }
#tourBtn { background: var(--navy); border-color: var(--navy); }
#tourBtn strong, #tourBtn span { color: #fff; }
#tourBtn:hover { background: var(--navy-2); }

.sec-q { margin: 0 0 2px; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--bronze-text); font-weight: 700; }
.sub-h { margin: 18px 0 10px; }
.sub-h .small { font-family: var(--sans); font-weight: 400; }

.preset-group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bar-label { font-size: .86rem; font-weight: 600; margin-right: 2px; }
.btn.preset.is-on { background: var(--navy); color: #fff; }
.posture { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--navy); padding: 6px 12px; border-radius: var(--radius); margin: 4px 0 14px; }
.what-changed { background: var(--navy-soft); border-radius: var(--radius); padding: 8px 12px; font-size: .88rem; margin: 10px 0 6px; }
.what-changed strong { color: var(--navy); margin-right: 4px; }

.more-in { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.more-in > summary { cursor: pointer; font-weight: 600; color: var(--navy); font-size: .9rem; padding: 4px 0; }
.more-in > summary .small { font-weight: 400; margin-left: 4px; }
.more-out > summary, .quotes-card > summary, .ai-more > summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.more-out h4 { font-family: var(--serif); color: var(--navy); margin: 14px 0 8px; }
.quotes-card .quotes { margin-top: 12px; }
.ai-more[open] > summary { margin-bottom: 14px; }
.ai-more .card { margin-bottom: 14px; }

.dms-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.dms-opt { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; font-size: .9rem; }
.dms-opt.is-on { border-top-color: var(--bronze); border-color: #C7D1DF; }
.dms-opt h4 { font-family: var(--serif); color: var(--navy); margin: 0 0 4px; font-size: 1.02rem; }
.dms-opt p { margin-bottom: 8px; }
.dms-opt .btn { align-self: flex-start; margin-top: auto; }
.opt-table { font-size: .8rem; margin-bottom: 8px; }
.opt-table th, .opt-table td { padding: 4px 3px; }
.opt-table tr:first-child th { font-size: .72rem; color: var(--ink-2); font-weight: 600; }
.opt-table td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.caution { background: var(--yellow-soft); border-left: 3px solid var(--bronze); padding: 4px 8px; font-size: .84rem; }
.memo .score { background: var(--navy-soft); padding: 6px 10px; border-radius: var(--radius); }
.horizon-card { border-top: 3px solid var(--bronze); margin: 0; }
.decision-note { border-left: 3px solid var(--bronze); padding-left: 10px; }
.success-block { margin-top: 10px; }

.tourbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 60; max-width: min(960px, calc(100% - 24px));
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--navy); color: #fff; border-radius: var(--radius); padding: 10px 14px; border-top: 2px solid var(--bronze);
}
.tourbar[hidden] { display: none; }
.tour-step { font-weight: 700; font-size: .88rem; }
.tour-hint { font-size: .84rem; color: #D5DEEA; flex: 1 1 240px; }
.tourbar .btn { font-size: .82rem; padding: 5px 10px; }
.tourbar .btn:not(.btn-primary) { background: transparent; color: #fff; border-color: #8FA0B8; }
.tourbar .btn-primary { background: #fff; color: var(--navy); border-color: #fff; }

@media (max-width: 1080px) {
  .dms-options { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .start-here { grid-template-columns: 1fr; }
  .tourbar { bottom: 8px; }
}
@media print {
  .start-here { grid-template-columns: 1fr; }
  .tourbar, .start-paths, .dms-opt .btn { display: none !important; }
  .dms-options { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .dms-opt { font-size: .78rem; padding: 8px 10px; }
  .more-in > summary, .more-out > summary, .quotes-card > summary, .ai-more > summary { list-style: none; }
}
@media print {
  .model-bar { display: none !important; }
  .sub-h { break-after: avoid; page-break-after: avoid; }
  .sub-h + .small { break-after: avoid; }
  .dms-options { break-before: avoid; }
}

/* DMS is foundational */
.no-dms { border-left: 3px solid var(--bronze); }
.no-dms .btn { margin-top: 2px; }
.posture.dms-off { border-left-color: var(--red); background: var(--red-soft); }
@media print {
  .dms-options, .dms-opt { break-inside: avoid; page-break-inside: avoid; }
}
