/* ───────────────────────────────────────────────────────────────────────────
 *  Guide Montana shared UI primitives — buildPanel + buildKpiCard
 *  Phase 5 cleanup (2026-05-18)
 *  ----------------------------------------------------------------------
 *  Minimum stylesheet for the shared builders in src/ui/buildPanel.js
 *  and src/ui/buildKpiCard.js. Existing custom panels (.parcel-drawer,
 *  .pd-section, the hub-specific KPI rows) stay untouched.
 *
 *  Tokens used throughout: --guide-color-* (Phase 1 single source of
 *  truth) with the legacy --bg-* / --text-* aliases as fallbacks.
 * ─────────────────────────────────────────────────────────────────── */

/* Panel shell — used by the buildPanel() factory */
.guide-panel {
  display: flex;
  flex-direction: column;
  /* Premium frosted panel shell — heavy tier keeps panel content legible. */
  background: var(--guide-surface-glass-heavy, var(--guide-color-bg-1, #F2EFE8));
  -webkit-backdrop-filter: var(--guide-glass-filter, blur(var(--guide-blur-glass, 10px)) saturate(1.4));
  backdrop-filter: var(--guide-glass-filter, blur(var(--guide-blur-glass, 10px)) saturate(1.4));
  color: var(--guide-color-text-primary, #1A1A1F);
  border: 1px solid var(--guide-color-border-default, rgba(0, 0, 0, 0.10));
  border-radius: var(--guide-radius-lg, 12px);
  box-shadow: inset 0 1px 0 var(--guide-glass-highlight, rgba(255, 255, 255, 0.55)), var(--guide-shadow-raised);
  overflow: hidden;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .guide-panel { background: var(--guide-color-bg-1, #F2EFE8); }
}

.guide-panel-head {
  display: flex;
  align-items: center;
  gap: var(--guide-sp-3, 12px);
  padding: var(--guide-sp-4, 16px) var(--guide-sp-5, 20px);
  border-bottom: 1px solid var(--guide-color-border-subtle, rgba(0, 0, 0, 0.06));
  background: var(--guide-color-bg-3, #F7F5F0);
}
.guide-panel-icon {
  width: 20px;
  height: 20px;
  color: var(--guide-color-mt-red-text, #B22234);
  flex-shrink: 0;
}
.guide-panel-title-wrap { flex: 1; min-width: 0; }
.guide-panel-title {
  margin: 0;
  font-size: var(--guide-fs-17, 17px);
  font-weight: var(--guide-fw-bold, 700);
  letter-spacing: -0.005em;
  color: var(--guide-color-text-primary, #1A1A1F);
}
.guide-panel-subtitle {
  margin: 2px 0 0;
  font-size: var(--guide-fs-12, 12px);
  color: var(--guide-color-text-tertiary, #6B6B73);
}
.guide-panel-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--guide-radius-sm, 6px);
  color: var(--guide-color-text-tertiary, #6B6B73);
  cursor: pointer;
  transition: var(--motion-default, 180ms ease-out);
}
.guide-panel-close:hover {
  background: var(--guide-color-bg-4, #EDEAE2);
  color: var(--guide-color-text-primary, #1A1A1F);
}
.guide-panel-close [data-lucide] { width: 16px; height: 16px; }

.guide-panel-nav {
  display: flex;
  gap: var(--guide-sp-2, 8px);
  padding: var(--guide-sp-2, 8px) var(--guide-sp-5, 20px);
  border-bottom: 1px solid var(--guide-color-border-subtle, rgba(0, 0, 0, 0.06));
  background: var(--guide-color-bg-3, #F7F5F0);
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 2;
}
.guide-panel-nav a {
  display: inline-block;
  padding: 4px 10px;
  font-size: var(--guide-fs-12, 12px);
  font-weight: var(--guide-fw-semi, 600);
  color: var(--guide-color-text-secondary, #4A4A52);
  text-decoration: none;
  border-radius: var(--guide-radius-pill, 999px);
  white-space: nowrap;
}
.guide-panel-nav a:hover {
  background: var(--guide-color-bg-4, #EDEAE2);
  color: var(--guide-color-text-primary, #1A1A1F);
}

.guide-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--guide-sp-5, 20px);
}
.guide-panel-section { margin-bottom: var(--guide-sp-6, 24px); }
.guide-panel-section:last-child { margin-bottom: 0; }
.guide-panel-error {
  color: var(--guide-color-severity-crit, #C0392F);
  font-size: var(--guide-fs-12, 12px);
}

/* KPI card — used by buildKpiCard()
   The Infinimaker card: a raised sheet with a 1px rule. A tile that carries a
   status (`guide-kpi--ok|watch|warn|crit`) says so in a word, `.guide-kpi-status`,
   in the status hue — never in a coloured edge. Every tile used to wear a 3px
   edge (blue by default, or a hand-picked hub hue), so the one tile that really
   was critical looked like its neighbours. warn and watch share ochre because
   the token layer gives both statuses that hue. */
.guide-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--guide-sp-3, 12px) var(--guide-sp-4, 16px);
  background: var(--guide-color-raised);
  border: 1px solid var(--guide-color-line);
  border-radius: var(--guide-radius-lg);
  text-align: left;
  font: inherit;
  color: inherit;
}
.guide-kpi--clickable {
  cursor: pointer;
  transition: border-color var(--guide-dur-fast, 140ms) var(--guide-ease-out, ease-out);
}
.guide-kpi--clickable:hover { border-color: var(--guide-color-line-strong); }
.guide-kpi-label {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px;
  /* Infinimaker's technical label: system mono, uppercase, light tracking. */
  font-family: var(--guide-font-label);
  font-size: var(--guide-fs-11, 11px);
  font-weight: var(--guide-fw-semi, 600);
  color: var(--guide-color-ink-muted);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
}
.guide-kpi-label [data-lucide] { width: 14px; height: 14px; }
.guide-kpi-status {
  white-space: nowrap;
  font-size: var(--guide-fs-2xs, 11px);
  font-weight: var(--guide-fw-bold, 700);
  letter-spacing: var(--guide-letter-eyebrow, 0.08em);
  text-transform: var(--guide-label-case, uppercase);
}
.guide-kpi--ok .guide-kpi-status { color: var(--guide-color-status-ok); }
.guide-kpi--watch .guide-kpi-status,
.guide-kpi--warn .guide-kpi-status { color: var(--guide-color-status-watch); }
.guide-kpi--crit .guide-kpi-status { color: var(--guide-color-status-crit); }
.guide-kpi-value {
  display: inline-flex; align-items: baseline; gap: 4px;
  font-size: var(--guide-fs-22, 22px);
  font-weight: var(--guide-fw-bold, 700);
  color: var(--guide-color-text-primary, #1A1A1F);
  font-variant-numeric: tabular-nums;
}
.guide-kpi-unit {
  font-size: var(--guide-fs-12, 12px);
  font-weight: var(--guide-fw-medium, 500);
  color: var(--guide-color-text-tertiary, #6B6B73);
}
.guide-kpi-trend {
  font-size: var(--guide-fs-11, 11px);
  font-weight: var(--guide-fw-semi, 600);
}
.guide-kpi-trend--up   { color: var(--guide-color-severity-warn, #B45309); }
.guide-kpi-trend--down { color: var(--guide-color-severity-success, #157347); }
.guide-kpi-trend--flat { color: var(--guide-color-text-tertiary, #6B6B73); }
.guide-kpi-source {
  margin-top: 4px;
  /* A source and its date, as written: mono so "2026-11-10" reads as a date
     and an agency's own name keeps its case. */
  font-family: var(--guide-font-label);
  font-size: var(--guide-fs-2xs);
  color: var(--guide-color-ink-muted);
}
.guide-kpi-date { white-space: nowrap; }

/* ───────────────────────────────────────────────────────────────────────────
 *  Unified UI states — skeleton / empty / error
 *  ----------------------------------------------------------------------
 *  Canonical surfaces for the renderSkeleton / renderEmptyState /
 *  renderErrorState helpers in src/html-utils.js. Hubs should use those
 *  helpers (or these classes) instead of hand-rolling .dh-empty / .ef-shimmer
 *  / .rdash-loading per hub. All token-based — themes for free in dark mode.
 * ─────────────────────────────────────────────────────────────────── */

/* Skeleton loading placeholder */
/* The bare container shimmers on its own — seven call sites use
   `.guide-skeleton` with no `-bar` children. Moved here from layout.css,
   which had declared the same class in a second sheet. */
.guide-skeleton {
  padding: var(--guide-sp-4, 16px);
  background: linear-gradient(90deg,
    var(--guide-color-bg-4) 0%,
    color-mix(in srgb, var(--guide-color-bg-4) 60%, var(--guide-color-raised)) 50%,
    var(--guide-color-bg-4) 100%);
  background-size: 200% 100%;
  animation: guide-shimmer 1.6s linear infinite;
  border-radius: var(--guide-radius-sm, 6px);
}
@media (prefers-reduced-motion: reduce) {
  .guide-skeleton { animation: none; }
}
.guide-skeleton-bar {
  border-radius: var(--guide-radius-xs, 4px);
  margin-bottom: var(--guide-sp-2, 8px);
  background: linear-gradient(
    90deg,
    var(--guide-color-bg-3, #F7F5F0) 25%,
    var(--guide-color-bg-4, #EDEAE2) 50%,
    var(--guide-color-bg-3, #F7F5F0) 75%
  );
  background-size: 200% 100%;
  animation: guide-shimmer 1.5s ease-in-out infinite;
}
.guide-skeleton-bar:last-child { margin-bottom: 0; }
.guide-skeleton-row { display: flex; gap: var(--guide-sp-3, 12px); }
.guide-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--guide-sp-3, 12px);
}
@media (prefers-reduced-motion: reduce) {
  .guide-skeleton-bar { animation: none; }
}

/* Empty state — centered icon + message + optional action button */
.guide-empty {
  text-align: center;
  padding: var(--guide-sp-7, 32px) var(--guide-sp-4, 16px);
  color: var(--guide-color-text-muted, #706F6D);
}
.guide-empty [data-lucide] {
  width: 40px;
  height: 40px;
  margin-bottom: var(--guide-sp-3, 12px);
  opacity: 0.4;
}
.guide-empty-msg {
  margin: 0 0 var(--guide-sp-3, 12px);
  font-size: var(--guide-fs-13, 13px);
  line-height: 1.5;
}

/* Error state — tinted card + retry button */
.guide-error {
  text-align: center;
  padding: var(--guide-sp-6, 24px) var(--guide-sp-4, 16px);
  margin: var(--guide-sp-2, 8px);
  border-radius: var(--guide-radius-md, 8px);
  color: var(--guide-color-status-crit, #B22234);
  background: var(--guide-color-mt-red-soft, rgba(178, 34, 52, 0.10));
  border: 1px solid var(--guide-color-mt-red-soft, rgba(178, 34, 52, 0.10));
}
.guide-error [data-lucide] {
  width: 32px;
  height: 32px;
  margin-bottom: var(--guide-sp-2, 8px);
  opacity: 0.6;
}
.guide-error-msg {
  margin: 0 0 var(--guide-sp-3, 12px);
  font-size: var(--guide-fs-13, 13px);
  line-height: 1.5;
}
/* Which agency or dataset the missing figures would have come from — an
   unavailable panel should still say what it was reaching for. */
.guide-error-src {
  margin: 0 0 var(--guide-sp-3, 12px);
  font-size: var(--guide-fs-11, 11px);
  opacity: 0.75;
}

/* ───────────────────────────────────────────────────────────────────────────
 *  .guide-sev — a severity, in three channels (2026-11-12)
 *  ----------------------------------------------------------------------
 *  WCAG 1.4.1: colour may never be the only means of conveying information.
 *  Every .guide-sev carries a lucide glyph AND a word; the role colour is the
 *  third channel, not the only one. The traffic-light emoji this replaced
 *  ('🔴' : '🟡' : '🟠' in the weather-alert ticker) was worse than
 *  colour-only — it was interpolated into `data-lucide`, so lucide had no
 *  such icon, rendered nothing, and the severity reached the screen as a
 *  tint on a word that never named it.
 *
 *  The level → role mapping lives HERE so a theme flip reaches it; the JS
 *  builders in src/detail-panel.js, src/app-dashboard.js and src/charts.js
 *  pick a level name and never a hex. Levels are the role layer's own
 *  vocabulary (theme-tokens.css): ok · watch · warn · crit · info · none.
 *  Markup carries both classes: class="guide-sev guide-tier--crit".
 * ─────────────────────────────────────────────────────────────────── */
.guide-sev {
  --tier-color: var(--guide-color-ink-soft, #4A5563);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--guide-fs-xs, 12px);
  font-weight: var(--guide-fw-bold, 700);
  line-height: 1.2;
  color: var(--tier-color);
}
.guide-sev [data-lucide],
.guide-sev svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Chip form — a tinted pill for hero bars and badges. */
.guide-sev--chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tier-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier-color) 34%, transparent);
}
/* Card form — a tinted block carrying an advisory sentence. */
.guide-sev--card {
  display: block;
  padding: var(--guide-sp-3, 10px) var(--guide-sp-3, 12px);
  border-radius: var(--guide-radius-md, 8px);
  background: color-mix(in srgb, var(--tier-color) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier-color) 26%, transparent);
}
.guide-sev--card .guide-sev-head {
  display: flex; align-items: center; gap: 5px;
  font-weight: var(--guide-fw-semi, 600);
  color: var(--tier-color);
}
.guide-sev--card .guide-sev-body {
  margin-top: 3px;
  font-size: var(--guide-fs-xs, 12px);
  font-weight: var(--guide-fw-regular, 400);
  line-height: 1.5;
  color: var(--guide-color-text-secondary, #4A5563);
}

/* The level → role mapping, stated ONCE. Three consumers read --tier-color:
   .guide-sev (the badge), .guide-tier-ink (a readout that already has its
   label beside it) and .guide-tier-mark (an SVG glyph — a presentation
   attribute cannot hold var(), a CSS declaration on the node can). */
.guide-tier--ok    { --tier-color: var(--guide-color-status-ok, #44623A); }
.guide-tier--watch { --tier-color: var(--guide-color-status-watch, #8A5A10); }
.guide-tier--warn  { --tier-color: var(--guide-color-status-warn, #8A5A10); }
.guide-tier--crit  { --tier-color: var(--guide-color-status-crit, #A63A25); }
.guide-tier--info  { --tier-color: var(--guide-color-status-info, #1F5F8B); }
.guide-tier--none  { --tier-color: var(--guide-color-ink-soft, #4A5563); }

.guide-tier-ink  { color: var(--tier-color); }
.guide-tier-mark { fill: var(--tier-color); stroke: var(--tier-color); }
.guide-tier-mark--stroke { fill: none; stroke: var(--tier-color); }
.guide-sev-detail { font-weight: var(--guide-fw-regular, 400); }

/* An emoji in .det-hero-icon was sized by font-size; a lucide glyph is an
   <svg> and needs a box. Both detail-panel heroes and KPI icons mount here. */
.det-hero-icon svg,
.det-hero-icon [data-lucide] { width: 20px; height: 20px; }
.det-kpi-icon svg,
.det-kpi-icon [data-lucide] { width: 16px; height: 16px; }


/* ───────────────────────────────────────────────────────────────────────────
 *  Detail-panel surfaces that used to style themselves from JS (2026-11-12)
 *  ----------------------------------------------------------------------
 *  Each of these replaced a hex or an rgba() concatenated into innerHTML by
 *  src/detail-panel.js, where no theme flip could reach it. The module now
 *  names a role or hands off one custom property; the colour lives here.
 * ─────────────────────────────────────────────────────────────────── */

/* A hero whose left edge carries its subject or severity. */

/* Wind detail — the readouts that are not the advisory. */
.det-wind-card-value--ink { color: var(--guide-color-ink, #1B2430); }
.det-wind-card-value--dir { color: var(--guide-color-mt-gold, #E7B24C); }
.det-compass-svg { margin: 0 auto; display: block; }
.det-compass-ring { fill: none; stroke: var(--guide-color-line, #D9D1C0); }
.det-compass-tick { fill: var(--guide-color-ink-soft, #4A5563); }  /* size stays on the SVG attribute */

/* Water-right status chips + governance context banner. */
.wr-status-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.wr-decree-val { margin-left: 4px; opacity: 0.8; }
.gr-governance-ctx {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: var(--guide-radius-md, 8px);
  background: color-mix(in srgb, var(--tier-color, var(--guide-color-line)) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier-color, var(--guide-color-line)) 20%, transparent);
}
.gr-gov-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.gr-gov-row:last-child { margin-bottom: 0; }
.gr-gov-note {
  font-size: var(--guide-fs-2xs, 11px);
  color: var(--guide-color-text-secondary, #4A5563);
}
.gr-gov-caveat { font-size: var(--guide-fs-2xs, 11px); opacity: 0.65; }

/* ── SVG furniture (2026-11-12) ─────────────────────────────────────────────
   Grid lines, tick labels and plot grounds inside hand-built SVG, which used
   to carry #888 / #aaa / rgba(0,0,0,0.04) as presentation attributes. A
   presentation attribute cannot hold var(), so the only way these follow the
   theme is a CSS declaration on the node — hence a class, not an attribute. */
.guide-svg-grid        { stroke: var(--guide-color-line, #D9D1C0); }
.guide-svg-axis        { stroke: var(--guide-color-line-strong, #8A7F6B); }
.guide-svg-label       { fill: var(--guide-color-ink-soft, #4A5563); }
.guide-svg-label--faint{ fill: var(--guide-color-ink-soft, #4A5563); opacity: 0.6; }
.guide-svg-value       { fill: var(--guide-color-ink, #1B2430); }
.guide-svg-plot-bg     { fill: color-mix(in srgb, var(--guide-color-ink, #1B2430) 4%, transparent); }
.guide-svg-dot-ring    { stroke: var(--guide-color-bg-0, #E8E4D9); }
.guide-svg-block       { display: block; }

/* A trend delta beside a chart: arrow + sign + percentage, tinted by role. */
.guide-trend-badge {
  font-size: var(--guide-fs-2xs, 11px);
  font-weight: var(--guide-fw-bold, 700);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--tier-color);
  background: color-mix(in srgb, var(--tier-color) 10%, transparent);
}
.guide-chart-note {
  font-size: var(--guide-fs-2xs, 11px);
  color: var(--guide-color-ink-soft, #4A5563);
}
.guide-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

/* A condition badge tinted from whatever hue its producer reports — the
   hand-off pattern CONVENTIONS.md prescribes, replacing `background:${c}1a`
   string concatenation that only worked for 6-digit hex. */
.cbar-cond-badge--tier {
  color: var(--tier-color);
  background: color-mix(in srgb, var(--tier-color) 10%, transparent);
}

/* A trend badge — arrow + word, tinted by the direction's role. It had no
   stylesheet rule at all: every one of its four call sites carried
   `color:${c};background:${c}18`, which is also why it could only ever be a
   6-digit hex. */

/* Basin-level U.S. Drought Monitor banner on a gauge report. */
.gr-usdm-banner {
  margin: 6px 0;
  padding: 6px 10px;
  border-radius: var(--guide-radius-sm, 6px);
  font-size: var(--guide-fs-2xs, 11px);
  background: color-mix(in srgb, var(--tier-color) 10%, transparent);
  border: 1px solid var(--guide-color-line);
}
.gr-usdm-level { font-weight: var(--guide-fw-bold, 700); }
.gr-usdm-area { color: var(--guide-color-ink-soft, #4A5563); margin-left: 6px; }

/* A badge that takes its hue as --tier-color and mixes its own wash. */
.det-badge--tier {
  color: var(--tier-color);
  background: color-mix(in srgb, var(--tier-color) 10%, transparent);
}
/* A meter fill that darkens toward its leading edge. */
.guide-tier-bar {
  background: linear-gradient(90deg, color-mix(in srgb, var(--tier-color) 80%, transparent), var(--tier-color));
}

/* A month cell in a period-of-use strip, tinted from the right's own hue. */

/* A translucent fill handed one hue — forecast bars, mini histograms. */
.guide-tier-fill {
  width: 100%;
  border-radius: 2px;
  background: color-mix(in srgb, var(--tier-color) 19%, transparent);
}

/* Chart furniture that the JS used to paint with a presentation attribute.
   `fill="var(--status-info,#0F766E)"` on an SVG node is invalid — a
   presentation attribute is not a CSS declaration — so the particles were
   black. The fill belongs here. */
/* Which agency the figures came from — every chart that states one. */
.guide-chart-src {
  font-size: var(--guide-fs-2xs, 11px);
  color: var(--guide-color-ink-soft, #4A5563);
}

/* Cascade node glyphs were emoji sized by font-size; a lucide glyph is an
   <svg> and needs a box. */
.cascade-icon svg,
.cascade-icon [data-lucide] { width: 18px; height: 18px; }

/* ── Recurring text and layout patterns from the dashboard / detail panel ───
   Each of these replaced an inline style= string repeated at several call
   sites in src/app-dashboard.js and src/detail-panel.js. CONVENTIONS.md's
   first preference: move it into a class so it participates in the theme. */
.gm-note {
  font-size: var(--guide-fs-2xs, 11px);
  color: var(--guide-color-ink-soft, #4A5563);
  margin-top: 6px;
}
.gm-note--center { text-align: center; }
.gm-note--12 { font-size: var(--guide-fs-xs, 12px); margin-top: 0; }
.gm-subhead {
  font-size: var(--guide-fs-2xs, 11px);
  font-weight: var(--guide-fw-bold, 700);
  color: var(--guide-color-text-secondary, #4A5563);
  margin-bottom: 4px;
}
.gm-subhead--gap { margin-bottom: 8px; }
.gm-quiet {
  font-weight: var(--guide-fw-regular, 400);
  color: var(--guide-color-ink-soft, #4A5563);
}
.gm-eyebrow {
  font-size: var(--guide-fs-2xs, 11px);
  color: var(--guide-color-text-tertiary, #6B6B73);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.5px;
}
.gm-row { display: flex; align-items: center; gap: var(--guide-sp-2, 8px); margin-bottom: 6px; }
.gm-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--guide-sp-2, 8px);
  margin-bottom: var(--guide-sp-3, 12px);
}
.gm-split-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--guide-color-border-subtle, rgba(0, 0, 0, 0.06));
}

/* ── Meters, rails, scroll lists and tiles (2026-11-12) ────────────────────
   The second half of the inline-style sweep of src/detail-panel.js and
   src/app-dashboard.js: patterns that recur in both and were pasted as
   style= strings, two of them carrying a raw #EDEAE2 ground that could not
   follow a theme flip. */
.gm-meter {
  position: relative;
  height: 32px;
  background: var(--guide-color-bg-3, #F7F5F0);
  border-radius: var(--guide-radius-sm, 6px);
  overflow: hidden;
  margin: 6px 0;
}
.gm-meter--sm { height: 24px; margin: 4px 0; }
.gm-meter-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--guide-fs-2xs, 11px);
  font-weight: var(--guide-fw-semi, 600);
  color: var(--guide-color-white, #FFFFFF);
}
.gm-meter-caption {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px;
  font-size: var(--guide-fs-2xs, 11px);
  font-weight: var(--guide-fw-semi, 600);
  color: var(--guide-color-text-secondary, #4A5563);
}
.gm-rail {
  position: relative;
  height: 6px;
  background: var(--guide-color-bg-0, #E8E4D9);
  border-radius: 3px;
  margin-top: 4px;
  overflow: visible;
}
.gm-rail--full { width: 100%; }
.gm-axis-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--guide-fs-2xs, 11px);
  color: var(--guide-color-ink-soft, #4A5563);
  margin-top: 2px;
}
.gm-axis-row--10 { margin: 2px 0 6px; padding: 0 4px; }
.gm-scroll-list {
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gm-scroll-list--tall { max-height: 160px; gap: 3px; }
.gm-barchart { display: flex; gap: 3px; align-items: flex-end; height: 60px; margin: 6px 0; }
.gm-barcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.gm-card {
  background: var(--guide-color-bg-1, #F2EFE8);
  border: 1px solid var(--guide-color-border-subtle, rgba(0, 0, 0, 0.06));
  border-radius: var(--guide-radius-md, 10px);
  padding: 8px 10px;
}
.gm-body {
  font-size: var(--guide-fs-xs, 12px);
  color: var(--guide-color-text-secondary, #4A5563);
  padding: 8px 0;
}
.gm-body--lh { line-height: 1.5; }
.gm-mono {
  font-family: var(--guide-font-mono);
  opacity: 0.7;
  font-size: var(--guide-fs-xs, 12px);
}
.gm-eyebrow--strong { font-weight: var(--guide-fw-bold, 700); margin-bottom: 6px; }
.gm-subhead--gap6 { margin-bottom: 6px; }
.gm-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.gm-chips--gap { gap: 6px; margin-top: 8px; }
.gm-chips--text {
  gap: var(--guide-sp-2, 8px);
  font-size: var(--guide-fs-2xs, 11px);
  color: var(--guide-color-text-secondary, #4A5563);
  margin-top: 0;
}
.gm-divider-top {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--guide-color-line, #D9D1C0);
}
.gm-divider-top--lg { margin-top: 14px; padding-top: 10px; }
.gm-ellipsis { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.gm-grid-3--gap { gap: var(--guide-sp-2, 8px); }
.gm-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: var(--guide-fs-2xs, 11px);
  background: var(--guide-color-bg-1, #F2EFE8);
  border: 1px solid var(--guide-color-line, #D9D1C0);
}
.gm-src-badge {
  font-size: var(--guide-fs-2xs, 11px);
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--guide-color-action, #1F5F8B);
  color: var(--guide-color-white, #FFFFFF);
}
.gm-ok-tile {
  text-align: center;
  padding: 6px;
  border-radius: var(--guide-radius-md, 8px);
  background: color-mix(in srgb, var(--guide-color-status-ok) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--guide-color-status-ok) 16%, transparent);
}
.gm-row--tile {
  gap: 6px;
  margin-bottom: 0;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: var(--guide-fs-2xs, 11px);
  background: var(--guide-color-bg-1, #F2EFE8);
}
.gm-dotted-link { text-decoration: none; border-bottom: 1px dotted currentColor; }

/* The tail of the same sweep — small recurring rows, values and notes. */
.gm-row--2 { gap: 6px; margin-top: 2px; margin-bottom: 0; }
.gm-row--3 { gap: 6px; margin-top: 3px; margin-bottom: 0; }
.gm-row--wrap { flex-wrap: wrap; margin-bottom: 0; }
.gm-row--11 { margin: 4px 0; font-size: var(--guide-fs-2xs, 11px); }
.gm-row--pad { gap: 10px; padding: 8px 0; margin-bottom: 0; }
.gm-val {
  font-size: var(--guide-fs-sm, 14px);
  font-weight: var(--guide-fw-bold, 700);
  color: var(--guide-color-text-primary, #1B2430);
}
.gm-val--11 { font-size: var(--guide-fs-2xs, 11px); font-weight: var(--guide-fw-semi, 600); }
.gm-val--right { font-size: inherit; font-weight: var(--guide-fw-semi, 600); max-width: 60%; text-align: right; }
.gm-note--flush { margin-top: 0; padding: 4px 0; }
.gm-note--italic { font-style: italic; margin-top: 1px; color: var(--guide-color-text-secondary, #4A5563); }
.gm-barcol--2 { flex: none; gap: 2px; }
.gm-grid-2--flush { margin-bottom: 0; }
.gm-rail--10 { flex: 1; height: 10px; border-radius: 5px; overflow: hidden; margin-top: 0; background: var(--guide-color-bg-3, #F7F5F0); }
.gm-rail-label { width: 36px; color: var(--guide-color-ink-soft, #4A5563); font-weight: var(--guide-fw-semi, 600); }

/* Last of the inline-style sweep: tiles, stacked bars and a vial gauge. */
.gm-stat-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: var(--guide-radius-md, 8px);
  background: var(--guide-color-bg-2, #FFFFFF);
  border: 1px solid var(--guide-color-border-default, rgba(0, 0, 0, 0.10));
  cursor: pointer;
}
.gm-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}
.gm-vial {
  position: relative;
  width: 24px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--guide-color-bg-3, #F7F5F0);
  border: 2px solid var(--guide-color-border-default, rgba(0, 0, 0, 0.10));
}
.gm-stack-bar { height: 22px; border-radius: var(--guide-radius-sm, 6px); margin-bottom: 10px; }
.gm-stack-bar--sm { height: 18px; margin-bottom: 12px; }
.gm-ico-20 { width: 20px; height: 20px; }
.gm-row--tight { gap: 6px; padding: 4px; margin-bottom: 0; }
