/* StripMeister Copper Recovery Signal — internal prototype
   Palette: charcoal + StripMeister red, with copper as the warm metal accent.
   Blue is reserved exclusively for the primary CTA button. */

:root,
[data-theme='light'] {
  --color-bg: #f4f3ef;
  --color-surface: #ffffff;
  --color-surface-2: #fafaf7;
  --color-surface-offset: #ececea;
  --color-border: #d9d6cf;

  --color-text: #181715;
  --color-text-muted: #4f4a44;
  --color-text-faint: #8a847b;

  /* StripMeister brand red (matches logo) */
  --color-primary: #d6201f;
  --color-primary-hover: #a8171a;

  /* Charcoal — used for body type and dark surfaces */
  --color-charcoal: #1a1a1a;
  --color-charcoal-2: #262624;

  /* Copper — warm metallic accent for dial, surface accents */
  --color-copper: #b46a2c;
  --color-copper-deep: #8a4a1a;
  --color-copper-bright: #d98a3e;
  --color-copper-light: #e8b182;

  /* === Metallic gauge palette ============================================
     Five stops, each a *richer* version of the existing four band colors,
     pushed slightly warmer / more saturated so the arc reads as polished
     metal rather than flat paint. The stops align (roughly) with the score
     segment boundaries 60 / 78 / 85 / 92 / 100. No harsh red, no rainbow.
       gauge-1  = burnished copper-brown (watch / verify, low end)
       gauge-2  = amber-copper mid-tone (transition into good)
       gauge-3  = amber/copper warm (good)
       gauge-4  = warm olive-green (strong)
       gauge-5  = vivid recovery green (exceptional)
     gauge-sheen-* are the highlight + shadow used by the metallic dual
     stroke overlay to fake a polished bevel without rainbow clutter. */
  --color-gauge-1: #7a3e14;
  --color-gauge-2: #b8631e;
  --color-gauge-3: #d98a3e;
  --color-gauge-4: #7c9a3d;
  --color-gauge-5: #2f8260;
  --color-gauge-sheen-hi: rgba(255, 233, 196, 0.55);
  --color-gauge-sheen-lo: rgba(34, 18, 6, 0.32);

  /* Blue — ONLY for primary CTA button */
  --color-cta-blue: #0a66d8;
  --color-cta-blue-hover: #084fae;

  --color-success: #2f8260;
  --color-success-tint: rgba(47, 130, 96, 0.14);
  /* Muted warm/olive green — the "strong" stoplight band. Sits between the
     vivid optimal green and the copper amber so the four-color stoplight
     reads as one continuous descent rather than a rainbow. */
  --color-success-muted: #6b8a3a;
  --color-warning: #b8791b;
  --color-risk: #c93636;

  --shadow-lg: 0 22px 56px rgba(20, 14, 10, 0.10);
  --shadow-md: 0 10px 28px rgba(20, 14, 10, 0.08);
  --shadow-sm: 0 4px 14px rgba(20, 14, 10, 0.06);
  --shadow-glow-green: 0 0 0 6px rgba(47, 130, 96, 0.18), 0 8px 24px rgba(47, 130, 96, 0.30);

  --radius-sm: 0.4rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.4rem;

  --font-body: 'Satoshi', 'Inter', system-ui, sans-serif;

  --text-xs: clamp(0.75rem, 0.7rem + 0.18vw, 0.83rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.1rem);
  --text-lg: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
}

[data-theme='dark'] {
  --color-bg: #0d0c0b;
  --color-surface: #161513;
  --color-surface-2: #1c1b18;
  --color-surface-offset: #26241f;
  --color-border: #322f2a;

  --color-text: #f3f1ec;
  --color-text-muted: #a59f95;
  --color-text-faint: #6f6a61;

  --color-primary: #ef3a37;        /* slightly brighter red on dark */
  --color-primary-hover: #ff5a55;

  --color-charcoal: #0d0c0b;
  --color-charcoal-2: #161513;

  --color-copper: #cf8748;
  --color-copper-deep: #8b4f1c;
  --color-copper-bright: #f0a869;
  --color-copper-light: #ebc69a;

  /* Metallic gauge palette — dark theme. Slightly brighter / more saturated
     so the arc lifts off the charcoal panel and reads as polished copper.
     Same five-stop structure as the light theme. */
  --color-gauge-1: #a85a22;
  --color-gauge-2: #de8a3a;
  --color-gauge-3: #f4a85c;
  --color-gauge-4: #b6cc5e;
  --color-gauge-5: #4cb487;
  --color-gauge-sheen-hi: rgba(255, 226, 174, 0.42);
  --color-gauge-sheen-lo: rgba(0, 0, 0, 0.45);

  --color-cta-blue: #4f9bff;
  --color-cta-blue-hover: #76b1ff;

  --color-success: #4cb487;
  --color-success-tint: rgba(76, 180, 135, 0.16);
  /* Muted olive-green for the "strong" band on dark surfaces. */
  --color-success-muted: #9bb05a;
  --color-warning: #d39a35;
  --color-risk: #e45c57;

  --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.50);
  --shadow-md: 0 14px 32px rgba(0, 0, 0, 0.36);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.30);
  --shadow-glow-green: 0 0 0 6px rgba(76, 180, 135, 0.22), 0 8px 24px rgba(76, 180, 135, 0.32);
}

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

html {
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--color-text);
  /* Charcoal base with restrained copper field accents — no blue in the field */
  background:
    radial-gradient(ellipse at 8% 0%, color-mix(in srgb, var(--color-copper) 20%, transparent), transparent 38rem),
    radial-gradient(ellipse at 92% 4%, color-mix(in srgb, var(--color-primary) 10%, transparent), transparent 32rem),
    radial-gradient(circle at 50% 100%, color-mix(in srgb, var(--color-copper-deep) 14%, transparent), transparent 40rem),
    linear-gradient(170deg, var(--color-bg), color-mix(in srgb, var(--color-bg) 92%, var(--color-copper) 8%));
  background-attachment: fixed;
}

a { color: inherit; }

.skip-link {
  /* Visually hidden until focused. Use the standard clip technique
     (instead of transform alone) so it stays hidden in fullPage screenshots
     and any context where transforms might be ignored. */
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 20;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  color: var(--color-bg);
  background: var(--color-text);
  font-weight: 800;
}
.skip-link:focus,
.skip-link:focus-visible {
  width: auto;
  height: auto;
  padding: var(--space-3) var(--space-4);
  overflow: visible;
  clip: auto;
  clip-path: none;
  border-radius: var(--radius-sm);
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.widget-shell {
  width: min(1180px, calc(100% - var(--space-6)));
  margin: 0 auto;
  padding: var(--space-6) 0;
}

/* Panels — subtle copper-tinted card surface on charcoal */
.hero-panel,
.decision-panel,
.source-panel {
  border: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 96%, var(--color-copper) 4%), var(--color-surface));
  box-shadow: var(--shadow-lg);
}

.hero-panel {
  position: relative;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  overflow: hidden;
}

/* Subtle copper hairline at the top edge of the hero — metal cue */
.hero-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-copper-deep) 12%,
    var(--color-copper-bright) 50%,
    var(--color-copper-deep) 88%,
    transparent 100%
  );
  opacity: 0.7;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

/* StripMeister logo — official wordmark served from /assets.
   The PNG is 500×59 (≈ 8.47:1). We size by height and let width follow the
   aspect ratio so the logo never warps or pixelates. */
.brand-mark {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.brand-mark:hover,
.brand-mark:focus-visible {
  opacity: 0.92;
  outline: none;
}

.brand-mark:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

.brand-mark-img {
  display: block;
  width: auto;
  height: clamp(1.85rem, 1.4rem + 1.4vw, 2.5rem); /* ~30–40 px */
  max-width: min(220px, 60vw);
  object-fit: contain;
  /* The official asset reads in dark gray + brand red on a light field.
     On the dark theme it is paired against a charcoal panel — invert luminance
     of the dark text only via CSS filter so we keep one canonical asset. */
  filter: none;
}

/* Dark theme: the canonical PNG is dark-on-light. Rather than recolor it (which
   would lose the brand-red STRIP), we wrap the image in a subtle cream chip so
   the wordmark stays brand-accurate against the charcoal hero panel. */
[data-theme='dark'] .brand-mark {
  padding: 0.35rem 0.55rem;
  background: #f6f1e9;
  border: 1px solid color-mix(in srgb, var(--color-copper) 30%, transparent);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18) inset, 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* .eyebrow retained because it is still used inside the CTA card */
.eyebrow,
.metric-label {
  margin: 0 0 var(--space-1);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  color: var(--color-text);
  font-size: var(--text-xl);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: var(--space-3);
  color: var(--color-text);
  font-size: var(--text-lg);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

p { color: var(--color-text-muted); }

/* Theme toggle */
.theme-toggle {
  min-height: 40px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: var(--space-2) var(--space-4);
  color: var(--color-text);
  background: var(--color-surface-2);
  font-family: inherit;
  font-weight: 800;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--color-primary);
}

/* === Currency toolbar (USD/CAD toggle) ===
   Visual language modeled on the StripMeister scrap calculator page:
   subtle off-white field, segmented pill where the active segment becomes a
   white card with a thin dark border (the calculator’s “selected” treatment),
   inactive segments are quiet/transparent. We keep the brand-red border accent
   on the parent rail (subtle, not loud) to echo the calculator’s red-bordered
   number inputs without recoloring our existing palette. */
.currency-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: 0 0 var(--space-5);
  padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
  border-left: 3px solid color-mix(in srgb, var(--color-primary) 70%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
}

.currency-toolbar-label {
  margin: 0;
  color: var(--color-text-muted);
  /* Re-use .metric-label color/spacing/case but quieter — the calculator page
     uses muted gray field labels above its inputs, not red. */
}

.currency-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--color-border) 90%, transparent);
  border-radius: 10px; /* squarer than a full pill, matches calculator chips */
  background: color-mix(in srgb, var(--color-surface-offset) 55%, transparent);
  gap: 2px;
}

.currency-toggle-btn {
  appearance: none;
  border: 1px solid transparent;
  margin: 0;
  padding: 0.4rem 0.95rem;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  font-variant-numeric: tabular-nums lining-nums;
}

.currency-toggle-btn:hover {
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-surface) 60%, transparent);
}

.currency-toggle-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.currency-toggle-btn.is-active {
  /* Matches the illuminated blue 'Calculate your recovery' primary CTA */
  background: var(--color-cta-blue);
  color: #ffffff;
  border-color: color-mix(in srgb, var(--color-cta-blue) 60%, #000);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--color-cta-blue) 35%, transparent);
}

[data-theme='dark'] .currency-toggle-btn.is-active {
  background: var(--color-cta-blue);
  color: #ffffff;
  border-color: color-mix(in srgb, var(--color-cta-blue) 60%, #000);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--color-cta-blue) 35%, transparent);
}

.currency-toggle-dollar {
  margin-left: 0.18rem;
  color: var(--color-text-faint);
  font-weight: 900;
}

.currency-toggle-btn.is-active .currency-toggle-dollar {
  /* Match the white CTA text so the dollar glyph stays legible on blue */
  color: rgba(255, 255, 255, 0.85);
}

[data-theme='dark'] .currency-toggle-btn.is-active .currency-toggle-dollar {
  color: rgba(255, 255, 255, 0.85);
}

.currency-toolbar-meta {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  text-align: right;
}

/* Subtle middot separator and "Last updated" caption.
   Same color/size as the surrounding caption (intentionally quiet);
   `font-variant-numeric: tabular-nums` keeps the time digits aligned
   so the line doesn't shift width when the timestamp re-renders. */
.currency-toolbar-meta-sep {
  color: color-mix(in srgb, var(--color-text-faint) 70%, transparent);
}

.currency-toolbar-meta-updated {
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .currency-toolbar {
    gap: var(--space-2);
  }
  .currency-toolbar-meta {
    flex-basis: 100%;
    text-align: left;
  }
  /* On narrow viewports the caption already wraps to its own line; hide
     the inline middot and let the "Last updated" line break naturally so
     long timestamps never push past the toolbar edge. */
  .currency-toolbar-meta-sep {
    display: none;
  }
  .currency-toolbar-meta-updated {
    display: block;
    margin-top: 2px;
    white-space: normal;
  }
}

/* Inline call-to-action inside the hero summary — “run the recovery math now”.
   Sits inline with surrounding sentence; subtle copper underline + small arrow
   to signal it is a link without disrupting the hero typography. */
.signal-summary-link {
  color: var(--color-text);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-copper) 70%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  border-radius: 2px;
  transition: color 140ms ease, text-decoration-color 140ms ease;
  white-space: normal;
}
.signal-summary-link:hover {
  color: var(--color-copper-deep);
  text-decoration-color: var(--color-copper);
}
[data-theme='dark'] .signal-summary-link:hover {
  color: var(--color-copper-bright);
}
.signal-summary-link-arrow {
  display: inline-block;
  margin-left: 0.25rem;
  font-weight: 900;
  color: var(--color-copper);
  transform: translateY(-1px);
  transition: transform 160ms ease;
}
.signal-summary-link:hover .signal-summary-link-arrow {
  transform: translate(2px, -1px);
}
.signal-summary-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* === Hero signal grid === */
.signal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 0.8fr));
  gap: var(--space-4);
  align-items: start; /* small cards size to content, no forced stretch to hero height */
}

.signal-card,
.market-card {
  border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
}

.signal-card {
  position: relative;
  padding: var(--space-6);
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--color-copper) 12%, transparent), transparent 60%),
    var(--color-surface-2);
  overflow: hidden;
}

/* Quieter market cards — clean and small, with positive coloring when positive */
.market-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  background: var(--color-surface-2);
}

.market-card.compact strong {
  display: block;
  margin-bottom: 0;
  color: var(--color-text);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums lining-nums;
}

.market-card.compact strong .unit {
  margin-left: 0.15rem;
  color: var(--color-text-faint);
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 0;
}

.market-card.compact p {
  margin-top: var(--space-1);
  margin-bottom: 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--color-text-muted);
}

.metric-delta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 800;
  font-variant-numeric: tabular-nums lining-nums;
}

.metric-delta.positive {
  color: var(--color-success);
  background: var(--color-success-tint);
  border: 1px solid color-mix(in srgb, var(--color-success) 30%, transparent);
}

.metric-delta.negative {
  /* Used when a price/change indicator drops below zero. Distinct from
     StripMeister brand red so a falling-price chip never reads as a CTA. */
  color: var(--color-risk);
  background: color-mix(in srgb, var(--color-risk) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-risk) 30%, transparent);
}

.metric-delta.neutral {
  color: var(--color-warning);
  background: color-mix(in srgb, var(--color-warning) 14%, transparent);
}

/* Multi-horizon delta chips inside Today's copper reference tile */
.delta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}

.delta-row .metric-delta {
  /* Slightly tighter than a standalone chip so three fit comfortably */
  padding: var(--space-1) 0.6rem;
  font-size: var(--text-xs);
  letter-spacing: -0.01em;
}

.delta-row .delta-unit {
  margin-left: 0.15em;
  font-weight: 700;
  opacity: 0.7;
}

/* === Strip value delta KPI tile === */
/* Override .market-card.compact strong (same specificity but later in cascade)
   so the +$ figure reads in copper, distinct from the green +6.06% badge on the
   sibling Today's copper reference card. */
.market-card.compact strong.spread-delta {
  color: var(--color-copper-bright);
}

.kpi-spread .spread-delta .sign {
  /* Render the plus glyph at the same size/weight as the digits.
     A smaller plus next to a tall '$' can read as '+-$' at low DPR. */
  margin-right: 0.02em;
  font-size: 1em;
  font-weight: 900;
  color: var(--color-copper-bright);
  letter-spacing: 0;
}

.spread-rail {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-copper) 5%, transparent);
  font-variant-numeric: tabular-nums lining-nums;
}

.spread-end {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  flex: 1 1 0;
}

.spread-end small {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spread-end b {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-text);
}

.spread-arrow {
  flex: 0 0 auto;
  width: 28px;
  height: 10px;
  color: var(--color-copper);
}

/* === Arched metallic gauge =============================================
   The gauge is a half-circle (radius 120, center cx=160 cy=170) rendered as
   a CONTINUOUS metallic copper-to-green gradient that descends from
   burnished copper-brown at the low (verify / watch) end, through warm
   amber-copper (good), into olive-green (strong) and finally a vivid
   recovery green (exceptional). Five SVG <stop>s align roughly with the
   score band edges 60 / 78 / 85 / 92 / 100 so the gradient still reads as
   a four-step descent. A second arc overlay paints a soft highlight on the
   upper edge and a shadow on the lower edge of the stroke so the metal
   reads as polished — not flat paint, not a rainbow. Divider tick lines,
   numeric labels, and an inline band legend sit on top so the band edges
   stay scannable. The needle is a stylized elongated triangle drawn as a
   single <polygon> so it stays crisp at any rotation. All gradient stop
   colors come from CSS custom properties (--color-gauge-1…5) so light /
   dark themes propagate without JS. */
.dial-wrap {
  position: relative;
  max-width: 32rem;
  margin: var(--space-3) auto var(--space-6);
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.dial-svg {
  display: block;
  width: 100%;
  height: auto;
  /* Allow the needle's drop-shadow to extend beyond the viewBox a little. */
  overflow: visible;
}

.dial-track {
  fill: none;
  stroke: color-mix(in srgb, var(--color-border) 70%, transparent);
  stroke-width: 22;
  stroke-linecap: butt;
}

/* Gradient stop colors. Set in CSS (rather than as SVG presentation
   attributes) so the var() lookups resolve through the document's theme
   tokens — light/dark themes automatically retint the gauge. */
.dial-grad-stop-1 { stop-color: var(--color-gauge-1); }
.dial-grad-stop-2 { stop-color: var(--color-gauge-2); }
.dial-grad-stop-3 { stop-color: var(--color-gauge-3); }
.dial-grad-stop-4 { stop-color: var(--color-gauge-4); }
.dial-grad-stop-5 { stop-color: var(--color-gauge-5); }
.dial-sheen-stop  { stop-color: var(--color-gauge-sheen-hi); }
.dial-shadow-stop { stop-color: var(--color-gauge-sheen-lo); }

/* Continuous metallic gradient arc. The <linearGradient id="dial-grad"> in
   index.html holds the five stop colors keyed off --color-gauge-1…5 (so
   light/dark themes propagate without JS). This single stroke replaces the
   previous four discrete band paths but still carries the same descent. */
.dial-band-gradient {
  fill: none;
  stroke: url(#dial-grad);
  stroke-width: 22;
  stroke-linecap: butt;
  /* A subtle outer glow lifts the metallic arc off the panel so it reads
     as attention-grabbing without resorting to harsh red. The glow color
     blends warm copper into a hint of the exceptional green so it stays
     in-palette regardless of which segment the needle points to. */
  filter:
    drop-shadow(0 6px 14px color-mix(in srgb, var(--color-copper-deep) 28%, transparent))
    drop-shadow(0 0 6px color-mix(in srgb, var(--color-success) 14%, transparent));
}
[data-theme='light'] .dial-band-gradient {
  filter:
    drop-shadow(0 6px 14px color-mix(in srgb, var(--color-copper-deep) 18%, transparent))
    drop-shadow(0 0 4px color-mix(in srgb, var(--color-success) 10%, transparent));
}

/* Metallic sheen overlay. A second arc drawn ON TOP of the gradient stroke,
   using a NARROWER stroke offset slightly upward via a second linear
   gradient (#dial-sheen). The sheen runs along the upper edge of the band
   to fake a highlight; a second, darker arc below the centerline fakes a
   shadow. Together they read as a polished bevel without overlaying any
   rainbow color. Both arcs sit at low opacity so the underlying gradient
   color still carries the meaning. */
.dial-band-sheen {
  fill: none;
  stroke: url(#dial-sheen);
  stroke-width: 8;
  stroke-linecap: butt;
  /* Slight vertical lift so the highlight sits along the upper rim of
     the main stroke rather than centered on it. */
  transform: translateY(-6px);
  mix-blend-mode: screen;
  opacity: 0.85;
  pointer-events: none;
}
.dial-band-shadow {
  fill: none;
  stroke: url(#dial-shadow);
  stroke-width: 7;
  stroke-linecap: butt;
  transform: translateY(5px);
  mix-blend-mode: multiply;
  opacity: 0.55;
  pointer-events: none;
}
[data-theme='light'] .dial-band-shadow { opacity: 0.40; }

/* Active-band emphasis. The continuous gradient already carries band color;
   this thin overlay halo subtly brightens the active band so the user's eye
   snaps to where the needle is pointing without dimming the rest of the
   arc (which would lose the metallic continuity). app.js sets the dasharray
   on this overlay so only the active segment paints. */
.dial-band-active {
  fill: none;
  stroke: color-mix(in srgb, #fff 60%, transparent);
  stroke-width: 22;
  stroke-linecap: butt;
  mix-blend-mode: overlay;
  opacity: 0;
  transition: stroke-dasharray 240ms ease-out, opacity 200ms ease;
  pointer-events: none;
}
.dial-band-active.is-on { opacity: 0.45; }
[data-theme='light'] .dial-band-active.is-on { opacity: 0.35; }

/* Faint divider lines layered across the segment seams so the band
   thresholds remain visually scannable even at low contrast. */
.dial-dividers line {
  stroke: color-mix(in srgb, var(--color-bg) 70%, var(--color-text) 30%);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.85;
}
[data-theme='light'] .dial-dividers line {
  stroke: color-mix(in srgb, var(--color-bg) 55%, var(--color-text) 45%);
  opacity: 0.6;
}

.dial-ticks line {
  stroke: var(--color-text-faint);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.7;
}

.dial-tick-labels text {
  fill: var(--color-text-faint);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.02em;
  text-anchor: middle;
  dominant-baseline: middle;
}
.dial-tick-labels text.is-active {
  fill: var(--color-text);
}

/* Stylized elongated triangle needle. The polygon is drawn with the tip
   pointing at the current score on the band path; the wide base sits on
   the hub. A thin stroke + drop-shadow keeps the triangle crisp on top of
   any band color regardless of which segment it's pointing at. */
.dial-needle-tri {
  fill: var(--color-text);
  stroke: color-mix(in srgb, var(--color-bg) 60%, transparent);
  stroke-width: 0.75;
  stroke-linejoin: round;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.32));
  transition: points 240ms ease-out;
}
[data-theme='light'] .dial-needle-tri {
  fill: var(--color-text);
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.18));
}

.dial-hub {
  fill: var(--color-charcoal);
  stroke: var(--color-copper-bright);
  stroke-width: 2;
}

[data-theme='light'] .dial-hub {
  fill: var(--color-text);
  stroke: var(--color-copper-bright);
}

/* Stoplight readout integrated below the arc — the only readout in the dial.
   Sits in normal flow so the band legend underneath has guaranteed space
   and never overlaps the integrated score pill. */
.dial-readout {
  display: flex;
  justify-content: center;
  /* Half-circle arc empties out below its midline. Pull the readout pill up
     into that empty space so it sits tucked under the arc's curve, while
     still leaving room for the band legend underneath. */
  margin-top: calc(-1 * var(--space-6));
  position: relative;
  z-index: 1;
}

/* Integrated stoplight: a single illuminated green light + label + small score, centered below the arc */
.buy-light {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem 0.55rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-success) 16%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--color-success) 45%, transparent);
  color: var(--color-text);
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
  max-width: 100%;
  min-width: 0;
}

.buy-light-score {
  display: inline-flex;
  align-items: baseline;
  padding-left: 0.6rem;
  margin-left: 0.1rem;
  border-left: 1px solid color-mix(in srgb, var(--color-success) 35%, transparent);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 900;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
}

.buy-light-score small {
  margin-left: 0.1rem;
  color: var(--color-text-faint);
  font-size: 0.7em;
  font-weight: 700;
}

.buy-light-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: radial-gradient(
    circle at 35% 30%,
    color-mix(in srgb, var(--color-success) 40%, #fff) 0%,
    var(--color-success) 55%,
    color-mix(in srgb, var(--color-success) 60%, #000) 100%
  );
  box-shadow: var(--shadow-glow-green);
  flex-shrink: 0;
}

.buy-light-text {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Band-aware readout variants. The pill mirrors the gauge palette so the
   readout color always matches the segment the needle is pointing to.
     verify (< 60)   = burnished copper-brown   — "Verify conditions"
     watch  (60–77) = burnished copper-brown   — "Watch & review economics"
     good   (78–84) = amber copper             — "Good time to buy"
     strong (85–91) = muted olive-green        — "Strong buying window"
     exceptional (92+) = vivid green            — "Exceptional recovery window"
   Verify and watch share the burnished copper-brown treatment so both
   sub-78 categories read as "not yet a buy" without using "Wait" language
   and without invoking the StripMeister brand red. */
.buy-light.band-verify,
.buy-light.band-watch,
.buy-light.band-hold {
  background: color-mix(in srgb, var(--color-copper-deep) 16%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-copper-deep) 50%, transparent);
}
.buy-light.band-verify .buy-light-dot,
.buy-light.band-watch .buy-light-dot,
.buy-light.band-hold .buy-light-dot {
  background: radial-gradient(
    circle at 35% 30%,
    color-mix(in srgb, var(--color-copper-deep) 30%, #fff) 0%,
    var(--color-copper-deep) 55%,
    color-mix(in srgb, var(--color-copper-deep) 70%, #000) 100%
  );
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-copper-deep) 20%, transparent);
}
.buy-light.band-verify .buy-light-score,
.buy-light.band-watch .buy-light-score,
.buy-light.band-hold .buy-light-score {
  border-left-color: color-mix(in srgb, var(--color-copper-deep) 40%, transparent);
}

.buy-light.band-exceptional {
  background: color-mix(in srgb, var(--color-success) 24%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-success) 60%, transparent);
}

/* "Good" range — amber-copper, the third step in the descent. */
.buy-light.band-good {
  background: color-mix(in srgb, var(--color-copper-bright) 18%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-copper-bright) 50%, transparent);
}
.buy-light.band-good .buy-light-dot {
  background: radial-gradient(
    circle at 35% 30%,
    color-mix(in srgb, var(--color-copper-bright) 35%, #fff) 0%,
    var(--color-copper-bright) 55%,
    color-mix(in srgb, var(--color-copper-bright) 70%, #000) 100%
  );
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-copper-bright) 22%, transparent);
}
.buy-light.band-good .buy-light-score {
  border-left-color: color-mix(in srgb, var(--color-copper-bright) 40%, transparent);
}

/* "Strong" range — muted olive-green, the second step from the top. */
.buy-light.band-strong {
  background: color-mix(in srgb, var(--color-success-muted) 18%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-success-muted) 55%, transparent);
}
.buy-light.band-strong .buy-light-dot {
  background: radial-gradient(
    circle at 35% 30%,
    color-mix(in srgb, var(--color-success-muted) 30%, #fff) 0%,
    var(--color-success-muted) 55%,
    color-mix(in srgb, var(--color-success-muted) 70%, #000) 100%
  );
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-success-muted) 22%, transparent);
}
.buy-light.band-strong .buy-light-score {
  border-left-color: color-mix(in srgb, var(--color-success-muted) 40%, transparent);
}

/* === Compact band legend beneath the gauge =============================== */
.dial-band-legend {
  margin: var(--space-3) auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 0.5rem;
  row-gap: 0.3rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
  text-align: center;
  max-width: 34rem;
}
.dial-band-legend-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--color-text-faint);
  margin-right: 0.1rem;
}
/* Single inline key entry: small color dot + numeric range + label word.
   Lighter than a chip so the row fits on one line on most viewports. */
.dial-band-key {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  font-weight: 500;
  color: var(--color-text-muted);
  opacity: 0.85;
  transition: opacity 200ms ease, color 200ms ease;
}
.dial-band-key .dial-band-chip-range {
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.dial-band-key.is-active {
  opacity: 1;
  font-weight: 700;
  color: var(--color-text);
}
.dial-band-key-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  flex-shrink: 0;
}
/* Legend dots track the four stoplight steps exactly. verify and watch share
   the burnished copper-brown dot — because the published score is floored at
   60 we don't ship a separate 'verify' chip in the legend (it would clutter
   the row for a band the user rarely sees). Verify is still named in the
   screen-reader desc above so the category isn't hidden, just not chip-listed. */
/* Legend dot colors mirror the gauge gradient stops (--color-gauge-1..5)
   exactly so the chip palette matches the metallic arc above. A thin radial
   highlight gives the dot a tiny metallic sheen. */
.dial-band-key.band-verify .dial-band-key-dot,
.dial-band-key.band-watch .dial-band-key-dot {
  background:
    radial-gradient(circle at 35% 30%,
      color-mix(in srgb, var(--color-gauge-1) 40%, #fff) 0%,
      var(--color-gauge-1) 60%,
      color-mix(in srgb, var(--color-gauge-1) 70%, #000) 100%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-gauge-1) 22%, transparent);
}
.dial-band-key.band-good .dial-band-key-dot {
  background:
    radial-gradient(circle at 35% 30%,
      color-mix(in srgb, var(--color-gauge-3) 45%, #fff) 0%,
      var(--color-gauge-3) 60%,
      color-mix(in srgb, var(--color-gauge-3) 70%, #000) 100%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-gauge-3) 24%, transparent);
}
.dial-band-key.band-strong .dial-band-key-dot {
  background:
    radial-gradient(circle at 35% 30%,
      color-mix(in srgb, var(--color-gauge-4) 40%, #fff) 0%,
      var(--color-gauge-4) 60%,
      color-mix(in srgb, var(--color-gauge-4) 70%, #000) 100%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-gauge-4) 24%, transparent);
}
.dial-band-key.band-exceptional .dial-band-key-dot {
  background:
    radial-gradient(circle at 35% 30%,
      color-mix(in srgb, var(--color-gauge-5) 50%, #fff) 0%,
      var(--color-gauge-5) 60%,
      color-mix(in srgb, var(--color-gauge-5) 70%, #000) 100%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-gauge-5) 24%, transparent);
}
.dial-band-key-sep {
  color: var(--color-text-faint);
  opacity: 0.5;
  font-weight: 400;
}
@media (max-width: 480px) {
  .dial-band-legend {
    column-gap: 0.4rem;
    row-gap: 0.25rem;
  }
  .dial-band-key-sep { display: none; }
  .buy-light {
    /* On narrow viewports, tighten padding + label size so the pill
       fits inside the card without horizontal clip. Allow the label
       to wrap if the band string is long (e.g. “Exceptional recovery window”). */
    padding: 0.45rem 0.75rem;
    gap: 0.45rem;
    white-space: normal;
    text-align: left;
    border-radius: var(--radius-md);
  }
  .buy-light-text { font-size: 0.7rem; line-height: 1.2; }
  .buy-light-score { padding-left: 0.5rem; }
}

/* `hidden` attribute must always hide elements, even when other selectors set
   display: inline-flex or flex. Place this near the top of the readout block. */
[hidden] { display: none !important; }

/* Restrained "since last refresh" + drivers lines, rendered below the dial. */
.signal-delta,
.signal-drivers {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  text-align: left;
  line-height: 1.4;
}

.signal-drivers { margin-bottom: var(--space-2); }

.signal-delta-label,
.signal-drivers-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--color-text-faint);
}

.signal-delta-value {
  font-weight: 800;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--color-text);
}

.signal-delta-value.positive { color: var(--color-success); }
.signal-delta-value.negative { color: var(--color-danger, var(--color-copper-deep)); }
.signal-delta-value.flat { color: var(--color-text-faint); }

.signal-delta-meta { color: var(--color-text-faint); }

.signal-drivers-list {
  color: var(--color-text);
  font-weight: 500;
}

.refresh-meta {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-style: italic;
}

/* === Decision panel === */
.decision-panel {
  margin-top: var(--space-4);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.panel-heading {
  max-width: 52rem;
  margin-bottom: var(--space-5);
}

.panel-lede {
  margin-top: 0;
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: 1.5;
}

.timeline-card {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--color-copper) 4%, var(--color-surface-2)), var(--color-surface-2));
  overflow: hidden;
}

.timeline-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 3px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-copper));
  border-radius: 999px;
}

.signal-factors {
  display: grid;
  gap: var(--space-4);
  max-width: 50rem;
  margin: 0;
  padding-left: var(--space-5);
  list-style: decimal;
}

.signal-factors li {
  color: var(--color-text-muted);
}

.signal-factors li::marker {
  color: var(--color-primary);
  font-weight: 900;
}

.signal-factors strong {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--color-text);
  font-weight: 800;
}

/* === CTA card — single grouped area === */
.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  margin-top: var(--space-5);
  padding: var(--space-6);
  border: 1px solid color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--color-primary) 10%, var(--color-charcoal)) 0%,
      color-mix(in srgb, var(--color-copper-deep) 18%, var(--color-charcoal)) 100%);
  color: #f6f4ef;
  box-shadow: var(--shadow-md);
}

.cta-card .eyebrow { color: var(--color-copper-light); }
.cta-card h2 { color: #ffffff; }
.cta-card p { color: rgba(246, 244, 239, 0.78); }

.cta-copy { max-width: 30rem; }

.cta-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  font-weight: 800;
  font-size: var(--text-sm);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.button:hover { transform: translateY(-1px); }

/* Primary CTA — the only place blue appears, the loudest action */
.button.primary {
  color: #ffffff;
  background: var(--color-cta-blue);
  border: 1px solid color-mix(in srgb, var(--color-cta-blue) 60%, #000);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--color-cta-blue) 35%, transparent);
  padding: var(--space-3) var(--space-5);
}
.button.primary:hover {
  background: var(--color-cta-blue-hover);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--color-cta-blue) 45%, transparent);
}

/* Secondary CTA — charcoal-filled chip on the dark CTA card */
.button.secondary {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.32);
}
.button.secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
}

/* Tertiary CTA — subtle ghost link, lowest-weight of the three */
.button.tertiary {
  color: rgba(246, 244, 239, 0.85);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.button.tertiary:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.36);
}

/* === Source / methodology — compact accordion === */
.source-panel {
  margin-top: var(--space-4);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
}

.source-panel details {
  font-size: var(--text-sm);
}

.source-panel summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.source-panel summary::-webkit-details-marker { display: none; }

.source-panel summary::after {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 900;
  transition: transform 180ms ease;
}

.source-panel details[open] summary::after {
  content: '–';
  transform: rotate(0deg);
}

.method-content {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.method-content p {
  font-size: var(--text-sm);
  line-height: 1.6;
}

.source-panel a {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.source-panel a:hover { color: var(--color-primary-hover); }

.disclaimer {
  margin-top: var(--space-3);
  margin-bottom: 0;
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  font-style: italic;
}

/* === Methodology accordion: matrix table, calc block, source list === */
.method-heading {
  margin: var(--space-5) 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.method-heading:first-of-type { margin-top: var(--space-2); }

.method-lede {
  margin: 0 0 var(--space-3);
  color: var(--color-text-muted);
}

.method-table-wrap {
  /* Allow horizontal overflow on narrow viewports without breaking layout */
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  -webkit-overflow-scrolling: touch;
}
.method-table-wrap:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.method-table {
  width: 100%;
  min-width: 560px; /* keeps four columns scannable; container scrolls if narrower */
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.method-table thead th {
  position: sticky;
  top: 0;
  padding: var(--space-3) var(--space-3);
  background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface-2));
  color: var(--color-text);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
}

.method-table tbody th[scope="row"] {
  padding: var(--space-3);
  text-align: left;
  font-weight: 800;
  color: var(--color-text);
  white-space: nowrap;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
  vertical-align: top;
}

.method-table tbody td {
  padding: var(--space-3);
  color: var(--color-text-muted);
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
  vertical-align: top;
  line-height: 1.5;
}

.method-table tbody tr:last-child th,
.method-table tbody tr:last-child td { border-bottom: 0; }

.method-table tbody tr:nth-child(even) td,
.method-table tbody tr:nth-child(even) th[scope="row"] {
  background: color-mix(in srgb, var(--color-surface-offset) 35%, transparent);
}

.method-table td.num {
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 800;
  color: var(--color-text);
  white-space: nowrap;
}
.method-table td.num.pos { color: var(--color-success); }
.method-table td.num.neg { color: var(--color-risk); }

/* Source links inside table cells stay inline-friendly */
.method-table a { font-weight: 600; }

/* Stacked-arithmetic calculation block */
.calc-block {
  margin: var(--space-3) 0 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-copper);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-copper) 5%, var(--color-surface-2));
}

.calc-stack {
  margin: 0;
  padding: 0;
  font-family: 'Satoshi', 'Inter', system-ui, sans-serif;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.calc-row {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  align-items: baseline;
  gap: var(--space-3);
  padding: 0.25rem 0;
}

.calc-op {
  font-weight: 800;
  color: var(--color-text-faint);
  text-align: center;
}

.calc-label {
  color: var(--color-text-muted);
}

.calc-val {
  color: var(--color-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
  white-space: nowrap;
}

.calc-row.calc-rule {
  margin-top: 0.1rem;
  padding-top: 0.45rem;
  border-top: 1.5px solid var(--color-text);
}
.calc-row.calc-rule .calc-op,
.calc-row.calc-rule .calc-label,
.calc-row.calc-rule .calc-val {
  color: var(--color-text);
}
.calc-row.calc-rule .calc-val strong { color: var(--color-copper-bright); }

.calc-row.calc-extension {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed color-mix(in srgb, var(--color-border) 90%, transparent);
  color: var(--color-text-muted);
}
.calc-row.calc-extension .calc-val { color: var(--color-copper-bright); font-weight: 800; }

.calc-block figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-style: italic;
}

/* Source list — compact bulleted column */
.source-list {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-5);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-1) var(--space-5);
  list-style: disc outside;
  color: var(--color-text-muted);
}
.source-list li {
  font-size: var(--text-sm);
  line-height: 1.55;
  break-inside: avoid;
}

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* === Responsive === */
@media (max-width: 980px) {
  .signal-grid {
    grid-template-columns: 1fr 1fr;
  }
  .signal-card { grid-column: 1 / -1; }

  .cta-card {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .cta-stack {
    justify-content: stretch;
    gap: var(--space-2);
  }
  .cta-stack .button { flex: 1 1 auto; }
}

@media (max-width: 620px) {
  .widget-shell {
    width: min(100% - var(--space-4), 1180px);
    padding: var(--space-4) 0;
  }

  .hero-panel,
  .decision-panel,
  .source-panel {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
  }

  .signal-grid {
    grid-template-columns: 1fr;
  }

  .brand-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .theme-toggle { width: 100%; }

  .dial-readout { gap: var(--space-1); }
  .signal-score strong { font-size: 2.6rem; }

  /* Methodology table stays scrollable; tighten column widths a touch on phones */
  .method-table { min-width: 520px; font-size: 0.85rem; }
  .method-table thead th,
  .method-table tbody th[scope="row"],
  .method-table tbody td { padding: 0.6rem 0.7rem; }

  .calc-block { padding: var(--space-3) var(--space-4); }
  .calc-row { grid-template-columns: 1.1rem 1fr auto; gap: var(--space-2); }

  .source-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
