/* Styles for article visualisations (post-viz.mjs).
   Colours come only from the site tokens; neutral greys/white are allowed.
   Everything is visible by default; hidden start states live under html.pv-on (set by post-viz.js
   when motion is allowed), so without JS or with reduced motion the figures are shown complete. */

.pv { margin: 36px 0 40px; }
.post-body .pv p, .post-body .pv li { line-height: 1.4; }
.post-body .pv p + p { margin-top: 0; }
.post-body .pv ul, .post-body .pv ol { margin: 0; padding: 0; list-style: none; display: block; }
.post-body .pv li { padding-left: 0; }
.post-body .pv li::before { content: none; }
.pv-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(18px, 3vw, 28px); font-size: .9375rem; overflow: hidden; }
.pv-head { display: grid; gap: 6px; margin-bottom: 22px; }
.pv-k { justify-self: start; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 5px 10px; border-radius: 999px; }
.post-body .pv-t { font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem); font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; color: var(--ink); }
.pv-cap { margin-top: 12px; padding: 0 4px; font-size: .875rem; line-height: 1.5; color: var(--muted); }
.pv-src { display: block; margin-top: 4px; font-size: .8125rem; }
.pv b, .pv strong { font-weight: 700; color: var(--ink); }
.pv-n { font-variant-numeric: tabular-nums; }
.pv-lab { color: var(--ink-2); }
.pv-val { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.post-body .pv-note { margin-top: 8px; font-size: .8125rem; color: var(--muted); }
.pv svg text { font-family: inherit; }

/* ── horizontal bars */
.pv-bars { display: grid; gap: 14px; }
.pv-row-h { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 7px; font-size: .875rem; }
.pv-track { position: relative; display: block; height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pv-bar { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 999px; background: var(--grad); transform-origin: left center; }
.pv-bar.is-open { background: linear-gradient(90deg, var(--accent) 70%, var(--accent-line)); }
.is-muted > .pv-track .pv-bar, .pv-row.is-muted .pv-bar { background: var(--muted); opacity: .55; }
.pv-range { position: absolute; top: 0; bottom: 0; left: var(--l); width: var(--w); border-radius: 0 999px 999px 0; background: repeating-linear-gradient(135deg, var(--accent-line) 0 5px, var(--accent-soft) 5px 9px); transform-origin: left center; }
.pv-row, .pv-col, .pv-drow { transition: filter .25s; }
@media (hover: hover) {
  .pv-bars:hover .pv-row, .pv-cols:hover .pv-col, .pv-div:hover .pv-drow { filter: opacity(.45); }
  .pv-bars:hover .pv-row:hover, .pv-cols:hover .pv-col:hover, .pv-div:hover .pv-drow:hover { filter: none; }
}

/* ── vertical columns */
.pv-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: clamp(8px, 2vw, 22px); align-items: end; }
.pv-col { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pv-col-v { font-weight: 700; font-size: .875rem; line-height: 1.2; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.pv-col-b { display: block; width: min(100%, 86px); height: calc(var(--p) * var(--h)); border-radius: 12px 12px 4px 4px; background: var(--grad); transform-origin: center bottom; }
.pv-col.is-muted .pv-col-b { background: var(--muted); opacity: .45; }
.pv-col.is-bad .pv-col-b { background: var(--ink); opacity: .85; }
.pv-col-l { min-height: 3.2em; margin-top: 10px; font-size: .8125rem; line-height: 1.25; color: var(--ink-2); font-weight: 600; }
.pv-col-l small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; margin-top: 2px; }

/* ── bars around zero */
.pv-div { display: grid; gap: 12px; }
.pv-drow { display: grid; grid-template-columns: minmax(0, 22ch) minmax(0, 1fr) var(--vw, 8ch); gap: 14px; align-items: center; font-size: .875rem; }
.pv-drow .pv-lab { line-height: 1.25; }
.pv-drow.is-hot .pv-lab { color: var(--ink); font-weight: 700; }
.pv-dtrack { position: relative; height: 16px; border-radius: 6px; background: var(--surface-2); }
.pv-dtrack::after { content: ""; position: absolute; left: var(--z); top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--ink); opacity: .55; }
.pv-dbar { position: absolute; top: 0; bottom: 0; width: var(--w); }
.pv-dbar.is-neg { right: calc(100% - var(--z)); border-radius: 6px 0 0 6px; background: var(--muted); opacity: .7; transform-origin: right center; }
.pv-drow.is-hot .pv-dbar.is-neg { background: var(--ink); opacity: .85; }
.pv-dbar.is-pos { left: var(--z); border-radius: 0 6px 6px 0; background: var(--grad); transform-origin: left center; }
.pv-dbar.is-neg.is-open { background: linear-gradient(270deg, var(--muted) 60%, var(--surface-2)); }
.pv-drow .pv-val { text-align: right; }

/* ── big numbers */
.pv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 22px; }
.pv-stat { background: var(--surface-2); border-radius: 16px; padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.pv-big { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.pv-big s { color: var(--muted); -webkit-text-fill-color: var(--muted); text-decoration-thickness: 2px; font-weight: 500; }
.pv-sl { font-size: .8125rem; line-height: 1.35; color: var(--ink-2); }

/* ── checklists */
.pv-checks { display: grid !important; gap: 10px; }
.pv-checks li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px !important; border-radius: 14px; background: var(--surface-2); transition: background-color .2s; }
.pv-checks li:hover { background: var(--accent-soft); }
.pv-ic { width: 26px; height: 26px; }
.pv-ic circle { fill: var(--accent); }
.pv-ic path { fill: none; stroke: var(--surface); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pv-checks .is-warn .pv-ic circle { fill: var(--ink); }
.pv-checks .is-q .pv-ic circle { fill: var(--muted); }
.pv-checks li > span { padding-top: 2px; }

/* ── flow of steps */
.pv-flow { display: grid !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 26px; counter-reset: none; }
.pv-flow li { position: relative; display: grid; gap: 8px; align-content: start; }
.pv-flow li + li::before { content: "" !important; position: absolute; left: -21px; top: 13px; width: 16px; height: 2px; background: var(--ink); opacity: .35; }
.pv-flow li + li::after { content: ""; position: absolute; left: -8px; top: 9px; width: 7px; height: 10px; background: var(--ink); opacity: .35; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.pv-flow-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .875rem; }
.pv-flow li:last-child .pv-flow-n { background: var(--grad); color: var(--surface); }
.pv-flow-t { font-size: .875rem; line-height: 1.35; color: var(--ink-2); }
.pv-flow li:last-child .pv-flow-t { color: var(--ink); font-weight: 600; }

/* ── vertical timeline */
.pv-tl { position: relative; display: grid !important; gap: 18px; padding-left: 26px !important; }
.pv-tl::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); transform-origin: top; }
.pv-tl li { position: relative; display: grid; gap: 2px; }
.pv-tl li::after { content: ""; position: absolute; left: -25px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--muted); box-sizing: border-box; }
.pv-tl li.is-hot::after { border-color: var(--accent); background: var(--accent); }
.pv-tl-d { font-weight: 700; font-size: .875rem; color: var(--ink); }
.pv-tl li.is-hot .pv-tl-d { color: var(--accent); }
.pv-tl-t { color: var(--ink-2); }

/* ── ranges on an axis, hour rulers */
.pv-rng, .pv-ruler { display: grid; gap: 16px; }
.pv-rtrack { position: relative; height: 14px; border-radius: 999px; background: var(--surface-2); }
.pv-rseg { position: absolute; top: 0; bottom: 0; left: var(--a); width: var(--b); border-radius: 999px; background: var(--grad); transform-origin: left center; }
.pv-rrow.is-muted .pv-rseg { background: var(--muted); opacity: .5; }
.pv-rseg.is-open { background: linear-gradient(90deg, var(--accent) 35%, var(--accent-soft)); border-radius: 999px 0 0 999px; }
.pv-rrow:has(.pv-rdot) .pv-rseg { background: var(--accent-line); }
.pv-rdot { position: absolute; top: 50%; left: var(--x); width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--surface); }
.pv-rrow.is-muted .pv-rdot { background: var(--muted); }
.pv-axis { position: relative; height: 18px; margin-top: -4px; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; border-top: 1px dashed var(--line); }
.pv-axis span { position: absolute; left: var(--x); top: 4px; transform: translateX(-50%); }
.pv-axis span:first-child { transform: none; }
.pv-axis span:last-child { transform: translateX(-100%); }
.post-body .pv-unit { font-size: .75rem; color: var(--muted); margin-top: -8px; }
.pv-lane .pv-lab { font-size: .875rem; margin-bottom: 8px; }
.pv-rband { position: absolute; top: 0; bottom: 0; left: var(--a); width: var(--b); border-radius: 999px; background: var(--grad); transform-origin: left center; }
.pv-rmark { position: absolute; top: -4px; bottom: -4px; left: var(--x); width: 6px; margin-left: -3px; border-radius: 3px; background: var(--ink); }
.pv-rmark:last-child { margin-left: -6px; }

/* ── month strip */
.pv-mo { display: grid; gap: 12px; }
.pv-mo-h { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); font-size: .75rem; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.pv-mo-lane .pv-lab { font-size: .8125rem; margin-bottom: 6px; line-height: 1.3; }
.pv-mo-track { position: relative; height: 24px; border-radius: 8px; background: repeating-linear-gradient(90deg, var(--surface-2) 0 calc(100% / var(--n) - 2px), var(--surface) calc(100% / var(--n) - 2px) calc(100% / var(--n))); }
.pv-mo-seg { position: absolute; top: 0; bottom: 0; left: var(--a); width: var(--b); border-radius: 8px; background: var(--accent-line); transform-origin: left center; display: flex; align-items: center; overflow: hidden; }
.pv-mo-lane.is-hot .pv-mo-seg { background: var(--grad); }
.pv-mo-lane.is-muted .pv-mo-seg { background: var(--muted); opacity: .45; }
.pv-mo-seg em { font-style: normal; font-size: .75rem; font-weight: 600; padding: 0 8px; white-space: nowrap; color: var(--ink); }
.pv-mo-lane.is-hot .pv-mo-seg em { color: var(--surface); }
.pv-mo-mark { position: absolute; top: -4px; bottom: -4px; left: var(--x); width: 4px; margin-left: -2px; border-radius: 2px; background: var(--ink); }

/* ── rings */
.pv-rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pv-ring { display: grid; justify-items: center; text-align: center; gap: 10px; align-content: start; }
.pv-ring-c { position: relative; width: min(100%, 132px); }
.pv-ring-c svg { display: block; width: 100%; height: auto; }
.pv-ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 11; }
.pv-ring-fg { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; stroke-dasharray: var(--p) 100; }
.pv-ring-v { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.post-body .pv-ring-l { font-size: .8125rem; line-height: 1.35; color: var(--ink-2); }
.pv-ring-l small { display: block; margin-top: 3px; color: var(--muted); font-size: .75rem; }
.pv-share { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr); gap: 28px; align-items: center; }

/* ── chips / pills */
.pv-chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pv-chiprow--c { justify-content: center; margin-top: 0; }
.pv-pill { display: inline-block; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: .8125rem; line-height: 1.3; }

/* ── callout under a chart */
.post-body .pv-callout { margin-top: 18px; padding: 12px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--ink); font-size: .875rem; }

/* ── split panes (name vs number) */
.pv-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pv-pane { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 18px 14px; border-radius: 16px; background: var(--surface-2); }
.pv-pane.is-hot { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.post-body .pv-pane-h { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pv-q { font-weight: 600; color: var(--ink); background: var(--surface); padding: 9px 14px; border-radius: 12px; box-shadow: 0 1px 0 var(--line); }
.pv-down { width: 2px; height: 20px; background: var(--ink); opacity: .3; position: relative; transform-origin: top; }
.pv-down::after { content: ""; position: absolute; left: -4px; bottom: -2px; width: 10px; height: 7px; background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.pv-pane .pv-pill { background: var(--surface); }
.pv-out { font-weight: 700; padding: 8px 14px; border-radius: 999px; }
.pv-out.is-bad { color: var(--ink-2); background: var(--surface); border: 1.5px dashed var(--muted); }
.pv-out.is-good { color: var(--surface); background: var(--grad); }

/* ── comparison cards */
.pv-cmp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pv-cmp-c { display: grid; gap: 12px; align-content: start; padding: 16px; border-radius: 16px; background: var(--surface-2); transition: box-shadow .25s; }
.pv-cmp-c:hover { box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.post-body .pv-cmp-h { font-weight: 700; font-size: 1.0625rem; color: var(--ink); }
.post-body .pv-cmp-r { font-size: .8125rem; line-height: 1.4; color: var(--ink-2); }
.pv-price { display: grid; gap: 6px; }
.pv-price-l { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pv-price .pv-track { background: var(--surface); }
.pv-track--q { background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px) !important; }
.pv-price-v { font-size: .8125rem; font-weight: 600; color: var(--ink); }

/* ── choice matrix */
.pv-mx { display: grid; gap: 10px; }
.pv-mx-r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.post-body .pv-mx-t { font-weight: 700; color: var(--ink); }
.pv-mx-t small { display: block; font-weight: 400; font-size: .8125rem; color: var(--muted); margin-top: 2px; }
.pv-mx-p { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pv-tag { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; font-size: .8125rem; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); }
.pv-tag.is-on { color: var(--surface); background: var(--accent); border-color: transparent; }
.pv-tag svg { width: 14px; height: 14px; }
.pv-tag path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ── volumetric weight */
.pv-calc { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 24px; align-items: center; }
.pv-crate { display: block; width: 100%; height: auto; }
.pv-face { stroke: none; }
.pv-face--top { fill: var(--surface); }
.pv-face--l { fill: var(--surface-2); }
.pv-face--r { fill: var(--line); }
.pv-slat { stroke: var(--muted); stroke-width: 1; opacity: .45; fill: none; }
.pv-edges path { fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-linecap: round; }
.pv-dim { font-size: 12px; font-weight: 600; fill: var(--ink-2); }
.pv-wt { font-size: 17px; font-weight: 700; fill: var(--accent); }
.pv-eq { display: grid; gap: 8px; }
.post-body .pv-eq-r { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.pv-eq-r span { color: var(--ink-2); }
.pv-eq-r.is-muted b { color: var(--muted); }
.post-body .pv-eq-res { margin-top: 4px; padding: 12px 14px; border-radius: 12px; background: var(--grad); color: var(--surface); font-weight: 500; }
.pv-eq-res b { color: inherit; }

/* ── steps up (receiving method) */
.pv-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; }
.pv-step { display: grid; grid-template-rows: 112px auto auto; gap: 4px; }
.pv-step-b { display: block; height: calc(36px + var(--s) * 34px); border-radius: 12px 12px 4px 4px; background: var(--accent-line); transform-origin: center bottom; margin-bottom: 8px; align-self: end; }
.pv-step:last-child .pv-step-b { background: var(--grad); }
.post-body .pv-step-t { font-weight: 700; color: var(--ink); }
.post-body .pv-step-s { font-size: .8125rem; color: var(--ink-2); }
.post-body .pv-axisline { display: flex; justify-content: space-between; margin-top: 14px; padding-top: 8px; border-top: 2px solid var(--line); font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; position: relative; }
.post-body .pv-axisline::after { content: ""; position: absolute; right: 0; top: -6px; width: 9px; height: 9px; border-top: 2px solid var(--line); border-right: 2px solid var(--line); transform: rotate(45deg); }

/* ── map */
.pv-scroll { contain: inline-size; overflow-x: auto; overscroll-behavior-x: contain; margin: 0 -4px; padding: 0 4px; -webkit-overflow-scrolling: touch; }
.pv-map { display: block; width: 100%; height: auto; }
.post-body .pv-hint { display: none; font-size: .75rem; color: var(--muted); margin-top: 6px; }
.pv-zone { fill: var(--surface-2); }
.pv-zone--2 { fill: var(--line); opacity: .7; }
.pv-zone--3 { fill: var(--surface-2); }
.pv-zl { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; fill: var(--muted); }
.pv-route { fill: none; stroke-width: 4; stroke-linecap: round; transition: opacity .25s, stroke-width .25s; }
.pv-route--1 { stroke: var(--accent); }
.pv-route--sea { stroke: var(--accent); stroke-dasharray: 2 8; stroke-width: 4; }
.pv-route--2 { stroke: var(--accent-2); stroke-width: 5; }
.pv-route--3 { stroke: var(--ink); stroke-dasharray: 10 7; stroke-width: 3; }
.pv-pin circle, .pv-pin rect { fill: var(--surface); stroke: var(--ink); stroke-width: 3; }
.pv-pin text { font-size: 15px; font-weight: 700; fill: var(--ink); }
.pv-pin--s text { font-size: 12px; font-weight: 600; fill: var(--ink-2); }
.pv-badge circle { fill: var(--dark); }
.pv-badge text { font-size: 13px; font-weight: 700; fill: #fff; }
.pv-routes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.pv-route-c { position: relative; display: grid; gap: 6px; align-content: start; padding: 14px 14px 14px 48px; border-radius: 16px; background: var(--surface-2); font-size: .8125rem; line-height: 1.4; color: var(--ink-2); cursor: default; transition: opacity .25s, box-shadow .25s; outline: none; }
.pv-route-c:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.post-body .pv-route-t { font-weight: 700; font-size: .875rem; color: var(--ink); }
.pv-rn { position: absolute; left: 14px; top: 13px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--dark); color: #fff; font-weight: 700; font-size: .75rem; }
.pv-rn--1 { box-shadow: 0 0 0 3px var(--accent); }
.pv-rn--2 { box-shadow: 0 0 0 3px var(--accent-2); }
.pv-rn--3 { box-shadow: 0 0 0 3px var(--muted); }

/* linked hover (map, undercarriage) – set by post-viz.js */
.pv-link.has-hot [data-k]:not(.is-hot) { filter: opacity(.3); }
.pv-link.has-hot svg g[data-k]:not(.is-hot) { filter: none; opacity: .22; }
.pv-link.has-hot .pv-route-c.is-hot, .pv-link.has-hot .pv-legend li.is-hot { box-shadow: inset 0 0 0 1.5px var(--accent); }
.pv-link [data-k] { transition: opacity .25s, filter .25s, box-shadow .25s; }

/* ── undercarriage */
.pv-uc { display: block; width: 100%; height: auto; }
.pv-ground { stroke: var(--line); stroke-width: 2; stroke-dasharray: 6 6; }
.pv-frame { fill: var(--surface-2); stroke: var(--line); stroke-width: 2; }
.pv-shoes { fill: none; stroke: var(--ink-2); stroke-width: 13; stroke-dasharray: 15 4; }
.pv-chain { fill: none; stroke: var(--muted); stroke-width: 6; stroke-dasharray: 7 3; }
.pv-part circle { fill: var(--surface); stroke: var(--ink-2); stroke-width: 3; }
.pv-part .pv-teeth { fill: none; stroke: var(--ink-2); stroke-width: 9; stroke-dasharray: 8 7; }
.pv-part .pv-hub { fill: var(--accent); stroke: none; }
.pv-uc .pv-badge circle { fill: var(--dark); stroke: var(--surface); stroke-width: 2; }
.pv-uc .pv-badge text { font-size: 17px; }
.pv-lead-l { stroke: var(--dark); stroke-width: 1.5; fill: none; }
.pv-legend { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px !important; }
.pv-legend li { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px !important; border-radius: 12px; background: var(--surface-2); font-size: .8125rem; font-weight: 600; color: var(--ink); outline: none; min-width: 0; hyphens: auto; overflow-wrap: anywhere; }
.pv-legend .pv-rn { position: static; flex: none; box-shadow: none; }

/* ── stacked 100% bars */
.pv-stack { display: grid; gap: 22px; }
.pv-strack { position: relative; height: 22px; border-radius: 8px; background: var(--surface-2); }
.pv-sseg { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 8px; background: var(--grad); transform-origin: left center; }
.pv-sseg.is-open { background: linear-gradient(90deg, var(--accent) 80%, var(--accent-line)); border-radius: 8px 0 0 8px; }
.pv-sbr { position: absolute; left: var(--a); width: var(--b); top: 28px; height: 8px; border: 2px solid var(--ink); border-top: 0; border-radius: 0 0 4px 4px; opacity: .6; }
.pv-sbr em { position: absolute; top: 12px; right: 0; font-style: normal; font-size: .75rem; color: var(--ink-2); white-space: nowrap; }
.pv-srow:last-child { padding-bottom: 34px; }

/* ── unit squares */
.pv-units { display: grid; gap: 18px; }
.pv-urow { display: grid; gap: 8px; }
.pv-urow .pv-lab { font-size: .875rem; }
.pv-ugrid { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-ugrid span { position: relative; width: 30px; height: 30px; border-radius: 7px; background: var(--grad); overflow: hidden; }
.pv-urow.is-muted .pv-ugrid span { background: var(--muted); opacity: .6; }
.pv-ugrid .is-part { background: var(--surface-2) !important; opacity: 1 !important; }
.pv-ugrid .is-part::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--f); background: var(--muted); opacity: .6; }
.pv-ugrid .is-more { display: grid; place-items: center; background: none !important; color: var(--accent); font-weight: 700; font-size: 1.25rem; }
.post-body .pv-unote { font-size: .8125rem; color: var(--ink-2); padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); }

/* ── tiles */
.pv-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pv-tile { display: grid; gap: 6px; align-content: start; padding: 16px; border-radius: 16px; background: var(--surface-2); }
.pv-tile.is-hot { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.pv-tile.is-muted .pv-big { background: none; color: var(--muted); }
.post-body .pv-tile-h { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pv-tile .pv-bars { margin-top: 10px; gap: 10px; }
.pv-tile .pv-row-h { font-size: .75rem; }
.pv-tile .pv-track { height: 10px; background: var(--surface); }

/* ── two panels */
.pv-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pv-two-c { display: grid; gap: 12px; align-content: start; padding: 16px; border-radius: 16px; background: var(--surface-2); }
.pv-two-c .pv-track { background: var(--surface); }

/* ── before / after */
.pv-ba { display: grid; gap: 10px; }
.pv-ba-r { display: grid; gap: 14px; padding: 16px; border-radius: 16px; background: var(--accent-soft); }
.pv-ba-r.is-muted { background: var(--surface-2); }
.pv-ba-r.is-muted .pv-flow-n { background: var(--surface); color: var(--muted); }
.pv-ba-r.is-muted li:last-child .pv-flow-n { background: var(--muted); color: var(--surface); }
.pv-ba-r.is-muted li:last-child .pv-flow-t { color: var(--ink-2); font-weight: 400; }

/* ── VAT years */
.pv-yr { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.pv-yr-c { display: grid; gap: 8px; align-content: start; padding: 16px; border-radius: 16px; background: var(--surface-2); }
.pv-yr-c.is-hot { background: var(--accent-soft); }
.post-body .pv-yr-h { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.pv-yr-c.is-hot .pv-yr-h { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.post-body .pv-yr-e { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface); font-size: .8125rem; color: var(--ink-2); }
.pv-yr-e b { font-size: .875rem; }
.pv-yr-e.is-muted { opacity: .7; }
.pv-yr-x { display: grid; place-content: center; justify-items: center; gap: 6px; padding: 0 6px; text-align: center; position: relative; }
.pv-yr-x::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: repeating-linear-gradient(180deg, var(--ink) 0 5px, transparent 5px 10px); opacity: .35; }
.pv-yr-x span, .pv-yr-x b { position: relative; background: var(--surface); padding: 4px 6px; border-radius: 8px; }
.pv-yr-x span { font-size: .75rem; color: var(--muted); max-width: 8ch; line-height: 1.25; }
.pv-yr-x b { font-size: 1.25rem; color: var(--accent); }

/* ── numbers highlighted in the text */
.post-body strong.pv-mark { position: relative; z-index: 0; white-space: nowrap; }
.post-body strong.pv-mark::after { content: ""; position: absolute; z-index: -1; left: -3px; right: -3px; bottom: .04em; height: .5em; border-radius: 4px; background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent-line); transform-origin: left center; }

/* ── conclusion quotes */
.post-body .pv-quote { position: relative; margin: 32px 0; padding: 22px 24px 22px 64px; border-radius: 18px; background: var(--accent-soft); }
.post-body .pv-quote::before { content: "«"; position: absolute; left: 20px; top: 8px; font-size: 3.4rem; line-height: 1; font-weight: 800; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; transform-origin: top left; }
.post-body .pv-quote p { font-size: 1.0625rem; font-weight: 500; line-height: 1.55; color: var(--ink); margin: 0; }

/* ───────────────── motion (only when post-viz.js allowed it) */
.pv-on .pv .pv-head, .pv-on .pv [style*="--i"], .pv-on .pv-cap, .pv-on .pv-calc-art {
  opacity: 0; transform: translateY(12px);
  transition: opacity .6s var(--e, ease), transform .6s var(--e, ease), filter .25s;
  transition-delay: calc(var(--i, 0) * 90ms + 120ms), calc(var(--i, 0) * 90ms + 120ms), 0s;
}
.pv-on .pv-cap { transition-delay: 500ms; }
.pv-on .pv.pv-in .pv-head, .pv-on .pv.pv-in [style*="--i"], .pv-on .pv.pv-in .pv-cap, .pv-on .pv.pv-in .pv-calc-art { opacity: 1; transform: none; }
/* nested staggered items inside a staggered item keep their own delay but shouldn't move twice */
.pv-on .pv [style*="--i"] [style*="--i"] { transform: none; }

.pv-on .pv .pv-bar, .pv-on .pv .pv-range, .pv-on .pv .pv-rseg, .pv-on .pv .pv-rband, .pv-on .pv .pv-sseg, .pv-on .pv .pv-mo-seg { transform: scaleX(0); transition: transform 1s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 110ms + 300ms + var(--j, 0) * 120ms); }
.pv-on .pv .pv-range { transition-delay: calc(var(--i, 0) * 110ms + 1000ms); }
.pv-on .pv .pv-dbar { transform: scaleX(0); transition: transform 1s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 110ms + 300ms); }
.pv-on .pv .pv-col-b, .pv-on .pv .pv-step-b { transform: scaleY(0); transition: transform 1s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 120ms + 300ms); }
.pv-on .pv.pv-in .pv-bar, .pv-on .pv.pv-in .pv-range, .pv-on .pv.pv-in .pv-rseg, .pv-on .pv.pv-in .pv-rband, .pv-on .pv.pv-in .pv-sseg, .pv-on .pv.pv-in .pv-mo-seg, .pv-on .pv.pv-in .pv-dbar { transform: none; }
.pv-on .pv.pv-in .pv-col-b, .pv-on .pv.pv-in .pv-step-b { transform: none; }

.pv-on .pv .pv-rdot, .pv-on .pv .pv-rmark, .pv-on .pv .pv-mo-mark, .pv-on .pv .pv-ugrid span, .pv-on .pv .pv-sbr { opacity: 0; transform: scale(.4); transition: opacity .4s, transform .5s cubic-bezier(.3, 1.4, .5, 1); transition-delay: calc(var(--i, 0) * 110ms + 700ms + var(--j, 0) * 70ms); }
.pv-on .pv .pv-rmark { transform: scaleY(0); }
.pv-on .pv .pv-sbr { transform: translateY(-6px); transition-delay: 1200ms; }
.pv-on .pv.pv-in .pv-rdot, .pv-on .pv.pv-in .pv-rmark, .pv-on .pv.pv-in .pv-mo-mark, .pv-on .pv.pv-in .pv-ugrid span, .pv-on .pv.pv-in .pv-sbr { opacity: 1; transform: none; }
.pv-on .pv .pv-ugrid span.is-part, .pv-on .pv .pv-ugrid span.is-more { opacity: 0; }
.pv-on .pv.pv-in .pv-ugrid span.is-part, .pv-on .pv.pv-in .pv-ugrid span.is-more { opacity: 1; }

.pv-on .pv .pv-ring-fg { stroke-dashoffset: var(--p); transition: stroke-dashoffset 1.3s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 150ms + 300ms); }
.pv-on .pv.pv-in .pv-ring-fg { stroke-dashoffset: 0; }

.pv-on .pv .pv-draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s cubic-bezier(.4, 0, .2, 1); transition-delay: calc(var(--i, 0) * 90ms + 350ms); }
.pv-on .pv .pv-checks .pv-draw, .pv-on .pv .pv-tag .pv-draw { transition-duration: .5s; transition-delay: calc(var(--i, 0) * 90ms + 500ms); }
.pv-on .pv.pv-in .pv-draw { stroke-dashoffset: 0; }
.pv-on .pv .pv-map .pv-route--sea, .pv-on .pv .pv-map .pv-route--3, .pv-on .pv .pv-map .pv-pin, .pv-on .pv .pv-map .pv-badge,
.pv-on .pv .pv-uc .pv-part, .pv-on .pv .pv-uc .pv-badge, .pv-on .pv .pv-uc .pv-shoes, .pv-on .pv .pv-uc .pv-chain,
.pv-on .pv .pv-crate .pv-face, .pv-on .pv .pv-crate text, .pv-on .pv .pv-crate .pv-slat { opacity: 0; transition: opacity .7s ease; }
.pv-on .pv .pv-map .pv-route--sea { transition-delay: 200ms; }
.pv-on .pv .pv-map .pv-route--3 { transition-delay: 900ms; }
.pv-on .pv .pv-map .pv-pin, .pv-on .pv .pv-uc .pv-part { transition-delay: 150ms; }
.pv-on .pv .pv-map .pv-badge, .pv-on .pv .pv-uc .pv-badge { transition-delay: 1100ms; }
.pv-on .pv .pv-uc .pv-chain { transition-delay: 450ms; }
.pv-on .pv .pv-uc .pv-shoes { transition-delay: 700ms; }
.pv-on .pv .pv-crate .pv-face { transition-delay: 700ms; }
.pv-on .pv .pv-crate text, .pv-on .pv .pv-crate .pv-slat { transition-delay: 1100ms; }
.pv-on .pv.pv-in .pv-map .pv-route--sea, .pv-on .pv.pv-in .pv-map .pv-route--3, .pv-on .pv.pv-in .pv-map .pv-pin, .pv-on .pv.pv-in .pv-map .pv-badge,
.pv-on .pv.pv-in .pv-uc .pv-part, .pv-on .pv.pv-in .pv-uc .pv-badge, .pv-on .pv.pv-in .pv-uc .pv-shoes, .pv-on .pv.pv-in .pv-uc .pv-chain,
.pv-on .pv.pv-in .pv-crate .pv-face, .pv-on .pv.pv-in .pv-crate text, .pv-on .pv.pv-in .pv-crate .pv-slat { opacity: 1; }
.pv-on .pv .pv-crate .pv-slat { opacity: 0; }
.pv-on .pv.pv-in .pv-crate .pv-slat { opacity: .45; }

.pv-on .pv .pv-down { transform: scaleY(0); transition: transform .5s ease; transition-delay: calc(var(--i, 0) * 90ms + 500ms); }
.pv-on .pv.pv-in .pv-down { transform: none; }
.pv-on .pv .pv-tl::before { transform: scaleY(0); transition: transform 1.4s cubic-bezier(.2, .8, .2, 1) .2s; }
.pv-on .pv.pv-in .pv-tl::before { transform: none; }

.pv-on strong.pv-mark::after { transform: scaleX(0); transition: transform .9s cubic-bezier(.2, .8, .2, 1) .25s; }
.pv-on strong.pv-mark.pv-in::after { transform: none; }
.pv-on .pv-quote::before { transform: scale(.4); opacity: 0; transition: transform .6s cubic-bezier(.2, .8, .2, 1) .1s, opacity .4s ease .1s; }
.pv-on .pv-quote p { opacity: 0; transform: translateY(8px); transition: opacity .7s ease .25s, transform .7s cubic-bezier(.2, .8, .2, 1) .25s; }
.pv-on .pv-quote.pv-in::before { transform: none; opacity: 1; }
.pv-on .pv-quote.pv-in p { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .pv *, .pv *::before, .pv *::after, .pv-quote, .pv-quote *, .pv-quote::before, strong.pv-mark::after { transition: none !important; animation: none !important; }
}

/* ───────────────── narrow screens */
@media (max-width: 760px) {
  .pv-cmp, .pv-tiles, .pv-routes, .pv-two { grid-template-columns: minmax(0, 1fr); }
  .pv-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pv-map { min-width: 500px; }
  .post-body .pv-hint { display: block; }
}
@media (max-width: 560px) {
  .pv-card { padding: 16px; border-radius: 18px; }
  .pv-stats .pv-big { font-size: 1.35rem; }
  .pv-split { grid-template-columns: minmax(0, 1fr); }
  .pv-flow { grid-auto-flow: row; gap: 14px; }
  .pv-flow li { grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 12px; }
  .pv-flow li + li::before { left: 13px; top: -12px; width: 2px; height: 10px; }
  .pv-flow li + li::after { content: none; }
  .pv-drow { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .pv-drow .pv-val { min-width: 0; }
  .pv-drow .pv-dtrack { grid-column: 1 / -1; grid-row: 2; }
  .pv-rings { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .pv-ring { grid-template-columns: 96px minmax(0, 1fr); text-align: left; align-items: center; justify-items: start; gap: 14px; }
  .pv-share { grid-template-columns: minmax(0, 1fr); justify-items: stretch; gap: 18px; }
  .pv-share .pv-ring { grid-template-columns: 110px minmax(0, 1fr); }
  .pv-calc { grid-template-columns: minmax(0, 1fr); }
  .pv-calc-art { max-width: 220px; margin: 0 auto; width: 100%; }
  .pv-yr { grid-template-columns: minmax(0, 1fr); }
  .pv-yr-x { grid-auto-flow: column; padding: 6px 0; }
  .pv-yr-x::before { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 2px; margin: -1px 0 0; background: repeating-linear-gradient(90deg, var(--ink) 0 5px, transparent 5px 10px); }
  .pv-yr-x span { max-width: none; }
  .pv-mx-r { grid-template-columns: minmax(0, 1fr); }
  .pv-mx-p { justify-content: flex-start; }
  .pv-mo-h span { font-size: .6875rem; }
  .pv-ugrid span { width: 24px; height: 24px; border-radius: 6px; }
  .pv-col-b { border-radius: 10px 10px 4px 4px; }
  .post-body .pv-quote { padding: 18px 18px 18px 54px; }
  .post-body .pv-quote::before { left: 14px; font-size: 2.8rem; }
  .pv-sbr em { white-space: normal; width: 22ch; text-align: right; }
  .pv-srow:last-child { padding-bottom: 48px; }
}
