/* ==========================================================================
   Headcount: civic picture-statistics system
   Flat screenprint. Ink on cream. One coral sun. Everything stands on the groundline.
   Fonts: Gabarito (display, numerals, labels) + Work Sans (body, UI, tables)
   Icons: Phosphor Icons, Fill weight only
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Gabarito:wght@600;700;800;900&family=Work+Sans:wght@400;500;600;700&display=swap");
@import url("https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.2/src/fill/style.css");

:root {
  /* ---- Colour: grounds ---- */
  --hc-paper: #F1E6D0;          /* primary page ground */
  --hc-paper-raised: #F8F1E3;   /* fields, table rows, raised surfaces */
  --hc-sage: #DEE2D6;           /* alternate frieze ground */

  /* ---- Colour: ink ---- */
  --hc-ink: #141412;            /* text, glyphs, groundlines, primary buttons */
  --hc-ink-muted: #4F4E49;      /* secondary text, captions (AA on paper and sage) */
  --hc-slate: #6B6A64;          /* de-emphasised remainder units (graphic only) */

  /* ---- Colour: signal ---- */
  --hc-coral: #E8735A;          /* key action fill, highlighted units, sun */
  --hc-coral-deep: #A63F2A;     /* coral as text/links on cream */
  --hc-straw: #D9B26A;          /* pending / lost / secondary units */
  --hc-error: #A63F2A;          /* errors reuse coral-deep, always with ink icon + text */

  /* ---- Semantic aliases ---- */
  --hc-bg: var(--hc-paper);
  --hc-surface: var(--hc-paper-raised);
  --hc-text: var(--hc-ink);
  --hc-text-muted: var(--hc-ink-muted);
  --hc-on-ink: var(--hc-paper);
  --hc-on-coral: var(--hc-ink);
  --hc-focus: var(--hc-coral);

  /* ---- Unit states (picture statistics) ---- */
  --hc-unit-highlight: var(--hc-coral);
  --hc-unit-base: var(--hc-ink);
  --hc-unit-remainder: var(--hc-slate);
  --hc-unit-pending: var(--hc-straw);
  --hc-unit-lost-opacity: 0.45;

  /* ---- Typography ---- */
  --hc-font-display: "Gabarito", "Futura", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  --hc-font-body: "Work Sans", "Helvetica Neue", Arial, system-ui, sans-serif;

  --hc-text-display: clamp(3.5rem, 2.2rem + 5vw, 6.5rem);   /* 56 → 104 */
  --hc-text-h1: clamp(2.75rem, 1.9rem + 3.4vw, 4.5rem);     /* 44 → 72 */
  --hc-text-h2: clamp(2rem, 1.5rem + 2vw, 3rem);            /* 32 → 48 */
  --hc-text-h3: 1.75rem;                                     /* 28 */
  --hc-text-h4: 1.25rem;                                     /* 20 */
  --hc-text-stat: clamp(4rem, 3rem + 4vw, 6rem);             /* 64 → 96 */
  --hc-text-stat-sm: 3rem;                                   /* 48 */
  --hc-text-body-lg: 1.25rem;                                /* 20 */
  --hc-text-body: 1.0625rem;                                 /* 17 */
  --hc-text-body-sm: 0.9375rem;                              /* 15 */
  --hc-text-label: 0.8125rem;                                /* 13 */
  --hc-text-micro: 0.75rem;                                  /* 12 */

  --hc-leading-display: 0.92;
  --hc-leading-heading: 1.05;
  --hc-leading-body: 1.55;
  --hc-tracking-display: -0.02em;
  --hc-tracking-label: 0.08em;

  /* ---- Spacing (8px base) ---- */
  --hc-space-1: 4px;
  --hc-space-2: 8px;
  --hc-space-3: 12px;
  --hc-space-4: 16px;
  --hc-space-5: 24px;
  --hc-space-6: 32px;
  --hc-space-7: 48px;
  --hc-space-8: 64px;
  --hc-space-9: 96px;
  --hc-space-10: 128px;
  --hc-frieze-gap: clamp(64px, 4rem + 4vw, 128px);

  /* ---- Grid ---- */
  --hc-container: 1360px;
  --hc-margin: clamp(24px, 6vw, 96px);
  --hc-gutter: 24px;
  --hc-columns: 12;

  /* ---- Structure: rules and bars (the only "depth") ---- */
  --hc-groundline: 10px;       /* signature bar */
  --hc-bar: 4px;               /* nav rule, stat bar, focused field */
  --hc-rule: 2px;              /* headers, outlines, field bottoms */
  --hc-hairline: 1.5px;        /* table rows, secondary rules */

  /* ---- Radius ---- */
  --hc-radius-none: 0;
  --hc-radius-field: 2px;      /* inputs only */
  --hc-radius-disk: 9999px;    /* the sun and glyph geometry only */

  /* ---- Elevation: none. Declared so no one invents one. ---- */
  --hc-shadow: none;

  /* ---- Focus ---- */
  --hc-focus-ring: 3px solid var(--hc-coral);
  --hc-focus-offset: 2px;

  /* ---- Pictogram units ---- */
  --hc-unit-size: 30px;
  --hc-unit-gap: 10px;

  /* ---- Motion: mechanical, short ---- */
  --hc-ease: cubic-bezier(0.2, 0, 0, 1);
  --hc-dur: 140ms;

  /* ---- Screenprint grain (illustration fills only) ---- */
  --hc-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.08  0 0 0 0 0.07  0 0 0 1.4 -0.55'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ==========================================================================
   Base
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--hc-bg);
  color: var(--hc-text);
  font-family: var(--hc-font-body);
  font-size: var(--hc-text-body);
  line-height: var(--hc-leading-body);
  font-feature-settings: "tnum" 1, "lnum" 1;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--hc-font-display);
  font-weight: 800;
  line-height: var(--hc-leading-heading);
  letter-spacing: var(--hc-tracking-display);
  color: var(--hc-ink);
  text-wrap: balance;
}
h1 { font-size: var(--hc-text-h1); }
h2 { font-size: var(--hc-text-h2); }
h3 { font-size: var(--hc-text-h3); font-weight: 700; letter-spacing: -0.01em; }
h4 { font-size: var(--hc-text-h4); font-weight: 700; letter-spacing: 0; }

p { margin: 0; max-width: 62ch; text-wrap: pretty; }

a {
  color: var(--hc-coral-deep);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { color: var(--hc-ink); }

:focus-visible {
  outline: var(--hc-focus-ring);
  outline-offset: var(--hc-focus-offset);
}

::selection { background: var(--hc-coral); color: var(--hc-ink); }

.hc-display {
  font-family: var(--hc-font-display);
  font-size: var(--hc-text-display);
  font-weight: 900;
  line-height: var(--hc-leading-display);
  letter-spacing: var(--hc-tracking-display);
}

.hc-lede {
  font-size: var(--hc-text-body-lg);
  line-height: 1.5;
  color: var(--hc-ink);
  max-width: 46ch;
}

.hc-label {
  font-family: var(--hc-font-display);
  font-size: var(--hc-text-label);
  font-weight: 700;
  letter-spacing: var(--hc-tracking-label);
  text-transform: uppercase;
  line-height: 1.2;
}

.hc-caption {
  font-size: var(--hc-text-body-sm);
  color: var(--hc-text-muted);
  line-height: 1.45;
}

.hc-num {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.hc-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   Layout: container, 12-col grid, friezes
   ========================================================================== */

.hc-container {
  width: 100%;
  max-width: calc(var(--hc-container) + var(--hc-margin) * 2);
  margin-inline: auto;
  padding-inline: var(--hc-margin);
}

.hc-grid {
  display: grid;
  grid-template-columns: repeat(var(--hc-columns), minmax(0, 1fr));
  column-gap: var(--hc-gutter);
  row-gap: var(--hc-space-7);
}

.hc-stack { display: flex; flex-direction: column; gap: var(--hc-space-5); }
.hc-stack--tight { gap: var(--hc-space-3); }
.hc-stack--loose { gap: var(--hc-space-7); }
.hc-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--hc-space-4); }

/* A frieze is a full-width horizontal band. Friezes alternate paper and sage. */
.hc-frieze {
  position: relative;
  padding-block: var(--hc-frieze-gap);
  background: var(--hc-paper);
}
.hc-frieze--sage { background: var(--hc-sage); }
.hc-frieze--raised { background: var(--hc-paper-raised); }
.hc-frieze--ink { background: var(--hc-ink); color: var(--hc-paper); }
.hc-frieze--ink h1,
.hc-frieze--ink h2,
.hc-frieze--ink h3 { color: var(--hc-paper); }
.hc-frieze--flush-bottom { padding-bottom: 0; }

/* Panoramic frieze: art anchored in the left third, calm field on the right */
.hc-frieze__art { grid-column: 1 / span 5; align-self: end; position: relative; }
.hc-frieze__copy { grid-column: 7 / span 6; align-self: center; }
.hc-frieze--reverse .hc-frieze__art { grid-column: 8 / span 5; order: 2; }
.hc-frieze--reverse .hc-frieze__copy { grid-column: 1 / span 6; order: 1; }

@media (max-width: 900px) {
  .hc-frieze__art,
  .hc-frieze__copy,
  .hc-frieze--reverse .hc-frieze__art,
  .hc-frieze--reverse .hc-frieze__copy { grid-column: 1 / -1; order: 0; }
  :root { --hc-groundline: 8px; --hc-unit-size: 26px; --hc-unit-gap: 8px; }
}

/* ==========================================================================
   Signature: the groundline and the sun
   ========================================================================== */

.hc-groundline {
  display: block;
  height: var(--hc-groundline);
  background: var(--hc-ink);
  border: 0;
  margin: 0;
  width: 100%;
  position: relative;
  z-index: 2;
}
.hc-groundline--bleed {
  width: auto;
  margin-inline: calc(var(--hc-margin) * -1);
}

/* Anything that "stands" on the line: content bottom sits flush on the bar */
.hc-stands {
  position: relative;
  border-bottom: var(--hc-groundline) solid var(--hc-ink);
}

/* Hero sun: a coral half-disk sunk behind the groundline. Place inside a positioned parent
   whose bottom edge is the groundline. Size via --sun. */
.hc-sun {
  --sun: 280px;
  position: absolute;
  bottom: 0;
  left: var(--sun-x, 50%);
  width: var(--sun);
  height: calc(var(--sun) / 2);
  transform: translateX(-50%);
  background: var(--hc-coral);
  border-radius: var(--sun) var(--sun) 0 0;
  z-index: 0;
  pointer-events: none;
}

/* Small echo of the sun: a bullet / marker */
.hc-sun-marker {
  display: inline-block;
  width: 12px;
  height: 6px;
  background: var(--hc-coral);
  border-radius: 12px 12px 0 0;
  border-bottom: 2px solid var(--hc-ink);
  box-sizing: content-box;
  flex: none;
}

.hc-list-sun {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--hc-space-3);
}
.hc-list-sun > li {
  display: grid;
  grid-template-columns: 12px 1fr;
  column-gap: var(--hc-space-3);
  align-items: baseline;
}
.hc-list-sun > li::before {
  content: "";
  width: 12px;
  height: 6px;
  background: var(--hc-coral);
  border-radius: 12px 12px 0 0;
  border-bottom: 2px solid var(--hc-ink);
  box-sizing: content-box;
  transform: translateY(-2px);
}

/* Section header: heading standing on a groundline, supporting text below the line */
.hc-section-head {
  display: grid;
  gap: var(--hc-space-4);
  margin-bottom: var(--hc-space-8);
}
.hc-section-head__title {
  padding-bottom: var(--hc-space-4);
  border-bottom: var(--hc-groundline) solid var(--hc-ink);
}
.hc-section-head p { color: var(--hc-ink); font-size: var(--hc-text-body-lg); max-width: 56ch; }

/* ==========================================================================
   Illustration frame: the only place grain is allowed
   ========================================================================== */

.hc-illus {
  position: relative;
  margin: 0;
  isolation: isolate;
}
.hc-illus img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}
.hc-illus--panorama { aspect-ratio: 2 / 1; }
.hc-illus--wide { aspect-ratio: 21 / 9; }
.hc-illus--square { aspect-ratio: 1 / 1; }
.hc-illus--grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: var(--hc-grain);
  mix-blend-mode: multiply;
  opacity: 0.35;
  pointer-events: none;
}
/* Illustration that stands on the groundline */
.hc-illus--grounded { border-bottom: var(--hc-groundline) solid var(--hc-ink); }

/* ==========================================================================
   Navigation
   ========================================================================== */

.hc-nav {
  background: var(--hc-paper);
  border-bottom: var(--hc-bar) solid var(--hc-ink);
}
.hc-nav__inner {
  display: flex;
  align-items: center;
  gap: var(--hc-space-6);
  min-height: 64px;
}
.hc-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--hc-space-3);
  color: var(--hc-ink);
  text-decoration: none;
  font-family: var(--hc-font-display);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}
.hc-brand svg { width: 30px; height: 30px; flex: none; }
.hc-nav__links {
  display: flex;
  gap: var(--hc-space-6);
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}
.hc-nav__link {
  font-family: var(--hc-font-display);
  font-size: var(--hc-text-label);
  font-weight: 700;
  letter-spacing: var(--hc-tracking-label);
  text-transform: uppercase;
  color: var(--hc-ink);
  text-decoration: none;
  padding-block: 22px 18px;
  border-bottom: 4px solid transparent;
}
.hc-nav__link:hover { border-bottom-color: var(--hc-ink); color: var(--hc-ink); }
.hc-nav__link[aria-current="page"] { border-bottom-color: var(--hc-coral); }

@media (max-width: 760px) {
  .hc-nav__links { display: none; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.hc-btn {
  --btn-bg: var(--hc-ink);
  --btn-fg: var(--hc-paper);
  --btn-border: var(--hc-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hc-space-2);
  min-height: 48px;
  padding: 0 var(--hc-space-5);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: var(--hc-rule) solid var(--btn-border);
  border-radius: 0;
  font-family: var(--hc-font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--hc-dur) var(--hc-ease), color var(--hc-dur) var(--hc-ease), border-color var(--hc-dur) var(--hc-ease);
}
.hc-btn i { font-size: 1.125rem; }
.hc-btn:hover { --btn-bg: var(--hc-coral); --btn-fg: var(--hc-ink); --btn-border: var(--hc-ink); color: var(--btn-fg); }
.hc-btn:active { transform: translateY(1px); }
.hc-btn:focus-visible { outline: var(--hc-focus-ring); outline-offset: var(--hc-focus-offset); }

/* The single key action per view */
.hc-btn--key { --btn-bg: var(--hc-coral); --btn-fg: var(--hc-ink); --btn-border: var(--hc-coral); }
.hc-btn--key:hover { --btn-bg: var(--hc-ink); --btn-fg: var(--hc-paper); --btn-border: var(--hc-ink); }

.hc-btn--secondary { --btn-bg: transparent; --btn-fg: var(--hc-ink); --btn-border: var(--hc-ink); }
.hc-btn--secondary:hover { --btn-bg: var(--hc-ink); --btn-fg: var(--hc-paper); }

.hc-btn--text {
  --btn-bg: transparent; --btn-fg: var(--hc-ink); --btn-border: transparent;
  padding-inline: 0;
  min-height: 40px;
  border-width: 0 0 var(--hc-rule) 0;
  border-bottom-color: var(--hc-ink);
}
.hc-btn--text:hover { --btn-bg: transparent; --btn-fg: var(--hc-coral-deep); border-bottom-color: var(--hc-coral); }

.hc-btn--sm { min-height: 36px; padding-inline: var(--hc-space-4); font-size: var(--hc-text-label); }
.hc-btn--lg { min-height: 56px; padding-inline: var(--hc-space-6); font-size: 1rem; }

.hc-btn:disabled,
.hc-btn[aria-disabled="true"] {
  --btn-bg: var(--hc-sage); --btn-fg: var(--hc-ink-muted); --btn-border: var(--hc-slate);
  cursor: not-allowed;
}

/* On an ink frieze, primary inverts */
.hc-frieze--ink .hc-btn:not(.hc-btn--key) { --btn-bg: var(--hc-paper); --btn-fg: var(--hc-ink); --btn-border: var(--hc-paper); }
.hc-frieze--ink .hc-btn:not(.hc-btn--key):hover { --btn-bg: var(--hc-coral); --btn-border: var(--hc-coral); }

/* ==========================================================================
   Form fields
   ========================================================================== */

.hc-field { display: grid; gap: var(--hc-space-2); }
.hc-field__label {
  font-family: var(--hc-font-display);
  font-size: var(--hc-text-micro);
  font-weight: 700;
  letter-spacing: var(--hc-tracking-label);
  text-transform: uppercase;
  color: var(--hc-ink);
}
.hc-field__hint { font-size: var(--hc-text-body-sm); color: var(--hc-text-muted); }
.hc-field__error {
  display: flex; align-items: center; gap: var(--hc-space-2);
  font-size: var(--hc-text-body-sm); font-weight: 600; color: var(--hc-error);
}

.hc-input,
.hc-select,
.hc-textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px 10px;
  background: var(--hc-paper-raised);
  color: var(--hc-ink);
  border: 0;
  border-bottom: var(--hc-rule) solid var(--hc-ink);
  border-radius: var(--hc-radius-field) var(--hc-radius-field) 0 0;
  font-family: var(--hc-font-body);
  font-size: var(--hc-text-body);
  font-variant-numeric: tabular-nums;
  transition: border-bottom-width var(--hc-dur) var(--hc-ease), padding-bottom var(--hc-dur) var(--hc-ease);
}
.hc-input::placeholder,
.hc-textarea::placeholder { color: var(--hc-ink-muted); opacity: 1; }
.hc-input:focus,
.hc-select:focus,
.hc-textarea:focus {
  outline: none;
  border-bottom-width: var(--hc-bar);
  padding-bottom: 8px;
}
.hc-input:focus-visible,
.hc-select:focus-visible,
.hc-textarea:focus-visible {
  outline: var(--hc-focus-ring);
  outline-offset: var(--hc-focus-offset);
}
.hc-input[aria-invalid="true"] { border-bottom-color: var(--hc-error); }
.hc-textarea { min-height: 128px; resize: vertical; }
.hc-select {
  appearance: none;
  padding-right: 40px;
}
/* Wrap selects so the solid ink triangle marker can sit on top */
.hc-select-wrap { position: relative; display: block; }
.hc-select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 12px;
  height: 7px;
  margin-top: -3px;
  background: var(--hc-ink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}

/* Checkbox and radio: square ink box, coral fill when on */
.hc-check {
  display: inline-flex;
  align-items: center;
  gap: var(--hc-space-3);
  cursor: pointer;
  font-size: var(--hc-text-body);
}
.hc-check input {
  appearance: none;
  margin: 0;
  width: 22px;
  height: 22px;
  flex: none;
  background: var(--hc-paper-raised);
  border: var(--hc-rule) solid var(--hc-ink);
  border-radius: 0;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.hc-check input::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--hc-ink);
  transform: scale(0);
  transition: transform var(--hc-dur) var(--hc-ease);
}
.hc-check input:checked { background: var(--hc-coral); }
.hc-check input:checked::before { transform: scale(1); }
.hc-check input[type="radio"] { border-radius: 50%; }
.hc-check input[type="radio"]::before { border-radius: 50%; }
.hc-check input:focus-visible { outline: var(--hc-focus-ring); outline-offset: var(--hc-focus-offset); }

/* ==========================================================================
   Tabs and filters
   ========================================================================== */

.hc-tabs {
  display: flex;
  gap: var(--hc-space-6);
  border-bottom: var(--hc-rule) solid var(--hc-ink);
  overflow-x: auto;
}
.hc-tab {
  appearance: none;
  background: none;
  border: 0;
  margin: 0 0 calc(var(--hc-rule) * -1);
  padding: var(--hc-space-3) 0 var(--hc-space-3);
  border-bottom: 6px solid transparent;
  font-family: var(--hc-font-display);
  font-size: var(--hc-text-label);
  font-weight: 700;
  letter-spacing: var(--hc-tracking-label);
  text-transform: uppercase;
  color: var(--hc-ink-muted);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--hc-space-2);
}
.hc-tab:hover { color: var(--hc-ink); border-bottom-color: var(--hc-ink); }
.hc-tab[aria-selected="true"],
.hc-tab[aria-pressed="true"] { color: var(--hc-ink); border-bottom-color: var(--hc-coral); }
.hc-tab__count { font-family: var(--hc-font-body); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* Filter group: same grammar, tighter, for dashboards */
.hc-filters { gap: var(--hc-space-5); }

/* ==========================================================================
   Pictogram unit row: the core data component
   ========================================================================== */

.hc-pictogram { display: grid; gap: var(--hc-space-3); }

.hc-pictogram__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--hc-space-4);
}
.hc-pictogram__name { font-family: var(--hc-font-display); font-weight: 700; font-size: var(--hc-text-h4); }
.hc-pictogram__value {
  font-family: var(--hc-font-display);
  font-weight: 800;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.hc-units {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--hc-unit-gap);
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
  border-bottom: var(--hc-groundline) solid var(--hc-ink);
}
.hc-units--nowrap { flex-wrap: nowrap; overflow: hidden; }

.hc-unit {
  display: block;
  width: var(--hc-unit-size);
  height: var(--hc-unit-size);
  font-size: var(--hc-unit-size);
  line-height: 1;
  color: var(--hc-unit-base);
  overflow: hidden;
  flex: none;
}
.hc-unit > i { display: block; width: var(--hc-unit-size); }
.hc-unit--highlight { color: var(--hc-unit-highlight); }
.hc-unit--remainder { color: var(--hc-unit-remainder); }
.hc-unit--pending { color: var(--hc-unit-pending); }
.hc-unit--lost { color: var(--hc-unit-pending); opacity: var(--hc-unit-lost-opacity); }
/* Fractional last glyph: set --fraction (0–1). The glyph is clipped, never scaled. */
.hc-unit--partial { width: calc(var(--hc-unit-size) * var(--fraction, 0.5)); }

.hc-units--lg { --hc-unit-size: 44px; --hc-unit-gap: 12px; }
.hc-units--sm { --hc-unit-size: 22px; --hc-unit-gap: 6px; padding-bottom: 4px; border-bottom-width: 6px; }

/* Legend: "one figure = 1,000 residents" plus state keys */
.hc-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hc-space-2) var(--hc-space-5);
  font-size: var(--hc-text-body-sm);
  color: var(--hc-ink);
  margin: 0;
  padding: 0;
  list-style: none;
}
.hc-legend__item { display: inline-flex; align-items: center; gap: var(--hc-space-2); }
.hc-legend__item i { font-size: 18px; }
.hc-legend__key {
  font-family: var(--hc-font-display);
  font-weight: 700;
  font-size: var(--hc-text-label);
  letter-spacing: var(--hc-tracking-label);
  text-transform: uppercase;
}

/* ==========================================================================
   Step sequence: glyphs growing left to right on a dotted trajectory
   ========================================================================== */

.hc-steps {
  --steps-rise: 96px;
  container-type: inline-size;
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: var(--hc-space-5);
  margin: 0;
  padding: 0 0 var(--hc-space-4);
  list-style: none;
  border-bottom: var(--hc-groundline) solid var(--hc-ink);
}
/* Dotted trajectory rising from bottom-left to top-right */
.hc-steps::before {
  content: "";
  position: absolute;
  left: 4%;
  bottom: 34%;
  width: hypot(92cqw, var(--steps-rise));
  border-top: 3px dotted var(--hc-ink);
  transform-origin: 0 0;
  transform: rotate(calc(atan2(var(--steps-rise), 92cqw) * -1));
  z-index: 0;
}
.hc-step {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--hc-space-3);
  justify-items: start;
}
.hc-step__glyph {
  font-size: var(--step-size, 48px);
  line-height: 0.9;
  color: var(--hc-slate);
  background: var(--hc-bg);
  padding-right: 4px;
}
.hc-step:nth-child(1) { --step-size: 40px; }
.hc-step:nth-child(2) { --step-size: 64px; }
.hc-step:nth-child(3) { --step-size: 88px; }
.hc-step:nth-child(4) { --step-size: 112px; }
.hc-step:nth-child(5) { --step-size: 136px; }
.hc-step--done .hc-step__glyph { color: var(--hc-ink); }
.hc-step--active .hc-step__glyph { color: var(--hc-coral); }
.hc-step--pending .hc-step__glyph { color: var(--hc-straw); }
.hc-step__title { font-family: var(--hc-font-display); font-weight: 700; font-size: 1.125rem; line-height: 1.2; }
.hc-step__text { font-size: var(--hc-text-body-sm); color: var(--hc-text-muted); max-width: 26ch; }
.hc-frieze--sage .hc-step__glyph { background: var(--hc-sage); }

@media (max-width: 760px) {
  .hc-steps { grid-auto-flow: row; gap: var(--hc-space-6); }
  .hc-steps::before { display: none; }
  .hc-step { --step-size: 48px !important; }
}

/* ==========================================================================
   Stat block: numeral on a short black bar, no card
   ========================================================================== */

.hc-stat { display: grid; gap: var(--hc-space-3); justify-items: start; align-content: start; }
.hc-stat__figure {
  font-family: var(--hc-font-display);
  font-size: var(--hc-text-stat);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums lining-nums;
  padding-bottom: var(--hc-space-2);
  border-bottom: 6px solid var(--hc-ink);
  min-width: 96px;
}
.hc-stat__figure--sm { font-size: var(--hc-text-stat-sm); border-bottom-width: var(--hc-bar); }
.hc-stat__unit { font-size: 0.45em; font-weight: 700; letter-spacing: 0; margin-left: 0.08em; }
.hc-stat__caption {
  display: flex;
  align-items: flex-start;
  gap: var(--hc-space-2);
  font-size: var(--hc-text-body-sm);
  line-height: 1.4;
  color: var(--hc-ink);
  max-width: 28ch;
}
.hc-stat__caption i { font-size: 20px; flex: none; margin-top: 1px; }
.hc-stat--highlight .hc-stat__caption i { color: var(--hc-coral); }
.hc-stat__delta { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--hc-ink); }

.hc-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--hc-space-7) var(--hc-gutter);
}

/* ==========================================================================
   Panel: a flat colour field, not a card. Top ink rule, no border box.
   ========================================================================== */

.hc-panel {
  background: var(--hc-paper-raised);
  border-top: var(--hc-bar) solid var(--hc-ink);
  padding: var(--hc-space-6);
  display: grid;
  gap: var(--hc-space-4);
  align-content: start;
}
.hc-panel--sage { background: var(--hc-sage); }
.hc-panel--bare { background: transparent; padding-inline: 0; }

/* ==========================================================================
   Table
   ========================================================================== */

.hc-table-wrap { overflow-x: auto; }
.hc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--hc-text-body);
  font-variant-numeric: tabular-nums;
}
.hc-table caption {
  text-align: left;
  caption-side: top;
  padding-bottom: var(--hc-space-3);
  font-family: var(--hc-font-display);
  font-weight: 700;
  font-size: var(--hc-text-h4);
}
.hc-table th {
  text-align: left;
  font-family: var(--hc-font-display);
  font-size: var(--hc-text-micro);
  font-weight: 700;
  letter-spacing: var(--hc-tracking-label);
  text-transform: uppercase;
  padding: var(--hc-space-3) var(--hc-space-4) var(--hc-space-2);
  border-bottom: var(--hc-bar) solid var(--hc-ink);
  vertical-align: bottom;
}
.hc-table td {
  padding: 14px var(--hc-space-4);
  border-bottom: var(--hc-hairline) solid var(--hc-ink);
  vertical-align: middle;
}
.hc-table th:first-child,
.hc-table td:first-child { padding-left: 0; }
.hc-table .hc-num,
.hc-table th.hc-num { text-align: right; }
.hc-table tbody tr:hover { background: var(--hc-paper-raised); }
.hc-table tfoot td {
  border-top: var(--hc-rule) solid var(--hc-ink);
  border-bottom: var(--hc-groundline) solid var(--hc-ink);
  font-weight: 700;
}
.hc-table__glyph { display: inline-flex; align-items: center; gap: var(--hc-space-3); font-weight: 600; }
.hc-table__glyph i { font-size: 22px; flex: none; }
.hc-table__inline-units { display: inline-flex; gap: 3px; font-size: 16px; vertical-align: middle; }

/* ==========================================================================
   Status: only for real, changing data states
   ========================================================================== */

.hc-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--hc-font-display);
  font-size: var(--hc-text-micro);
  font-weight: 700;
  letter-spacing: var(--hc-tracking-label);
  text-transform: uppercase;
  color: var(--hc-ink);
}
.hc-status::before { content: ""; width: 10px; height: 10px; background: var(--hc-ink); flex: none; }
.hc-status--done::before { background: var(--hc-ink); }
.hc-status--active::before { background: var(--hc-coral); }
.hc-status--pending::before { background: var(--hc-straw); }

/* ==========================================================================
   Footer
   ========================================================================== */

.hc-footer {
  background: var(--hc-ink);
  color: var(--hc-paper);
  padding-block: var(--hc-space-8);
  font-size: var(--hc-text-body-sm);
}
.hc-footer a { color: var(--hc-paper); }
.hc-footer a:hover { color: var(--hc-coral); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
