/* =====================================================================================================
 HIVE design system · v1.0 · 2026-09-30 · docs/design-system.css
 The token layer and the component classes, standalone. Spec: docs/DESIGN_SYSTEM.md.
 Gallery: docs/design-system.html (inlines this file verbatim; check in DESIGN_SYSTEM.md §10).

 Rules this file encodes (CLAUDE.md, binding):
 - One dark world. No light theme. color-scheme: dark.
 - Numbers up are ALWAYS green: bigger = brighter green + stronger green aura + bigger size (the win scale, data-win 1..5).
   Down = red (--hv-loss). Milestone chips may be amber (--hv-mile); the figures stay green. No gradient text on figures.
 - Honey is the accent (identity, selection, "peak" marker). Status colours (ok / warn / crit) are separate from the accent
   and never colour a figure.
 - Motion animates transform and opacity only, and every effect has a reduced-motion form ([data-motion] + the OS setting).

 Naming: every token is --hv-*, every class is hv-*. Nothing here collides with style.css or the Calls v3 prototype, so this
 file can load BEFORE style.css during the migration. Unlayered style.css rules win over these layered ones on any overlap.
 The canvas palette (--k-*, --n-*, --cls-*) keeps its old names: app.js readTokens() reads them (6-digit hex only).
 Gallery-only state hooks (.is-hover, .is-focus, .is-active, .is-disabled) sit beside the real pseudo-classes; they are inert
 in the app unless something adds them.
 ===================================================================================================== */


/* ------------------------------------------------------------------------------------------------ tokens */
/* tokens (no @layer: unlayered so class rules beat element resets such as style.css "button { color: inherit }") */
:root {
  color-scheme: dark;

  /* ground and surfaces (warm propolis black, raised in four steps) */
  --hv-bg-0: #0b0a08;               /* ground: page, world canvas */
  --hv-bg-1: #15120e;               /* panel: rails, sheets, scoreboard box, graveyard */
  --hv-bg-2: #211b14;               /* card: call card, tile, list row */
  --hv-bg-3: #2b231a;               /* control: chip, button, bar track */
  --hv-bg-4: #372c20;               /* control hover / pressed-neutral */
  --hv-glass: rgba(20, 17, 13, 0.90);        /* floating chrome over the live canvas (desktop, with blur) */
  --hv-glass-solid: rgba(20, 17, 13, 0.97);  /* popovers, toasts, dialogs, all phone chrome (no blur) */
  --hv-scrim: rgba(5, 4, 3, 0.72);           /* behind a dialog or a full sheet */

  /* lines */
  --hv-line-1: rgba(255, 214, 150, 0.09);    /* hairline divider, card edge */
  --hv-line-2: rgba(255, 214, 150, 0.17);    /* control edge, card hover */
  --hv-line-3: #85714f;                      /* input / switch boundary: >= 3:1 on bg-0..bg-3 (WCAG 1.4.11) */

  /* ink */
  --hv-ink-1: #f1e8da;              /* primary text */
  --hv-ink-2: #b4a794;              /* secondary text */
  --hv-ink-3: #9d9180;              /* tertiary text: the lightest colour allowed for text (>= 4.5:1 on bg-0..bg-3) */
  --hv-ink-4: #7c7061;              /* decoration only: rules, strike-through, unlit icons (>= 3:1 on bg-0..bg-2) */
  --hv-on-accent: #0b0a08;          /* text on a honey or honey-2 fill */

  /* accent: honey = HIVE identity, selection, the "peak" marker, our own hubs */
  --hv-honey: #f5b83d;
  --hv-honey-2: #ffd98c;            /* accent text and links on dark */
  --hv-honey-bg: rgba(245, 184, 61, 0.13);
  --hv-honey-line: rgba(245, 184, 61, 0.45);
  --hv-honey-glow: rgba(245, 184, 61, 0.35);
  --hv-focus: #ffd98c;              /* focus ring (outer); the inner ring is --hv-bg-0 */
  /* card frame v3.1 (handover INDEX, 19 Oct): the rarity ladder's edges, washes and glows. Win and loss colours stay on figures. */
  --hv-frame-common: #9d9180;       /* Common and Loss: 1 px ink-3 edge, flat */
  /* #157: Rare, Epic and Legendary take frame-v3.1.css's values (Drive hive-card-frame-v3.1, 13,411 B) */
  --hv-wash-rare: rgba(245, 184, 61, 0.06);     /* Rare: the honey top wash */
  --hv-wash-epic: rgba(245, 184, 61, 0.16);     /* Epic: the honey corner wash */
  --hv-wash-legend: rgba(255, 217, 140, 0.20);  /* Legendary: the honey-2 corner wash */
  --hv-fill-rare: linear-gradient(180deg, var(--hv-wash-rare), rgba(245, 184, 61, 0) 46%);
  --hv-fill-epic: radial-gradient(120% 70% at 100% 0, var(--hv-wash-epic), rgba(245, 184, 61, 0) 55%);
  --hv-fill-legend: radial-gradient(110% 75% at 100% 0, var(--hv-wash-legend), rgba(255, 217, 140, 0) 55%);
  --hv-sheen-legend: linear-gradient(160deg, rgba(255, 244, 214, 0.05), rgba(255, 244, 214, 0) 40%);
  /* the tiles on a Rare, Epic or Legendary card (frame-v3.1.css .tile and .tile.hero): black .5 over the card, so its wash and comb read through */
  --hv-tile-frame: rgba(11, 10, 8, 0.5);
  --hv-tile-hero: radial-gradient(90% 90% at 50% 0, rgba(95, 227, 156, 0.1), rgba(11, 10, 8, 0.55));
  /* the comb: line alpha .025 on bg-2 is 1.055:1, so ink-3 text keeps 5.2:1 over it (frame-v3.1.css) */
  --hv-comb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='48.5'%3E%3Cpath d='M14 0 28 8v16L14 32 0 24V8zM14 32v16.5' fill='none' stroke='%23ffd696' stroke-opacity='.025' stroke-width='1.2'/%3E%3C/svg%3E");
  --hv-glow-epic: 0 0 0 1px rgba(245, 184, 61, 0.5), 0 0 34px rgba(245, 184, 61, 0.65), 0 0 70px rgba(245, 184, 61, 0.28);
  --hv-glow-legend: 0 0 34px rgba(255, 217, 140, 0.55), 0 0 4px rgba(255, 217, 140, 0.9);
  /* the Epic halo (frame-v3.1.css .halo): hex lines (honey-2, .9) over honey .55, a ring 7 px outside the edge, and the 2 px honey edge,
     as one border image (the card clips its content, so the ring is the card's own paint). 9-slice: corners hold the curves (radius
     18, outer 25; 12 and 19 on a phone), edge slices are whole hex periods (24 x 104, 2 and 5 periods; whole pixels, so the bottom edge lands on the pixel grid as the top does) so `round` keeps the texture continuous. */
  --hv-halo-epic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='74' height='154'%3E%3Cdefs%3E%3Cpattern id='h' width='12' height='20.8' patternUnits='userSpaceOnUse'%3E%3Cpath d='M6 0 12 3.5v6.9L6 13.9 0 10.4V3.5zM6 13.9v6.9' fill='none' stroke='%23ffd98c' stroke-opacity='.9' stroke-width='1.1'/%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M25 0H49A25 25 0 0 1 74 25V129A25 25 0 0 1 49 154H25A25 25 0 0 1 0 129V25A25 25 0 0 1 25 0ZM25 7H49A18 18 0 0 1 67 25V129A18 18 0 0 1 49 147H25A18 18 0 0 1 7 129V25A18 18 0 0 1 25 7Z' fill='%23f5b83d' fill-opacity='.55' fill-rule='evenodd'/%3E%3Cpath d='M25 0H49A25 25 0 0 1 74 25V129A25 25 0 0 1 49 154H25A25 25 0 0 1 0 129V25A25 25 0 0 1 25 0ZM25 7H49A18 18 0 0 1 67 25V129A18 18 0 0 1 49 147H25A18 18 0 0 1 7 129V25A18 18 0 0 1 25 7Z' fill='url%28%23h%29' fill-rule='evenodd'/%3E%3Cpath d='M25 7H49A18 18 0 0 1 67 25V129A18 18 0 0 1 49 147H25A18 18 0 0 1 7 129V25A18 18 0 0 1 25 7ZM25 9H49A16 16 0 0 1 65 25V129A16 16 0 0 1 49 145H25A16 16 0 0 1 9 129V25A16 16 0 0 1 25 9Z' fill='%23f5b83d' fill-rule='evenodd'/%3E%3C/svg%3E");
  --hv-halo-epic-sm: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='62' height='142'%3E%3Cdefs%3E%3Cpattern id='h' width='12' height='20.8' patternUnits='userSpaceOnUse'%3E%3Cpath d='M6 0 12 3.5v6.9L6 13.9 0 10.4V3.5zM6 13.9v6.9' fill='none' stroke='%23ffd98c' stroke-opacity='.9' stroke-width='1.1'/%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M19 0H43A19 19 0 0 1 62 19V123A19 19 0 0 1 43 142H19A19 19 0 0 1 0 123V19A19 19 0 0 1 19 0ZM19 7H43A12 12 0 0 1 55 19V123A12 12 0 0 1 43 135H19A12 12 0 0 1 7 123V19A12 12 0 0 1 19 7Z' fill='%23f5b83d' fill-opacity='.55' fill-rule='evenodd'/%3E%3Cpath d='M19 0H43A19 19 0 0 1 62 19V123A19 19 0 0 1 43 142H19A19 19 0 0 1 0 123V19A19 19 0 0 1 19 0ZM19 7H43A12 12 0 0 1 55 19V123A12 12 0 0 1 43 135H19A12 12 0 0 1 7 123V19A12 12 0 0 1 19 7Z' fill='url%28%23h%29' fill-rule='evenodd'/%3E%3Cpath d='M19 7H43A12 12 0 0 1 55 19V123A12 12 0 0 1 43 135H19A12 12 0 0 1 7 123V19A12 12 0 0 1 19 7ZM19 9H43A10 10 0 0 1 53 19V123A10 10 0 0 1 43 133H19A10 10 0 0 1 9 123V19A10 10 0 0 1 19 9Z' fill='%23f5b83d' fill-rule='evenodd'/%3E%3C/svg%3E");
  /* K2 (#180 review r1): the five v3 group chips in the design boards' colours (text AA on bg-2), their edges, the figure flash, the ring */
  --hv-grp-insiders: #c99bf0;   --hv-grp-insiders-l: rgba(201, 155, 240, 0.5);
  --hv-grp-early: #ffd98c;      --hv-grp-early-l: rgba(255, 217, 140, 0.5);
  --hv-grp-snipers: #3a8dff;    --hv-grp-snipers-l: rgba(58, 141, 255, 0.55);
  --hv-grp-fast: #ff9a52;       --hv-grp-fast-l: rgba(255, 154, 82, 0.5);
  --hv-grp-other: #9fb4c8;      --hv-grp-other-l: rgba(159, 180, 200, 0.45);
  --hv-flash-up: 0 0 12px rgba(61, 255, 154, 0.75);
  --hv-flash-dn: 0 0 12px rgba(255, 107, 87, 0.7);
  --hv-ring-pop: 0 0 0 2px #ffcf4a, 0 0 22px rgba(255, 207, 74, 0.35);
  --hv-foil-hi: #fff4d6;            /* the foil's light band (Legendary edge and badge) */
  --hv-foil: linear-gradient(125deg, #ffd98c 0%, #fff4d6 18%, #f5b83d 36%, #ffd98c 52%, #fff4d6 70%, #f5b83d 86%, #ffd98c 100%);   /* honey-2, foil-hi, honey: twice */
  --hv-hex-line: rgba(255, 214, 150, 0.025);    /* the honeycomb motif line: the comb's stroke (#ffd696 at .025, #157), never brand amber */

  /* WIN SCALE: every up value is green. Magnitude reads through brightness, aura and size, never hue.
     1: above call to <2x · 2: 2x to <5x · 3: 5x to <10x · 4: 10x to <100x · 5: 100x and up */
  --hv-win-1: #5fe39c;
  --hv-win-2: #4cf69e;
  --hv-win-3: #55ffa7;
  --hv-win-4: #98ffcc;
  --hv-win-5: #c8ffe6;
  --hv-win-aura-1: rgba(61, 255, 154, 0.12);
  --hv-win-aura-2: rgba(61, 255, 154, 0.18);
  --hv-win-aura-3: rgba(61, 255, 154, 0.26);
  --hv-win-aura-4: rgba(61, 255, 154, 0.36);
  --hv-win-aura-5: rgba(61, 255, 154, 0.48);
  --hv-win-shadow-3: 0 0 10px rgba(61, 255, 154, 0.35);
  --hv-win-shadow-4: 0 0 16px rgba(61, 255, 154, 0.50);
  --hv-win-shadow-5: 0 0 24px rgba(61, 255, 154, 0.65), 0 0 4px rgba(200, 255, 230, 0.55);
  --hv-win-scale-1: 1;
  --hv-win-scale-2: 1.04;
  --hv-win-scale-3: 1.08;
  --hv-win-scale-4: 1.14;
  --hv-win-scale-5: 1.2;
  --hv-win-bg: rgba(95, 227, 156, 0.12);
  --hv-win-line: rgba(95, 227, 156, 0.40);

  /* losses: one red, same size as win-1, no aura pulse */
  --hv-loss: #ff6b57;
  --hv-loss-bg: rgba(255, 107, 87, 0.13);
  --hv-loss-bg-2: rgba(255, 107, 87, 0.26);   /* r1b hive: the deeper fall (Movers dn2) */
  --hv-loss-line: rgba(255, 107, 87, 0.45);
  --hv-loss-aura: rgba(255, 107, 87, 0.12);

  /* Movers 0a (operator 20 Oct, Ocula Explore standard): the heat map's five bands each way; a 40% tint of the sign's colour at the
     floor, gold from +50%, a brighter red edge from -25%; the glows behind bands 3 to 5 (style.css .mv-t.mv-bubble, .mv-glow) */
  --hv-mv-up1: color-mix(in srgb, var(--hv-win-1) 40%, var(--hv-bg-1));
  --hv-mv-up2: color-mix(in srgb, var(--hv-win-1) 48%, var(--hv-bg-1));
  --hv-mv-up3: color-mix(in srgb, var(--hv-win-2) 56%, var(--hv-bg-1));
  --hv-mv-up4: color-mix(in srgb, var(--hv-win-2) 64%, var(--hv-bg-1));
  --hv-mv-up5: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--hv-honey) 64%, var(--hv-bg-1)), color-mix(in srgb, var(--hv-win-2) 54%, var(--hv-bg-1)) 80%);
  --hv-mv-dn1: color-mix(in srgb, var(--hv-loss) 40%, var(--hv-bg-1));
  --hv-mv-dn2: color-mix(in srgb, var(--hv-loss) 48%, var(--hv-bg-1));
  --hv-mv-dn3: color-mix(in srgb, var(--hv-loss) 56%, var(--hv-bg-1));
  --hv-mv-dn4: color-mix(in srgb, var(--hv-loss) 62%, var(--hv-bg-1));
  --hv-mv-dn5: color-mix(in srgb, var(--hv-loss) 68%, var(--hv-bg-1));
  --hv-mv-dn-ink: color-mix(in srgb, var(--hv-loss) 55%, var(--hv-ink-1));
  --hv-mv-dn-ink-hi: color-mix(in srgb, var(--hv-loss) 22%, var(--hv-ink-1));
  --hv-mv-dn-edge-hi: color-mix(in srgb, var(--hv-loss) 72%, var(--hv-ink-1));
  /* quality sweep 26 Oct (row 11, WCAG AA): the plate under each hexagon label line; >= 4.5:1 for every label ink over every band,
     also over a white pixel of the coin's icon (0.2) */
  --hv-mv-plate: rgba(11, 10, 8, 0.55);
  --hv-mv-glow-up: rgba(61, 255, 154, 0.6);
  --hv-mv-glow-gold: rgba(255, 217, 140, 0.75);
  --hv-mv-glow-dn: rgba(255, 107, 87, 0.6);

  /* milestone chips (2x / 5x / 10x / 100x): amber chip, green figure */
  --hv-mile: #ffcf5c;
  --hv-mile-bg: rgba(255, 207, 92, 0.14);
  --hv-mile-line: rgba(255, 207, 92, 0.40);

  /* semantic status: health, freshness, feed state. Never a figure, never the accent */
  --hv-ok: #6fdc8c;
  --hv-ok-bg: rgba(111, 220, 140, 0.10);
  --hv-ok-line: rgba(111, 220, 140, 0.28);
  --hv-warn: #ffb547;
  --hv-warn-ink: #ffd9a3;
  --hv-warn-bg: rgba(255, 181, 71, 0.10);
  --hv-warn-line: rgba(255, 181, 71, 0.32);
  --hv-crit: #ff4d5e;
  --hv-crit-ink: #ffd3d8;
  --hv-crit-bg: rgba(255, 77, 94, 0.12);
  --hv-crit-line: rgba(255, 77, 94, 0.40);
  --hv-idle: #71695e;               /* status dot only */
  --hv-live: #ff2f6d;               /* real-capital LIVE pill (operator surfaces) */
  --hv-live-ink: #ffd0d6;

  /* facts and sources */
  --hv-flag: #e38a58;               /* Rug catcher, exposure ring, entity-linked outline (coral, never red) */
  --hv-flag-bg: rgba(227, 138, 88, 0.12);
  --hv-flag-line: rgba(227, 138, 88, 0.55);
  --hv-study: #b98cff;
  --hv-exit: #9fb4c8;               /* rule-exit marker */
  --hv-rh: #35d0ba;
  --hv-sol: #a98bff;
  --hv-halo: #ffd98c;               /* clean-record halo ring (a record state, not a figure) */
  --hv-halo-glow: rgba(245, 184, 61, 0.45);
  --hv-co-precursor: #ffd98c;
  --hv-co-crew: #ff9a52;
  --hv-co-insider: #c99bf0;
  --hv-co-wash: #9d9180;

  /* canvas palette: names are an API (app.js readTokens reads --k-* / --n-* / --cls-*; 6-digit hex only) */
  --k-fund: #f5b83d;  --k-buy: #5fe39c;  --k-sell: #ff6b57;  --k-swap: #8fd8c8;  --k-fire: #56c8ff;
  --k-exit: #d67dff;  --k-alert: #ff2f6d; --k-detect: #c3cedc; --k-birth: #fff0c4; --k-machine: #ff7ad9;
  --cls-org: #5fd4c4; --cls-op: #ff7ad9; --cls-bot: #8c8478; --cls-unres: #4a443c; --cls-ours: #56c8ff;
  --n-operator: #ffc24d; --n-engine: #56c8ff; --n-wallet: #cbbca6; --n-pool: #5fd4c4; --n-token: #f6e7c1;
  --n-funder: #e38a58; --n-service: #5f5b55; --n-ghost: #8c8478;

  /* type */
  --hv-f-display: "Big Shoulders Display", "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --hv-f-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --hv-f-data: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --hv-text-cap: 0.6875rem;   /* 11: captions, chip labels, table heads (the floor: nothing smaller) */
  --hv-text-xs: 0.75rem;      /* 12 */
  --hv-text-sm: 0.8125rem;    /* 13: secondary lines */
  --hv-text-md: 0.875rem;     /* 14: UI body (desktop rails, tables) */
  --hv-text-lg: 0.9375rem;    /* 15: reading body (cards, sheets) */
  --hv-text-xl: 1.0625rem;    /* 17: lead */
  --hv-display-sm: 1rem;      /* 16: list ticker, eyebrow in display face */
  --hv-display-md: 1.25rem;   /* 20: card ticker (phone), h3 */
  --hv-display-lg: 1.5rem;    /* 24: h2, card ticker (desktop) */
  --hv-display-xl: 1.875rem;  /* 30: results headline */
  --hv-display-2xl: 2.5rem;   /* 40: gate / hero headline */
  --hv-fig-xs: 0.75rem;       /* 12: table cells, sub-figures */
  --hv-fig-sm: 0.875rem;      /* 14: inline figures */
  --hv-fig-md: 1.0625rem;     /* 17: rail values, board rows */
  --hv-fig-lg: 1.375rem;      /* 22: toast hero (phone), secondary tiles */
  --hv-fig-xl: 1.75rem;       /* 28: stat tile, toast hero (desktop), podium #2/#3 */
  --hv-fig-2xl: 2.5rem;       /* 40: call-card hero (phone), podium #1 */
  --hv-fig-3xl: 3rem;         /* 48: call-card hero (wide), player-card hero */
  --hv-lh-tight: 1;
  --hv-lh-snug: 1.2;
  --hv-lh-body: 1.45;
  --hv-lh-read: 1.55;
  --hv-track-caps: 0.08em;    /* uppercase display labels */
  --hv-track-display: 0.03em; /* tickers, headings */
  --hv-track-fig: -0.02em;    /* figures >= 22 px */

  /* space: --hv-s-N = N x 4 px (05 = 2 px, 15 = 6 px, 25 = 10 px, 35 = 14 px) */
  --hv-s-0: 0;
  --hv-s-05: 2px;
  --hv-s-1: 4px;
  --hv-s-15: 6px;
  --hv-s-2: 8px;
  --hv-s-25: 10px;
  --hv-s-3: 12px;
  --hv-s-35: 14px;
  --hv-s-4: 16px;
  --hv-s-5: 20px;
  --hv-s-6: 24px;
  --hv-s-8: 32px;
  --hv-s-10: 40px;
  --hv-s-12: 48px;
  --hv-gutter: 16px;          /* page edge, phone and desktop */
  --hv-tap: 44px;             /* minimum target, every interactive element */
  --hv-measure: 62ch;         /* longest reading line */

  /* radii */
  --hv-r-xs: 3px;             /* tags, bars up to 6 px tall */
  --hv-r-sm: 6px;             /* badges, dense inputs */
  --hv-r-md: 10px;            /* buttons, link chips, tiles, rows */
  --hv-r-lg: 14px;            /* cards, panels, rails, toasts, popovers */
  --hv-r-xl: 18px;            /* dialogs, sheet top corners */
  --hv-r-pill: 999px;
  --hv-r-round: 50%;

  /* elevation: e-0 flat · e-1 card · e-2 raised · e-3 floating · e-4 modal */
  --hv-e-0: none;
  --hv-e-1: 0 1px 2px rgba(0, 0, 0, 0.30);
  --hv-e-2: 0 6px 18px rgba(0, 0, 0, 0.40);
  --hv-e-3: 0 16px 44px rgba(0, 0, 0, 0.55);
  --hv-e-4: 0 24px 64px rgba(0, 0, 0, 0.65);
  --hv-glow-honey: 0 0 18px rgba(245, 184, 61, 0.35);
  --hv-blur: 14px;            /* desktop glass only; phones get --hv-glass-solid and no blur */

  /* z layers */
  --hv-z-world: 0;
  --hv-z-canvas: 1;
  --hv-z-canvas-ui: 2;
  --hv-z-rail: 20;
  --hv-z-sheet: 21;
  --hv-z-dock: 22;
  --hv-z-coach: 29;
  --hv-z-header: 30;
  --hv-z-tabbar-sub: 34;
  --hv-z-tabbar: 35;
  --hv-z-newpill: 36;
  --hv-z-drawer: 40;
  --hv-z-menu: 42;
  --hv-z-filters: 45;
  --hv-z-hovercard: 50;
  --hv-z-toast: 55;
  --hv-z-banner: 60;
  --hv-z-search: 70;
  --hv-z-popover: 80;
  --hv-z-dialog: 90;
  --hv-z-gate: 100;

  /* breakpoints (constants for matchMedia; @media cannot read custom properties, so the literals are 620 / 1024 / 1440) */
  --hv-bp-sm: 620px;          /* large phone, small tablet */
  --hv-bp-md: 1024px;         /* desktop layout: rails, lens bar, side drawer */
  --hv-bp-lg: 1440px;         /* wide: stream rail + lens + centre together */
  --hv-bp-ref: 390px;         /* phone reference width (min supported 320) */

  /* motion */
  --hv-dur-hover: 120ms;      /* colour on hover / press */
  --hv-dur-exit: 160ms;       /* toast out, popover out */
  --hv-dur-enter: 220ms;      /* toast in, pill in, chip */
  --hv-dur-sheet: 250ms;      /* card entrance, sheet snap, drawer in */
  --hv-dur-move: 300ms;       /* range-bar markers, tile roll, lane move */
  --hv-dur-roll: 450ms;       /* hero odometer, rank FLIP */
  --hv-dur-flash: 600ms;      /* tick flash, milestone pop, toast count */
  --hv-dur-count: 700ms;      /* arrival count-up, burst ring */
  --hv-dur-sweep: 1000ms;     /* milestone sweep */
  --hv-dur-live: 800ms;       /* live-dot pulse per poll */
  --hv-dur-toast: 8000ms;     /* toast auto-dismiss */
  --hv-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);     /* entering, settling (the default) */
  --hv-ease-in: cubic-bezier(0.4, 0, 1, 1);          /* leaving */
  --hv-ease-inout: cubic-bezier(0.4, 0, 0.2, 1);     /* FLIP, detent to detent */
  --hv-ease-snap: cubic-bezier(0.22, 1.1, 0.36, 1);  /* sheet release, milestone pop (about 2 % overshoot) */
}

/* Motion levels. Full: everything. Calm: state changes still move (rolls, slides, sheets); attention effects
   (flash, sweep, pop, burst, pulse, marquee) are off. Off: nothing moves; ▲/▼ marks show each change.
   The OS setting means Off unless the viewer picked Full or Calm. Legacy body[data-motion="reduced"] = Off. */
:is(html, body):is([data-motion="off"], [data-motion="reduced"]) {
  --hv-dur-hover: 1ms; --hv-dur-exit: 1ms; --hv-dur-enter: 1ms; --hv-dur-sheet: 1ms; --hv-dur-move: 1ms;
  --hv-dur-roll: 1ms; --hv-dur-flash: 1ms; --hv-dur-count: 1ms; --hv-dur-sweep: 1ms; --hv-dur-live: 1ms;
}
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]):not([data-motion="calm"]) {
    --hv-dur-hover: 1ms; --hv-dur-exit: 1ms; --hv-dur-enter: 1ms; --hv-dur-sheet: 1ms; --hv-dur-move: 1ms;
    --hv-dur-roll: 1ms; --hv-dur-flash: 1ms; --hv-dur-count: 1ms; --hv-dur-sweep: 1ms; --hv-dur-live: 1ms;
  }
}

/* ------------------------------------------------------------------------------------------------ base */
/* base (no @layer: unlayered so class rules beat element resets such as style.css "button { color: inherit }") */
:where([class^="hv-"], [class*=" hv-"])[hidden] { display: none !important; }
.hv-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hv-num { font-family: var(--hv-f-data); font-variant-numeric: tabular-nums; }
.hv-caps { font: 700 var(--hv-text-cap) / var(--hv-lh-snug) var(--hv-f-display); letter-spacing: var(--hv-track-caps); text-transform: uppercase; }
.hv-muted { color: var(--hv-ink-2); }
.hv-br { color: var(--hv-ink-2); font-weight: 500; }   /* operator term in brackets: "Linked-wallet share (machine share)" */

/* focus: a 2 px honey-2 outline 2 px off the element. The gap shows the dark surface behind, so the ring reads on the ground,
   on cards and around honey fills (12:1 on bg-2). Outline, not box-shadow: it never fights a component's own shadow and it
   survives forced-colours mode. Inside scrollers (tab rows) the ring sits inset so the scroller cannot clip it. */
:is([class^="hv-"], [class*=" hv-"]):is(:focus-visible, .is-focus) {
  outline: 2px solid var(--hv-focus);
  outline-offset: 2px;
}
:is(.hv-tabs__btn, .hv-tabbar__btn, .hv-chips--scroll > *, .hv-lensbar__btn, .hv-seg > button):is(:focus-visible, .is-focus) { outline-offset: -3px; }
.hv-seg > button:is(:focus-visible, .is-focus) { outline: 2px solid var(--hv-focus); outline-offset: -2px; }

/* the change mark: hidden while motion is on (the flash carries the change), shown under Calm / Off */
.hv-delta-mark { display: none; margin-left: 0.3em; font-size: 0.6em; vertical-align: 0.25em; }
.hv-delta-mark[data-dir="up"] { color: var(--hv-win-1); }
.hv-delta-mark[data-dir="down"] { color: var(--hv-loss); }
:is(html, body):is([data-motion="calm"], [data-motion="off"], [data-motion="reduced"]) .hv-delta-mark { display: inline; }
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]):not([data-motion="calm"]) .hv-delta-mark { display: inline; }
}

/* container hosts: components below respond to the width they are given, not the viewport */
.hv-cq, .hv-sheet__body, .hv-drawer__body, .hv-dialog, .hv-toasts, .hv-feed { container-type: inline-size; }   /* every surface that sets a width is a container host */
.hv-feed { display: grid; gap: var(--hv-s-25); min-width: 0; }

/* ------------------------------------------------------------------------------------------------ components */
/* components (no @layer: unlayered so class rules beat element resets such as style.css "button { color: inherit }") */

/* ---------- buttons ---------- */
.hv-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--hv-s-15);
  min-height: var(--hv-tap); min-width: var(--hv-tap);
  padding: 0 var(--hv-s-35);
  border-radius: var(--hv-r-md);
  border: 1px solid var(--hv-line-2);
  background: var(--hv-bg-3);
  color: var(--hv-ink-1);
  font: 600 var(--hv-text-sm) / 1 var(--hv-f-body);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--hv-dur-hover) var(--hv-ease-out), border-color var(--hv-dur-hover) var(--hv-ease-out), color var(--hv-dur-hover) var(--hv-ease-out);
}
.hv-btn svg { width: 18px; height: 18px; flex: none; }
.hv-btn:hover, .hv-btn.is-hover { background: var(--hv-bg-4); border-color: var(--hv-line-3); }
.hv-btn:active, .hv-btn.is-active { background: var(--hv-bg-4); transform: translateY(1px); }
.hv-btn[aria-pressed="true"] { background: var(--hv-honey-bg); border-color: var(--hv-honey-line); color: var(--hv-honey-2); }
.hv-btn[aria-pressed="true"]::before { content: "✓"; font-size: 0.9em; }
.hv-btn--primary { background: var(--hv-honey); border-color: var(--hv-honey); color: var(--hv-on-accent); }
.hv-btn--primary:hover, .hv-btn--primary.is-hover { background: var(--hv-honey-2); border-color: var(--hv-honey-2); }
.hv-btn--ghost { background: transparent; border-color: transparent; color: var(--hv-ink-2); }
.hv-btn--ghost:hover, .hv-btn--ghost.is-hover { background: var(--hv-bg-3); color: var(--hv-ink-1); border-color: transparent; }
.hv-btn--icon { padding: 0; width: var(--hv-tap); }
.hv-btn--close { padding: 0; width: var(--hv-tap); border-radius: var(--hv-r-round); background: transparent; border-color: transparent; color: var(--hv-ink-2); font-size: 22px; font-weight: 400; }
.hv-btn--close:hover, .hv-btn--close.is-hover { background: var(--hv-bg-3); color: var(--hv-ink-1); }
.hv-btn:disabled, .hv-btn[aria-disabled="true"], .hv-btn.is-disabled {
  background: var(--hv-bg-2); border-color: var(--hv-line-1); color: var(--hv-ink-4); cursor: not-allowed; transform: none;
}
.hv-btn__count { font: 600 10px / 1 var(--hv-f-data); background: var(--hv-honey); color: var(--hv-on-accent); border-radius: var(--hv-r-pill); padding: 2px 5px; }
.hv-btn[aria-busy="true"] { color: transparent; pointer-events: none; }
.hv-btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: var(--hv-r-round);
  border: 2px solid var(--hv-ink-4); border-top-color: var(--hv-honey-2);
  animation: hv-spin 900ms linear infinite;
}

/* ---------- live dot ---------- */
.hv-live { display: inline-flex; align-items: center; gap: var(--hv-s-15); font: 500 var(--hv-text-xs) / 1 var(--hv-f-data); color: var(--hv-ink-2); white-space: nowrap; }
.hv-live::before { content: ""; width: 8px; height: 8px; border-radius: var(--hv-r-round); background: var(--hv-ok); flex: none; }
.hv-live.is-beat::before { animation: hv-live var(--hv-dur-live) var(--hv-ease-out); }
.hv-live[data-state="stale"]::before { background: var(--hv-idle); animation: none; }
.hv-live[data-state="stale"] { color: var(--hv-warn-ink); }
.hv-live[data-state="down"]::before { background: var(--hv-crit); animation: none; }
.hv-live[data-state="demo"]::before { background: var(--hv-honey); }

/* ---------- win figure (with its label chip) ----------
   <div class="hv-winfig hv-winfig--card" data-dir="up" data-win="2">
     <span class="hv-winfig__fig" aria-hidden="true">▲ +142%</span><span class="hv-vh">up 142 percent since call</span>
     <span class="hv-lchip">since call · now</span><span class="hv-winfig__x">2.42x</span></div> */
.hv-winfig {
  --_size: var(--hv-fig-md);
  --_scale: 1;
  position: relative; isolation: isolate;
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--hv-s-1) var(--hv-s-2);
  color: var(--hv-ink-1);
}
.hv-winfig__fig {
  position: relative;
  font: 600 calc(var(--_size) * var(--_scale)) / var(--hv-lh-tight) var(--hv-f-data);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--hv-track-fig);
  white-space: nowrap;
  color: inherit;
  border-radius: var(--hv-r-sm);
}
.hv-winfig__x { font: 500 calc(var(--_size) * 0.42) / 1 var(--hv-f-data); color: var(--hv-ink-2); white-space: nowrap; }
.hv-winfig[data-dir="flat"] { color: var(--hv-ink-1); }
.hv-winfig[data-dir="down"] { color: var(--hv-loss); --_aura: var(--hv-loss-aura); }
.hv-winfig[data-dir="up"] { color: var(--hv-win-1); }
.hv-winfig[data-dir="up"][data-win="1"] { color: var(--hv-win-1); --_aura: var(--hv-win-aura-1); --_scale: var(--hv-win-scale-1); }
.hv-winfig[data-dir="up"][data-win="2"] { color: var(--hv-win-2); --_aura: var(--hv-win-aura-2); --_scale: var(--hv-win-scale-2); }
.hv-winfig[data-dir="up"][data-win="3"] { color: var(--hv-win-3); --_aura: var(--hv-win-aura-3); --_scale: var(--hv-win-scale-3); }
.hv-winfig[data-dir="up"][data-win="4"] { color: var(--hv-win-4); --_aura: var(--hv-win-aura-4); --_scale: var(--hv-win-scale-4); }
.hv-winfig[data-dir="up"][data-win="5"] { color: var(--hv-win-5); --_aura: var(--hv-win-aura-5); --_scale: var(--hv-win-scale-5); }
/* the green glow on static figures (odometer digits clip text-shadow, so a rolling figure relies on the aura) */
.hv-winfig[data-dir="up"][data-win="3"] .hv-winfig__fig:not(.hv-roll) { text-shadow: var(--hv-win-shadow-3); }
.hv-winfig[data-dir="up"][data-win="4"] .hv-winfig__fig:not(.hv-roll) { text-shadow: var(--hv-win-shadow-4); }
.hv-winfig[data-dir="up"][data-win="5"] .hv-winfig__fig:not(.hv-roll) { text-shadow: var(--hv-win-shadow-5); }
/* sizes: only lg and up get the size bump and the aura; small figures carry magnitude by brightness alone */
.hv-winfig--xs { --_size: var(--hv-fig-xs); --_scale: 1 !important; }
.hv-winfig--sm { --_size: var(--hv-fig-sm); --_scale: 1 !important; }
.hv-winfig--md { --_size: var(--hv-fig-md); --_scale: 1 !important; }
.hv-winfig--tile { --_size: var(--hv-fig-xl); }
.hv-winfig--toast { --_size: var(--hv-fig-lg); }
.hv-winfig--podium { --_size: var(--hv-fig-xl); }
.hv-winfig--podium1 { --_size: var(--hv-fig-2xl); }
.hv-winfig--card { --_size: var(--hv-fig-2xl); }
.hv-winfig--player { --_size: var(--hv-fig-3xl); }
@container (min-width: 560px) {
  .hv-winfig--card { --_size: var(--hv-fig-3xl); }
  .hv-winfig--toast { --_size: var(--hv-fig-xl); }
}
:is(.hv-winfig--tile, .hv-winfig--toast, .hv-winfig--podium, .hv-winfig--podium1, .hv-winfig--card, .hv-winfig--player)::before {
  content: ""; position: absolute; z-index: -1; inset: -12px -10px; border-radius: 22px; pointer-events: none;
  background: radial-gradient(ellipse 70% 90% at 24% 60%, var(--_aura, transparent), transparent 72%);
}
.hv-winfig[data-dir="flat"]::before { display: none; }
/* states */
.hv-winfig[data-state="nm"] .hv-winfig__fig { font-family: var(--hv-f-body); font-weight: 600; font-size: var(--hv-text-lg); color: var(--hv-ink-3); letter-spacing: 0; }
.hv-winfig[data-state="pending"] .hv-lchip::after { content: " · so far"; }
.hv-winfig[data-state="loading"] .hv-winfig__fig { color: transparent; background: var(--hv-bg-3); min-width: 4.5ch; }
.hv-winfig[data-state="stale"] { filter: saturate(0.35); }
.hv-winfig[data-state="stale"] .hv-lchip::after { content: " · stale"; }

/* the label chip: "since call · now" or "peak". Every big % carries one. Never inside the counting text. */
.hv-lchip {
  display: inline-flex; align-items: center; align-self: center;
  font: 700 0.625rem / 1 var(--hv-f-body); letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 7px; border-radius: var(--hv-r-pill);
  background: var(--hv-bg-4); color: var(--hv-ink-2); white-space: nowrap;
}
.hv-lchip--peak { background: var(--hv-honey-bg); color: var(--hv-honey-2); }
.hv-lchip--exit { background: var(--hv-bg-4); color: var(--hv-exit); }

/* odometer: one column per digit, transform-only roll. The visible glyphs are aria-hidden; a sibling .hv-vh speaks. */
.hv-roll { display: inline-flex; height: 1em; line-height: 1; overflow: hidden; vertical-align: top; }
.hv-roll > span { display: inline-block; height: 1em; }
.hv-roll .hv-dc { display: block; transition: transform var(--hv-dur-roll) var(--hv-ease-out); }
.hv-roll .hv-dc i { display: block; height: 1em; font-style: normal; }
.hv-roll--fast .hv-dc { transition-duration: var(--hv-dur-move); }

/* tick flash (value changed): an overlay fades in and out behind the figure; the glyph never hides */
.hv-flash { position: relative; isolation: isolate; }
.hv-flash::after {
  content: ""; position: absolute; inset: -2px -6px; z-index: -1; border-radius: var(--hv-r-md);
  background: var(--_flash, var(--hv-win-1)); opacity: 0; pointer-events: none;
}
.hv-flash[data-dir="down"] { --_flash: var(--hv-loss); }
.hv-flash.is-flash-a::after { animation: hv-flash-a var(--hv-dur-flash) linear; }
.hv-flash.is-flash-b::after { animation: hv-flash-b var(--hv-dur-flash) linear; }

/* ---------- chips, badges, pills ---------- */
/* interactive chip (filter, sort, toggle): 36 px visual, 44 px target */
.hv-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--hv-s-15);
  min-height: 36px; min-width: var(--hv-tap);
  padding: 0 var(--hv-s-35);
  border-radius: var(--hv-r-pill);
  border: 1px solid var(--hv-line-2);
  background: var(--hv-bg-3);
  color: var(--hv-ink-2);
  font: 600 var(--hv-text-sm) / 1 var(--hv-f-body);
  white-space: nowrap; cursor: pointer;
  transition: background-color var(--hv-dur-hover) var(--hv-ease-out), color var(--hv-dur-hover) var(--hv-ease-out), border-color var(--hv-dur-hover) var(--hv-ease-out);
}
.hv-chip::before { content: ""; position: absolute; inset: -4px 0; }   /* hit area to 44 px */
.hv-chip:hover, .hv-chip.is-hover { background: var(--hv-bg-4); color: var(--hv-ink-1); }
.hv-chip:active, .hv-chip.is-active { transform: translateY(1px); }
.hv-chip[aria-pressed="true"], .hv-chip[aria-checked="true"], .hv-chip[aria-selected="true"] {
  background: var(--hv-honey-bg); border-color: var(--hv-honey-line); color: var(--hv-honey-2);
}
.hv-chip[aria-pressed="true"] > .hv-chip__check, .hv-chip[aria-checked="true"] > .hv-chip__check { display: inline; }
.hv-chip__check { display: none; font-size: 0.9em; }
.hv-chip__dot { width: 9px; height: 9px; border-radius: var(--hv-r-round); background: var(--kc, var(--hv-ink-3)); opacity: 0.35; flex: none; }   /* event-kind filter: --kc = a canvas colour */
.hv-chip[aria-pressed="true"] > .hv-chip__dot { opacity: 1; box-shadow: 0 0 8px var(--kc, transparent); }
.hv-chip__n { font: 500 var(--hv-text-cap) / 1 var(--hv-f-data); color: var(--hv-ink-2); }
.hv-chip[aria-pressed="true"] .hv-chip__n { color: var(--hv-honey-2); }
.hv-chip:disabled, .hv-chip[aria-disabled="true"], .hv-chip.is-disabled { background: var(--hv-bg-2); border-color: var(--hv-line-1); color: var(--hv-ink-4); cursor: not-allowed; transform: none; }
.hv-chips { display: flex; flex-wrap: wrap; gap: var(--hv-s-2); align-items: center; }
.hv-chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-block: 4px; }
.hv-chips--scroll::-webkit-scrollbar { display: none; }
.hv-chips--scroll > * { flex: none; }

/* static badge (a fact, a source, a basis). Not interactive: no hover, no target size. */
.hv-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: var(--hv-r-sm);
  background: var(--hv-bg-3); color: var(--hv-ink-2);
  font: 600 var(--hv-text-cap) / 1.3 var(--hv-f-body);
  white-space: nowrap; max-width: 100%;
}
.hv-badge svg { width: 12px; height: 12px; flex: none; }
.hv-badge--wrap { white-space: normal; }
.hv-badge--hive { background: transparent; color: var(--hv-honey-2); box-shadow: inset 0 0 0 1px var(--hv-honey-line); }
.hv-badge--src { background: transparent; color: var(--hv-ink-2); box-shadow: inset 0 0 0 1px var(--hv-line-2); }
.hv-badge--pf { background: transparent; color: var(--hv-ink-2); box-shadow: inset 0 0 0 1px var(--hv-line-2); }
.hv-badge--fomo { background: transparent; color: var(--hv-ink-2); outline: 1px dashed var(--hv-line-3); outline-offset: -1px; }
/* Rug catcher: coral outline plus the fact in words. Never red, never a verdict. */
.hv-badge--flag { background: var(--hv-flag-bg); color: var(--hv-flag); box-shadow: inset 0 0 0 1px var(--hv-flag-line); white-space: normal; }
.hv-badge--flag b { font-weight: 700; }
/* entity-linked: primary ink, coral outline, link glyph */
.hv-badge--entity { background: transparent; color: var(--hv-ink-1); box-shadow: inset 0 0 0 1px var(--hv-flag-line); }
.hv-badge--entity svg { color: var(--hv-flag); }
.hv-badge--study { background: transparent; color: var(--hv-study); box-shadow: inset 0 0 0 1px currentColor; }
.hv-badge--beta { background: transparent; color: var(--hv-warn); box-shadow: inset 0 0 0 1px var(--hv-warn-line); font-family: var(--hv-f-display); font-weight: 700; letter-spacing: var(--hv-track-caps); text-transform: uppercase; }
.hv-badge--demo { background: transparent; color: var(--hv-honey-2); outline: 1px dashed var(--hv-honey-line); outline-offset: -1px; text-transform: uppercase; letter-spacing: 0.06em; }
/* basis tags on a column head or value: GROSS (tape value) / NET / STUDY / COMPUTED / FILE */
.hv-basis { display: inline-block; padding: 2px 4px 1px; border-radius: var(--hv-r-xs); border: 1px solid currentColor; font: 700 var(--hv-text-cap) / 1 var(--hv-f-display); letter-spacing: var(--hv-track-caps); vertical-align: 1px; color: var(--hv-ink-2); }
.hv-basis[data-basis="gross"] { color: var(--hv-honey-2); }
.hv-basis[data-basis="net"] { color: var(--cls-org); }
.hv-basis[data-basis="study"] { color: var(--hv-study); }
.hv-basis[data-basis="computed"] { color: var(--hv-ink-3); border-style: dashed; }
.hv-basis[data-basis="file"] { color: var(--hv-ink-2); }

/* status pill: health and freshness only (dot + word) */
.hv-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px 3px 7px; border-radius: var(--hv-r-pill);
  font: 700 var(--hv-text-cap) / 1.2 var(--hv-f-display); letter-spacing: var(--hv-track-caps); text-transform: uppercase;
  color: var(--hv-ink-2); background: rgba(113, 105, 94, 0.18); border: 1px solid transparent; white-space: nowrap;
}
.hv-status::before { content: ""; width: 6px; height: 6px; border-radius: var(--hv-r-round); background: currentColor; flex: none; }
.hv-status[data-level="ok"] { color: var(--hv-ok); background: var(--hv-ok-bg); border-color: var(--hv-ok-line); }
.hv-status[data-level="warn"] { color: var(--hv-warn); background: var(--hv-warn-bg); border-color: var(--hv-warn-line); }
.hv-status[data-level="crit"] { color: var(--hv-crit); background: var(--hv-crit-bg); border-color: var(--hv-crit-line); }
.hv-status[data-level="idle"] { color: var(--hv-ink-3); }
.hv-status[data-level="live"] { color: var(--hv-live-ink); background: rgba(255, 47, 109, 0.2); border-color: rgba(255, 47, 109, 0.55); }
.hv-status[data-level="paper"] { color: var(--hv-honey-2); background: var(--hv-honey-bg); border-color: var(--hv-honey-line); }

/* milestone chip: amber when the peak reached it; unlit otherwise. Down milestones use the same chip in the loss tint. */
.hv-mile {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 8px; border-radius: var(--hv-r-pill);
  background: transparent; color: var(--hv-ink-3); box-shadow: inset 0 0 0 1px var(--hv-line-2);   /* unlit: text stays >= 4.5:1 */
  font: 700 var(--hv-text-cap) / 1 var(--hv-f-data); white-space: nowrap;
}
.hv-mile svg { width: 12px; height: 12px; flex: none; }
.hv-mile[data-on="1"] { background: var(--hv-mile-bg); color: var(--hv-mile); box-shadow: inset 0 0 0 1px var(--hv-mile-line); }
.hv-mile[data-on="1"][data-dir="down"] { background: var(--hv-loss-bg); color: var(--hv-loss); box-shadow: inset 0 0 0 1px var(--hv-loss-line); }
.hv-miles { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.hv-miles__cap { font: 500 var(--hv-text-cap) / 1.3 var(--hv-f-body); color: var(--hv-ink-3); }

/* cohort chip: a named data source on a wallet (outline in the cohort colour) */
.hv-cohort {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: var(--hv-r-pill); border: 1px solid currentColor;
  font: 700 var(--hv-text-cap) / 1.3 var(--hv-f-display); letter-spacing: var(--hv-track-caps); text-transform: uppercase;
  color: var(--hv-ink-2); white-space: nowrap;
}
.hv-cohort[data-co="precursor"] { color: var(--hv-co-precursor); }
.hv-cohort[data-co="crew"] { color: var(--hv-co-crew); }
.hv-cohort[data-co="insider"] { color: var(--hv-co-insider); }
.hv-cohort[data-co="wash"] { color: var(--hv-co-wash); border-style: dashed; }

/* chain tag: dot + short name */
.hv-chain { display: inline-flex; align-items: center; gap: 5px; font: 600 var(--hv-text-cap) / 1 var(--hv-f-data); color: var(--hv-ink-2); white-space: nowrap; }
.hv-chain::before { content: ""; width: 8px; height: 8px; border-radius: var(--hv-r-round); background: var(--hv-sol); flex: none; }
.hv-chain[data-chain="rh"]::before { background: var(--hv-rh); }

/* event chip on a toast or alert row */
.hv-ev { display: inline-flex; align-items: center; gap: 4px; font: 700 var(--hv-text-cap) / 1 var(--hv-f-body); padding: 5px 8px; border-radius: var(--hv-r-pill); background: var(--hv-honey-bg); color: var(--hv-honey-2); white-space: nowrap; }
.hv-ev[data-kind="mile-up"] { background: var(--hv-mile-bg); color: var(--hv-mile); }
.hv-ev[data-kind="mile-down"] { background: var(--hv-loss-bg); color: var(--hv-loss); }
.hv-ev[data-kind="flag"] { background: var(--hv-flag-bg); color: var(--hv-flag); }
.hv-ev[data-kind="system"] { background: var(--hv-honey-2); color: var(--hv-on-accent); }
.hv-ev[data-kind="new"] { background: transparent; box-shadow: inset 0 0 0 1px var(--hv-honey-line); }

/* ---------- type helpers used by the components ---------- */
.hv-ticker { margin: 0; font: 700 var(--hv-display-md) / 1 var(--hv-f-display); letter-spacing: var(--hv-track-display); color: var(--hv-ink-1); overflow-wrap: anywhere; }
.hv-age { font: 500 var(--hv-text-xs) / 1 var(--hv-f-data); color: var(--hv-ink-2); white-space: nowrap; }
.hv-eyebrow { font: 600 var(--hv-text-cap) / 1.3 var(--hv-f-body); letter-spacing: 0.07em; text-transform: uppercase; color: var(--hv-ink-2); }
.hv-h2 { margin: 0; font: 700 var(--hv-display-lg) / 1.1 var(--hv-f-display); letter-spacing: var(--hv-track-display); text-wrap: balance; }
.hv-h3 { margin: 0; font: 700 var(--hv-display-md) / 1.15 var(--hv-f-display); letter-spacing: var(--hv-track-display); text-wrap: balance; }
.hv-mc { margin: 0; font: 500 var(--hv-text-sm) / var(--hv-lh-body) var(--hv-f-data); color: var(--hv-ink-2); }
.hv-mc b { color: var(--hv-ink-1); font-weight: 600; }

/* ---------- call card ---------- */
.hv-call {
  position: relative; isolation: isolate;
  display: grid; gap: var(--hv-s-2); min-width: 0;
  padding: var(--hv-s-35);
  background: var(--hv-bg-2);
  border: 1px solid var(--hv-line-1);
  border-radius: var(--hv-r-lg);
  box-shadow: var(--hv-e-1);
  overflow: hidden;
  transition: border-color var(--hv-dur-hover) var(--hv-ease-out);
}
.hv-call:hover, .hv-call.is-hover { border-color: var(--hv-line-2); }
.hv-call:has(.hv-call__open:active), .hv-call.is-active { border-color: var(--hv-honey-line); }
.hv-call:focus-within:has(.hv-call__open:focus-visible) { border-color: var(--hv-honey-line); }
.hv-call.is-open, .hv-call[data-open="1"] { border-color: var(--hv-honey-line); }
.hv-call__head { display: flex; align-items: center; gap: var(--hv-s-15) var(--hv-s-2); flex-wrap: wrap; min-width: 0; }
.hv-call__head .hv-age { margin-left: auto; }
.hv-call__crown { display: inline-flex; align-items: center; gap: 4px; font: 700 var(--hv-text-cap) / 1 var(--hv-f-body); padding: 5px 8px; border-radius: var(--hv-r-pill); background: var(--hv-win-bg); color: var(--hv-win-1); box-shadow: inset 0 0 0 1px var(--hv-win-line); white-space: nowrap; }
.hv-call__hero { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--hv-s-3); min-width: 0; }
.hv-call__hero > :first-child { min-width: 0; }
.hv-call__side { display: grid; justify-items: end; gap: var(--hv-s-1); flex: none; }
.hv-call__peak { margin: 0; font: 500 var(--hv-text-sm) / var(--hv-lh-body) var(--hv-f-data); color: var(--hv-ink-2); }
.hv-call__peak .hv-lchip { margin-right: 6px; }
.hv-call__exit { margin: 0; font: 500 var(--hv-text-xs) / var(--hv-lh-body) var(--hv-f-data); color: var(--hv-ink-2); }
.hv-call__exit b[data-dir="up"] { color: var(--hv-win-1); font-weight: 600; }
.hv-call__exit b[data-dir="down"] { color: var(--hv-loss); font-weight: 600; }
.hv-call__what { margin: 0; font: 400 var(--hv-text-lg) / var(--hv-lh-body) var(--hv-f-body); color: var(--hv-ink-1); max-width: var(--hv-measure); }
.hv-call__facts { display: flex; flex-wrap: wrap; gap: var(--hv-s-15); }
.hv-call__status { display: flex; align-items: center; gap: var(--hv-s-2); font: 500 var(--hv-text-xs) / 1 var(--hv-f-data); color: var(--hv-ink-2); }
.hv-call__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--hv-s-15); }
.hv-call__foot .hv-links { flex: 1; }
/* the whole card opens from one real button (the ticker), stretched over the card; links stay above it */
.hv-call__open { all: unset; cursor: pointer; font: inherit; color: inherit; border-radius: var(--hv-r-sm); }
.hv-call__open::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.hv-call :is(a, button:not(.hv-call__open), .hv-links, .hv-pv) { position: relative; z-index: 1; }
.hv-call__more { display: grid; gap: var(--hv-s-3); padding-top: var(--hv-s-3); border-top: 1px solid var(--hv-line-1); }
/* states */
.hv-call[data-state="graveyard"] { background: var(--hv-bg-1); box-shadow: none; }
.hv-call[data-state="graveyard"] :is(.hv-ticker, .hv-call__what, .hv-winfig, .hv-call__peak) { color: var(--hv-ink-2); }
.hv-call[data-state="graveyard"] .hv-winfig::before { display: none; }
.hv-call[data-state="graveyard"] .hv-range { --_rise: var(--hv-ink-4); --_gap: var(--hv-bg-4); --_peak: var(--hv-ink-4); }
.hv-call[data-state="stale"] .hv-winfig { filter: saturate(0.35); }
.hv-call[data-state="loading"] { pointer-events: none; }
.hv-call[data-state="error"] { border-color: var(--hv-crit-line); }
@container (min-width: 560px) {
  .hv-call { padding: var(--hv-s-4); gap: var(--hv-s-25); }
  .hv-call .hv-ticker { font-size: var(--hv-display-lg); }
}

/* pending ring: redraws once a minute, never tweens */
.hv-pring { width: 18px; height: 18px; flex: none; transform: rotate(-90deg); }
.hv-pring circle { fill: none; stroke-width: 3; }
.hv-pring .bg { stroke: var(--hv-bg-4); }
.hv-pring .fg { stroke: var(--hv-honey); stroke-linecap: round; }
.hv-pring[data-done="1"] .fg { stroke: var(--hv-ink-3); }

/* ---------- progress-to-peak (range) bar ----------
   positions are fractions 0..1 of the track: --call, --now, --peak (and --exit once P5 stores the exit mcap).
   Every marker is a full-width layer moved by transform, so an update never triggers layout. */
.hv-range {
  --_rise: var(--hv-win-1); --_gap: rgba(245, 184, 61, 0.34); --_peak: var(--hv-honey); --_below: var(--hv-loss);
  position: relative; padding: 9px 8px; margin-inline: -8px; overflow: hidden;
}
.hv-range__track { position: relative; height: 6px; border-radius: var(--hv-r-xs); background: var(--hv-bg-3); }
.hv-range__seg { position: absolute; inset: 0; border-radius: var(--hv-r-xs); transform-origin: 0 50%; transition: transform var(--hv-dur-move) var(--hv-ease-out); }
.hv-range__seg--rise { background: var(--_rise); transform: translateX(calc(var(--call) * 100%)) scaleX(calc(var(--now) - var(--call))); }
.hv-range__seg--gap { background: var(--_gap); transform: translateX(calc(var(--now) * 100%)) scaleX(calc(var(--peak) - var(--now))); }
.hv-range__seg--below { background: var(--_below); transform: translateX(calc(var(--now) * 100%)) scaleX(calc(var(--call) - var(--now))); }
.hv-range__mk { position: absolute; inset: 0; pointer-events: none; transition: transform var(--hv-dur-move) var(--hv-ease-out); }
.hv-range__mk > b { position: absolute; left: 0; top: 50%; }
.hv-range__mk--call { transform: translateX(calc(var(--call) * 100%)); }
.hv-range__mk--call > b { width: 2px; height: 16px; margin: -8px 0 0 -1px; background: var(--hv-ink-2); border-radius: 1px; }
.hv-range__mk--peak { transform: translateX(calc(var(--peak) * 100%)); }
.hv-range__mk--peak > b { width: 3px; height: 18px; margin: -9px 0 0 -1.5px; background: var(--_peak); border-radius: 2px; }
.hv-range__mk--now { transform: translateX(calc(var(--now) * 100%)); }
.hv-range__mk--now > b { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: var(--hv-r-round); background: var(--hv-ink-1); box-shadow: 0 0 0 2px var(--hv-bg-2); }
.hv-range__mk--exit { transform: translateX(calc(var(--exit) * 100%)); }
.hv-range__mk--exit > b { width: 10px; height: 10px; margin: -5px 0 0 -5px; transform: rotate(45deg); border: 2px solid var(--hv-exit); background: var(--hv-bg-2); }
.hv-range__mk--peak.is-pop > b { animation: hv-pop var(--hv-dur-flash) var(--hv-ease-snap); }
.hv-range__cap { margin: -2px 0 0; font: 500 var(--hv-text-xs) / 1.4 var(--hv-f-body); color: var(--hv-ink-2); }
.hv-range[data-state="nm"] .hv-range__track { background: repeating-linear-gradient(90deg, var(--hv-bg-3) 0 6px, transparent 6px 10px); }

/* ---------- sparkline (mini mcap since the call) and record bars ---------- */
.hv-spark { display: block; width: 112px; height: 44px; overflow: visible; color: var(--hv-win-1); }
.hv-spark[data-dir="down"] { color: var(--hv-loss); }
.hv-spark[data-win="2"] { color: var(--hv-win-2); } .hv-spark[data-win="3"] { color: var(--hv-win-3); }
.hv-spark[data-win="4"] { color: var(--hv-win-4); } .hv-spark[data-win="5"] { color: var(--hv-win-5); }
.hv-spark .call { stroke: var(--hv-ink-4); stroke-dasharray: 3 3; stroke-width: 1; }
.hv-spark .line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.hv-spark .area { fill: currentColor; opacity: 0.18; }
.hv-spark .peak { fill: var(--hv-honey); }
.hv-spark .now { fill: var(--hv-ink-1); stroke: var(--hv-bg-2); stroke-width: 2; }
.hv-spark[data-state="nm"] .line { stroke: var(--hv-ink-4); stroke-dasharray: 2 4; }
@container (max-width: 359px) { .hv-spark { width: 96px; } }
/* record sparkline: last 12 resolved calls, bar height = peak multiple (log), oldest left */
.hv-rsp { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; }
.hv-rsp i { display: block; width: 5px; min-height: 2px; border-radius: 1px; background: var(--hv-ink-4); height: var(--h, 20%); }
.hv-rsp i[data-k="win"] { background: var(--hv-win-1); }
.hv-rsp i[data-k="big"] { background: var(--hv-win-3); }
.hv-rsp i[data-k="grave"] { background: var(--hv-loss); opacity: 0.7; }

/* ---------- link-out group ---------- */
.hv-links { display: flex; flex-wrap: wrap; gap: var(--hv-s-15); min-width: 0; }
.hv-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--hv-tap); min-width: var(--hv-tap); padding: 0 var(--hv-s-3);
  border-radius: var(--hv-r-md); background: var(--hv-bg-3); border: 1px solid var(--hv-line-1);
  color: var(--hv-ink-1); font: 600 var(--hv-text-sm) / 1 var(--hv-f-body); text-decoration: none; white-space: nowrap;
  transition: background-color var(--hv-dur-hover) var(--hv-ease-out), border-color var(--hv-dur-hover) var(--hv-ease-out);
}
a.hv-link::after { content: "↗"; color: var(--hv-ink-2); font-size: 11px; }
.hv-link svg { width: 16px; height: 16px; flex: none; }
.hv-link:hover, .hv-link.is-hover { background: var(--hv-bg-4); border-color: var(--hv-line-2); }
.hv-link:active, .hv-link.is-active { transform: translateY(1px); }
.hv-link--hive { color: var(--hv-honey-2); border-color: var(--hv-honey-line); }
.hv-link--hive svg { color: var(--hv-honey); }
.hv-link--i { padding: 0; width: var(--hv-tap); font: 600 var(--hv-text-lg) / 1 var(--hv-f-data); }
.hv-link--i[aria-expanded="true"] { background: var(--hv-honey-bg); color: var(--hv-honey-2); border-color: var(--hv-honey-line); }
.hv-link--i::after { content: none !important; }
.hv-link__demo { font: 500 var(--hv-text-cap) / 1 var(--hv-f-body); color: var(--hv-ink-3); }
/* no address yet: never a placeholder link, an inert label says why */
.hv-link--none { background: transparent; border-style: dashed; border-color: var(--hv-line-2); color: var(--hv-ink-3); cursor: default; }
@container (max-width: 359px) { .hv-link { padding: 0 var(--hv-s-25); } }

/* ---------- stat tile ---------- */
.hv-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--hv-s-2); }
@container (min-width: 600px) { .hv-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hv-tile { position: relative; display: grid; gap: 3px; align-content: start; min-width: 0; padding: var(--hv-s-25) var(--hv-s-3); border-radius: var(--hv-r-md); background: var(--hv-bg-2); }
.hv-tile--wide { grid-column: 1 / -1; }
.hv-tile__label { font: 600 var(--hv-text-xs) / 1.3 var(--hv-f-body); color: var(--hv-ink-2); }
.hv-tile__value { font: 600 var(--hv-fig-xl) / 1.1 var(--hv-f-data); font-variant-numeric: tabular-nums; letter-spacing: var(--hv-track-fig); color: var(--hv-ink-1); white-space: nowrap; }
.hv-tile__sub { font: 500 var(--hv-text-cap) / 1.35 var(--hv-f-data); color: var(--hv-ink-2); }
.hv-tile__sub b { color: var(--hv-ink-1); font-weight: 600; }
.hv-tile[data-state="nm"] .hv-tile__value { font: 600 var(--hv-text-lg) / 1.6 var(--hv-f-body); color: var(--hv-ink-3); letter-spacing: 0; }
.hv-tile[data-state="pending"] .hv-tile__value { font: 600 var(--hv-text-lg) / 1.6 var(--hv-f-body); color: var(--hv-ink-2); letter-spacing: 0; }
.hv-tile[data-state="loading"] .hv-tile__value { color: transparent; }
.hv-tile[data-state="loading"] .hv-tile__value, .hv-tile[data-state="loading"] .hv-tile__sub { border-radius: var(--hv-r-xs); background: var(--hv-bg-3); }
.hv-tile[data-state="loading"] .hv-tile__sub { color: transparent; width: 70%; }
/* tiles shrink to one line once the page scrolls under them */
.hv-tiles.is-compact { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: var(--hv-s-4); padding: var(--hv-s-15) var(--hv-s-2); border-radius: var(--hv-r-md); background: var(--hv-bg-2); }
.hv-tiles.is-compact .hv-tile { display: flex; align-items: baseline; gap: 6px; padding: 0; background: none; flex: none; }
.hv-tiles.is-compact .hv-tile__value { font-size: var(--hv-fig-sm); }
.hv-tiles.is-compact .hv-tile__sub { display: none; }

/* ---------- leaderboard row and podium ---------- */
.hv-lb { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--hv-s-2); }
.hv-lb-row {
  position: relative;
  display: grid; grid-template-columns: 28px auto minmax(0, 1fr) auto; align-items: center; gap: var(--hv-s-2) var(--hv-s-25);
  min-height: 56px; padding: var(--hv-s-2) var(--hv-s-2) var(--hv-s-2) var(--hv-s-25);
  border-radius: var(--hv-r-md); background: var(--hv-bg-2); border: 1px solid var(--hv-line-1);
  transition: border-color var(--hv-dur-hover) var(--hv-ease-out);
}
.hv-lb-row:hover, .hv-lb-row.is-hover { border-color: var(--hv-line-2); }
.hv-lb-row.is-followed { border-color: var(--hv-honey-line); }
.hv-lb-row__rank { font: 700 var(--hv-display-md) / 1 var(--hv-f-display); color: var(--hv-ink-2); text-align: center; }
.hv-lb-row__who { display: grid; gap: 3px; min-width: 0; }
.hv-lb-row__name { justify-self: start; display: inline-flex; align-items: center; min-height: var(--hv-tap); padding: 0; border: 0; background: none; color: var(--hv-honey-2); font: 600 var(--hv-text-sm) / 1 var(--hv-f-data); text-decoration: underline; text-decoration-color: var(--hv-honey-line); text-underline-offset: 3px; cursor: pointer; }
.hv-lb-row__name::after { content: ""; position: absolute; inset: 0; }   /* whole row opens the player card */
.hv-lb-row__meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font: 500 var(--hv-text-cap) / 1.3 var(--hv-f-data); color: var(--hv-ink-2); }
.hv-lb-row__val { display: grid; justify-items: end; gap: 2px; }
.hv-lb-row__val small { font: 500 var(--hv-text-cap) / 1.2 var(--hv-f-data); color: var(--hv-ink-2); max-width: 18ch; text-align: right; }
.hv-lb-row__few { font: 600 var(--hv-text-md) / 1.2 var(--hv-f-body); color: var(--hv-ink-3); }
.hv-lb-row__extra { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--hv-s-15); align-items: center; position: relative; z-index: 1; }
.hv-rankchg { font: 700 var(--hv-text-cap) / 1 var(--hv-f-data); padding: 3px 6px; border-radius: var(--hv-r-sm); background: var(--hv-win-bg); color: var(--hv-win-1); }
.hv-rankchg[data-dir="down"] { background: var(--hv-loss-bg); color: var(--hv-loss); }
.hv-lb-row.is-moving { transition: transform var(--hv-dur-roll) var(--hv-ease-inout); }
.hv-lb-note { margin: 0; font: 400 var(--hv-text-xs) / 1.45 var(--hv-f-body); color: var(--hv-ink-2); }

.hv-podium { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: var(--hv-s-2); align-items: end; }
.hv-podium__step { position: relative; min-width: 0; display: grid; gap: 4px; justify-items: center; text-align: center; padding: var(--hv-s-25) var(--hv-s-2); border-radius: var(--hv-r-md); background: var(--hv-bg-2); border: 1px solid var(--hv-line-1); }
.hv-podium__step[data-place="1"] { order: 2; padding-block: var(--hv-s-35); border-color: var(--hv-honey-line); box-shadow: 0 8px 28px rgba(245, 184, 61, 0.10); }
.hv-podium__step[data-place="2"] { order: 1; }
.hv-podium__step[data-place="3"] { order: 3; }
.hv-podium__n { font: 800 var(--hv-text-sm) / 1 var(--hv-f-display); color: var(--hv-ink-3); }
.hv-podium__tk { font: 700 var(--hv-display-sm) / 1 var(--hv-f-display); letter-spacing: var(--hv-track-display); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-podium__m { font: 500 var(--hv-text-cap) / 1.35 var(--hv-f-data); color: var(--hv-ink-2); overflow-wrap: anywhere; }
.hv-podium .hv-winfig { justify-content: center; }
@container (max-width: 359px) { .hv-podium__step { padding-inline: 4px; } .hv-podium .hv-winfig--podium { --_size: var(--hv-fig-lg); } .hv-podium .hv-winfig--podium1 { --_size: var(--hv-fig-xl); } }

/* ---------- player card, ring rule, exposure panel ---------- */
.hv-player { display: grid; gap: var(--hv-s-3); padding: var(--hv-s-35) var(--hv-s-4) var(--hv-s-5); min-width: 0; }
.hv-player__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: var(--hv-s-25); flex-wrap: wrap; padding: var(--hv-s-2) 52px var(--hv-s-2) 0; margin: calc(-1 * var(--hv-s-2)) 0 0; background: var(--hv-glass-solid); }
.hv-player__head .hv-btn--close { position: absolute; top: 0; right: -8px; }
.hv-player__who { display: grid; gap: 3px; min-width: 0; }
.hv-player__who b { font: 600 var(--hv-text-xl) / 1.1 var(--hv-f-data); color: var(--hv-ink-1); overflow-wrap: anywhere; }
.hv-player__who span { font: 400 var(--hv-text-sm) / 1.3 var(--hv-f-body); color: var(--hv-ink-2); }
.hv-player__acts { display: flex; flex-wrap: wrap; gap: var(--hv-s-15); }
.hv-player__hero { display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--hv-s-25) var(--hv-s-35); }
.hv-player__hero p { margin: 0; font: 500 var(--hv-text-sm) / 1.4 var(--hv-f-body); color: var(--hv-ink-2); max-width: 30ch; }
.hv-player__few { font: 700 var(--hv-display-xl) / 1 var(--hv-f-body); color: var(--hv-ink-3); }
.hv-player__line { margin: 0; font: 500 var(--hv-text-sm) / 1.45 var(--hv-f-data); color: var(--hv-ink-2); }
.hv-player__line b { color: var(--hv-ink-1); }
.hv-player__foot { margin: 0; font: 500 var(--hv-text-xs) / 1.4 var(--hv-f-body); color: var(--hv-ink-3); }
.hv-rec { width: 100%; border-collapse: collapse; font: 500 var(--hv-fig-xs) / 1.3 var(--hv-f-data); font-variant-numeric: tabular-nums; }
.hv-rec th { text-align: left; font: 600 var(--hv-text-cap) / 1.2 var(--hv-f-body); color: var(--hv-ink-2); padding: 5px 6px; border-bottom: 1px solid var(--hv-line-2); }
.hv-rec td { padding: 7px 6px; border-bottom: 1px solid var(--hv-line-1); }
.hv-rec td:first-child { font-family: var(--hv-f-body); color: var(--hv-ink-2); }

/* ring rule (7.6): halo = clean record, exposure = any exposure fact >= 20 % (n >= 5) or a linked wallet,
   plain = ranked and low exposure, few = n < 20 or first seen < 14 d. The ring is a record state, never a gain colour. */
.hv-ring { --_d: 40px; position: relative; flex: none; width: var(--_d); height: var(--_d); display: inline-grid; place-items: center; border-radius: var(--hv-r-round); }
.hv-ring::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.hv-ring__ini { font: 700 var(--hv-text-xs) / 1 var(--hv-f-data); color: var(--hv-ink-1); }
.hv-ring--lg { --_d: 56px; }
.hv-ring--sm { --_d: 32px; }
.hv-ring[data-ring="halo"]::before { box-shadow: inset 0 0 0 3px var(--hv-halo), 0 0 12px var(--hv-halo-glow); }
.hv-ring[data-ring="plain"]::before { box-shadow: inset 0 0 0 1.5px var(--hv-ink-4); }
.hv-ring[data-ring="few"]::before { border: 1.5px dashed var(--hv-ink-4); }
.hv-ring[data-ring="exposure"]::before {
  background: conic-gradient(var(--hv-flag) calc(var(--sweep, 20) * 1%), var(--hv-bg-4) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
}
.hv-ring__link { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: var(--hv-r-round); background: var(--hv-flag); color: var(--hv-on-accent); display: grid; place-items: center; box-shadow: 0 0 0 2px var(--hv-bg-2); }
.hv-ring__link svg { width: 9px; height: 9px; }
.hv-ring-note { font: 500 var(--hv-text-xs) / 1.3 var(--hv-f-body); color: var(--hv-ink-2); }
.hv-ring-note[data-ring="exposure"] { color: var(--hv-flag); }
.hv-ring-note[data-ring="halo"] { color: var(--hv-honey-2); }

.hv-exposure { display: grid; gap: var(--hv-s-2); padding: var(--hv-s-3); border-radius: var(--hv-r-md); background: var(--hv-bg-1); border: 1px solid var(--hv-line-1); }
.hv-exposure__h { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.hv-exposure__h h4 { margin: 0; font: 600 var(--hv-text-xs) / 1.3 var(--hv-f-body); letter-spacing: 0.07em; text-transform: uppercase; color: var(--hv-ink-2); }
.hv-exposure__h h4 .hv-br { text-transform: none; letter-spacing: 0; }
.hv-exposure__sum { font: 600 var(--hv-text-xs) / 1.3 var(--hv-f-data); color: var(--hv-ink-1); }
.hv-xrow { display: grid; grid-template-columns: minmax(0, 1fr) 64px 52px; gap: 4px var(--hv-s-2); align-items: center; font: 400 var(--hv-text-sm) / 1.3 var(--hv-f-body); color: var(--hv-ink-1); }
.hv-xrow__bar { grid-column: 1 / -1; display: block; height: 5px; border-radius: var(--hv-r-xs); background: var(--hv-bg-3); overflow: hidden; }
.hv-xrow__bar i { display: block; height: 100%; background: var(--hv-ink-4); transform-origin: 0 50%; transform: scaleX(var(--v, 0)); transition: transform var(--hv-dur-flash) var(--hv-ease-out); }
.hv-xrow__v { font: 600 var(--hv-fig-xs) / 1 var(--hv-f-data); text-align: right; }
.hv-xrow__n { font: 500 var(--hv-text-cap) / 1 var(--hv-f-data); color: var(--hv-ink-2); text-align: right; }
.hv-xrow__src { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font: 400 var(--hv-text-cap) / 1.35 var(--hv-f-body); color: var(--hv-ink-3); }
.hv-xrow[data-hi="1"] .hv-xrow__bar i { background: var(--hv-flag); }
.hv-xrow[data-hi="1"] .hv-xrow__v { color: var(--hv-flag); }
.hv-xrow[data-state="few"] .hv-xrow__bar { background: repeating-linear-gradient(90deg, var(--hv-bg-3) 0 4px, transparent 4px 8px); }
.hv-xrow[data-state="few"] .hv-xrow__bar i { display: none; }
.hv-xrow[data-state="few"] .hv-xrow__v, .hv-xrow[data-state="nm"] .hv-xrow__v { color: var(--hv-ink-3); font-weight: 500; }
.hv-const { display: grid; place-items: center; color: var(--hv-ink-3); font: 500 var(--hv-text-cap) / 1.3 var(--hv-f-body); width: 100%; height: 190px; border-radius: var(--hv-r-md); border: 1px solid var(--hv-line-1); background: radial-gradient(90% 90% at 50% 50%, rgba(245, 184, 61, 0.06), transparent 70%), var(--hv-bg-1); }

/* ---------- tab bars ---------- */
/* phone bottom bar: up to 5 destinations at 390 px (icon 20 + label 11 px sentence case). */
.hv-tabbar {
  display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  padding: 4px 6px env(safe-area-inset-bottom, 0px);
  min-height: calc(58px + env(safe-area-inset-bottom, 0px));
  background: var(--hv-bg-1); border-top: 1px solid var(--hv-line-1);   /* opaque: a sheet slides under it */
}
.hv-tabbar__btn {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 3px;
  min-height: 50px; min-width: 0; padding: 0 2px; border: 0; border-radius: var(--hv-r-md);
  background: transparent; color: var(--hv-ink-2);
  font: 600 var(--hv-text-cap) / 1 var(--hv-f-body); white-space: nowrap; cursor: pointer;
  transition: color var(--hv-dur-hover) var(--hv-ease-out), background-color var(--hv-dur-hover) var(--hv-ease-out);
}
.hv-tabbar__btn svg { width: 20px; height: 20px; }
.hv-tabbar__btn::before { content: ""; position: absolute; top: -4px; left: 30%; right: 30%; height: 2px; border-radius: 0 0 2px 2px; background: var(--hv-honey); transform: scaleX(0); transition: transform var(--hv-dur-enter) var(--hv-ease-out); }
.hv-tabbar__btn:hover, .hv-tabbar__btn.is-hover { color: var(--hv-ink-1); }
.hv-tabbar__btn[aria-selected="true"], .hv-tabbar__btn[aria-current="page"], .hv-tabbar__btn[aria-expanded="true"] { color: var(--hv-honey-2); background: rgba(245, 184, 61, 0.08); }
.hv-tabbar__btn[aria-selected="true"]::before, .hv-tabbar__btn[aria-current="page"]::before { transform: scaleX(1); }
.hv-tabbar__btn:disabled, .hv-tabbar__btn.is-disabled { color: var(--hv-ink-4); cursor: not-allowed; }
.hv-tabbar__alarm { position: absolute; top: 6px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: var(--hv-r-round); background: var(--hv-crit); box-shadow: 0 0 0 2px var(--hv-bg-1); }
.hv-tabbar__count { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; padding: 2px 5px; border-radius: var(--hv-r-pill); background: var(--hv-honey); color: var(--hv-on-accent); font: 700 10px / 1 var(--hv-f-data); }

/* desktop lens bar: one segmented group in the top bar */
.hv-lensbar { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--hv-r-pill); background: var(--hv-bg-2); border: 1px solid var(--hv-line-1); }
.hv-lensbar__btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 var(--hv-s-35); border: 0; border-radius: var(--hv-r-pill);
  background: transparent; color: var(--hv-ink-2);
  font: 700 var(--hv-text-sm) / 1 var(--hv-f-display); letter-spacing: var(--hv-track-caps); text-transform: uppercase; white-space: nowrap; cursor: pointer;
  transition: color var(--hv-dur-hover) var(--hv-ease-out), background-color var(--hv-dur-hover) var(--hv-ease-out);
}
.hv-lensbar__btn::after { content: ""; position: absolute; inset: -4px 0; }   /* 44 px target */
.hv-lensbar__btn:hover, .hv-lensbar__btn.is-hover { color: var(--hv-ink-1); background: var(--hv-bg-3); }
.hv-lensbar__btn[aria-selected="true"], .hv-lensbar__btn[aria-pressed="true"] { background: var(--hv-bg-3); color: var(--hv-honey-2); box-shadow: inset 0 0 0 1px var(--hv-honey-line); }
.hv-lensbar__btn:disabled, .hv-lensbar__btn.is-disabled { color: var(--hv-ink-4); cursor: not-allowed; background: transparent; }
.hv-lensbar__btn .hv-status { padding: 1px 5px; }
.hv-lensbar__btn[data-chain="rh"][aria-pressed="true"] { color: var(--hv-rh); }
.hv-lensbar__btn[data-chain="sol"][aria-pressed="true"] { color: var(--hv-sol); }

/* in-page tabs (Feed · Scoreboard · Who was first · How we measure) */
.hv-tabs { display: flex; gap: 2px var(--hv-s-1); border-bottom: 1px solid var(--hv-line-1); overflow-x: auto; scrollbar-width: none; }   /* never widens the page */
.hv-tabs::-webkit-scrollbar { display: none; }
.hv-tabs__btn { flex: none; min-height: var(--hv-tap); padding: 0 var(--hv-s-25); margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--hv-ink-2); font: 600 var(--hv-text-md) / 1 var(--hv-f-body); white-space: nowrap; cursor: pointer; }
.hv-tabs__btn:hover, .hv-tabs__btn.is-hover { color: var(--hv-ink-1); }
.hv-tabs__btn[aria-selected="true"] { color: var(--hv-ink-1); border-bottom-color: var(--hv-honey); }
.hv-tabs__btn:disabled, .hv-tabs__btn.is-disabled { color: var(--hv-ink-4); cursor: not-allowed; }

/* segmented control (Retail | Operator, Motion Full | Calm | Off) */
.hv-seg { display: flex; gap: 3px; padding: 3px; border-radius: var(--hv-r-md); background: var(--hv-bg-3); }
.hv-seg > button { flex: 1; min-height: 38px; border: 0; border-radius: 8px; background: none; color: var(--hv-ink-2); font: 600 var(--hv-text-sm) / 1 var(--hv-f-body); cursor: pointer; position: relative; }
.hv-seg > button::after { content: ""; position: absolute; inset: -3px 0; }
.hv-seg > button:hover, .hv-seg > button.is-hover { color: var(--hv-ink-1); }
.hv-seg > button[aria-pressed="true"], .hv-seg > button[aria-checked="true"] { background: var(--hv-bg-2); color: var(--hv-ink-1); box-shadow: inset 0 0 0 1px var(--hv-line-2), var(--hv-e-1); }

/* ---------- bottom sheet (phone) / side drawer (desktop) / dialog ---------- */
.hv-sheet {
  --peek: 112px;
  position: fixed; z-index: var(--hv-z-sheet); left: 0; right: 0; bottom: 0;
  height: var(--sheet-max, 92dvh);
  display: flex; flex-direction: column;
  background: var(--hv-glass-solid); border: 1px solid var(--hv-line-1); border-bottom: 0;
  border-radius: var(--hv-r-xl) var(--hv-r-xl) 0 0; box-shadow: var(--hv-e-4);
  transform: translateY(var(--sheet-y, calc(100% - var(--peek))));
  transition: transform var(--hv-dur-sheet) var(--hv-ease-snap);
  will-change: auto; overflow: hidden;
}
.hv-sheet[data-detent="peek"] { --sheet-y: calc(100% - var(--peek)); }
.hv-sheet[data-detent="half"] { --sheet-y: 45%; }
.hv-sheet[data-detent="full"] { --sheet-y: 0px; }
.hv-sheet.is-dragging { transition: none; will-change: transform; }
.hv-sheet__grip { flex: none; display: grid; place-items: center; width: 100%; height: var(--hv-tap); margin: 0 0 -14px; padding: 0; border: 0; background: none; cursor: grab; touch-action: none; }
.hv-sheet__grip i { display: block; width: 42px; height: 4px; border-radius: 2px; background: var(--hv-line-3); }
.hv-sheet__head { flex: none; display: grid; gap: 6px; padding: var(--hv-s-25) var(--hv-s-3) var(--hv-s-25) var(--hv-s-35); border-bottom: 1px solid var(--hv-line-1); }
.hv-sheet__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--hv-s-25) var(--hv-s-25) var(--hv-s-4); display: grid; gap: var(--hv-s-3); align-content: start; }
.hv-sheet[data-detent="peek"] .hv-sheet__body { visibility: hidden; }
.hv-sheet--inline { position: relative; z-index: auto; height: 360px; }   /* gallery / embedded demo */

.hv-drawer {
  position: fixed; z-index: var(--hv-z-drawer);
  top: calc(env(safe-area-inset-top, 0px) + 66px); right: var(--hv-gutter); bottom: var(--hv-gutter);
  width: clamp(360px, 30vw, 440px);
  display: flex; flex-direction: column;
  background: var(--hv-glass-solid); border: 1px solid var(--hv-line-2); border-radius: var(--hv-r-lg); box-shadow: var(--hv-e-3);
  overflow: hidden;
  transition: opacity var(--hv-dur-sheet) var(--hv-ease-out), transform var(--hv-dur-sheet) var(--hv-ease-out);
}
@starting-style { .hv-drawer { opacity: 0; transform: translateX(12px); } }
.hv-drawer.is-closing { opacity: 0; transform: translateX(12px); transition-duration: var(--hv-dur-exit); transition-timing-function: var(--hv-ease-in); }
.hv-drawer__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--hv-s-25); padding: var(--hv-s-35) var(--hv-s-3) var(--hv-s-3) var(--hv-s-4); border-bottom: 1px solid var(--hv-line-1); }
.hv-drawer__title { margin: 0; font: 800 var(--hv-display-md) / 1.05 var(--hv-f-display); letter-spacing: 0.04em; overflow-wrap: anywhere; }
.hv-drawer__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--hv-s-35) var(--hv-s-4) var(--hv-s-5); display: grid; gap: var(--hv-s-4); align-content: start; }
.hv-drawer--inline { position: relative; top: auto; right: auto; bottom: auto; z-index: auto; height: 420px; }

.hv-dialog {
  width: min(560px, 100vw); max-width: 100%; max-height: 92dvh; margin: auto auto 0; padding: 0;
  border: 1px solid var(--hv-line-2); border-radius: var(--hv-r-xl) var(--hv-r-xl) 0 0;
  background: var(--hv-glass-solid); color: var(--hv-ink-1); box-shadow: var(--hv-e-4); overflow: auto; overscroll-behavior: contain;
  transition: transform var(--hv-dur-sheet) var(--hv-ease-out), opacity var(--hv-dur-sheet) var(--hv-ease-out);
}
@starting-style { .hv-dialog[open] { transform: translateY(24px); opacity: 0; } }
.hv-dialog::backdrop { background: var(--hv-scrim); }
@media (min-width: 620px) { .hv-dialog { margin: auto; border-radius: var(--hv-r-xl); } }
.hv-dialog--inline { display: block; position: relative; margin: 0; max-height: none; width: 100%; }

/* ---------- toasts, banner, notes ---------- */
.hv-toasts { position: fixed; z-index: var(--hv-z-toast); top: calc(env(safe-area-inset-top, 0px) + 108px); left: var(--hv-gutter); right: var(--hv-gutter); display: flex; flex-direction: column; gap: var(--hv-s-2); pointer-events: none; }
@media (min-width: 620px) { .hv-toasts { left: auto; width: 360px; } }
.hv-toasts--inline { position: relative; top: auto; left: auto; right: auto; width: auto; z-index: auto; }
.hv-toast {
  pointer-events: auto; position: relative; display: grid; gap: 4px; min-width: 0;
  padding: var(--hv-s-25) var(--hv-s-3) var(--hv-s-3);
  background: var(--hv-glass-solid); border: 1px solid var(--hv-line-2); border-radius: var(--hv-r-lg); box-shadow: var(--hv-e-3);
  overflow: hidden; touch-action: pan-y; cursor: pointer;
  transition: opacity var(--hv-dur-enter) var(--hv-ease-out), transform var(--hv-dur-enter) var(--hv-ease-out);
}
@starting-style { .hv-toast { opacity: 0; transform: translateY(-12px); } }
.hv-toast.is-out { opacity: 0; transform: translateX(24px); transition-duration: var(--hv-dur-exit); transition-timing-function: var(--hv-ease-in); }
.hv-toast.is-out-up { opacity: 0; transform: translateY(-8px); transition-duration: var(--hv-dur-exit); transition-timing-function: var(--hv-ease-in); }
.hv-toast:hover, .hv-toast.is-hover { border-color: var(--hv-line-3); }
.hv-toast__row1 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 7px; min-height: 32px; padding-right: 40px; }
.hv-toast__row1 .hv-ticker { font-size: var(--hv-display-md); }
.hv-toast .hv-btn--close { position: absolute; top: 2px; right: 2px; }
.hv-toast__mc { font: 500 var(--hv-text-xs) / 1.4 var(--hv-f-data); color: var(--hv-ink-2); }
.hv-toast__peak { font: 500 var(--hv-text-xs) / 1.4 var(--hv-f-data); color: var(--hv-ink-2); }
.hv-toast__lat { font: 500 var(--hv-text-xs) / 1.4 var(--hv-f-body); color: var(--hv-ink-2); }
.hv-toast__links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.hv-toast__timer { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--hv-honey); transform-origin: 0 50%; transform: scaleX(var(--left, 1)); }
.hv-toast[data-kind="mile-down"] .hv-toast__timer, .hv-toast[data-kind="flag"] .hv-toast__timer { background: var(--hv-ink-3); }
.hv-toast.is-paused .hv-toast__timer { background: var(--hv-ink-3); }
.hv-toast.is-collapsed :is(.hv-toast__mc, .hv-toast__peak, .hv-toast__links) { display: none; }   /* the latency line stays */
.hv-toasts__more { pointer-events: auto; align-self: flex-end; }

.hv-banner { display: inline-flex; align-items: center; gap: var(--hv-s-25); max-width: calc(100vw - 2 * var(--hv-gutter)); padding: var(--hv-s-2) var(--hv-s-35); border-radius: var(--hv-r-pill); background: rgba(58, 32, 12, 0.94); border: 1px solid var(--hv-warn-line); color: var(--hv-warn-ink); font: 500 var(--hv-text-sm) / 1.35 var(--hv-f-body); box-shadow: var(--hv-e-3); }
.hv-banner::before { content: ""; width: 8px; height: 8px; border-radius: var(--hv-r-round); background: var(--hv-warn); flex: none; }
.hv-banner[data-level="crit"] { background: rgba(62, 14, 22, 0.95); border-color: var(--hv-crit-line); color: var(--hv-crit-ink); }
.hv-banner[data-level="crit"]::before { background: var(--hv-crit); }
.hv-note { margin: 0; padding: var(--hv-s-25) var(--hv-s-3); border-radius: var(--hv-r-md); background: var(--hv-bg-1); border: 1px solid var(--hv-line-1); color: var(--hv-ink-2); font: 400 var(--hv-text-sm) / 1.45 var(--hv-f-body); }
.hv-note[data-level="warn"] { background: var(--hv-warn-bg); border-color: var(--hv-warn-line); color: var(--hv-warn-ink); }
.hv-note[data-level="crit"] { background: var(--hv-crit-bg); border-color: var(--hv-crit-line); color: var(--hv-crit-ink); }
.hv-newpill { display: inline-flex; align-items: center; gap: 6px; min-height: var(--hv-tap); padding: 0 var(--hv-s-4); border: 0; border-radius: var(--hv-r-pill); background: var(--hv-honey); color: var(--hv-on-accent); font: 700 var(--hv-text-sm) / 1 var(--hv-f-body); box-shadow: var(--hv-e-3); cursor: pointer; transition: transform var(--hv-dur-enter) var(--hv-ease-out), opacity var(--hv-dur-enter) var(--hv-ease-out); }
@starting-style { .hv-newpill { transform: translateY(-8px); opacity: 0; } }

/* ---------- empty, not measured, pending, error ---------- */
.hv-empty { display: grid; justify-items: start; gap: var(--hv-s-2); padding: var(--hv-s-4); border-radius: var(--hv-r-lg); border: 1px dashed var(--hv-line-2); background: var(--hv-bg-1); color: var(--hv-ink-2); }
.hv-empty__icon { width: 28px; height: 28px; color: var(--hv-ink-4); }
.hv-empty__title { margin: 0; font: 700 var(--hv-display-sm) / 1.15 var(--hv-f-display); letter-spacing: var(--hv-track-display); color: var(--hv-ink-1); }
.hv-empty__body { margin: 0; font: 400 var(--hv-text-md) / 1.5 var(--hv-f-body); max-width: var(--hv-measure); }
.hv-empty[data-kind="error"] { border-style: solid; border-color: var(--hv-crit-line); }
.hv-empty[data-kind="error"] .hv-empty__icon { color: var(--hv-crit); }
.hv-empty[data-kind="stale"] .hv-empty__icon { color: var(--hv-warn); }
/* n/m inline: a fact ("we don't have this number"), not a warning. Retail reads "not measured", Operator "n/m". */
.hv-nm { display: inline-block; padding: 1px 5px; border-radius: var(--hv-r-xs); border: 1px dashed var(--hv-line-3); color: var(--hv-ink-3); font: 600 var(--hv-text-cap) / 1.3 var(--hv-f-data); white-space: nowrap; }
.hv-pending { display: inline-flex; align-items: center; gap: 6px; font: 500 var(--hv-text-xs) / 1 var(--hv-f-data); color: var(--hv-ink-2); }
.hv-skel { display: block; height: 0.9em; border-radius: var(--hv-r-xs); background: linear-gradient(90deg, var(--hv-bg-3) 0 40%, var(--hv-bg-4) 50%, var(--hv-bg-3) 60% 100%); background-size: 250% 100%; animation: hv-skel 1.4s linear infinite; }

/* ---------- provenance popover ---------- */
.hv-pv { position: relative; cursor: help; text-decoration: underline dotted var(--hv-line-3); text-underline-offset: 3px; background: none; border: 0; padding: 0; color: inherit; font: inherit; }
.hv-pv::after { content: ""; position: absolute; inset: -13px -4px; }   /* 44 px tall target around inline text */
.hv-pv:hover, .hv-pv.is-hover { color: var(--hv-honey-2); }
.hv-prov {
  position: fixed; z-index: var(--hv-z-popover);
  width: min(320px, calc(100vw - 16px)); max-height: 62vh; overflow-y: auto;
  display: grid; gap: var(--hv-s-2); padding: var(--hv-s-3) var(--hv-s-35);
  background: var(--hv-glass-solid); border: 1px solid var(--hv-line-2); border-radius: var(--hv-r-lg); box-shadow: var(--hv-e-3);
  font: 400 var(--hv-text-sm) / 1.45 var(--hv-f-body); color: var(--hv-ink-1);
  transition: opacity var(--hv-dur-enter) var(--hv-ease-out), transform var(--hv-dur-enter) var(--hv-ease-out);
}
@starting-style { .hv-prov { opacity: 0; transform: translateY(4px); } }
.hv-prov--inline { position: relative; z-index: auto; }
.hv-prov__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--hv-s-2); margin: -6px -8px 0 0; }
.hv-prov__label { padding-top: 10px; font: 600 var(--hv-text-xs) / 1.3 var(--hv-f-body); color: var(--hv-ink-2); }
.hv-prov__val { font: 600 var(--hv-fig-md) / 1.2 var(--hv-f-data); color: var(--hv-ink-1); overflow-wrap: anywhere; }
.hv-prov__what { margin: 0; color: var(--hv-ink-1); }
.hv-prov__not { margin: 0; color: var(--hv-ink-2); }
.hv-prov__src { display: grid; gap: 5px; padding-top: var(--hv-s-2); border-top: 1px solid var(--hv-line-1); }
.hv-prov__src p { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--hv-ink-2); font-size: var(--hv-text-xs); }
.hv-prov__src code { font: 500 var(--hv-text-cap) / 1.3 var(--hv-f-data); color: var(--hv-ink-2); }
.hv-prov__foot { margin: 0; font: 400 var(--hv-text-cap) / 1.35 var(--hv-f-data); color: var(--hv-ink-3); }
@media (max-width: 619.98px) {
  .hv-prov:not(.hv-prov--inline) { left: 8px; right: 8px; width: auto; top: auto; bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 8px); }
}

/* ---------- supporting pieces (targets for the style.css migration) ---------- */
/* generic surfaces: .hv-panel (bg-1, sections, scoreboard box) and .hv-card (bg-2, lens cards, list cards) */
.hv-panel { display: grid; gap: var(--hv-s-25); min-width: 0; padding: var(--hv-s-35); border-radius: var(--hv-r-lg); background: var(--hv-bg-1); border: 1px solid var(--hv-line-1); }
.hv-card { display: grid; gap: var(--hv-s-2); min-width: 0; padding: var(--hv-s-3); border-radius: var(--hv-r-md); background: var(--hv-bg-2); border: 1px solid var(--hv-line-1); }
.hv-card[data-state="wait"] { border-style: dashed; }
.hv-card[data-state="stale"] { opacity: 0.6; filter: grayscale(0.75); }
.hv-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 7px; min-width: 0; }
.hv-card__title { margin: 0 4px 0 0; font: 800 var(--hv-text-lg) / 1.15 var(--hv-f-display); letter-spacing: var(--hv-track-caps); text-transform: uppercase; color: var(--hv-ink-1); }
.hv-verdict { margin: 0; font: 400 var(--hv-text-sm) / var(--hv-lh-body) var(--hv-f-body); color: var(--hv-ink-1); text-wrap: pretty; }
.hv-verdict::before { content: "▸ "; color: var(--hv-honey); }
.hv-grave { padding: 4px var(--hv-s-3) var(--hv-s-3); border-radius: var(--hv-r-lg); border: 1px dashed var(--hv-line-2); background: var(--hv-bg-1); }
.hv-grave > summary { min-height: 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; cursor: pointer; list-style: none; }
.hv-grave > summary::-webkit-details-marker { display: none; }
.hv-grave > summary::before { content: "▸"; color: var(--hv-ink-2); }
.hv-grave[open] > summary::before { content: "▾"; }
.hv-menu { display: grid; gap: var(--hv-s-35); width: min(310px, calc(100vw - 32px)); padding: var(--hv-s-35); border-radius: var(--hv-r-lg); background: var(--hv-glass-solid); border: 1px solid var(--hv-line-2); box-shadow: var(--hv-e-3); z-index: var(--hv-z-menu); }
/* utilities for inline figures in tables and lines (same rule as the win figure: up green, down red) */
.hv-up { color: var(--hv-win-1); }
.hv-down { color: var(--hv-loss); }
/* launch-timeline step chip: funded → bought → sold → swept (fact terms; the operator's phase names only in brackets) */
.hv-step { display: inline-block; padding: 2px 7px; border-radius: var(--hv-r-sm); background: rgba(255, 255, 255, 0.05); font: 700 var(--hv-text-cap) / 1.4 var(--hv-f-display); letter-spacing: var(--hv-track-caps); text-transform: uppercase; color: var(--hv-ink-2); white-space: nowrap; }
.hv-step[data-kind="funded"] { color: var(--hv-honey-2); }
.hv-step:is([data-kind="bought"], [data-kind="launch"]) { color: var(--cls-org); }
.hv-step:is([data-kind="sold"], [data-kind="swept"]) { color: var(--cls-op); }
.hv-step[data-kind="rotation"] { color: var(--hv-warn); }
/* data table: real <table>, heads in ink-2 (never ink-4), numbers mono right-aligned with a 12 px gap */
.hv-table { width: 100%; border-collapse: collapse; font: 400 var(--hv-text-sm) / 1.35 var(--hv-f-body); }
.hv-table th { text-align: left; padding: 0 8px 6px 0; border-bottom: 1px solid var(--hv-line-2); font: 700 var(--hv-text-cap) / 1.2 var(--hv-f-display); letter-spacing: var(--hv-track-caps); text-transform: uppercase; color: var(--hv-ink-2); white-space: nowrap; }
.hv-table td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--hv-line-1); vertical-align: middle; }
.hv-table :is(td, th).n { text-align: right; font-family: var(--hv-f-data); font-variant-numeric: tabular-nums; }
.hv-table :is(td, th).n:not(:last-child) { padding-right: 12px; }
.hv-table tr:last-child td { border-bottom: 0; }
.hv-table tbody tr[data-focus] { cursor: pointer; }
.hv-table tbody tr[data-focus]:hover { background: rgba(245, 184, 61, 0.05); }
.hv-table-wrap { overflow-x: auto; }
/* switch: a checkbox with a 44 px label row */
.hv-switch { display: inline-flex; align-items: center; gap: var(--hv-s-25); min-height: var(--hv-tap); font: 600 var(--hv-text-sm) / 1.2 var(--hv-f-body); cursor: pointer; }
.hv-switch input { appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 24px; margin: 0; border-radius: var(--hv-r-pill); background: var(--hv-bg-4); box-shadow: inset 0 0 0 1px var(--hv-line-3); position: relative; cursor: pointer; transition: background-color var(--hv-dur-hover) var(--hv-ease-out); }
.hv-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: var(--hv-r-round); background: var(--hv-ink-2); transition: transform var(--hv-dur-enter) var(--hv-ease-out); }
.hv-switch input:checked { background: var(--hv-honey); box-shadow: none; }
.hv-switch input:checked::after { transform: translateX(18px); background: var(--hv-on-accent); }
.hv-switch input:focus-visible { outline: 2px solid var(--hv-focus); outline-offset: 2px; }
.hv-switch input:disabled { opacity: 0.45; cursor: not-allowed; }
.hv-note[data-level="accent"] { background: var(--hv-honey-bg); border-color: rgba(245, 184, 61, 0.25); color: var(--hv-honey-2); }

/* ---------- results block (winners first, losers in the same block) ---------- */
.hv-results { position: relative; overflow: hidden; display: grid; gap: var(--hv-s-25); padding: var(--hv-s-4) var(--hv-s-35); border-radius: var(--hv-r-lg); border: 1px solid var(--hv-honey-line); background: radial-gradient(120% 90% at 0% 0%, rgba(61, 255, 154, 0.07), transparent 60%), var(--hv-bg-1); }
.hv-results__h { margin: 0; font: 800 var(--hv-display-xl) / 1.05 var(--hv-f-display); letter-spacing: 0.02em; text-wrap: balance; }
.hv-results__h .hv-winfig__fig { font-size: 1.1em; }
.hv-results__line { margin: 0; font: 500 var(--hv-text-md) / 1.45 var(--hv-f-data); color: var(--hv-ink-2); }
.hv-results__line b { color: var(--hv-ink-1); }
.hv-results__q { margin: 0; font: 500 var(--hv-text-xs) / 1.45 var(--hv-f-data); color: var(--hv-ink-2); }

/* ------------------------------------------------------------------------------------------------ motion */
/* motion (no @layer: unlayered so class rules beat element resets such as style.css "button { color: inherit }") */
@keyframes hv-flash-a { 0%, 100% { opacity: 0; } 30% { opacity: 0.28; } }
@keyframes hv-flash-b { 0%, 100% { opacity: 0; } 30% { opacity: 0.28; } }   /* twin so a second tick restarts the animation */
@keyframes hv-pop { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.06); } }
@keyframes hv-tick-pop { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.04); } }
@keyframes hv-sweep { 0% { transform: translateX(-100%); opacity: 1; } 100% { transform: translateX(100%); opacity: 1; } }
@keyframes hv-burst { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes hv-live { 0% { transform: scale(1); } 40% { transform: scale(1.8); opacity: 0.5; } 100% { transform: scale(1); } }
@keyframes hv-marquee { to { transform: translateX(-50%); } }
@keyframes hv-spin { to { transform: rotate(360deg); } }
@keyframes hv-skel { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* card entrance (a new call while the viewer is at the top) */
.hv-enter { transition: opacity var(--hv-dur-sheet) var(--hv-ease-out), transform var(--hv-dur-sheet) var(--hv-ease-out); }
@starting-style { .hv-enter { opacity: 0; transform: translateY(8px); } }

/* milestone moment on a card: one sweep across, one burst ring behind the hero, one pop on the chip. Down = same, loss tint. */
.hv-sweep { position: relative; isolation: isolate; }
.hv-sweep::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transform: translateX(-100%);
  background: linear-gradient(105deg, transparent 35%, var(--_sw, rgba(61, 255, 154, 0.14)) 50%, transparent 65%); }
.hv-sweep[data-dir="down"] { --_sw: rgba(255, 107, 87, 0.14); }
.hv-sweep.is-sweep::before { animation: hv-sweep var(--hv-dur-sweep) var(--hv-ease-out); }
.hv-burst { position: absolute; left: 18%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; z-index: -1; border-radius: var(--hv-r-round); border: 3px solid var(--hv-win-3); opacity: 0; pointer-events: none; }
.hv-burst[data-dir="down"] { border-color: var(--hv-loss); }
.is-burst > .hv-burst, .hv-burst.is-burst { animation: hv-burst var(--hv-dur-count) var(--hv-ease-out); }
.hv-mile.is-pop, .hv-ev.is-pop { animation: hv-pop var(--hv-dur-flash) var(--hv-ease-snap); }
.hv-winfig.is-tick .hv-winfig__fig { animation: hv-tick-pop var(--hv-dur-flash) var(--hv-ease-out); }

/* latest-calls tape (optional): one layer, pauses on hover / focus / touch / hidden tab (WCAG 2.2.2 needs the pause button too) */
.hv-tape { overflow: hidden; }
.hv-tape__in { display: flex; width: max-content; animation: hv-marquee 40s linear infinite; }
.hv-tape:is(:hover, :focus-within, .is-paused) .hv-tape__in { animation-play-state: paused; }

/* Calm: attention effects off, state motion stays */
:is(html, body)[data-motion="calm"] .hv-flash::after,
:is(html, body)[data-motion="calm"] .hv-sweep::before,
:is(html, body)[data-motion="calm"] .hv-live::before,
:is(html, body)[data-motion="calm"] :is(.hv-burst, .hv-mile, .hv-ev, .hv-winfig__fig, .hv-range__mk > b) { animation: none !important; }
:is(html, body)[data-motion="calm"] .hv-tape__in { animation: none; }
:is(html, body)[data-motion="calm"] .hv-tape { overflow-x: auto; }
/* Off (and legacy "reduced"): nothing moves; a changed value shows a static tint for 1 s (JS removes .is-flash-*) */
:is(html, body):is([data-motion="off"], [data-motion="reduced"]) *,
:is(html, body):is([data-motion="off"], [data-motion="reduced"]) *::before,
:is(html, body):is([data-motion="off"], [data-motion="reduced"]) *::after { animation: none !important; transition: none !important; }
:is(html, body):is([data-motion="off"], [data-motion="reduced"]) :is(.hv-flash.is-flash-a, .hv-flash.is-flash-b)::after { opacity: 0.2; }
:is(html, body):is([data-motion="off"], [data-motion="reduced"]) .hv-tape { overflow-x: auto; }
:is(html, body):is([data-motion="off"], [data-motion="reduced"]) .hv-skel { background: var(--hv-bg-3); }
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]):not([data-motion="calm"]) *,
  :root:not([data-motion="full"]):not([data-motion="calm"]) *::before,
  :root:not([data-motion="full"]):not([data-motion="calm"]) *::after { animation: none !important; transition: none !important; }
  :root:not([data-motion="full"]):not([data-motion="calm"]) :is(.hv-flash.is-flash-a, .hv-flash.is-flash-b)::after { opacity: 0.2; }
  :root:not([data-motion="full"]):not([data-motion="calm"]) .hv-tape { overflow-x: auto; }
  :root:not([data-motion="full"]):not([data-motion="calm"]) .hv-skel { background: var(--hv-bg-3); }
}

/* phones: no backdrop blur over the live canvas (it re-blurs every frame); desktop glass may blur */
.hv-glass { background: var(--hv-glass-solid); }
@media (min-width: 1024px) {
  .hv-glass { background: var(--hv-glass); -webkit-backdrop-filter: blur(var(--hv-blur)) saturate(1.1); backdrop-filter: blur(var(--hv-blur)) saturate(1.1); }
}
