/* ---------- figures and flows ---------- */
.fig { margin: 0 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; box-shadow: var(--shadow); }
.fig figcaption { color: var(--muted); font-size: .88rem; margin-top: 8px; }
.fig h3 { margin: 0 0 8px; font-size: 1.02rem; }
.fig-scroll { overflow-x: auto; }
.fig svg { display: block; width: 100%; height: auto; min-width: 640px; color: var(--ink); }
.fig svg text { fill: currentColor; font-family: var(--font); }
.fig svg .t-muted { fill: var(--muted); }
.fig svg .t-b { font-weight: 700; }
.fig svg .ln { stroke: currentColor; fill: none; stroke-width: 1.5; }
.fig svg .ln-muted { stroke: var(--muted); fill: none; stroke-width: 1.2; }
.fig svg .ln-bad { stroke: var(--bad); fill: none; stroke-width: 1.8; stroke-dasharray: 5 4; }
.fig svg .ln-good { stroke: var(--good); fill: none; stroke-width: 2; }
.fig svg .box { fill: var(--surface); stroke: var(--line); stroke-width: 1.2; }
.fig svg .box-accent { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.4; }
.fig svg .box-good { fill: var(--good-soft); stroke: var(--good); stroke-width: 1.4; }
.fig svg .box-bad { fill: var(--bad-soft); stroke: var(--bad); stroke-width: 1.4; }
.fig svg .fill-bad { fill: var(--bad); }
.fig svg .fill-good { fill: var(--good); }
.fig svg .fill-accent { fill: var(--accent); }
.fig svg .halo { stroke: var(--surface); stroke-width: 5; paint-order: stroke; fill: currentColor; }
.fig svg .t-bad { fill: var(--bad); }
.fig svg .t-good { fill: var(--good); }

.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.flow-step { position: relative; padding: 0 22px 0 0; }
.flow-step:last-child { padding-right: 0; }
.flow-step .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .78rem; margin-bottom: 6px; }
.flow-step h4 { margin: 0 0 2px; font-size: .98rem; }
.flow-step .sub { color: var(--muted); font-size: .82rem; margin-bottom: 8px; min-height: 2.5em; }
.flow-step .ex { background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; font-size: .84rem; line-height: 1.4; min-height: 74px; }
.flow-step .ex.good { background: var(--good-soft); }
.flow-step:not(:last-child)::after { content: "\2192"; position: absolute; right: 2px; top: 34px; color: var(--muted); font-size: 1.3rem; }
@media (max-width: 860px) {
  .flow { grid-template-columns: 1fr; gap: 14px; }
  .flow-step { padding-right: 0; }
  .flow-step .sub, .flow-step .ex { min-height: 0; }
  .flow-step:not(:last-child)::after { content: "\2193"; position: static; display: block; margin-top: 6px; }
}

.chain { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 8px; align-items: stretch; }
.chain > div { padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); font-size: .88rem; }
.chain > div + div { border-left: 0; }
.chain > div:first-child { border-radius: 8px 0 0 8px; }
.chain > div:last-child { border-radius: 0 8px 8px 0; }
.chain .k { display: none; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; font-weight: 600; }
.chain .late { background: var(--bad-soft); }
.chain .early { background: var(--good-soft); }
.chain-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 0 12px; margin-bottom: 4px; }
@media (max-width: 760px) {
  .chain { grid-template-columns: 1fr; margin-bottom: 14px; }
  .chain-head { display: none; }
  .chain .k { display: block; }
  .chain > div + div { border-left: 1px solid var(--line); border-top: 0; }
  .chain > div:first-child { border-radius: 8px 8px 0 0; }
  .chain > div:last-child { border-radius: 0 0 8px 8px; }
}

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr; } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .big { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; margin-bottom: 2px; }
.tile p { margin: 0; color: var(--muted); font-size: .9rem; }
.tile.accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

.tree { display: grid; justify-items: center; gap: 0; margin-bottom: 18px; }
.tree .star { width: min(640px, 100%); text-align: center; background: var(--accent); color: var(--accent-ink); border-radius: 14px; padding: 18px 20px; }
.tree .star .lbl { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.tree .star .name { font-size: 1.3rem; font-weight: 700; line-height: 1.25; margin-top: 2px; }
.tree .stem { width: 2px; height: 22px; background: var(--line); }
.tree .branches { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; position: relative; padding-top: 14px; }
.tree .branches::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 2px; background: var(--line); }
@media (max-width: 760px) { .tree .branches { grid-template-columns: 1fr; } .tree .branches::before { display: none; } }
.mini { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; font-size: .88rem; margin-bottom: 8px; }
.mini b { display: block; }
.mini span { color: var(--muted); }
.mini.trip { border-left: 3px solid var(--bad); }
.group-t { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); margin: 0 0 8px; }

.lede { font-size: 1.12rem; color: var(--muted); max-width: 720px; margin: 0 0 16px; }
.checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
@media (max-width: 900px) { .checks { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .checks { grid-template-columns: 1fr; } }
.checks .tile { padding: 10px 12px; }
.checks .tile b { display: block; margin-bottom: 2px; font-size: .95rem; }
.checks .tile span { color: var(--muted); font-size: .84rem; }
.more { margin: 0 0 14px; }
.more > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .92rem; padding: 6px 0; }
.who { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
@media (max-width: 900px) { .who { grid-template-columns: 1fr 1fr; } }
.who .tile { padding: 10px 12px; }
.who b { display: block; font-size: .92rem; }
.who span { color: var(--muted); font-size: .84rem; }

/* tour bar */
.tour { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(720px, calc(100vw - 24px)); background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 14px; z-index: 40; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tour .tcap { flex: 1; min-width: 220px; font-size: .95rem; line-height: 1.4; }
.tour .tcap b { display: block; }
.tour .btn { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.tour .btn.primary { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.tour .tdots { display: flex; gap: 5px; margin-top: 6px; }
.tour .tdots i { width: 18px; height: 4px; border-radius: 3px; background: color-mix(in srgb, var(--bg) 30%, transparent); }
.tour .tdots i.on { background: var(--bg); }
.tour-pad { height: 120px; }

/* flag card: compact evidence and action buttons */
.ev { list-style: none; margin: 0; padding: 0; }
.ev li { display: grid; grid-template-columns: 150px 120px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .88rem; align-items: start; }
.ev li:last-child { border-bottom: 0; }
.ev .q { font-family: var(--serif); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev .ok { color: var(--good); font-family: var(--font); font-weight: 700; }
@media (max-width: 620px) { .ev li { grid-template-columns: 1fr; gap: 2px; } }
.actrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.actform { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 10px; background: var(--bg); }
.cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .cols2 { grid-template-columns: 1fr; } }
.msg { font-family: var(--serif); font-size: .9rem; line-height: 1.55; white-space: pre-wrap; background: var(--note-soft); border-radius: 8px; padding: 12px 14px; max-height: 280px; overflow: auto; }
.kv.tight { gap: 3px 12px; font-size: .86rem; }
.timeline.compact li { padding: 4px 0; font-size: .8rem; grid-template-columns: 78px 92px 1fr; }

/* evidence on the problem page, metric targets */
.evid { margin: 0 0 10px; }
.evid li { margin-bottom: 8px; line-height: 1.45; }
.src { list-style: none; margin: 0 0 10px; padding: 0; }
.src li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: start; }
.src li:last-child { border-bottom: 0; }
.src .q { font-family: var(--serif); color: var(--muted); font-size: .9rem; margin: 2px 0 4px; }
.src .chip { justify-self: start; }
@media (max-width: 620px) { .src li { grid-template-columns: 1fr; gap: 4px; } }
.mini .tgt { display: block; margin-top: 3px; color: var(--accent); font-style: normal; font-size: .8rem; font-weight: 600; }
.mini .tgt.bad { color: var(--bad); }

/* record figure: HTML so the columns stay aligned and it reflows on a phone */
.rec { display: grid; justify-items: center; }
.rec-pill { background: var(--accent-soft); border: 1.5px solid var(--accent); border-radius: 10px; padding: 10px 20px; font-weight: 700; }
.vline { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: .85rem; text-align: center; }
.vline span { margin: 8px 0 4px; }
.vline i { display: block; width: 2px; height: 24px; background: var(--ink); position: relative; margin-bottom: 4px; }
.vline i::after { content: ""; position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%); border: 6px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
.rec-record { width: 100%; border: 1.5px solid var(--ink); border-radius: 12px; padding: 12px 16px; background: var(--surface); }
.rec-title { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; margin-bottom: 8px; }
.rec-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.rec-fields .k { display: block; color: var(--muted); font-size: .78rem; }
.rec-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; }
.rec-col { display: flex; flex-direction: column; align-items: stretch; }
.rec-col .vline { align-self: center; }
.rec-view { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); flex: 1; }
.rec-view.good { background: var(--good-soft); border-color: var(--good); }
.rec-view b { display: block; margin-bottom: 4px; }
.rec-view p { margin: 0; font-size: .92rem; }
.rec figcaption { justify-self: start; }
@media (max-width: 720px) { .rec-three { grid-template-columns: 1fr; } .rec-fields { grid-template-columns: 1fr 1fr; } }

/* why intake: three-stage comparison */
.cmp { display: grid; grid-template-columns: 108px repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); margin-bottom: 8px; }
.cmp > div { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.cmp > div:nth-last-child(-n+4) { border-bottom: 0; }
.cmp .h { font-weight: 700; background: var(--note-soft); }
.cmp .h.hl { background: var(--accent-soft); color: var(--accent); }
.cmp .r { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; align-self: center; }
.cmp .hl:not(.h) { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }

/* stakeholder map: who has a stake, and the four collisions */
.stk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.stk .tile { padding: 10px 12px; }
.stk .tile b { display: block; font-size: .95rem; }
.stk .tile span { color: var(--muted); font-size: .84rem; }
.stk .tile.light { border-style: dashed; }
@media (max-width: 900px) { .stk { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .stk { grid-template-columns: 1fr; } }
.clashes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
@media (max-width: 900px) { .clashes { grid-template-columns: 1fr; } }
.clash { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.clash .vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; padding: 12px 14px; align-items: center; }
.clash .vs b { display: block; }
.clash .vs span { color: var(--muted); font-size: .86rem; }
.clash .x { font-size: .78rem; font-weight: 700; color: var(--bad); border: 1px solid var(--bad); border-radius: 999px; padding: 2px 8px; }
.clash .fix { background: var(--good-soft); padding: 10px 14px; font-size: .88rem; border-top: 1px solid var(--line); }
