/* Halden report explainer (tools/halden_explainer.py, preview revamp 4 Nov 2026).
   Benefit hero, an empty shell of the report, parts lit one step at a time, then the live report.
   Without JavaScript every part is lit and every step shows: the dimmed start and the sticky stage exist only under
   .hx-on, which assets/halden-explainer.js adds. Motion runs only under prefers-reduced-motion: no-preference.
   Every drawn element paints in currentColor, so lighting a part is one colour change. */

/* ---------------------------------------------------------------- hero */
.hx-hero { display: flex; flex-direction: column; gap: 16px; padding-top: 40px; padding-bottom: 24px; }
.hx-hero > * { max-width: 46rem; margin: 0; }
.hx-hero .crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 14px; color: var(--ink-2); margin: 0; }
.hx-hero .crumbs a { color: var(--ink-2); min-height: var(--tap); display: inline-flex; align-items: center; }
.hx-hero .lead { margin: 0; }
.hx-hero .caption a { white-space: nowrap; }

/* ---------------------------------------------------------------- build: steps left, shell right */
.hx { padding-bottom: 32px; }
.hx-build { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 56px; align-items: start; }
.hx-label { grid-column: 1 / -1; margin: 8px 0 20px; }
.hx-stage { grid-column: 2; grid-row: 2; }
.hx-steps { grid-column: 1; grid-row: 2; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 28px; }
.hx-step { border-left: 3px solid var(--border); padding: 4px 0 4px 20px; }
.hx-step .h3 { margin: 6px 0 6px; }
.hx-step p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--ink-2); max-width: 30em; }
.hx-n { font-family: var(--font-data); font-weight: 700; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-deep); }
.hx-step-0 .hx-n { color: var(--ink-2); }

/* With JavaScript: the shell stays in view while the steps scroll past it. */
.hx-on .hx-stage { position: sticky; top: 24px; }
.hx-on .hx-steps { gap: 0; padding: 4vh 0 18vh; }
.hx-on .hx-step { min-height: 46vh; display: flex; flex-direction: column; justify-content: center; border-left-color: var(--border); }
.hx-on .hx-step > * { opacity: .45; }
.hx-on .hx-step.is-cur { border-left-color: var(--accent-deep); }
.hx-on .hx-step.is-cur > *, .hx-on .hx-step.is-past > * { opacity: 1; }
.hx-on .hx-step.is-past:not(.is-cur) > * { opacity: .7; }

/* ---------------------------------------------------------------- the shell */
.hx-shell { --s: 1; position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: 0 18px 40px -28px rgba(31, 70, 81, .45); color: var(--ink-3); }
.hx-shead { display: flex; align-items: center; gap: 8px; font-family: var(--font-data); font-weight: 700; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); padding: 0 2px 4px; }
.hx-shead .hx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-deep); }
.hx-r { display: flex; gap: 10px; height: max(calc(var(--h) * var(--s)), 28px); }
.hx-b { position: relative; flex: var(--f) 1 0; min-width: 0; display: flex; flex-direction: column; padding: 10px; border-radius: 10px;
  border: 1.5px solid currentColor; background: color-mix(in srgb, currentColor 8%, var(--surface)); color: var(--accent-deep); overflow: hidden; }
.hx-b > span:not(.hx-badge), .hx-b > svg { flex: 1 1 auto; min-height: 0; width: 100%; }
.hx-b > svg { display: block; height: 100%; }
.hx-k-tabs, .hx-k-chips { padding: 4px 8px; justify-content: center; }
.hx-badge { position: absolute; top: 6px; right: 6px; z-index: 1; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font: 700 11px/1 var(--font-text); background: var(--ink); color: var(--surface); }
.hx-k-tabs .hx-badge, .hx-k-chips .hx-badge { top: 50%; transform: translateY(-50%); }
.hx-frame { border: 2px solid var(--accent-deep); }
.hx-badge-z { top: 10px; right: 10px; }

/* Dimmed until its step: the same rule for whole blocks and for the parts drawn inside them. */
.hx-on [data-hx-part]:not(.is-lit) { color: var(--muted); }
.hx-on .hx-b[data-hx-part]:not(.is-lit) { border-style: dashed; background: transparent; }
.hx-on .hx-b[data-hx-part]:not(.is-lit) .hx-badge, .hx-on .hx-shell[data-hx-part]:not(.is-lit) > .hx-badge { background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--muted); }
.hx-on .hx-shell[data-hx-part]:not(.is-lit) { border: 2px dashed var(--muted); color: var(--ink-3); }
.hx-on .hx-b[data-hx-part]:not(.is-lit) .hx-fbox b, .hx-on .hx-b[data-hx-part]:not(.is-lit) .hx-pair b { color: var(--ink-3); }

/* ---------------------------------------------------------------- block art */
.hx-b i { display: block; }
.hx-ln { height: 6px; border-radius: 3px; background: currentColor; opacity: .35; width: var(--w); }
.hx-ln-s { height: 5px; opacity: .22; }
.hx-num { height: 14px; width: 46%; border-radius: 3px; background: currentColor; opacity: .75; }
.hx-num-l { height: 24px; width: 58%; }
.hx-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.hx-tile { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 8px; border-radius: 8px; background: color-mix(in srgb, currentColor 12%, transparent); }
.hx-tabs { display: flex; gap: 6px; align-items: center; }
.hx-tabs i { width: 64px; height: 14px; border-radius: 999px; border: 1.5px solid currentColor; opacity: .6; }
.hx-tabs i:first-child { background: currentColor; }
.hx-chips { display: flex; gap: 6px; align-items: center; overflow: hidden; }
.hx-chips i { flex: none; width: var(--w); height: 16px; border-radius: 999px; border: 1.5px solid currentColor; opacity: .6; }
.hx-chipsv { display: flex; flex-direction: column; justify-content: space-around; }
.hx-chipsv i { width: var(--w); height: 14px; border-radius: 999px; background: color-mix(in srgb, currentColor 22%, transparent); }
.hx-bars, .hx-rows, .hx-cal, .hx-plan, .hx-sliders, .hx-dumb, .hx-panel { display: flex; flex-direction: column; justify-content: space-around; }
.hx-bar { height: 10px; border-radius: 5px; background: currentColor; opacity: .55; width: var(--w); }
.hx-row { display: flex; align-items: center; gap: 8px; }
.hx-row .hx-ln { flex: 0 1 auto; min-width: 0; width: calc(var(--w) * .62); }
.hx-id, .hx-date { flex: none; width: 26px; height: 9px; border-radius: 2px; background: currentColor; opacity: .7; }
.hx-date { height: 14px; }
.hx-pill { flex: none; margin-left: auto; width: 32px; height: 12px; border-radius: 999px; background: color-mix(in srgb, currentColor 30%, transparent); }
.hx-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 6px; }
.hx-card { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 8px; border-radius: 6px; background: color-mix(in srgb, currentColor 12%, transparent); }
.hx-panel { border-left: 3px solid currentColor; padding-left: 10px; }
.hx-panel .hx-ph { height: 12px; width: 60%; border-radius: 3px; background: currentColor; opacity: .75; }
.hx-summary, .hx-focus { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.hx-focus { border-left: 4px solid currentColor; padding-left: 12px; }
.hx-flag { width: 96px; height: 14px; border-radius: 999px; background: currentColor; opacity: .7; }
.hx-pair { display: flex; flex-direction: column; gap: 8px; }
.hx-pair b, .hx-fbox b { font-family: var(--font-text); font-size: 13px; line-height: 1.25; font-weight: 700; color: var(--ink); padding-right: 22px; }
.hx-pp { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hx-pp i { border-radius: 6px; background: color-mix(in srgb, currentColor 16%, transparent); }
.hx-fbox { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.hx-fbox span { font-size: 13px; line-height: 1.3; color: currentColor; }
.hx-prow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.hx-pg { position: relative; height: 10px; width: var(--w); border-radius: 5px; background: color-mix(in srgb, currentColor 55%, transparent); overflow: hidden; }
.hx-pr { position: absolute; top: 0; right: 0; bottom: 0; width: var(--w); color: var(--green); background: currentColor; }
.hx-pc { height: 10px; width: var(--w); border-radius: 5px; color: var(--fail); background: currentColor; }
.hx-cols { display: flex; align-items: flex-end; gap: 6px; height: 100%; }
.hx-cols i { flex: 1; height: var(--h); position: relative; bottom: var(--b, 0); border-radius: 3px 3px 0 0; background: currentColor; opacity: .5; }
.hx-wf i:nth-child(2), .hx-wf i:nth-child(4) { opacity: .85; }
.hx-k-split { justify-content: center; gap: 18px; }
.hx-b > .hx-split { flex: none; }
.hx-split { display: flex; gap: 2px; height: 18px; border-radius: 4px; overflow: hidden; }
.hx-split i { width: var(--w); background: currentColor; opacity: .7; }
.hx-split i + i { opacity: .3; }
.hx-split i + i + i { opacity: .15; }
.hx-tree-map { display: grid; grid-template-columns: 3fr 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; }
.hx-tree-map i { border-radius: 4px; background: currentColor; opacity: .5; }
.hx-tree-map .t1 { grid-row: span 2; opacity: .75; }
.hx-tree-map .t2 { opacity: .4; } .hx-tree-map .t3 { opacity: .3; } .hx-tree-map .t4 { grid-column: span 2; opacity: .22; }
.hx-heat, .hx-matrix { display: grid; gap: 3px; }
.hx-heat { grid-template-columns: repeat(5, 1fr); }
.hx-heat i { border-radius: 2px; background: currentColor; opacity: .15; }
.hx-heat i:nth-child(n+6) { opacity: .25; } .hx-heat i:nth-child(n+11) { opacity: .35; } .hx-heat i:nth-child(n+16) { opacity: .5; } .hx-heat i:nth-child(n+21) { opacity: .7; }
.hx-heat i:nth-child(5n+1) { opacity: .12; }
.hx-matrix { grid-template-columns: repeat(6, 1fr); }
.hx-matrix i { border-radius: 3px; background: color-mix(in srgb, currentColor 18%, transparent); }
.hx-matrix i.hx-x { color: var(--fail); background: currentColor; }
.hx-cal .hx-row .hx-ln { width: calc(var(--w) * .7); }
.hx-lane { position: relative; }
.hx-lane::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: currentColor; opacity: .35; }
.hx-lane i { position: absolute; left: var(--x); top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: currentColor; }
.hx-lane i.hx-late { background: var(--surface); box-shadow: inset 0 0 0 3px var(--amber); }
.hx-flow { display: flex; align-items: center; gap: 6px; }
.hx-flow i { flex: 1; height: 24px; border-radius: 6px; background: color-mix(in srgb, currentColor 18%, transparent); }
.hx-flow b { flex: none; width: 18px; height: 2px; background: currentColor; }
.hx-sl { display: flex; flex-direction: column; gap: 6px; }
.hx-track { position: relative; display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, currentColor 30%, transparent); }
.hx-track i { position: absolute; left: var(--x); top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px var(--surface); }
.hx-towers { display: flex; gap: 8px; align-items: flex-end; }
.hx-tw { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; }
.hx-tw i { height: 14px; border-radius: 2px; background: currentColor; opacity: .3; }
.hx-tw i.hx-ret { opacity: .85; }
.hx-tw-l { height: 100%; }
.hx-tw-l i { flex: 1; height: auto; }
.hx-calc { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.hx-calc .hx-in { width: 36%; height: 20px; border-radius: 6px; border: 1.5px solid currentColor; }
.hx-db { position: relative; display: block; height: 14px; }
.hx-db::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: currentColor; opacity: .15; }
.hx-db i { position: absolute; left: var(--a); width: calc(var(--b) - var(--a)); top: 6px; height: 2px; background: currentColor; }
.hx-db i::before, .hx-db i::after { content: ""; position: absolute; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.hx-db i::before { left: -6px; } .hx-db i::after { right: -6px; opacity: .5; }
.hx-k-tube svg path { stroke: currentColor; }
.hx-stops { color: var(--ink); fill: var(--surface); stroke: currentColor; stroke-width: 2.5; }
.hx-fail { color: var(--fail); fill: currentColor; }

/* ---------------------------------------------------------------- the live report */
.hx-live { padding-top: 40px; padding-bottom: 8px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.hx-live > * { margin: 0; max-width: 46rem; }
.hx-live-tag, .band-milk .hx-live-tag { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-family: var(--font-data); font-weight: 700;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green-strong); background: var(--surface);
  border: 1px solid var(--green); border-radius: 999px; padding: 5px 12px 5px 10px; margin: 0; }
.hx-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.hx-live-note { font-size: 16px; line-height: 1.55; color: var(--ink-2); padding: 12px 16px; border-radius: var(--radius-tile); background: var(--surface); border: 1px solid var(--border); }
.hx-live-note b { color: var(--ink); }
.rd-cover .hx-live-note { max-width: 34em; }

/* ---------------------------------------------------------------- phones: shell on top, steps under it */
@media (max-width: 899px) {
  .hx-build { grid-template-columns: minmax(0, 1fr); }
  .hx-label { margin-bottom: 12px; }
  .hx-stage, .hx-steps { grid-column: 1; }
  .hx-stage { grid-row: 2; margin-bottom: 20px; }
  .hx-steps { grid-row: 3; }
  .hx-shell { --s: .6; padding: 12px; gap: 8px; }
  .hx-r { gap: 8px; }
  .hx-b { padding: 8px; }
  .hx-k-tabs, .hx-k-chips { padding: 3px 6px; }
  .hx-pair b, .hx-fbox b { font-size: 12px; }
  .hx-fbox span { font-size: 12px; }
  .hx-tile { padding: 6px; gap: 6px; }
  .hx-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-cards .hx-card:nth-child(n+5) { display: none; }
  .hx-k-pair .hx-pp { display: none; }
  .hx-chips i, .hx-tabs i { height: 12px; }
  .hx-rows .hx-row:nth-child(n+5) { display: none; }
  .hx-k-pair { justify-content: center; }
  .hx-on .hx-stage { top: 0; z-index: 3; background: var(--ground); margin: 0 calc(-1 * var(--gutter)) 0; padding: 8px var(--gutter) 12px; }
  .hx-on .hx-steps { padding: 0 0 30vh; }
  .hx-on .hx-step { min-height: 34vh; justify-content: flex-start; padding-top: 12px; }
  .hx-step p { font-size: 16px; }
}
@media (max-width: 899px) and (max-height: 700px) {
  .hx-shell { --s: .5; }
}

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: no-preference) {
  .hx-b, .hx-shell, [data-hx-part] { transition: color .45s ease, background-color .45s ease, border-color .45s ease; }
  .hx-step > * { transition: opacity .35s ease; }
  .hx-b.is-new { animation: hx-pop .6s ease-out; }
  .hx-pulse { animation: hx-pulse 2.4s ease-in-out infinite; }
}
@keyframes hx-pop { 0% { transform: scale(.96); box-shadow: 0 0 0 0 rgba(23, 121, 122, .35); } 60% { box-shadow: 0 0 0 8px rgba(23, 121, 122, 0); } 100% { transform: none; } }
@keyframes hx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------------------------------------------------------------- framework: held links (HD-01, D-8)
   Approach pages with no public preview on www render as text (tools/halden_explainer.py HELD_FRAMEWORK). The staging
   framework CSS gives .fh-box a pointer cursor; text must not look clickable. */
.fh-box.is-soon, .fh-frame-l.is-soon { cursor: default; }
.fh-box.is-soon:hover { background: var(--surface-2); }
.fh-more .fh-more-t.is-soon { opacity: 1; color: var(--ink-2); font-weight: 600; text-decoration: none; }

/* ---------------------------------------------------------------- held reports (D-2: reports not public on www)
   build.py renders a link to an unbuilt report as span.is-soon with a "Soon" tag. On the hub that meant a "See the
   report" line and a Soon tag on every card, a Soon tag on every role link and a dead "Open the board pack" button.
   These rules match only those spans, so where the reports are built (the preview) nothing changes. */
.hr-card.is-soon { cursor: default; }
.hr-card.is-soon .more { display: none; }
.rd-hub-links .link.is-soon { color: var(--ink-2); font-weight: 500; text-decoration: none; opacity: 1; }
.rd-hub-links .is-soon .soon { display: none; }
.rd-hub-board .btn.is-soon { display: none; }
