/* Research figure kit for the malware papers: figures, code listings, charts and terminal replays (2026-12-01).
   The hg- prefix comes from the first paper that used it (Hagaseca); every malware page now loads this file.
   Built on the brand tokens and intel.css's one data colour (--tl-mark); red (--tl-hot) marks the flaw only.
   Everything is readable without scripts: hagaseca.js adds .hg-js to <html> and .is-in to a figure when it
   scrolls into view, and the reveal animations only apply under those two classes. */

.hg-fig { margin: var(--ar-s-7) 0; }
.prose .hg-fig { max-width: none; }
.hg-fig > figcaption, .prose .hg-cap, .hg-cap { margin-top: var(--ar-s-3); font-size: var(--ar-fs-sm); line-height: 1.5; color: var(--ar-text-muted); max-width: 70ch; }
.prose .hg-legend, .hg-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ar-s-2) var(--ar-s-4); margin: 0 0 var(--ar-s-3); font: 500 var(--ar-fs-xs)/1.4 var(--ar-font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ar-text-muted); }
.hg-legend b { color: var(--tl-mark); font-weight: 600; }
.hg-wide { width: auto; }   /* figures share the text column (--ar-measure in site.css) */
.hg-plate { background: var(--ar-surface); border: 1px solid var(--ar-line); border-radius: var(--ar-r-lg); padding: var(--ar-s-5); }

/* Lamps: lit = we saw it happen; unlit = read in the program's code */
.hg-lamp { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ar-text-faint); vertical-align: 1px; }
.hg-lamp.is-on { border-color: var(--tl-mark); background: var(--tl-mark); box-shadow: 0 0 8px var(--tl-glow); }
.hg-lamp.is-hot { border-color: var(--tl-hot); background: var(--tl-hot); }

/* ---------- specimen tag ---------- */
.hg-spec, .hg-kill { box-sizing: border-box; max-width: var(--ar-measure, 70ch); }
.hg-spec { margin: var(--ar-s-6) 0 var(--ar-s-5); background: var(--ar-readout-bg); color: #f0eee7; border-radius: var(--ar-r-lg); padding: var(--ar-s-5); display: grid; gap: var(--ar-s-4);
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .75); position: relative; overflow: hidden; }
.hg-spec::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--ar-acid); }
.hg-spec-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--ar-s-2); font: 500 var(--ar-fs-xs)/1.4 var(--ar-font-mono); letter-spacing: .08em; text-transform: uppercase; color: #a9aaa1; }
.hg-spec-head b { color: var(--ar-acid); font-weight: 600; }
.hg-spec dl { margin: 0; display: grid; gap: 1px; grid-template-columns: 1fr; background: rgba(240, 238, 231, .10); border-radius: var(--ar-r-md); overflow: hidden; }
@media (min-width: 560px) { .hg-spec dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .hg-spec dl { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hg-spec dl > div { background: var(--ar-readout-bg); padding: var(--ar-s-3) var(--ar-s-4); display: grid; gap: 4px; align-content: start; }
.hg-spec dt { font: 500 10px/1.4 var(--ar-font-mono); letter-spacing: .08em; text-transform: uppercase; color: #85867d; }
.hg-spec dd { margin: 0; font: 600 var(--ar-fs-sm)/1.4 var(--ar-font-mono); overflow-wrap: anywhere; }
.hg-spec dd.is-new { color: var(--ar-acid); }

/* ---------- the life of one infection (hero) ---------- */
.hg-kill { position: relative; }
.hg-kill ol { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ar-s-3); counter-reset: st; position: relative; }
@media (min-width: 560px) { .hg-kill ol { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .hg-kill ol { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--ar-s-2); } }
.hg-kill li { counter-increment: st; position: relative; padding: var(--ar-s-4); padding-top: var(--ar-s-6); background: var(--ar-surface); border: 1px solid var(--ar-line); border-radius: var(--ar-r-md); display: grid; gap: var(--ar-s-2); align-content: start; }
.hg-kill li::before { content: "0" counter(st); position: absolute; top: var(--ar-s-3); left: var(--ar-s-4); font: 600 var(--ar-fs-xs)/1 var(--ar-font-mono); letter-spacing: .08em; color: var(--ar-text-faint); }
.hg-kill li .hg-lamp { position: absolute; top: var(--ar-s-3); right: var(--ar-s-4); }
.hg-kill li b { font: 700 var(--ar-fs-md)/1.2 var(--ar-font-display); }
.hg-kill li span { font-size: var(--ar-fs-sm); line-height: 1.45; color: var(--ar-text-muted); }
.hg-kill li code { font-size: .86em; overflow-wrap: anywhere; }
.hg-kill li.is-new { border-color: var(--tl-hot); }
.hg-kill li.is-new b { color: var(--tl-hot); }
.hg-track { height: 4px; margin: 0 0 var(--ar-s-4); border-radius: 2px; background: var(--tl-mark-soft); position: relative; overflow: hidden; }
.hg-track::after { content: ""; position: absolute; inset: 0 0 0 -44px; background: repeating-linear-gradient(90deg, var(--tl-mark) 0 18px, transparent 18px 44px); animation: hg-run 2.4s linear infinite; }
.prose .hg-loop, .hg-loop { margin-top: var(--ar-s-3); display: flex; align-items: center; gap: var(--ar-s-2); font: 500 var(--ar-fs-xs)/1.4 var(--ar-font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ar-text-muted); }
.hg-loop svg { width: 28px; height: 16px; flex: none; color: var(--tl-mark); }

/* ---------- two devices, side by side in time ---------- */
.hg-lanes { display: grid; gap: var(--ar-s-5); }
.hg-lane { display: grid; gap: var(--ar-s-2); }
.hg-lane-h { display: flex; flex-wrap: wrap; gap: var(--ar-s-2) var(--ar-s-4); align-items: baseline; font: 600 var(--ar-fs-sm)/1.3 var(--ar-font-display); }
.hg-lane-h small { font: 500 var(--ar-fs-xs)/1.3 var(--ar-font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ar-text-muted); }
.hg-lane-bar { display: flex; align-items: center; min-height: 34px; }
.hg-seg { height: 4px; background: var(--tl-mark-soft); position: relative; transform-origin: left; }
.hg-seg span { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); white-space: nowrap; font: 500 11px/1 var(--ar-font-mono); color: var(--ar-text-muted); }
.hg-pin { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--tl-mark); background: var(--ar-surface); position: relative; z-index: 1; }
.hg-pin.is-hot { border-color: var(--tl-hot); box-shadow: 0 0 10px var(--tl-glow); }
.hg-lane-k { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: var(--ar-s-2); margin: 0; padding: 0; list-style: none; font-size: var(--ar-fs-sm); color: var(--ar-text-muted); }
.hg-lane-k li { line-height: 1.4; }
.hg-lane-k b { display: block; font: 600 var(--ar-fs-sm)/1.3 var(--ar-font-mono); color: var(--ar-text); }
.hg-s-a1 { flex: 925; } .hg-s-a2 { flex: 646; } .hg-s-b1 { flex: 272; } .hg-s-b2 { flex: 1112; } .hg-s-b3 { flex: 2; } .hg-s-pad { flex: 185; visibility: hidden; }

/* ---------- code listings ---------- */
.hg-code { margin: var(--ar-s-6) 0; border-radius: var(--ar-r-lg); overflow: hidden; background: var(--ar-readout-bg); color: #e6e4dc; box-shadow: 0 24px 50px -34px rgba(0, 0, 0, .7); }
.hg-code-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--ar-s-2); padding: var(--ar-s-3) var(--ar-s-4); border-bottom: 1px solid rgba(240, 238, 231, .10); font: 500 var(--ar-fs-xs)/1.4 var(--ar-font-mono); letter-spacing: .06em; text-transform: uppercase; color: #a9aaa1; }
.hg-code-h b { color: var(--ar-acid); font-weight: 600; }
.prose .hg-code pre { margin: 0; border: 0; border-radius: 0; background: transparent; color: inherit; padding: var(--ar-s-4) var(--ar-s-4) var(--ar-s-5); font: 500 13px/1.7 var(--ar-font-mono); counter-reset: ln; }
.prose .hg-code pre code { display: inline-block; min-width: 100%; }
.hg-code .l { display: block; padding-left: 3.2em; position: relative; }
.hg-code .l::before { counter-increment: ln; content: counter(ln); position: absolute; left: 0; width: 2.2em; text-align: right; color: #5c5d56; }
.hg-code .l.is-mark { background: rgba(255, 83, 64, .10); box-shadow: inset 3px 0 0 #ff7a68; }
.hg-code .l.is-lit { background: rgba(200, 242, 36, .07); box-shadow: inset 3px 0 0 var(--ar-acid); }
.hg-code .c { color: #7f8178; font-style: italic; }
.hg-code .k { color: #ffb224; }
.hg-code .s { color: var(--ar-acid); }
.hg-code .n { color: #8fd3ff; }
.hg-code .f { color: #f0eee7; font-weight: 600; }
.hg-code .r { color: #ff7a68; font-weight: 600; }
.hg-code-f { padding: var(--ar-s-3) var(--ar-s-4); border-top: 1px solid rgba(240, 238, 231, .10); font-size: var(--ar-fs-sm); line-height: 1.5; color: #a9aaa1; }
.hg-code-f ol { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }

/* ---------- terminal replays ---------- */
.hg-term { margin: var(--ar-s-6) 0; border-radius: var(--ar-r-lg); overflow: hidden; background: var(--ar-readout-bg); color: #d8d6ce; box-shadow: 0 24px 50px -34px rgba(0, 0, 0, .7); }
.hg-term-h { display: flex; align-items: center; gap: var(--ar-s-3); padding: var(--ar-s-3) var(--ar-s-4); border-bottom: 1px solid rgba(240, 238, 231, .10); font: 500 var(--ar-fs-xs)/1.4 var(--ar-font-mono); letter-spacing: .06em; text-transform: uppercase; color: #a9aaa1; }
.hg-term-h .hg-lamp.is-on { animation: hg-blink 1.6s steps(2) infinite; }
.prose .hg-term-b, .hg-term-b { margin: 0; padding: var(--ar-s-4); border: 0; border-radius: 0; background: transparent; color: inherit; font: 500 12.5px/1.75 var(--ar-font-mono); overflow-x: auto; }
.hg-term-b > span { display: block; white-space: pre; }
.hg-term-b .t { color: #6f7069; }
.hg-term-b .o { color: var(--ar-acid); }
.hg-term-b .w { color: #ffb224; }
.hg-term-b .r { color: #ff7a68; font-weight: 600; }
.hg-term-b .m { color: #85867d; font-style: italic; }
.hg-term-b .y { color: #f0eee7; font-weight: 600; }

/* ---------- sizes ---------- */
.hg-size { display: grid; gap: var(--ar-s-4); }
.hg-size-row { display: grid; gap: var(--ar-s-2); }
.hg-size-l { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--ar-s-2); font-size: var(--ar-fs-sm); }
.hg-size-l b { font: 700 var(--ar-fs-md)/1.2 var(--ar-font-display); }
.hg-size-l span { font: 500 var(--ar-fs-sm)/1.3 var(--ar-font-mono); color: var(--ar-text-muted); }
.hg-size-bar { height: 22px; border-radius: var(--ar-r-sm); background: var(--ar-sunken); overflow: hidden; }
.hg-size-bar i { display: block; height: 100%; border-radius: var(--ar-r-sm); background: var(--tl-mark-soft); border-right: 3px solid var(--tl-mark); transform-origin: left; }
.hg-size-bar.is-ours i { background: var(--tl-mark); border-right-color: var(--tl-mark); }
.hg-w34 { width: 33.9%; } .hg-w100 { width: 100%; }

/* ---------- peeling the layers ---------- */
.hg-peel { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ar-s-2); }
.hg-peel li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--ar-s-2) var(--ar-s-4); align-items: center; padding: var(--ar-s-3) var(--ar-s-4); background: var(--ar-surface); border: 1px solid var(--ar-line); border-radius: var(--ar-r-md); }
@media (min-width: 720px) { .hg-peel li:nth-child(2) { margin-left: 4%; } .hg-peel li:nth-child(3) { margin-left: 8%; } .hg-peel li:nth-child(4) { margin-left: 12%; } .hg-peel li:nth-child(5) { margin-left: 16%; } }
.hg-peel b { display: block; font: 700 var(--ar-fs-sm)/1.3 var(--ar-font-display); }
.hg-peel span { font-size: var(--ar-fs-sm); line-height: 1.45; color: var(--ar-text-muted); }
.hg-peel em { font: 600 var(--ar-fs-xs)/1 var(--ar-font-mono); font-style: normal; letter-spacing: .06em; text-transform: uppercase; color: var(--tl-mark); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.hg-peel li.is-core { border-color: var(--tl-mark); box-shadow: 0 0 0 3px var(--tl-mark-soft); }

/* ---------- message sequences ---------- */
.hg-seq { position: relative; padding: var(--ar-s-4) 0 var(--ar-s-2); --hg-l: 11%; --hg-r: 89%; }
.hg-seq::before { content: ""; position: absolute; top: 3.2rem; bottom: 0; left: var(--hg-l); border-left: 2px dashed var(--ar-line-strong); }
.hg-seq::after { content: ""; position: absolute; top: 3.2rem; bottom: 0; left: var(--hg-r); border-left: 2px dashed var(--ar-line-strong); }
.hg-actors { display: flex; justify-content: space-between; margin-bottom: var(--ar-s-4); }
.hg-actor { width: 22%; min-width: 7.5rem; padding: var(--ar-s-2) var(--ar-s-3); text-align: center; font: 600 var(--ar-fs-xs)/1.3 var(--ar-font-mono); letter-spacing: .04em; background: var(--ar-readout-bg); color: #f0eee7; border-radius: var(--ar-r-sm); position: relative; z-index: 1; }
.hg-actor small { display: block; font-weight: 400; color: #a9aaa1; letter-spacing: 0; text-transform: none; }
.hg-m { position: relative; margin: 0 calc(100% - var(--hg-r)) 0 var(--hg-l); padding: var(--ar-s-2) var(--ar-s-4) var(--ar-s-4); text-align: center; z-index: 1; }
.hg-m p { margin: 0; font-size: var(--ar-fs-sm); line-height: 1.4; }
.hg-m code { font-size: .88em; }
.hg-m small { display: block; margin-top: 2px; font-size: var(--ar-fs-xs); line-height: 1.4; color: var(--ar-text-muted); }
.hg-m::before { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 2px; background: var(--tl-mark); transform-origin: left; }
.hg-m::after { content: ""; position: absolute; bottom: 3px; right: -2px; border: 6px solid transparent; border-left: 9px solid var(--tl-mark); border-right: 0; }
.hg-m.to-l::before { transform-origin: right; }
.hg-m.to-l::after { right: auto; left: -2px; border-left: 0; border-right: 9px solid var(--tl-mark); }
.hg-m.is-tls::before { height: 6px; bottom: 6px; background: repeating-linear-gradient(90deg, var(--tl-mark) 0 8px, transparent 8px 12px); }
.hg-m.is-bad::before { background: var(--tl-hot); } .hg-m.is-bad::after { border-left-color: var(--tl-hot); }
.hg-m.to-l.is-bad::after { border-right-color: var(--tl-hot); border-left-color: transparent; }
.hg-note { position: relative; z-index: 1; margin: var(--ar-s-2) 3% var(--ar-s-4); padding: var(--ar-s-3) var(--ar-s-4); border-radius: var(--ar-r-md); background: var(--ar-surface); border: 1px solid var(--ar-line); font-size: var(--ar-fs-sm); line-height: 1.5; }
.hg-note.is-r { margin-left: 46%; } .hg-note.is-l { margin-right: 46%; }
.hg-note.is-flaw { border: 2px solid var(--tl-hot); background: color-mix(in srgb, var(--ar-surface) 88%, #ff5340); }
.hg-note b { font-family: var(--ar-font-display); }
@media (max-width: 640px) { .hg-seq { --hg-l: 6%; --hg-r: 94%; } .hg-actor { width: 40%; min-width: 0; } .hg-note.is-r, .hg-note.is-l { margin-left: 3%; margin-right: 3%; } }

/* ---------- 32 seconds ---------- */
.hg-race-t { position: relative; margin: var(--ar-s-2) 0 var(--ar-s-4); }
.hg-race-t svg { width: 100%; height: auto; display: block; overflow: visible; }
.hg-race-t .bg { stroke: var(--ar-sunken); stroke-width: 10; stroke-linecap: round; }
.hg-race-t .fg { stroke: var(--tl-mark); stroke-width: 10; stroke-linecap: round; }
.hg-race-t .dot { fill: var(--ar-surface); stroke: var(--tl-mark); stroke-width: 4; }
.hg-race-t .dot.is-hot { stroke: var(--tl-hot); }
.hg-race-t .tick { fill: var(--ar-text-faint); font: 22px var(--ar-font-mono); }
.hg-race-k { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ar-s-3); grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.hg-race-k li { font-size: var(--ar-fs-sm); line-height: 1.45; color: var(--ar-text-muted); border-top: 2px solid var(--tl-mark); padding-top: var(--ar-s-2); }
.hg-race-k li.is-hot { border-top-color: var(--tl-hot); }
.hg-race-k b { display: block; font: 700 var(--ar-fs-lg)/1.1 var(--ar-font-display); color: var(--ar-text); font-variant-numeric: tabular-nums; }

/* ---------- orders as keys ---------- */
.hg-keys { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ar-s-2); grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
.hg-keys li { position: relative; padding: var(--ar-s-3); padding-top: var(--ar-s-4); border-radius: var(--ar-r-md); background: linear-gradient(var(--ar-key-face-hi), var(--ar-key-face)); border: 1px solid var(--ar-key-edge);
  box-shadow: inset 0 1px 0 var(--ar-shine), 0 3px 0 var(--ar-key-skirt), 0 6px 12px -8px var(--ar-shade); display: grid; gap: 4px; align-content: start; }
.hg-keys code { font: 700 var(--ar-fs-sm)/1.2 var(--ar-font-mono); color: var(--ar-text); }
.hg-keys span { font-size: var(--ar-fs-xs); line-height: 1.4; color: var(--ar-text-muted); }
.hg-keys .hg-lamp { position: absolute; top: 9px; right: 9px; }

/* ---------- whose address the website sees ---------- */
.hg-proxy { display: grid; gap: var(--ar-s-2); align-items: stretch; }
@media (min-width: 1100px) { .hg-proxy { grid-template-columns: 1fr 2.2rem 1.15fr 2.2rem 1.15fr 2.2rem 1fr; } }
.hg-hop { padding: var(--ar-s-4); border-radius: var(--ar-r-md); background: var(--ar-surface); border: 1px solid var(--ar-line); display: grid; gap: var(--ar-s-2); align-content: start; }
.hg-hop b { font: 700 var(--ar-fs-sm)/1.25 var(--ar-font-display); }
.hg-hop span { font-size: var(--ar-fs-sm); line-height: 1.45; color: var(--ar-text-muted); }
.hg-hop code { font-size: .82em; overflow-wrap: anywhere; }
.hg-hop.is-victim { border: 2px solid var(--tl-hot); }
.hg-hop.is-sees { background: var(--ar-readout-bg); color: #f0eee7; border-color: transparent; }
.hg-hop.is-sees span { color: #a9aaa1; }
.hg-hop.is-sees strong { color: var(--ar-acid); font: 600 var(--ar-fs-sm)/1.35 var(--ar-font-mono); }
.hg-arrow { position: relative; min-height: 26px; }
.hg-arrow::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px dashed var(--tl-mark); }
.hg-arrow::after { content: ""; position: absolute; left: 50%; top: 35%; width: 10px; height: 10px; margin-left: -4px; border-radius: 50%; background: var(--tl-mark); box-shadow: 0 0 10px var(--tl-glow); animation: hg-drop 1.8s var(--ar-ease) infinite; }
@media (min-width: 1100px) {
  .hg-arrow::before { left: 0; right: 0; top: 50%; bottom: auto; border-left: 0; border-top: 2px dashed var(--tl-mark); }
  .hg-arrow::after { left: 0; top: 50%; margin: -4px 0 0; animation-name: hg-slide; }
}

/* ---------- decrypted settings ---------- */
.hg-crack { display: grid; gap: var(--ar-s-2); }
.hg-crack-r { display: grid; gap: var(--ar-s-1) var(--ar-s-4); align-items: center; padding: var(--ar-s-3) var(--ar-s-4); background: var(--ar-surface); border: 1px solid var(--ar-line); border-radius: var(--ar-r-md); }
@media (min-width: 760px) { .hg-crack-r { grid-template-columns: minmax(0, 0.9fr) 1.5rem minmax(0, 1.4fr); } }
.hg-crack-r s { font: 500 12px/1.4 var(--ar-font-mono); color: var(--ar-text-faint); text-decoration-color: var(--tl-mark); overflow-wrap: anywhere; }
.hg-crack-r i { font-style: normal; color: var(--tl-mark); text-align: center; font-weight: 700; }
.hg-crack-r strong { font: 600 var(--ar-fs-sm)/1.4 var(--ar-font-mono); overflow-wrap: anywhere; }
.hg-crack-r small { grid-column: 1 / -1; font-size: var(--ar-fs-xs); color: var(--ar-text-muted); }

/* ---------- reveals (only with scripts, only when not reduced) ---------- */
.hg-js .hg-anim > * { opacity: 0; transform: translateY(8px); }
.hg-js .hg-anim.is-in > * { animation: hg-up 520ms var(--ar-ease) forwards; animation-delay: calc(var(--i, 0) * 110ms); }
.hg-js .hg-seq .hg-m::before { transform: scaleX(0); }
.hg-js .hg-seq.is-in .hg-m::before { animation: hg-draw 420ms var(--ar-ease) forwards; animation-delay: calc(var(--i, 0) * 110ms + 120ms); }
.hg-js .hg-term-b > span { opacity: 0; }
.hg-js .hg-term.is-in .hg-term-b > span { animation: hg-type 10ms linear forwards; animation-delay: calc(var(--i, 0) * 160ms); }
.hg-js .hg-size-bar i, .hg-js .hg-seg { transform: scaleX(0); }
.hg-js .is-in .hg-size-bar i, .hg-js .is-in .hg-seg { animation: hg-grow 900ms var(--ar-ease) forwards; animation-delay: calc(var(--i, 0) * 180ms); }
.hg-js .hg-race-t .fg { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.hg-js .is-in .hg-race-t .fg { animation: hg-dash 2.2s cubic-bezier(.2, .7, .3, 1) forwards; }

/* ---------- charts (SVG bars, HTML labels) ---------- */
.hg-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.hg-chart .b { fill: var(--tl-mark); }
.hg-chart .b:hover { fill: var(--tl-hot); }
.hg-chart .g { stroke: var(--ar-line); stroke-width: 1; }
.hg-axis { display: flex; justify-content: space-between; gap: var(--ar-s-2); margin-top: var(--ar-s-2); font: 500 11px/1.3 var(--ar-font-mono); color: var(--ar-text-muted); }
.hg-hbars { display: grid; gap: var(--ar-s-2); }
.hg-hbar { display: grid; grid-template-columns: minmax(7rem, 13rem) minmax(0, 1fr) auto; gap: var(--ar-s-3); align-items: center; font-size: var(--ar-fs-sm); }
.hg-hbar span { line-height: 1.3; }
.hg-hbar b { font: 600 var(--ar-fs-sm)/1 var(--ar-font-mono); font-variant-numeric: tabular-nums; }
.hg-hbar svg { width: 100%; height: 14px; display: block; }
.hg-hbar .t { fill: var(--ar-sunken); } .hg-hbar .b { fill: var(--tl-mark); } .hg-hbar .b.is-hot { fill: var(--tl-hot); }
@media (max-width: 560px) { .hg-hbar { grid-template-columns: 1fr auto; } .hg-hbar svg { grid-column: 1 / -1; order: 3; } }
.hg-js .hg-chart .b, .hg-js .hg-hbar .b { transform: scale(0, 0); transform-box: fill-box; transform-origin: left bottom; }
.hg-js .is-in .hg-chart .b, .hg-js .hg-chart.is-in .b { animation: hg-bar 700ms var(--ar-ease) forwards; animation-delay: calc(var(--i, 0) * 30ms); }
.hg-js .hg-hbars.is-in .b { animation: hg-bar 800ms var(--ar-ease) forwards; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes hg-bar { from { transform: scale(1, 0); } to { transform: scale(1, 1); } }
.hg-hbar .b { transform-origin: left center; }
.hg-js .hg-hbars .b { transform: scaleX(0); }
.hg-js .hg-hbars.is-in .b { animation-name: hg-barx; }
@keyframes hg-barx { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hg-gantt .hg-hbar { grid-template-columns: 12.5rem minmax(0, 1fr) 2.5rem; }
.hg-gantt-axis { margin-left: calc(12.5rem + var(--ar-s-3)); margin-right: calc(2.5rem + var(--ar-s-3)); }
@media (max-width: 560px) { .hg-gantt .hg-hbar { grid-template-columns: 1fr auto; } .hg-gantt-axis { margin: var(--ar-s-2) 0 0; } }
.hg-keys.is-compact { grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }
@media (max-width: 560px) { .hg-keys.is-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hg-keys.is-compact span { display: none; } .hg-keys.is-compact li { padding: var(--ar-s-3) var(--ar-s-2) var(--ar-s-2); } }

/* ---------- two copies, one difference ---------- */
.hg-diff { position: relative; height: 22px; border-radius: var(--ar-r-sm); background: var(--tl-mark-soft); margin: var(--ar-s-2) 0; }
.hg-diff b { position: absolute; left: 89.1%; width: 5px; top: -5px; bottom: -5px; border-radius: 2px; background: var(--tl-hot); box-shadow: 0 0 10px rgba(255, 83, 64, .5); }
.hg-plate .mal-decode.hg-diff-rows { margin: var(--ar-s-4) 0 0; padding: 0; background: transparent; border: 0; max-width: none; }

/* ---------- hex dump ---------- */
.hg-hex .h { color: var(--ar-acid); font-weight: 600; }
.hg-hex .z { color: #ffb224; }

@keyframes hg-up { to { opacity: 1; transform: none; } }
@keyframes hg-draw { to { transform: scaleX(1); } }
@keyframes hg-type { to { opacity: 1; } }
@keyframes hg-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes hg-dash { to { stroke-dashoffset: 0; } }
@keyframes hg-run { to { transform: translateX(44px); } }
@keyframes hg-blink { 50% { opacity: .25; } }
@keyframes hg-drop { from { transform: translateY(-14px); opacity: 0; } 40% { opacity: 1; } to { transform: translateY(14px); opacity: 0; } }
@keyframes hg-slide { from { transform: translateX(0); opacity: 0; } 30% { opacity: 1; } to { transform: translateX(calc(2.2rem - 10px)); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .hg-track::after, .hg-arrow::after, .hg-term-h .hg-lamp.is-on { animation: none; }
}
@media (max-width: 640px) { .hg-term-b { font-size: 11px; } .prose .hg-code pre { font-size: 12px; } .hg-seg span { display: none; } }
