/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f1f0ec;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6c6a64;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);
  --accent: #1f64b8;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --public: var(--s1);
  --private: var(--s2);
  --neutral: #6b6a65;
  --neutral-soft: #b9b7ae;
  --good: #0ca30c; --warn: #c98500; --serious: #d0632f;
  --link-opacity: 0.38;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
  --radius: 14px;
  --radius-sm: 9px;
  --header-h: 56px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #242422;
    --ink: #ffffff; --ink-2: #c3c2b7; --muted: #9b998f;
    --grid: #2c2c2a; --axis: #45443f;
    --border: rgba(255, 255, 255, 0.10); --border-strong: rgba(255, 255, 255, 0.2);
    --accent: #6da7ec;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --neutral: #a9a79e; --neutral-soft: #55544f;
    --good: #0ca30c; --warn: #fab219; --serious: #ec835a;
    --link-opacity: 0.45; --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #242422;
  --ink: #ffffff; --ink-2: #c3c2b7; --muted: #9b998f;
  --grid: #2c2c2a; --axis: #45443f;
  --border: rgba(255, 255, 255, 0.10); --border-strong: rgba(255, 255, 255, 0.2);
  --accent: #6da7ec;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --neutral: #a9a79e; --neutral-soft: #55544f;
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a;
  --link-opacity: 0.45; --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 64px); }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 16px/1.6 var(--font); overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.012em; text-wrap: balance; }
h1 { font-size: clamp(30px, 4.6vw, 44px); margin: 0 0 14px; font-weight: 750; }
h2 { font-size: clamp(23px, 2.6vw, 28px); margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 18px; margin: 0 0 8px; font-weight: 650; }
p { margin: 0 0 14px; }
strong { font-weight: 650; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--page); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 8px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ credit strip + header */
.credit-strip {
  background: var(--surface-2); color: var(--ink-2); font-size: 13px; line-height: 1.4;
  border-bottom: 1px solid var(--border);
}
.credit-strip .wrap { padding-top: 7px; padding-bottom: 7px; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: baseline; }
.credit-strip a { color: var(--ink); font-weight: 600; }
.site-header {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 16px; white-space: nowrap; }
.brand-mark { width: 22px; height: 22px; flex: none; }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: 14.5px; padding: 8px 12px; border-radius: 8px; white-space: nowrap;
  min-height: 40px; display: inline-flex; align-items: center;
}
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 650; background: color-mix(in srgb, var(--ink) 8%, transparent); }
@media (max-width: 900px) {
  .site-header { height: auto; }
  .site-header .wrap { flex-direction: column; align-items: stretch; gap: 0; padding-top: 8px; }
  .brand { padding: 2px 0 4px; }
  .nav { margin: 0 -16px; padding: 0 28px 6px 12px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .nav a { padding: 6px 10px; font-size: 14px; }
  html { scroll-padding-top: 150px; }
}

/* ------------------------------------------------------------------ hero */
.hero { padding: 48px 0 28px; }
.hero .eyebrow { color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: .02em; margin: 0 0 10px; }
.hero .lede { font-size: 19px; color: var(--ink-2); max-width: 760px; margin: 0; text-wrap: pretty; }
@media (max-width: 640px) { .hero { padding: 28px 0 18px; } .hero .lede { font-size: 17px; } }
.summary {
  margin-top: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; max-width: 860px;
}
.summary h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; font-weight: 700; }
.summary ul { margin: 0; padding-left: 20px; }
.summary li { margin: 6px 0; color: var(--ink); }
.summary li::marker { color: var(--muted); }

/* ------------------------------------------------------------------ KPIs, findings, explore */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 8px 0 32px; }
@media (max-width: 960px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.kpi .k-label { font-size: 14px; color: var(--ink-2); }
.kpi .k-value { font-size: 30px; font-weight: 750; letter-spacing: -0.015em; line-height: 1.15; margin: 4px 0 2px; }
.kpi .k-sub { font-size: 13px; color: var(--muted); }
.kpi .split { display: flex; height: 8px; gap: 2px; margin: 10px 0 6px; }
.kpi .split span { border-radius: 4px; }
.kpi .split .pub { background: var(--public); }
.kpi .split .priv { background: var(--private); }
@media (max-width: 520px) { .kpis { gap: 10px; } .kpi { padding: 12px 14px; } .kpi .k-value { font-size: 20px; white-space: nowrap; } .kpi .k-label { font-size: 13px; } .kpi .k-sub { font-size: 12px; } }
.tag { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--ink-2); vertical-align: 1px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head p { margin: 0; color: var(--ink-2); max-width: 720px; }
.block { padding: 40px 0 8px; }
.findings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 960px) { .findings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .findings { grid-template-columns: 1fr; } }
.finding {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px 16px; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s;
}
.finding:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.finding .f-num { font-size: 30px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.finding .f-title { font-weight: 650; margin: 8px 0 6px; line-height: 1.35; }
.finding .f-text { color: var(--ink-2); font-size: 14.5px; margin: 0 0 12px; flex: 1; }
.finding .f-more { font-size: 14px; color: var(--accent); font-weight: 600; }
.explore { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .explore { grid-template-columns: 1fr; } }
.explore a {
  display: block; padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  color: inherit; text-decoration: none; transition: border-color .15s;
}
.explore a:hover { border-color: var(--border-strong); }
.explore .e-title { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.explore .e-text { color: var(--ink-2); font-size: 14.5px; margin: 0 0 10px; }
.explore .e-more { color: var(--accent); font-weight: 600; font-size: 14px; }

/* ------------------------------------------------------------------ explorer (Sankey) */
.explorer { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px; }
@media (max-width: 640px) { .explorer { padding: 14px; border-radius: 14px; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; margin-bottom: 12px; }
.control { display: flex; flex-direction: column; gap: 5px; }
.control-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--ink-2); font-size: 14px;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; min-height: 36px;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--ink-2); margin: 2px 0 6px; }
.legend .item { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .stage { grid-template-columns: minmax(0, 1fr); } }
.sankey-wrap { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.col-heads { position: relative; height: 22px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.col-heads span { position: absolute; top: 0; white-space: nowrap; }
#sankey { display: block; }
#sankey .link { fill: none; stroke-opacity: var(--link-opacity); cursor: pointer; transition: stroke-opacity .15s; }
#sankey .link.dim { stroke-opacity: 0.07; }
#sankey .link.hi, #sankey .link.sel { stroke-opacity: 0.8; }
#sankey .node { cursor: pointer; }
#sankey .node rect.n { shape-rendering: crispEdges; }
#sankey .node.dim { opacity: 0.35; }
#sankey .node.sel rect.n { stroke: var(--ink); stroke-width: 2px; }
#sankey .node:focus { outline: none; }
#sankey .node:focus-visible rect.n { stroke: var(--accent); stroke-width: 3px; }
#sankey .lbl { font-size: 13px; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
#sankey .lbl .v { fill: var(--ink-2); font-size: 12px; }
#sankey .lbl.dim { opacity: 0.3; }
.view-switch { display: none; }
.columns-view { display: none; }
@media (max-width: 720px) {
  .view-switch { display: flex; }
  .explorer[data-view="coloane"] .sankey-wrap { display: none; }
  .explorer[data-view="coloane"] .columns-view { display: block; }
}
.columns-view .cv-col { margin: 6px 0 18px; }
.columns-view .cv-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.columns-view .cv-bar { display: flex; height: 14px; gap: 2px; margin-bottom: 8px; }
.columns-view .cv-bar span { display: block; height: 100%; }
.columns-view .cv-bar span:first-child { border-radius: 4px 0 0 4px; }
.columns-view .cv-bar span:last-child { border-radius: 0 4px 4px 0; }
.columns-view ul { list-style: none; margin: 0; padding: 0; }
.columns-view li button {
  all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center;
  padding: 9px 2px; min-height: 44px; border-bottom: 1px solid var(--grid); cursor: pointer; font-size: 15px;
}
.columns-view li button:focus-visible { outline: 2px solid var(--accent); }
.columns-view li .cv-v { font-weight: 650; font-variant-numeric: tabular-nums; }

/* panel */
.panel {
  background: var(--page); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
  font-size: 15px; outline: none; position: sticky; top: calc(var(--header-h) + 16px);
}
@media (max-width: 1100px) { .panel { position: static; } }
.panel .p-kind { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 4px; }
.panel h3 { font-size: 20px; margin: 0 0 6px; }
.panel .p-value { font-size: 26px; font-weight: 750; letter-spacing: -0.015em; margin: 4px 0 0; }
.panel .p-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.panel p { color: var(--ink); margin-bottom: 10px; }
.panel h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 6px; font-weight: 700; }
.panel .close { float: right; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 13px; min-height: 32px; }
.panel .more {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px;
  border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--ink); text-decoration: none; font-weight: 650; font-size: 14.5px;
}
.panel .more:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.panel .more span:last-child { color: var(--accent); }
.panel .src { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.flowlist { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.flowlist li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--grid); }
.flowlist li:last-child { border-bottom: 0; }
.flowlist button { all: unset; cursor: pointer; color: var(--ink); text-decoration: underline; text-decoration-color: var(--axis); text-underline-offset: 3px; }
.flowlist button:hover { text-decoration-color: currentColor; }
.flowlist button:focus-visible { outline: 2px solid var(--accent); }
.flowlist .fv { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.flowlist .fp { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.hint { font-size: 13.5px; color: var(--muted); margin: 12px 0 0; }

/* ------------------------------------------------------------------ topic page layout */
.topic-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; padding-bottom: 24px; }
@media (max-width: 1000px) { .topic-layout { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.toc { position: sticky; top: calc(var(--header-h) + 24px); font-size: 14px; }
.toc .toc-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 0 0 8px 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--grid); }
.toc a { display: block; padding: 6px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--ink); font-weight: 650; }
@media (max-width: 1000px) {
  .toc {
    position: sticky; top: var(--toc-top, 92px); z-index: 20; margin: 0 -16px 8px; padding: 8px 16px;
    background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
  }
  .toc .toc-title { display: none; }
  .toc ol { display: flex; gap: 6px; border: 0; overflow-x: auto; scrollbar-width: none; }
  .toc ol::-webkit-scrollbar { display: none; }
  .toc a { border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; margin: 0; white-space: nowrap; font-size: 13.5px; min-height: 36px; display: inline-flex; align-items: center; }
  .toc a[aria-current="true"] { border-color: var(--ink); }
}
.topic { padding: 32px 0 24px; border-top: 1px solid var(--border); }
.topic:first-child { border-top: 0; padding-top: 8px; }
.topic > h2 { scroll-margin-top: 120px; }
.prose { max-width: 70ch; color: var(--ink); }
.prose p { color: var(--ink); }
.callout {
  border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 16px 0; max-width: 70ch; font-size: 15px;
}
.callout strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.next-page {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 24px; margin: 24px 0 8px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none;
}
.next-page:hover { border-color: var(--border-strong); }
.next-page .np-k { font-size: 13px; color: var(--muted); }
.next-page .np-t { font-size: 20px; font-weight: 700; }
.next-page .np-arrow { font-size: 26px; color: var(--accent); }

/* ------------------------------------------------------------------ chart card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px 14px; margin: 18px 0; display: flex; flex-direction: column; }
.card-body { flex: 1 0 auto; }
.grid-2 > .card { margin: 0; }
.grid-2 { margin: 18px 0; }
@media (max-width: 640px) { .card { padding: 16px 14px 12px; } }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.card-title { font-size: 16.5px; font-weight: 700; margin: 0; line-height: 1.3; }
.card-sub { font-size: 13.5px; color: var(--muted); margin: 2px 0 0; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; align-items: baseline; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--grid); font-size: 12.5px; color: var(--muted); }
.card-foot .note { flex-basis: 100%; color: var(--ink-2); font-size: 13px; }
.linkbtn { all: unset; color: var(--accent); cursor: pointer; font-weight: 600; font-size: 12.5px; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-table { margin-top: 10px; }

/* bars (HTML) */
.bars { display: grid; gap: 10px; }
.bar-row { font-size: 14.5px; }
.bar-row .bl { display: flex; justify-content: space-between; gap: 12px; }
.bar-row .bl .lab { color: var(--ink); }
.bar-row .bl .val { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 650; white-space: nowrap; }
.bar-row .track { height: 10px; display: flex; gap: 2px; margin-top: 4px; }
.bar-row .track span { display: block; height: 100%; min-width: 2px; }
.bar-row .track span:last-child { border-radius: 0 4px 4px 0; }
.bar-row .bn { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.bar-row.hl .bl .lab { font-weight: 700; }
.grp-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 14px 0 2px; }
.grp-label:first-child { margin-top: 0; }

/* stacked 100% rows */
.s100 { display: grid; gap: 14px; }
.s100-row .s100-lab { display: flex; justify-content: space-between; gap: 8px; font-size: 14.5px; margin-bottom: 4px; }
.s100-row .s100-lab span:first-child { font-weight: 650; }
.s100-bar { display: flex; height: 26px; gap: 2px; }
.s100-bar span { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 12px; font-weight: 650; color: #fff; overflow: hidden; white-space: nowrap; }
.s100-bar span:first-child { border-radius: 5px 0 0 5px; }
.s100-bar span:last-child { border-radius: 0 5px 5px 0; }
.s100-bar span.dark-text { color: #0b0b0b; }

/* svg charts */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-size: 12px; fill: var(--muted); font-family: var(--font); }
.chart .grid line { stroke: var(--grid); }
.chart .baseline { stroke: var(--axis); }
.chart .lbl-strong { fill: var(--ink); font-weight: 650; }
.multiples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 22px; }
@media (max-width: 860px) { .multiples { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .multiples { grid-template-columns: 1fr; } }
.multiples .m-title { font-size: 14px; font-weight: 650; margin-bottom: 2px; }

/* facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.fact { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.fact .fv { font-size: 24px; font-weight: 750; letter-spacing: -0.01em; line-height: 1.2; }
.fact .fl { font-size: 14px; color: var(--ink); margin-top: 4px; line-height: 1.35; }
.fact .fd { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* timeline */
.timeline { list-style: none; margin: 16px 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 52px; top: 6px; bottom: 6px; width: 2px; background: var(--grid); }
.timeline li { display: grid; grid-template-columns: 44px 1fr; gap: 0 28px; padding: 8px 0 14px; position: relative; }
.timeline .t-year { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink-2); padding-top: 1px; }
.timeline .t-dot { position: absolute; left: 47px; top: 14px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); }
.timeline .t-act { font-weight: 650; }
.timeline .t-eff { font-size: 12px; font-weight: 650; padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.timeline .t-text { color: var(--ink-2); font-size: 15px; margin-top: 2px; max-width: 68ch; }
.timeline li.key .t-act { font-size: 17px; }
.timeline li.key .t-body { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; padding: 10px 14px; margin-top: -6px; }
.eff-minus { background: color-mix(in srgb, var(--s8) 16%, transparent); color: var(--ink); }
.eff-plus { background: color-mix(in srgb, var(--s3) 18%, transparent); color: var(--ink); }
.eff-neutru, .eff-mixt { background: var(--surface-2); color: var(--ink-2); }

/* comparator */
.comparator { display: grid; gap: 16px; }
.comparator label { font-weight: 650; font-size: 15px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.comparator output { font-variant-numeric: tabular-nums; }
.comparator input[type="range"] { width: 100%; accent-color: var(--accent); height: 32px; }
.cmp-results { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .cmp-results { grid-template-columns: 1fr; } }
.cmp-box { border-radius: 12px; padding: 14px 16px; background: var(--surface-2); }
.cmp-box .cb-k { font-size: 13.5px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.cmp-box .cb-v { font-size: 28px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.015em; }
.cmp-box .cb-d { font-size: 13px; color: var(--muted); }
.cmp-ratio { font-size: 15px; color: var(--ink); }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button { border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13.5px; min-height: 34px; }
.presets button:hover { color: var(--ink); border-color: var(--ink-2); }

/* tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th, table.data td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.data th { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }

/* badges (doar pagina Despre) */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 1px 8px 1px 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); white-space: nowrap; }
.badge i { font-style: normal; width: 14px; height: 14px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; color: #fff; }
.badge.verificat i { background: #0b8a0b; }
.badge.diferă i { background: #b07400; }
.badge.estimare i { background: #c0582a; }
.badge.doar-raport i, .badge.calculat i, .badge.reconciliere i { background: #7a7871; }

/* glossary terms + popover */
.term { border-bottom: 1px dotted var(--ink-2); cursor: help; text-decoration: none; color: inherit; }
button.term { all: unset; border-bottom: 1px dotted var(--ink-2); cursor: help; }
button.term:focus-visible { outline: 2px solid var(--accent); }
.popover, .tooltip {
  position: fixed; z-index: 60; max-width: 320px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 13.5px; line-height: 1.45;
}
.tooltip { pointer-events: none; }
.popover .pt { font-weight: 700; margin-bottom: 2px; }
.popover a { font-size: 13px; }
.tooltip .t-title { font-weight: 700; margin-bottom: 2px; }
.tooltip .t-val { font-size: 18px; font-weight: 750; }
.tooltip .t-sub { color: var(--ink-2); }
.tooltip .t-row { display: flex; justify-content: space-between; gap: 14px; }
.tooltip .t-row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tooltip .t-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 650; }
.tooltip .t-foot { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ------------------------------------------------------------------ about page */
.cite { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; max-width: 860px; }
.cite blockquote { margin: 8px 0 0; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font-size: 15px; }
.limits { display: grid; gap: 12px; max-width: 860px; padding: 0; list-style: none; }
.limits li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.limits h3 { font-size: 16.5px; margin-bottom: 4px; }
.limits p { margin: 0; color: var(--ink-2); font-size: 15px; }
.glossary { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px 28px; margin: 12px 0 0; }
.glossary div { border-top: 1px solid var(--grid); padding-top: 10px; }
.glossary dt { font-weight: 700; }
.glossary dd { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }
.sources { padding-left: 20px; max-width: 900px; }
.sources li { margin-bottom: 8px; color: var(--ink-2); }

/* ------------------------------------------------------------------ footer */
.site-footer { margin-top: 56px; border-top: 1px solid var(--border); background: var(--surface); font-size: 14px; color: var(--ink-2); }
.site-footer .wrap { padding-top: 28px; padding-bottom: 36px; display: grid; grid-template-columns: 2fr 1fr; gap: 24px 48px; }
@media (max-width: 800px) { .site-footer .wrap { grid-template-columns: 1fr; } }
.site-footer h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.site-footer p { margin: 0 0 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 4px 0; }
.site-footer a { color: var(--ink); }

/* 404 */
.notfound { padding: 96px 0; text-align: center; }
.notfound p { color: var(--ink-2); }

@media (forced-colors: active) { #sankey .link { stroke-opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-header, .toc, .toolbar, .next-page, .credit-strip { display: none; }
  body { background: #fff; }
  .card, .kpi, .finding { break-inside: avoid; }
}

/* credit: versiune scurtă pe ecrane mici */
.credit-short { display: none; }
@media (max-width: 640px) { .credit-long { display: none; } .credit-short { display: inline; } }
/* legendă: romb pentru estimări */
.swatch.diamond { width: 10px; height: 10px; border-radius: 1px; transform: rotate(45deg); background: transparent !important; border: 2px solid var(--ink-2); margin: 0 2px; }
#verif-table td:first-child { min-width: 220px; }
#verif-table td:nth-child(5) a { white-space: nowrap; }

/* ---------------------------------------------------------------- v4: bară de ponderi, grupuri, hartă, cifre cheie */
.sharebar .sb-bar { height: 30px; }
.sb-key { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 20px; }
.sb-key li { display: flex; align-items: baseline; gap: 8px; font-size: 14.5px; }
.sb-key .swatch { transform: translateY(1px); }
.sb-key .sb-lab { flex: 1; min-width: 0; }
.sb-key .sb-sub { display: block; font-size: 12.5px; color: var(--muted); }
.sb-key .sb-val { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-row.grp-head { margin-top: 14px; }
.bar-row.grp-head:first-child { margin-top: 0; }
.bar-row.grp-head .bl { font-size: 16.5px; }
.bar-row.grp-head .bl .lab, .bar-row.grp-head .bl .val { font-weight: 700; }
.bar-row.grp-head .track { height: 14px; }
.bar-row.sub { font-size: 13.5px; padding-left: 14px; border-left: 2px solid var(--border); }
.bar-row.sub .bl .lab { color: var(--ink-2); }
.bar-row.sub .bl .val { font-weight: 600; color: var(--ink-2); }
.bar-row.sub .track { height: 7px; margin-top: 3px; }
.bars .bar-row.sub + .bar-row.sub { margin-top: -4px; }
.subcharts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 640px) { .subcharts { grid-template-columns: 1fr; } }
.subcharts h4 { margin: 0 0 10px; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.subcharts h4 span { font-weight: 500; color: var(--muted); font-size: 13px; }
.lead-stat { font-size: 17px; line-height: 1.5; margin: 0 0 14px; max-width: 62ch; }
.lead-stat strong { font-size: 19px; }
.ref-sep { border-top: 1px dashed var(--border-strong); padding-top: 12px; }
.chart.map { display: flex; justify-content: center; }
.chart.map svg { width: auto; max-width: 100%; height: auto; }
.chart.map path { stroke: var(--surface); stroke-width: 1; cursor: pointer; }
.chart.map path.hl { fill: none; stroke: var(--ink); stroke-width: 2; cursor: default; }
.finding .f-stmt { font-size: 18px; line-height: 1.4; margin: 0 0 14px; flex: 1; color: var(--ink); }
.finding .f-stmt strong { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
.map-hint { margin: -4px 0 12px; }
