/* IBM AI Transformation course book - layout, charts, slide deck.
   Supports dual visual styles via html[data-style="dossier" | "infographic"]
   and dual color themes via html[data-theme="light" | "dark"]. */
:root {
  --bg: #ffffff; --fg: #16181d; --mut: #4a4f57; --mut2: #61666e; --soft: #f7f8f9; --tint: #edf2f9;
  --bd: #d9dce0; --bds: #16181d;
  --acc: #1b3a6b; --red: #c8102e; --good: #0e7a46; --bad: #c8102e; --warn: #a34f07;
  /* text on --acc and on each series fill, picked by WCAG ratio (all >= 4.5) */
  --on-acc: #fff; --o0: #fff; --o1: #fff; --o2: #fff; --o3: #fff; --o4: #fff; --o5: #fff;
  /* series: navy first, then red, green, amber, steel, graphite */
  --s0: #1b3a6b; --s1: #c8102e; --s2: #0e7a46; --s3: #a34f07; --s4: #4f6d99; --s5: #4a4f57;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --side: 300px; --top: 52px;
  --rad: 0px; --rad-sm: 0px; --rad-pill: 0px;
  --sh: none; --sh-sm: none;
}
[data-theme="dark"] {
  --bg: #111317; --fg: #eceef1; --mut: #b4bac3; --mut2: #9aa1ab; --soft: #1a1d23; --tint: #1b2537;
  --bd: #30353d; --bds: #c9ced6;
  --acc: #9db8e8; --red: #ff7a88; --good: #5ccb94; --bad: #ff7a88; --warn: #f2a65a;
  --on-acc: #111317; --o0: #111317; --o1: #111317; --o2: #111317; --o3: #111317; --o4: #111317; --o5: #111317;
  --s0: #9db8e8; --s1: #ff7a88; --s2: #5ccb94; --s3: #f2a65a; --s4: #c3cfe3; --s5: #b4bac3;
}
[data-style="infographic"] {
  --rad: 12px; --rad-sm: 8px; --rad-pill: 999px;
  --sh: 0 8px 24px -6px rgba(22, 24, 29, .08), 0 2px 6px -1px rgba(22, 24, 29, .04);
  --sh-sm: 0 2px 8px -2px rgba(22, 24, 29, .06);
  --s0: #1d4ed8; --s1: #e11d48; --s2: #047857; --s3: #b45309; --s4: #6d28d9; --s5: #0e7490;
}
[data-theme="dark"][data-style="infographic"] {
  --sh: 0 10px 28px -6px rgba(0, 0, 0, .45), 0 2px 8px -2px rgba(0, 0, 0, .35);
  --sh-sm: 0 3px 10px -2px rgba(0, 0, 0, .35);
  --s0: #60a5fa; --s1: #fb7185; --s2: #34d399; --s3: #fbbf24; --s4: #a78bfa; --s5: #22d3ee;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 12px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: var(--acc); color: var(--on-acc); }
h1, h2, h3, h4, h5 { line-height: 1.35; margin: 0; letter-spacing: -.015em; }
a { color: var(--acc); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
strong { font-weight: 600; color: var(--fg); }
code { font-family: var(--mono); font-size: .86em; background: var(--soft); border: 1px solid var(--bd); padding: 0 4px; border-radius: var(--rad-sm); }
button { font: inherit; cursor: pointer; }
/* mono label: the dossier's metadata voice. line-height 1.5 keeps Vietnamese capitals clear. */
.sec-head .no, .role .lbl, .plabel, .prow .no, .prow .go, #top, #side summary, #side .c,
.pn small, .chart figcaption::before, .chart .badge, .chart .k-tag, .chart .c-tag, .chart .b-code,
.chart .q-tag, .chart .kpi-tag, .chart .r-tag, .chart .br-idx, .deck-bar, th {
  font-family: var(--mono); letter-spacing: .05em; line-height: 1.5;
}

/* ---------- top bar, style switch, and sidebar ---------- */
#top { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 50; display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: var(--bg); border-bottom: 1px solid var(--bds); font-size: 11.5px; }
#top .brand { color: var(--acc); font-weight: 500; text-decoration: none; text-transform: uppercase; white-space: nowrap; }
#top .brand:hover { text-decoration: underline; }
#top .brand .short { display: none; }
#top .tt { color: var(--mut); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#top button:not(.style-sw) { border: 1px solid var(--bd); background: var(--bg); color: var(--fg); padding: 5px 11px; font-size: 11.5px; letter-spacing: inherit; border-radius: var(--rad-sm); }
#top button:not(.style-sw):hover { border-color: var(--acc); color: var(--acc); }
#top .open-deck { border-color: var(--acc); color: var(--acc); font-weight: 500; }
#top .open-deck:hover { background: var(--acc); color: var(--on-acc); }
#top .menu { display: none; }

/* Segmented toggle switch for Dossier vs Infographic */
.style-sw { display: inline-flex; align-items: center; padding: 2px; border: 1px solid var(--bds); background: var(--soft);
  color: var(--mut); font-size: 11px; letter-spacing: .04em; border-radius: var(--rad-pill); gap: 2px; white-space: nowrap; }
.style-sw .sw-opt { padding: 3px 9px; border-radius: var(--rad-pill); transition: background .15s, color .15s; }
html:not([data-style="infographic"]) .style-sw .sw-opt[data-st="dossier"],
html[data-style="dossier"] .style-sw .sw-opt[data-st="dossier"],
html[data-style="infographic"] .style-sw .sw-opt[data-st="infographic"] {
  background: var(--acc); color: var(--on-acc); font-weight: 600;
}
.style-sw:hover { border-color: var(--acc); }

#side { position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--side); overflow-y: auto; padding: 18px 14px 60px;
  background: var(--soft); border-right: 1px solid var(--bd); font-size: 14px; line-height: 1.45; z-index: 40; }
#side .home { display: block; font-weight: 600; padding: 6px 8px 12px; margin-bottom: 8px; border-bottom: 1px solid var(--bds); text-decoration: none; }
#side .home:hover { text-decoration: underline; }
#side summary { cursor: pointer; font-size: 11.5px; font-weight: 500; text-transform: uppercase; color: var(--acc); padding: 9px 8px; }
#side summary:hover { background: var(--tint); }
#side ol { list-style: none; margin: 0 0 8px; padding: 0; border-top: 1px solid var(--bd); }
#side li a { display: grid; grid-template-columns: 52px 1fr; gap: 6px; padding: 7px 8px; color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--bd); }
#side li a:hover { background: var(--tint); }
#side li a[aria-current] { background: var(--tint); color: var(--acc); font-weight: 600; box-shadow: inset 3px 0 0 var(--acc); }
#side .c { color: var(--acc); font-size: 11.5px; padding-top: 2px; }

/* ---------- book ---------- */
#book { margin-left: var(--side); padding: calc(var(--top) + 40px) 48px 80px; max-width: calc(var(--side) + 1120px); }
#book.index { margin: 0 auto; max-width: 1184px; padding-left: 32px; padding-right: 32px; }
.pt { color: var(--red); }
.lhead h1 { font-size: clamp(22px, 2.3vw, 30px); font-weight: 800; letter-spacing: -.02em; line-height: 1.32; padding: 20px 0 16px; }
.mast h1 { font-size: clamp(25px, 3vw, 38px); font-weight: 800; letter-spacing: -.025em; line-height: 1.25;
  padding: 22px 0 18px; overflow-wrap: anywhere; }
.role { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 18px 0 22px;
  border-top: 1px solid var(--bd); border-bottom: 1px solid var(--bds); }
.role .lbl { font-size: 11.5px; text-transform: uppercase; color: var(--acc); }
.role .val { min-width: 0; }
.en { color: var(--mut); font-style: italic; margin: 0 0 8px; }
.sum { font-size: clamp(14.5px, 1.15vw, 16.5px); line-height: 1.6; color: var(--mut); margin: 0; }
.cta { display: inline-block; margin-top: 16px; background: var(--bg); color: var(--acc); border: 1.5px solid var(--acc);
  padding: 8px 18px; font-weight: 700; font-size: 13.5px; letter-spacing: .02em; text-decoration: none; border-radius: var(--rad-sm); }
.cta:hover { background: var(--acc); color: var(--on-acc); }
/* index masthead: start button plus the way back to the low.vn portal; wraps whole, never mid-link */
.cta-row { display: flex; flex-wrap: wrap; align-items: center; column-gap: 20px; margin: 0; }
.cta-row .home { margin-top: 16px; color: var(--mut); text-decoration: underline; white-space: nowrap; }

/* sections: SEC label inline before the title, body across the full content column */
.sec-head { display: flex; gap: 14px; align-items: baseline;
  padding: 40px 0 16px; border-bottom: 1px solid var(--bds); }
.sec-head .no { flex: none; font-size: 11.5px; color: var(--acc); white-space: nowrap; }
.sec-head h2 { flex: 1; min-width: 0; font-size: clamp(18px, 1.75vw, 22px); font-weight: 700; letter-spacing: -.015em; line-height: 1.35; }
.sec-body { padding: 20px 0 8px; min-width: 0; }
.sec-body > p { color: var(--mut); margin: 0 0 1em; }
.sec-body > h3 { font-size: 16.5px; font-weight: 700; margin: 24px 0 8px; color: var(--fg); }
.sec-body > ol { padding-left: 22px; color: var(--mut); }
.sec-body li { margin: 0 0 .5em; }
/* unordered lists: the dossier's short red dash instead of a dot */
.sec-body ul:not(.legend):not(.c-sub), .slide ul:not(.legend):not(.c-sub) { list-style: none; padding-left: 0; color: var(--mut); }
.sec-body ul:not(.legend):not(.c-sub) > li, .slide ul:not(.legend):not(.c-sub) > li { position: relative; padding-left: 20px; }
.sec-body ul:not(.legend):not(.c-sub) > li::before, .slide ul:not(.legend):not(.c-sub) > li::before {
  content: ""; position: absolute; left: 0; top: .78em; width: 9px; height: 2px; background: var(--red);
}
.tbl { overflow-x: auto; margin: 20px 0 26px; border: 1px solid var(--bds); border-radius: var(--rad-sm);
  background: var(--bg); box-shadow: var(--sh-sm); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.55; }
th { font-size: 11px; font-weight: 500; text-transform: uppercase; color: var(--mut2); text-align: left; padding: 0 14px 10px 0; border-bottom: 1px solid var(--bds); vertical-align: bottom; }
td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--bd); vertical-align: top; }
td:first-child { font-weight: 600; }
.tbl th { padding: 10px 14px; background: var(--tint); color: var(--acc); vertical-align: middle; }
.tbl td { padding: 12px 14px; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.callout { margin: 20px 0; padding: 16px 20px; border: 1px solid var(--bds); background: var(--bg); border-radius: var(--rad-sm); box-shadow: var(--sh-sm); }
.callout b { display: block; margin-bottom: 4px; color: var(--fg); }
.callout p { margin: 0; color: var(--mut); font-size: 15px; }
.callout.tone-example { background: var(--soft); }
/* tone cue now lives in the title colour, not a coloured edge */
.callout.tone-key > b { color: var(--acc); }
.callout.tone-tip > b { color: var(--good); }
.callout.tone-warn > b { color: var(--red); }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 64px; border: 1px solid var(--bds); border-radius: var(--rad-sm); overflow: hidden; }
.pn a { padding: 14px 20px; text-decoration: none; color: var(--fg); font-weight: 600; }
.pn a:hover { background: var(--tint); }
.pn .prev { border-right: 1px solid var(--bd); }
.pn .next { text-align: right; }
.pn small { display: block; color: var(--acc); font-size: 11px; font-weight: 500; text-transform: uppercase; margin-bottom: 2px; }

/* ---------- index ---------- */
.pindex { border: 1px solid var(--bds); margin: 0 0 24px; border-radius: var(--rad-sm); overflow: hidden; box-shadow: var(--sh-sm); }
.plabel { margin: 0; padding: 10px 20px; border-bottom: 1px solid var(--bds); background: var(--tint);
  font-size: 11.5px; font-weight: 500; text-transform: uppercase; color: var(--acc); }
a.prow { display: grid; grid-template-columns: 64px 1fr auto; gap: 20px; align-items: baseline; padding: 14px 20px;
  border-bottom: 1px solid var(--bd); text-decoration: none; color: var(--fg); }
a.prow:last-child { border-bottom: 0; }
a.prow:hover { background: var(--tint); }
.prow .no { font-size: 12px; font-weight: 500; color: var(--acc); }
.prow .t { display: block; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.45; }
.prow .d { display: block; font-size: 13.5px; line-height: 1.55; color: var(--mut); margin-top: 3px; max-width: 72ch; }
.prow .go { font-size: 12px; color: var(--acc); white-space: nowrap; }

/* ---------- charts: shared ---------- */
#book { counter-reset: fig; }
.chart { margin: 30px 0; padding: 0; border: 1px solid var(--bds); background: var(--bg);
  border-radius: var(--rad); box-shadow: var(--sh); overflow: hidden; }
#book .chart { counter-increment: fig; }
.chart figcaption { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 12px 20px;
  background: var(--tint); border-bottom: 1px solid var(--bds); font-weight: 700; font-size: 15px; line-height: 1.45; }
[data-style="infographic"] .chart figcaption {
  background: linear-gradient(135deg, var(--tint) 0%, var(--soft) 100%);
  border-bottom-color: var(--bd);
}
#book .chart figcaption::before {
  content: "FIG " counter(fig, decimal-leading-zero);
  font-size: 11px; font-weight: 600; color: var(--on-acc); background: var(--acc);
  padding: 1px 7px; border-radius: var(--rad-pill);
}
.chart figcaption .fc-title { flex: 1; min-width: 180px; }
.chart .k-tag { font-size: 10.5px; font-weight: 500; text-transform: uppercase; color: var(--acc);
  background: var(--bg); border: 1px solid var(--bd); padding: 1px 8px; border-radius: var(--rad-pill); }
.chart .badge { font-size: 10.5px; font-weight: 500; text-transform: uppercase; color: var(--red);
  background: var(--bg); border: 1px solid currentColor; padding: 1px 7px; border-radius: var(--rad-pill); }
.chart > :not(figcaption) { margin: 20px; }
.chart > .cap { margin-top: -6px; padding-top: 10px; border-top: 1px dashed var(--bd); color: var(--mut); font-size: 13.5px; }
.chart .n { display: block; color: var(--mut); font-size: 13px; line-height: 1.45; margin-top: 4px; font-weight: 400; }
.chart .l { font-weight: 600; line-height: 1.4; color: var(--fg); }
.chart h5 { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--fg); }
.chart ul { margin: 0; }
.chart li { font-size: 14px; line-height: 1.5; margin: 4px 0; }
.chart .c-tag { display: inline-block; font-size: 10.5px; font-weight: 500; text-transform: uppercase;
  color: var(--c, var(--acc)); background: color-mix(in srgb, var(--c, var(--acc)) 12%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--c, var(--acc)) 30%, var(--bd));
  padding: 1px 7px; border-radius: var(--rad-pill); }
.chart ul.c-sub { list-style: none; padding: 6px 0 0; margin: 6px 0 0; border-top: 1px dashed var(--bd); }
.chart ul.c-sub > li { position: relative; padding-left: 14px; font-size: 12.5px; line-height: 1.45; color: var(--mut); margin: 3px 0; }
.chart ul.c-sub > li::before { content: ""; position: absolute; left: 0; top: .58em; width: 5px; height: 5px;
  border-radius: 50%; background: var(--c, var(--acc)); }
.chart .c-gate { margin-top: 8px; padding: 5px 8px; background: color-mix(in srgb, var(--warn) 10%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--bd)); border-radius: var(--rad-sm);
  font-size: 12px; line-height: 1.4; color: var(--fg); display: flex; gap: 6px; align-items: baseline; }
.chart .c-gate .g-k { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--warn);
  border: 1px solid currentColor; padding: 0 4px; border-radius: var(--rad-pill); flex: none; }
.chart .c-foot { margin-top: 10px; padding: 8px 10px; background: var(--soft); border-top: 1px solid var(--bd);
  font-size: 13px; font-weight: 500; color: var(--fg); border-radius: 0 0 var(--rad-sm) var(--rad-sm); }

[style*="--i:0"] { --c: var(--s0); --oc: var(--o0); } [style*="--i:1"] { --c: var(--s1); --oc: var(--o1); }
[style*="--i:2"] { --c: var(--s2); --oc: var(--o2); } [style*="--i:3"] { --c: var(--s3); --oc: var(--o3); }
[style*="--i:4"] { --c: var(--s4); --oc: var(--o4); } [style*="--i:5"] { --c: var(--s5); --oc: var(--o5); }
.k-mermaid pre { background: var(--soft); padding: 16px; border: 1px solid var(--bd); border-radius: var(--rad-sm); text-align: center; overflow-x: auto; }

/* ---------- 1. flow ---------- */
.flow { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 12px; }
.flow > li { position: relative; display: flex; flex-direction: column; background: var(--soft); padding: 12px 14px;
  border: 1px solid var(--bds); border-radius: var(--rad-sm); box-shadow: var(--sh-sm); margin: 0; }
[data-style="infographic"] .flow > li {
  background: linear-gradient(180deg, color-mix(in srgb, var(--c, var(--acc)) 7%, var(--bg)) 0%, var(--bg) 100%);
}
.flow .f-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.flow .k { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px;
  background: var(--c, var(--acc)); color: var(--oc, var(--on-acc)); font: 500 11.5px/1 var(--mono); border-radius: var(--rad-pill); }
.flow .f-arr { width: 26px; height: 12px; margin-left: auto; flex: none; }
.flow .f-arr line { stroke: var(--c, var(--acc)); stroke-width: 1.8; }
.flow .f-arr polygon { fill: var(--c, var(--acc)); }
.flow .f-end { width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--c, var(--acc)); }
.flow .l { display: block; font-size: 14.5px; }

/* ---------- 2. cycle and 3. hub ---------- */
.ringwrap { position: relative; width: min(100%, 560px); aspect-ratio: 1; margin: 20px auto; }
.ringwrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ringwrap .orbit { fill: none; stroke: var(--bd); stroke-width: .35; stroke-dasharray: 1.5 1.5; }
.ringwrap .ring { fill: none; stroke: var(--acc); stroke-width: .7; stroke-opacity: .45; }
.ringwrap .core-ring { fill: color-mix(in srgb, var(--acc) 6%, var(--bg)); stroke: var(--acc); stroke-width: .5; stroke-dasharray: 1 1; }
.ringwrap .arr { fill: var(--acc); }
.ringwrap .spoke { stroke: var(--acc); stroke-width: .65; stroke-opacity: .55; stroke-dasharray: 1.2 .8; }
.ringwrap .sdot { fill: var(--acc); }
.ringwrap .ndot { fill: var(--bg); stroke: var(--acc); stroke-width: .9; }
.ringwrap .node { position: absolute; width: 31%; transform: translate(-50%, -50%); background: var(--bg);
  border: 1px solid var(--bds); padding: 8px 10px;
  text-align: center; font-size: 13px; border-radius: var(--rad-sm); box-shadow: var(--sh-sm); }
.ringwrap .node .n-idx { display: inline-block; font: 500 10.5px/1.3 var(--mono); color: var(--oc, var(--on-acc));
  background: var(--c, var(--acc)); padding: 0 5px; border-radius: var(--rad-pill); margin-bottom: 3px; }
.ringwrap .node .l { display: block; font-size: 13px; }
.ringwrap .node .n { font-size: 11.5px; }
.ringwrap .center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 31%; aspect-ratio: 1;
  border-radius: 50%; background: var(--acc); color: var(--on-acc); display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center; padding: 10px; font-weight: 700; font-size: 13.5px;
  line-height: 1.3; box-shadow: 0 0 0 5px var(--tint), var(--sh); }
[data-style="infographic"] .ringwrap .center {
  background: linear-gradient(135deg, var(--s0) 0%, var(--acc) 100%);
}
.ringwrap .center .c-k { font: 500 9.5px/1.3 var(--mono); letter-spacing: .08em; opacity: .88; margin-bottom: 3px; text-transform: uppercase; }
.ringwrap .center .c-sub-txt { font-size: 11px; font-weight: 400; opacity: .9; margin-top: 3px; }
.chart > .ringwrap { margin-left: auto; margin-right: auto; }
.ringlist { display: none; list-style: none; padding: 0; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ringlist.show-extra { display: grid; border-top: 1px dashed var(--bd); padding-top: 14px; }
.ringlist > li { background: var(--soft); border: 1px solid var(--bds);
  padding: 10px 12px; border-radius: var(--rad-sm); margin: 0; }
.ringlist .rl-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ringlist .k { font: 500 11px/1.3 var(--mono); background: var(--c, var(--acc)); color: var(--oc, var(--on-acc));
  padding: 1px 6px; border-radius: var(--rad-pill); }

/* ---------- 4. compare ---------- */
.compare { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 12px; }
.compare .col { display: flex; flex-direction: column; border: 1px solid var(--bds);
  padding: 14px 16px; background: var(--bg); border-radius: var(--rad-sm); box-shadow: var(--sh-sm); }
.compare .col-head { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--bd); }
.compare .tone-pill { display: inline-flex; align-items: center; gap: 5px; font: 500 10.5px/1.4 var(--mono);
  text-transform: uppercase; padding: 2px 8px; border-radius: var(--rad-pill); margin-bottom: 6px;
  background: var(--soft); color: var(--mut); border: 1px solid var(--bd); }
.compare .tone-pill svg { width: 13px; height: 13px; flex: none; }
.compare .col ul { flex: 1; }
.compare .tone-good { --c: var(--good); }
.compare .tone-good .tone-pill { color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--bg)); border-color: color-mix(in srgb, var(--good) 35%, var(--bd)); }
.compare .tone-bad { --c: var(--bad); }
.compare .tone-bad .tone-pill { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--bg)); border-color: color-mix(in srgb, var(--bad) 35%, var(--bd)); }
.compare .tone-warn { --c: var(--warn); }
.compare .tone-warn .tone-pill { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--bg)); border-color: color-mix(in srgb, var(--warn) 35%, var(--bd)); }
.compare .tone-neutral .tone-pill { color: var(--c, var(--acc)); background: color-mix(in srgb, var(--c, var(--acc)) 10%, var(--bg)); border-color: color-mix(in srgb, var(--c, var(--acc)) 35%, var(--bd)); }

/* ---------- 5. matrix ---------- */
.matrix-wrap { display: flex; flex-direction: column; gap: 12px; }
.matrix { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: 1fr auto; gap: 8px; }
.matrix .yax { grid-row: 1; writing-mode: vertical-rl; transform: rotate(180deg); display: flex; justify-content: space-between; gap: 14px; text-align: center; font-size: 12.5px; color: var(--mut); }
.matrix .yax b, .matrix .xax b { color: var(--fg); text-transform: uppercase; font-family: var(--mono); font-size: 11.5px; }
.matrix .grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0; min-height: 300px;
  border: 1px solid var(--bds); border-radius: var(--rad-sm); overflow: hidden; }
.matrix .m-axes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.matrix .m-axes line { stroke: var(--bds); stroke-width: .5; stroke-dasharray: 2 1.5; }
.matrix .q { position: relative; background: var(--bg); padding: 14px 16px; font-size: 14px; border: 1px solid var(--bd); }
.matrix .q1 { background: var(--tint); }
[data-style="infographic"] .matrix .q1 { background: linear-gradient(135deg, var(--tint) 0%, color-mix(in srgb, var(--good) 8%, var(--bg)) 100%); }
.matrix .q-tag { display: inline-block; font-size: 10px; font-weight: 600; color: var(--acc);
  background: var(--soft); border: 1px solid var(--bd); padding: 0 6px; border-radius: var(--rad-pill); margin-bottom: 4px; }
.matrix .q1 .q-tag { background: var(--acc); color: var(--on-acc); border-color: var(--acc); }
.matrix .q p { margin: 0; color: var(--mut); line-height: 1.45; }
.matrix .dots { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.matrix .dot { position: absolute; transform: translate(-10px, 10px); font-size: 12px; font-weight: 600; line-height: 1.25;
  max-width: 46%; display: flex; gap: 5px; align-items: center; }
.matrix .dot.rt { flex-direction: row-reverse; text-align: right; transform: translate(10px, 10px); }
.matrix .dot i { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--c, var(--red)); color: var(--oc, #fff);
  border: 2px solid var(--bg); font: 600 10.5px/16px var(--mono); text-align: center; box-shadow: var(--sh-sm); }
.matrix .dot .dl { background: color-mix(in srgb, var(--bg) 92%, transparent); padding: 1px 6px;
  border: 1px solid var(--bd); border-radius: var(--rad-sm); }
.matrix .xax { grid-column: 2; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--mut); }
.m-legend { list-style: none; padding: 10px 12px; margin: 0; background: var(--soft); border: 1px solid var(--bd);
  border-radius: var(--rad-sm); display: flex; flex-wrap: wrap; gap: 8px 16px; }
.m-legend > li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin: 0; }
.m-legend b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--c, var(--red)); color: var(--oc, #fff); font: 600 10px/1 var(--mono); flex: none; }
.m-legend small { color: var(--mut); font-family: var(--mono); }

/* ---------- 6. bars and 7. stack ---------- */
.bars .row { display: grid; grid-template-columns: minmax(160px, 36%) 1fr 72px; gap: 12px; align-items: center;
  padding: 9px 0; font-size: 14px; border-bottom: 1px solid var(--bd); }
.bars .row:last-child { border-bottom: 0; }
.bars .row > .l { display: flex; align-items: flex-start; gap: 8px; }
.bars .b-idx { font: 500 11px/1.4 var(--mono); color: var(--c, var(--acc)); background: var(--tint);
  padding: 1px 6px; border-radius: var(--rad-pill); flex: none; margin-top: 1px; }
.bars .b-txt { min-width: 0; }
.bars .track { background: var(--soft); height: 16px; overflow: hidden; border: 1px solid var(--bd); border-radius: var(--rad-pill);
  background-image: linear-gradient(90deg, transparent 24.8%, var(--bd) 25%, transparent 25.2%, transparent 49.8%, var(--bd) 50%, transparent 50.2%, transparent 74.8%, var(--bd) 75%, transparent 75.2%); }
.bars .fill { display: block; height: 100%; background: var(--acc); border-radius: var(--rad-pill); }
[data-style="infographic"] .bars .fill { background: linear-gradient(90deg, var(--c, var(--acc)), color-mix(in srgb, var(--c, var(--acc)) 78%, var(--fg))); }
.bars .v { font: 600 13px/1.4 var(--mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--acc); }

.sbar { display: flex; min-height: 48px; gap: 3px; border-radius: var(--rad-sm); overflow: hidden; }
.sbar .seg { background: var(--c); color: var(--oc, var(--on-acc)); display: flex; flex-direction: column;
  justify-content: center; align-items: center; font: 500 12.5px/1.25 var(--mono); min-width: 36px; padding: 4px; text-align: center; overflow-wrap: anywhere; }
.sbar .seg small { font-size: 10px; opacity: .88; }
.legend { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.stack .legend.stack-cards { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.stack .stack-cards > li { display: flex; align-items: stretch; gap: 10px; background: var(--soft);
  border: 1px solid var(--bd); padding: 9px 12px; border-radius: var(--rad-sm); margin: 0; }
.stack .stack-cards > li > i { width: 6px; height: auto; min-height: 24px; border-radius: var(--rad-pill); background: var(--c); flex: none; }
.stack .st-body { flex: 1; min-width: 0; }
.stack .st-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.stack .st-top b { font: 600 12px/1.4 var(--mono); color: var(--c, var(--acc)); }
.legend li { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.legend i { width: 12px; height: 12px; background: var(--c); border-radius: 3px; }

/* ---------- 8. layers, 9. pyramid, 10. funnel, 11. nested ---------- */
.layers, .pyramid, .funnel { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; }
.band { background: color-mix(in srgb, var(--c) 10%, var(--bg)); border: 1px solid var(--bds);
  padding: 10px 14px; font-size: 14px; border-radius: var(--rad-sm);
  display: flex; align-items: flex-start; gap: 12px; box-shadow: var(--sh-sm); }
.band .b-left { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; min-width: 78px; }
.band .b-code { font-size: 10.5px; font-weight: 600; text-transform: uppercase; color: var(--oc, var(--on-acc));
  background: var(--c, var(--acc)); padding: 2px 7px; border-radius: var(--rad-pill); white-space: nowrap; flex: none; }
.band .l-io { width: 16px; height: 18px; color: var(--c, var(--acc)); opacity: .75; }
.band .b-main { flex: 1; min-width: 0; }
.band .v { color: var(--c); font-family: var(--mono); margin-left: 6px; }

.geom-diag { display: grid; grid-template-columns: 210px 1fr; gap: 18px; align-items: center; }
.geom-svg { width: 100%; max-width: 220px; height: auto; margin: 0 auto; display: block; }
.geom-svg .p-tier polygon { fill: color-mix(in srgb, var(--c) 82%, var(--bg)); stroke: var(--bg); stroke-width: 1.5; }
.geom-svg .p-tier text { fill: var(--oc, var(--on-acc)); font: 600 11px var(--mono); text-anchor: middle; }
.geom-svg .n-shell circle { fill: color-mix(in srgb, var(--c) 16%, var(--bg)); stroke: var(--c); stroke-width: 2; }
.geom-svg .n-shell text { fill: var(--c); font: 600 10px var(--mono); text-anchor: middle; }

.nested { width: 100%; }
.nest-overlay { margin-bottom: 10px; padding: 10px 14px; background: var(--tint); border: 1px dashed var(--bds); border-radius: var(--rad-sm); }
.nest-overlay .b-code { display: inline-block; font-size: 10px; font-weight: 600; color: var(--on-acc);
  background: var(--red); padding: 1px 6px; border-radius: var(--rad-pill); margin-right: 8px; }
.nest { border: 1px solid var(--bds); padding: 10px 14px 12px;
  background: color-mix(in srgb, var(--c) 6%, var(--bg)); font-size: 14px; border-radius: var(--rad-sm); }
.nest-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nest-head .b-code { font-size: 10px; font-weight: 600; color: var(--oc, var(--on-acc)); background: var(--c);
  padding: 1px 6px; border-radius: var(--rad-pill); }
.nest .nest { margin-top: 10px; }

/* ---------- 12. timeline ---------- */
.timeline { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 12px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 43px; height: 2px; background: var(--acc); opacity: .5; }
.timeline > li { position: relative; font-size: 14px; display: flex; flex-direction: column; margin: 0; }
.timeline .tl-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 26px; margin-bottom: 6px; }
.timeline .w { font: 600 11.5px/1.4 var(--mono); color: var(--acc); text-transform: uppercase; letter-spacing: .04em; }
.timeline > li > i { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--c, var(--red)); color: var(--oc, #fff); border: 3px solid var(--bg);
  font: 600 10px/1 var(--mono); font-style: normal; margin: 0 0 10px; position: relative; z-index: 1; box-shadow: var(--sh-sm); }
.timeline .tl-card { flex: 1; background: var(--soft); border: 1px solid var(--bds);
  padding: 10px 12px; border-radius: var(--rad-sm); box-shadow: var(--sh-sm); }
.timeline .l { display: block; }

/* ---------- 13. radar ---------- */
.radar { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.rwrap { position: relative; width: min(100%, 420px); aspect-ratio: 1; }
.rwrap svg { width: 100%; height: 100%; }
.radar .gridl { fill: none; stroke: var(--bd); stroke-width: .45; }
.radar .ser { stroke-width: 1.1; fill-opacity: .18; }
.radar .sdot { stroke: var(--bg); stroke-width: .6; }
.radar .s0 { fill: var(--s0); stroke: var(--s0); --c: var(--s0); }
.radar .s1 { fill: var(--s1); stroke: var(--s1); --c: var(--s1); }
.radar .s2 { fill: var(--s2); stroke: var(--s2); --c: var(--s2); }
.radar .ax { position: absolute; transform: translate(-50%, -50%); font-size: 12px; font-weight: 600;
  text-align: center; width: 26%; line-height: 1.3; background: color-mix(in srgb, var(--bg) 85%, transparent);
  padding: 1px 4px; border-radius: var(--rad-sm); }
.radar .r-table { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.radar .r-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: 6px 10px; background: var(--soft); border: 1px solid var(--bd); border-radius: var(--rad-sm); font-size: 13px; }
.radar .r-stat .v { font-family: var(--mono); color: var(--acc); white-space: nowrap; }
.radar .r-stat small { color: var(--mut); }

/* ---------- 14. kpis ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; background: var(--soft); border: 1px solid var(--bds);
  border-radius: var(--rad-sm); box-shadow: var(--sh-sm); }
[data-style="infographic"] .kpi {
  background: linear-gradient(180deg, color-mix(in srgb, var(--c, var(--acc)) 8%, var(--bg)) 0%, var(--bg) 100%);
}
.kpi .kpi-tag { display: inline-block; font-size: 10px; font-weight: 500; color: var(--c, var(--acc));
  text-transform: uppercase; margin-bottom: 4px; }
.kpi b { display: block; font-size: clamp(20px, 1.9vw, 26px); font-weight: 800; letter-spacing: -.025em;
  color: var(--c, var(--acc)); line-height: 1.2; margin-bottom: 4px; }
.kpi .l { font-weight: 600; font-size: 14px; display: block; }

/* ---------- 15. tree ---------- */
.tree .root { background: var(--acc); color: var(--on-acc); font-weight: 600; padding: 12px 18px;
  text-align: center; width: fit-content; max-width: 100%; margin: 0 auto; position: relative;
  border-radius: var(--rad-sm); box-shadow: var(--sh-sm); }
[data-style="infographic"] .tree .root { background: linear-gradient(135deg, var(--s0), var(--acc)); }
.tree .root .r-tag { display: block; font-size: 10px; opacity: .86; text-transform: uppercase; margin-bottom: 2px; }
.tree .root .r-lbl { font-size: 15px; font-weight: 700; }
.tree .root .n { color: var(--on-acc); opacity: .9; }
.tree .tree-wires { display: block; width: 100%; height: 42px; overflow: visible; }
.tree .tw-line { stroke: var(--acc); stroke-width: 2; vector-effect: non-scaling-stroke; }
.tree .tw-dot, .tree .tw-arr { fill: var(--acc); }
.tree .brs { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 12px; }
.tree .br { background: var(--soft); border: 1px solid var(--bds);
  padding: 12px 14px; overflow-wrap: anywhere; border-radius: var(--rad-sm); box-shadow: var(--sh-sm); }
.tree .br-head { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--bd); }
.tree .br-idx { display: inline-block; font-size: 10px; font-weight: 600; color: var(--oc, var(--on-acc));
  background: var(--c, var(--acc)); padding: 1px 6px; border-radius: var(--rad-pill); margin-bottom: 4px; }

/* ---------- 16. scale ---------- */
.scale .ends { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font: 600 11.5px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--acc); }
.scale .ends .e-mid { font-size: 10px; color: var(--mut); font-weight: 500; }
.scale .marks { list-style: none; position: relative; height: 34px; margin: 8px 0 0; padding: 0; }
.scale .marks::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 6px;
  border-radius: var(--rad-pill); background: linear-gradient(90deg, var(--tint), var(--acc), var(--red)); border: 1px solid var(--bd); }
.scale .marks > li { position: absolute; top: 5px; transform: translateX(-50%); margin: 0; }
.scale .marks i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--c, var(--red)); color: var(--oc, #fff); border: 2px solid var(--bg);
  font: 600 11px/1 var(--mono); font-style: normal; box-shadow: var(--sh-sm); }
.scale .scale-wires { display: block; width: 100%; height: 32px; }
.scale .sw-line { fill: none; stroke: var(--c, var(--acc)); stroke-width: 1.5; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
.scale .sw-dot { fill: var(--c, var(--acc)); }
.scale .scalelist { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px;
  list-style: none; padding: 0; margin: 0; }
.scale .scalelist > li { background: var(--soft); border: 1px solid var(--bds);
  padding: 10px 12px; border-radius: var(--rad-sm); box-shadow: var(--sh-sm); margin: 0; overflow-wrap: anywhere; }
.scale .sc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 5px; }
.scale .sc-top .k { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--c, var(--acc)); color: var(--oc, var(--on-acc)); font: 600 10.5px/1 var(--mono); }
.scale .sc-pos { font: 600 11px/1.3 var(--mono); color: var(--c, var(--acc)); }

/* ---------- slide deck ---------- */
#deck { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; flex-direction: column; }
#deck[hidden] { display: none; }
#deck:focus { outline: none; }
.deck-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--bds); font-size: 11.5px; }
.deck-bar .dt { font-weight: 500; flex: 1; color: var(--acc); text-transform: uppercase; }
.deck-bar .cnt { color: var(--mut); font-variant-numeric: tabular-nums; }
.deck-bar button:not(.style-sw) { border: 1px solid var(--bd); background: var(--bg); color: var(--fg); padding: 4px 12px; font-size: 11.5px; letter-spacing: inherit; border-radius: var(--rad-sm); }
.deck-bar button:not(.style-sw):hover { border-color: var(--acc); color: var(--acc); }
.slides { flex: 1; position: relative; overflow: hidden; }
.slide { position: absolute; inset: 0; padding: 4vh 5vw; display: none; flex-direction: column; overflow-y: auto; }
.slide.on { display: flex; }
.slide h2 { font-size: clamp(19px, 2.1vw, 27px); font-weight: 700; letter-spacing: -.02em; margin-bottom: 2.2vh; line-height: 1.32;
  padding-bottom: 1.5vh; border-bottom: 1px solid var(--bds); }
.slide .sb { flex: 1; display: grid; grid-template-columns: 1fr; gap: 3.2vw; align-items: start; }
.slide.has-v .sb { grid-template-columns: minmax(250px, 0.8fr) minmax(0, 1.2fr); }
.slide .sb > * { min-width: 0; }
.slide.v-only .sb { grid-template-columns: 1fr; }
.slide ul.pts { margin: 0; font-size: clamp(14.5px, 1.25vw, 18px); line-height: 1.55; color: var(--fg); }
.slide ul.pts > li { margin: 0 0 1.4vh; padding-left: 1.1em; }
.slide .sv .chart { margin: 0; }
#deck pre.mermaid svg { max-width: 100%; max-height: calc(78vh - 190px); }
.slide.cover { justify-content: center; }
.slide.cover h2 { font-size: clamp(24px, 2.8vw, 36px); margin: 0 0 2vh; padding: 2.5vh 0 2vh; max-width: 960px; line-height: 1.3; }
.slide.cover .en { font-size: clamp(14px, 1.2vw, 17px); }
.slide.cover .sum { font-size: clamp(15px, 1.3vw, 18px); max-width: 64ch; }
.prog { height: 4px; background: var(--soft); }
.prog i { display: block; height: 100%; background: var(--acc); width: 0; transition: width .2s; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  #top { gap: 8px; padding: 0 12px; }
  #top .menu { display: inline-block; }
  #top .tt { display: none; }
  #top .brand { flex: 1; overflow: hidden; text-overflow: ellipsis; }
  #top button:not(.style-sw) { min-height: 38px; }
  #side { transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility 0s .2s; width: min(86vw, 340px); }
  body.nav-open #side { transform: none; visibility: visible; transition: transform .2s; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  #book, #book.index { margin-left: 0; padding: calc(var(--top) + 22px) 18px 60px; }
  .compare, .tree .brs, .scale .scalelist { grid-template-columns: 1fr; }
  .tree .tree-wires, .scale .scale-wires { display: none; }
  .geom-diag { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .timeline::before { display: none; }
  .ringwrap { display: none; }
  .ringlist { display: grid; }
  .bars .row { grid-template-columns: 1fr 64px; }
  .bars .track { grid-column: 1 / -1; grid-row: 2; }
  .slide.has-v .sb { grid-template-columns: 1fr; }
  .pn { grid-template-columns: 1fr; }
  .pn .prev { border-right: 0; border-bottom: 1px solid var(--bd); }
  a.prow { grid-template-columns: 44px 1fr; gap: 12px; }
  a.prow .go { display: none; }
}
@media (max-width: 640px) {
  .matrix .dot .dl, .scale .ends .e-mid { display: none; }
  .band { flex-direction: column; gap: 6px; }
  .band .b-left { flex-direction: row; min-width: 0; }
}
@media (max-width: 560px) {
  #top .brand .long { display: none; }
  #top .brand .short { display: inline; }
  #top { gap: 5px; padding: 0 8px; }
  #top button:not(.style-sw) { padding: 4px 7px; font-size: 11px; letter-spacing: .01em; min-height: 34px; }
  .style-sw { font-size: 10px; padding: 1px; }
  .style-sw .sw-opt { padding: 3px 6px; }
}
@media print {
  #top, #side, #deck, .cta, .pn { display: none !important; }
  #book { margin: 0; padding: 0; max-width: none; }
  .chart { break-inside: avoid; }
}
.slide .sv { zoom: 1.02; }
.slide:not(.has-v):not(.cover) { justify-content: center; }
.slide:not(.has-v):not(.cover) .sb { flex: 0 0 auto; }
.slide:not(.has-v):not(.cover) .pts { font-size: clamp(16px, 1.55vw, 21px); max-width: 52ch; border-left: 4px solid var(--acc); padding-left: 1.3em; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- 17. line (time series) ---------- */
.line { display: flex; flex-direction: column; gap: 12px; }
.line .y-name { font: 500 11px/1.5 var(--mono); color: var(--mut); text-transform: uppercase; letter-spacing: .05em; }
.line .plot { display: grid; grid-template-columns: 56px 1fr; grid-template-rows: 240px auto; }
.line .yax { position: relative; grid-row: 1; }
.line .yt { position: absolute; right: 8px; transform: translateY(-50%); font: 500 11px/1 var(--mono); color: var(--mut); white-space: nowrap; }
.line .area { position: relative; grid-row: 1; grid-column: 2; border-left: 1px solid var(--bds); border-bottom: 1px solid var(--bds); }
.line svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.line .gl { stroke: var(--bd); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 3; }
.line .ln { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.line .ln.s0, .line .dot.s0 { stroke: var(--s0); --c: var(--s0); }
.line .ln.s1, .line .dot.s1 { stroke: var(--s1); --c: var(--s1); }
.line .ln.s2, .line .dot.s2 { stroke: var(--s2); --c: var(--s2); }
.line .ln.s3, .line .dot.s3 { stroke: var(--s3); --c: var(--s3); }
.line .dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--c); border: 2px solid var(--bg); z-index: 2; }
.line .tg { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.line .tg-l { position: absolute; right: 4px; transform: translateY(-120%); font: 600 11px/1.3 var(--mono); color: var(--red); background: color-mix(in srgb, var(--bg) 80%, transparent); padding: 0 4px; z-index: 1; }
.line .mkl { stroke: var(--mut2); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.line .mk { position: absolute; top: 2px; transform: translateX(-50%); font-size: 11px; line-height: 1.3; color: var(--fg); background: var(--soft);
  border: 1px solid var(--bd); padding: 1px 6px; border-radius: var(--rad-sm); max-width: 40%; text-align: center; }
.line .xax { position: relative; grid-column: 2; height: 34px; }
.line .xax span { position: absolute; top: 6px; transform: translateX(-50%); font: 500 11px/1.3 var(--mono); color: var(--mut); white-space: nowrap; }
.line .legend li i, .dtab th i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 6px; background: var(--c, var(--acc)); }
.line .legend .s0, .dtab .s0 { --c: var(--s0); } .line .legend .s1, .dtab .s1 { --c: var(--s1); }
.line .legend .s2, .dtab .s2 { --c: var(--s2); } .line .legend .s3, .dtab .s3 { --c: var(--s3); }
.dt-wrap { overflow-x: auto; max-width: 100%; }
.dtab, .ct { border-collapse: collapse; width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dtab th, .dtab td, .ct th, .ct td { border: 1px solid var(--bd); padding: 5px 8px; text-align: right; white-space: nowrap; }
.dtab tbody th, .ct tbody th { text-align: left; font-family: var(--sans); font-weight: 600; letter-spacing: 0; white-space: normal; min-width: 120px; }
.dtab thead th, .ct thead th { background: var(--soft); color: var(--mut); font-size: 11px; font-weight: 500; }

/* ---------- 18. cohort (heat table) ---------- */
.cohort .ct td { font-family: var(--mono); background: color-mix(in srgb, var(--acc) var(--h, 0%), var(--bg)); }
.cohort .ct td.hi { color: var(--on-acc); }
.cohort .ct td.na { background: repeating-linear-gradient(45deg, var(--soft) 0 4px, var(--bg) 4px 8px); }
.cohort .ct td.sz { background: var(--soft); color: var(--mut); }
.cohort .ct thead th .u { display: block; font-weight: 400; text-transform: none; color: var(--mut2, var(--mut)); }
.cohort .ct tbody th .n { display: block; font: 400 11px/1.35 var(--sans); text-transform: none; letter-spacing: 0; color: var(--mut); margin-top: 2px; }
.cohort .ct-key { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 8px; font: 500 11px/1 var(--mono); color: var(--mut); }
.cohort .ct-key i { width: 120px; height: 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--acc) 8%, var(--bg)), var(--acc)); border: 1px solid var(--bd); }

/* ---------- 19. formula ---------- */
.formula .f-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.formula .term { flex: 1 1 150px; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--bds); background: var(--bg); border-radius: var(--rad-sm); box-shadow: var(--sh-sm); }
.formula .term.res { background: var(--tint); }
.formula .term[style*="--i:1"] { --c: var(--s1); } .formula .term[style*="--i:2"] { --c: var(--s2); }
.formula .term[style*="--i:3"] { --c: var(--s3); } .formula .term[style*="--i:4"] { --c: var(--s4); }
.formula .term[style*="--i:5"] { --c: var(--s5); }
.formula .fv { font: 700 22px/1.2 var(--mono); color: var(--c, var(--acc)); }
.formula .op { align-self: center; font: 700 24px/1 var(--mono); color: var(--mut); padding: 0 2px; }
.formula .op.eq { color: var(--acc); }
.formula .f-ex { margin-top: 12px; display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; background: var(--soft);
  border: 1px solid var(--bds); border-radius: var(--rad-sm); font-size: 13.5px; }

/* ---------- 20. benchmark (lines in the sand) ---------- */
.benchmark .bm-rows { display: flex; flex-direction: column; }
.benchmark .bm-row { display: grid; grid-template-columns: minmax(160px, 34%) 1fr 150px; gap: 14px; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--bd); }
.benchmark .bm-track { position: relative; height: 18px; background: var(--soft); border: 1px solid var(--bd); border-radius: var(--rad-pill); }
.benchmark .band { position: absolute; top: 2px; bottom: 2px; background: color-mix(in srgb, var(--good) 70%, transparent);
  border: 0; border-radius: var(--rad-pill); min-width: 4px; padding: 0; box-shadow: none; display: block; }
.benchmark .mark { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; background: var(--red); }
.benchmark .bm-v { font: 500 12px/1.4 var(--mono); text-align: right; }
.benchmark .bm-v b { display: block; color: var(--good); font-size: 13px; }
.benchmark .bm-v .ml { color: var(--red); }
.benchmark .bm-axis { position: relative; height: 22px; margin-left: calc(34% + 14px); margin-right: 164px; }
.benchmark .bm-axis span { position: absolute; top: 4px; transform: translateX(-50%); font: 500 11px/1 var(--mono); color: var(--mut); white-space: nowrap; }
.benchmark .legend { display: flex; gap: 16px; padding: 0; list-style: none; margin-bottom: 4px !important; }
.benchmark .bm-k i { display: inline-block; width: 18px; height: 10px; vertical-align: middle; margin-right: 6px; }
.benchmark .kb { background: color-mix(in srgb, var(--good) 70%, transparent); border-radius: var(--rad-pill); }
.benchmark .km { width: 3px !important; background: var(--red); }

@media (max-width: 720px) {
  .line .plot { grid-template-columns: 44px 1fr; grid-template-rows: 200px auto; }
  .line .xax span:nth-child(even) { display: none; }
  .line .mk { font-size: 10px; }
  .benchmark .bm-row { grid-template-columns: 1fr; gap: 6px; }
  .benchmark .bm-v { text-align: left; }
  .benchmark .bm-axis { margin: 0; }
  .formula .op { flex-basis: 100%; text-align: center; }
}
