/* ============================================================================
   SaveCon Water Anomaly Detection — shared design system (Phase 0, rev B)
   ----------------------------------------------------------------------------
   Single source of truth for typography, color, spacing, radii, shadows and
   the small set of component primitives every dashboard page consumes.

   Rev B (visual elevation pass): same semantics, stronger application —
   real layered elevation, tinted page background, confident badge treatment
   (dot-carrying chips + solid headline variant), hero-scale metric values,
   and a dark-first theme behind :root[data-theme="dark"].

   Rules of the file:
   - Tokens are CSS custom properties prefixed `--ds-`.
   - Component primitives are classes prefixed `ds-`.
   - Status color SEMANTICS are load-bearing across the app (dashboard,
     device detail, schema, model reports). Extend, never reassign:
       normal / watch / warning / critical  -> anomaly severity (ordinal)
       stale                                -> device stopped reporting
                                               (NOT a severity verdict)
       unknown / excluded                   -> no data yet / not scored
                                               (deliberately achromatic)
       rule                                 -> rule-based-by-design (hybrid
                                               critical channels) — NOT ML,
                                               NOT a severity
       indep                                -> independently human-validated
                                               (Model Reports)
   - Light theme: severity is encoded twice — hue AND monotonic lightness
     (watch is the lightest accent, critical the darkest) so color-vision-
     deficient readers get the ordinal reading from darkness. The solid badge
     variant fills with the -fg step, so the ordering survives the fill.
     Dark theme: accents are re-stepped contrast-first against the dark
     surface (a dark critical would be the least visible — backwards), so
     there the ordinal reading rides on the mandatory text label + dot, never
     on lightness. Status colors are never the only carrier anywhere: every
     badge/pill in the app renders its text label.
   - Light accents validated with the dataviz six-checks script (surface
     #ffffff): all contrast >= 3:1, CVD separation in or above the
     labeled-secondary-encoding band; the two adjacent ordinal ramp pairs
     (warning<->critical, warning<->normal) are the documented exceptions.
     Dark accents validated the same way against the dark surface — see
     shared/DESIGN_SYSTEM.md for both runs.
   ========================================================================== */

/* ── Fonts (self-hosted, same-origin — no CDN at runtime) ─────────────────
   InterVariable  : UI sans. JetBrainsMono : numerics/telemetry/code.
   latin + latin-ext subsets (Turkish summaries need latin-ext). Variable
   weight axes, one file per subset. Preload the two latin files from pages
   for shift-free loading. */
@font-face {
  font-family: "InterVariable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/design/fonts/inter-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "InterVariable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/design/fonts/inter-latin-ext-wght.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0300-0301, U+0303-0304, U+0308-0309, U+0323,
    U+0329, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "JetBrainsMono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/static/design/fonts/jetbrains-mono-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "JetBrainsMono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/static/design/fonts/jetbrains-mono-latin-ext-wght.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0300-0301, U+0303-0304, U+0308-0309, U+0323,
    U+0329, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  /* Typography */
  --ds-font-sans: "InterVariable", -apple-system, "Segoe UI", system-ui,
    sans-serif;
  --ds-font-mono: "JetBrainsMono", ui-monospace, "Cascadia Code", "Menlo",
    monospace;
  --ds-text-xs: 11px;
  --ds-text-sm: 12px;
  --ds-text-base: 13px;
  --ds-text-md: 15px;
  --ds-text-lg: 18px;
  --ds-text-xl: 22px;
  --ds-text-2xl: 27px;  /* metric/hero values */
  --ds-text-3xl: 34px;  /* the one number a view leads with */
  --ds-weight-normal: 420;   /* variable axis: slightly above 400 for crispness at 13px */
  --ds-weight-medium: 520;
  --ds-weight-semibold: 600;
  --ds-weight-bold: 700;
  --ds-leading: 1.5;
  --ds-tracking-wide: 0.06em; /* uppercase micro-labels */
  --ds-tracking-tight: -0.015em; /* large numerals/headlines */

  /* Neutral surfaces & ink.
     The page background is a real cool tint (not near-white) so elevated
     white cards visibly sit ABOVE it — depth by contrast, not by border. */
  --ds-bg: #e7ebf1;
  --ds-bg-sheen: linear-gradient(180deg, #eef1f6 0%, #e7ebf1 220px);
  --ds-surface: #ffffff;
  --ds-surface-sunken: #f1f4f8;   /* wells, table header fills */
  --ds-header-bg: #131a2b;        /* app header band */
  --ds-header-grad: linear-gradient(180deg, #1d2740 0%, #131a2b 100%);
  --ds-header-ink: #dfe5ee;
  --ds-header-link: #8fb8e8;
  --ds-border: #e0e5ec;           /* hairlines are quieter; shadows separate */
  --ds-border-strong: #c6cfda;
  --ds-ink: #171b24;
  --ds-ink-muted: #5b6472;
  --ds-ink-faint: #8b93a2;

  /* Status — severity ramp (ordinal: accents darken as severity rises).
     -accent : the strong color (dots, glyphs, chart marks, schema lanes)
     -fg     : dark text on the tinted chip background (AA on -bg) — also
               the fill of the solid badge variant (white ink on it passes)
     -bg     : chip tint (rev B: deepened ~1.5x so chips read confident,
               not washed out; fg/bg contrast re-verified, see doc)
     -border : chip/panel edge in the status hue (banners/wells — the badge
               itself no longer draws a border) */
  --ds-status-normal-accent: #128a51;
  --ds-status-normal-fg: #0d5e38;
  --ds-status-normal-bg: #d8efe2;
  --ds-status-normal-border: #a9d9c0;

  --ds-status-watch-accent: #c8860a;
  --ds-status-watch-fg: #7a5205;
  --ds-status-watch-bg: #faeccb;
  --ds-status-watch-border: #e7cf92;

  --ds-status-warning-accent: #b83b09;
  --ds-status-warning-fg: #8a2c07;
  --ds-status-warning-bg: #fbe2d3;
  --ds-status-warning-border: #efbb96;

  --ds-status-critical-accent: #960b47;
  --ds-status-critical-fg: #7c0a3b;
  --ds-status-critical-bg: #f9dde9;
  --ds-status-critical-border: #ecafc9;

  /* Status — non-severity states */
  --ds-status-stale-accent: #7c3aed;   /* device stopped reporting */
  --ds-status-stale-fg: #5b21b6;
  --ds-status-stale-bg: #ebe2fc;
  --ds-status-stale-border: #cdb8f4;

  --ds-status-unknown-accent: #64748b; /* no data yet */
  --ds-status-unknown-fg: #46526b;
  --ds-status-unknown-bg: #e7ebf0;
  --ds-status-unknown-border: #ccd4de;

  --ds-status-excluded-accent: #64748b; /* scored out: null / barrier timeout */
  --ds-status-excluded-fg: #5b6472;
  --ds-status-excluded-bg: #edeff3;
  --ds-status-excluded-border: #d8dde4;

  --ds-status-rule-accent: #0691b8;    /* rule-based by design — not ML, not a severity */
  --ds-status-rule-fg: #086182;
  --ds-status-rule-bg: #d6eef7;
  --ds-status-rule-border: #a2d7e9;

  --ds-status-indep-accent: #2340c9;   /* independently human-validated */
  --ds-status-indep-fg: #1d33a8;
  --ds-status-indep-bg: #e0e6fa;
  --ds-status-indep-border: #b6c2f1;

  /* Pipeline-health aliases (system-health panel, schema page).
     Aliases, not new colors: healthy=normal, degraded=watch, unhealthy=critical. */
  --ds-status-healthy-accent: var(--ds-status-normal-accent);
  --ds-status-healthy-fg: var(--ds-status-normal-fg);
  --ds-status-healthy-bg: var(--ds-status-normal-bg);
  --ds-status-healthy-border: var(--ds-status-normal-border);
  --ds-status-degraded-accent: var(--ds-status-watch-accent);
  --ds-status-degraded-fg: var(--ds-status-watch-fg);
  --ds-status-degraded-bg: var(--ds-status-watch-bg);
  --ds-status-degraded-border: var(--ds-status-watch-border);
  --ds-status-unhealthy-accent: var(--ds-status-critical-accent);
  --ds-status-unhealthy-fg: var(--ds-status-critical-fg);
  --ds-status-unhealthy-bg: var(--ds-status-critical-bg);
  --ds-status-unhealthy-border: var(--ds-status-critical-border);

  /* Simulation context (Simulation page, Phase 2).
     NOT a status and never part of the severity ramp: it marks a whole SURFACE
     as synthetic/not-live, so it must never be mistaken for a channel verdict.
     Fuchsia sits outside the ramp (green→amber→orange→crimson) and outside the
     non-severity hues already spoken for — stale violet, rule cyan, indep blue,
     flow blue — so a simulation surface can carry real status badges on top of
     it without hue collision. */
  --ds-sim-accent: #b5179e;
  --ds-sim-fg: #8e1180;
  --ds-sim-bg: #fbe0f6;
  --ds-sim-border: #eeb0e2;
  --ds-sim-stripe: rgba(181, 23, 158, 0.14);

  /* Flow/animation accents (schema page) */
  --ds-flow: #2f7fd6;
  --ds-flow-glow: rgba(47, 127, 214, 0.55);
  --ds-idle-line: #c3ccd6;

  /* Spacing (4px base) */
  --ds-space-1: 4px;
  --ds-space-2: 8px;
  --ds-space-3: 12px;
  --ds-space-4: 16px;
  --ds-space-5: 20px;
  --ds-space-6: 24px;
  --ds-space-7: 32px;
  --ds-space-8: 40px;

  /* Radii */
  --ds-radius-sm: 4px;
  --ds-radius: 6px;
  --ds-radius-lg: 10px;
  --ds-radius-full: 999px;

  /* Elevation — layered: a crisp key line + soft ambient + long diffuse.
     Cards wear --ds-shadow by default (rev B: no more defined-but-unused). */
  --ds-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06),
    0 1px 4px rgba(15, 23, 42, 0.05);
  --ds-shadow: 0 1px 1px rgba(15, 23, 42, 0.04),
    0 3px 8px rgba(15, 23, 42, 0.06),
    0 16px 32px -12px rgba(15, 23, 42, 0.14);
  --ds-shadow-lg: 0 2px 4px rgba(15, 23, 42, 0.05),
    0 10px 24px rgba(15, 23, 42, 0.09),
    0 32px 64px -24px rgba(15, 23, 42, 0.2);

  /* Motion */
  --ds-transition: 140ms ease;
}

/* ── Dark-first theme ───────────────────────────────────────────────────────
   One override point, zero component changes. Accents are re-stepped (not
   auto-flipped) and validated against --ds-surface #141b2b with the dataviz
   six-checks script (--mode dark). -fg tokens become light tints (text on
   dark chips); the solid badge fills with -fg and inks with the surface
   color, so it stays readable in both themes by construction. */
:root[data-theme="dark"] {
  --ds-bg: #0b101b;
  --ds-bg-sheen: linear-gradient(180deg, #101728 0%, #0b101b 260px);
  --ds-surface: #141b2b;
  --ds-surface-sunken: #101623;
  --ds-header-bg: #0d1322;
  --ds-header-grad: linear-gradient(180deg, #16203a 0%, #0d1322 100%);
  --ds-header-ink: #d5dcea;
  --ds-header-link: #8fb8e8;
  --ds-border: #232d40;
  --ds-border-strong: #32405a;
  --ds-ink: #e8ecf4;
  --ds-ink-muted: #9aa5b8;
  --ds-ink-faint: #67748b;

  --ds-status-normal-accent: #2aa96b;
  --ds-status-normal-fg: #8ee6ba;
  --ds-status-normal-bg: #15311f;
  --ds-status-normal-border: #1f4a33;

  --ds-status-watch-accent: #bd8a0c;
  --ds-status-watch-fg: #f0c96d;
  --ds-status-watch-bg: #322813;
  --ds-status-watch-border: #4c3d1a;

  --ds-status-warning-accent: #bf3f17;
  --ds-status-warning-fg: #f59d78;
  --ds-status-warning-bg: #371c10;
  --ds-status-warning-border: #562a17;

  --ds-status-critical-accent: #e8399f;
  --ds-status-critical-fg: #f688c0;
  --ds-status-critical-bg: #3a1224;
  --ds-status-critical-border: #5c1c39;

  --ds-status-stale-accent: #9678f2;
  --ds-status-stale-fg: #c5b2fb;
  --ds-status-stale-bg: #261c40;
  --ds-status-stale-border: #3d2e66;

  --ds-status-unknown-accent: #8494ab;
  --ds-status-unknown-fg: #aab6c9;
  --ds-status-unknown-bg: #1c2536;
  --ds-status-unknown-border: #2d3a52;

  --ds-status-excluded-accent: #8494ab;
  --ds-status-excluded-fg: #98a4b8;
  --ds-status-excluded-bg: #192131;
  --ds-status-excluded-border: #28334a;

  --ds-status-rule-accent: #18a0c4;
  --ds-status-rule-fg: #7cd4ee;
  --ds-status-rule-bg: #0f2b38;
  --ds-status-rule-border: #15455a;

  /* Simulation context — re-stepped for the dark surface, not auto-flipped. */
  --ds-sim-accent: #e879d6;
  --ds-sim-fg: #f3aee8;
  --ds-sim-bg: #33113a;
  --ds-sim-border: #5d2062;
  --ds-sim-stripe: rgba(232, 121, 214, 0.12);

  --ds-status-indep-accent: #5a5fe6;
  --ds-status-indep-fg: #a6a9f9;
  --ds-status-indep-bg: #1b2342;
  --ds-status-indep-border: #2d3c6d;

  --ds-flow: #5b9be4;
  --ds-flow-glow: rgba(91, 155, 228, 0.55);
  --ds-idle-line: #32405a;

  --ds-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35),
    0 1px 4px rgba(0, 0, 0, 0.3);
  --ds-shadow: 0 1px 1px rgba(0, 0, 0, 0.3),
    0 3px 8px rgba(0, 0, 0, 0.35),
    0 16px 32px -12px rgba(0, 0, 0, 0.55);
  --ds-shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.35),
    0 10px 24px rgba(0, 0, 0, 0.45),
    0 32px 64px -24px rgba(0, 0, 0, 0.65);
}

/* ── Base primitives ────────────────────────────────────────────────────── */

/* Status badge — the one way to render a status anywhere in the app.
   Rev B: borderless chip on a deepened tint, carrying a solid accent dot —
   the pale hairline-outline pill read as tentative. Always contains its text
   label; color is never the only carrier (the dot is a bonus channel, and
   the --glyph variant upgrades it to a severity shape).
   Per-status modifiers only set the three channel variables. */
.ds-badge {
  --badge-accent: var(--ds-status-unknown-accent);
  --badge-fg: var(--ds-status-unknown-fg);
  --badge-bg: var(--ds-status-unknown-bg);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--ds-radius-full);
  background: var(--badge-bg);
  color: var(--badge-fg);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-xs);
  font-weight: 650;
  letter-spacing: var(--ds-tracking-wide);
  text-transform: uppercase;
  line-height: 1.6;
  white-space: nowrap;
}
.ds-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--badge-accent);
  flex-shrink: 0;
}
.ds-badge--normal   { --badge-accent: var(--ds-status-normal-accent);   --badge-fg: var(--ds-status-normal-fg);   --badge-bg: var(--ds-status-normal-bg); }
.ds-badge--watch    { --badge-accent: var(--ds-status-watch-accent);    --badge-fg: var(--ds-status-watch-fg);    --badge-bg: var(--ds-status-watch-bg); }
.ds-badge--warning  { --badge-accent: var(--ds-status-warning-accent);  --badge-fg: var(--ds-status-warning-fg);  --badge-bg: var(--ds-status-warning-bg); }
.ds-badge--critical { --badge-accent: var(--ds-status-critical-accent); --badge-fg: var(--ds-status-critical-fg); --badge-bg: var(--ds-status-critical-bg); }
.ds-badge--stale    { --badge-accent: var(--ds-status-stale-accent);    --badge-fg: var(--ds-status-stale-fg);    --badge-bg: var(--ds-status-stale-bg); }
.ds-badge--unknown  { --badge-accent: var(--ds-status-unknown-accent);  --badge-fg: var(--ds-status-unknown-fg);  --badge-bg: var(--ds-status-unknown-bg); }
.ds-badge--rule     { --badge-accent: var(--ds-status-rule-accent);     --badge-fg: var(--ds-status-rule-fg);     --badge-bg: var(--ds-status-rule-bg); }
.ds-badge--indep    { --badge-accent: var(--ds-status-indep-accent);    --badge-fg: var(--ds-status-indep-fg);    --badge-bg: var(--ds-status-indep-bg); }
.ds-badge--healthy   { --badge-accent: var(--ds-status-healthy-accent);   --badge-fg: var(--ds-status-healthy-fg);   --badge-bg: var(--ds-status-healthy-bg); }
.ds-badge--degraded  { --badge-accent: var(--ds-status-degraded-accent);  --badge-fg: var(--ds-status-degraded-fg);  --badge-bg: var(--ds-status-degraded-bg); }
.ds-badge--unhealthy { --badge-accent: var(--ds-status-unhealthy-accent); --badge-fg: var(--ds-status-unhealthy-fg); --badge-bg: var(--ds-status-unhealthy-bg); }
/* excluded: typography carries the difference from unknown; hollow dot = absence */
.ds-badge--excluded {
  --badge-accent: var(--ds-status-excluded-accent);
  --badge-fg: var(--ds-status-excluded-fg);
  --badge-bg: var(--ds-status-excluded-bg);
  font-style: italic;
  font-weight: var(--ds-weight-normal);
  text-transform: none;
  letter-spacing: 0;
}
.ds-badge--excluded::before {
  background: transparent;
  border: 1.5px solid var(--badge-accent);
  width: 6px;
  height: 6px;
}

/* Solid variant — headline moments only (device rollup, overall pipeline
   health): fills with the -fg step (dark in light theme, so white-ish ink
   passes AA; light in dark theme, where surface-colored ink passes) and the
   dot flips to the pale tint. Severity lightness order is preserved because
   the -fg ramp keeps it. */
.ds-badge--solid {
  background: var(--badge-fg);
  color: var(--ds-surface);
}
.ds-badge--solid::before { background: var(--badge-bg); }

/* Size variant — the pipeline HEALTHY badge and per-device rollups deserve
   more presence than a per-channel chip. */
.ds-badge--lg {
  font-size: var(--ds-text-sm);
  padding: 5px 14px;
  gap: 8px;
}
.ds-badge--lg::before { width: 8px; height: 8px; }

/* Optional shape glyph: a second, non-color severity channel.
   normal ● / watch ◆ / warning ▲ / critical ■ ; stale ◌ (hollow = absence).
   Replaces the default dot. */
.ds-badge--glyph::before {
  width: auto;
  height: auto;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 8px;
  line-height: 1;
}
.ds-badge--glyph.ds-badge--normal::before   { content: "●"; color: var(--ds-status-normal-accent); }
.ds-badge--glyph.ds-badge--watch::before    { content: "◆"; color: var(--ds-status-watch-accent); }
.ds-badge--glyph.ds-badge--warning::before  { content: "▲"; color: var(--ds-status-warning-accent); }
.ds-badge--glyph.ds-badge--critical::before { content: "■"; color: var(--ds-status-critical-accent); }
.ds-badge--glyph.ds-badge--stale::before    { content: "◌"; color: var(--ds-status-stale-accent); }
.ds-badge--glyph.ds-badge--rule::before     { content: "⚙"; font-size: 10px; color: var(--ds-status-rule-accent); }

/* Card / panel — visibly sits above the tinted page (rev B: cards wear the
   full layered shadow, borders retreat to a faint keyline). */
.ds-card {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow);
}
.ds-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-3);
  padding: var(--ds-space-3) var(--ds-space-4);
  border-bottom: 1px solid var(--ds-border);
}
.ds-card__title {
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-semibold);
  letter-spacing: var(--ds-tracking-wide);
  text-transform: uppercase;
  color: var(--ds-ink-muted);
}
.ds-card__body { padding: var(--ds-space-4); }

/* Data table */
.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-base);
}
.ds-table th {
  text-align: left;
  padding: var(--ds-space-2) var(--ds-space-3);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-semibold);
  letter-spacing: var(--ds-tracking-wide);
  text-transform: uppercase;
  color: var(--ds-ink-muted);
  background: var(--ds-surface-sunken);
  border-bottom: 1px solid var(--ds-border-strong);
  white-space: nowrap;
}
.ds-table td {
  padding: 10px var(--ds-space-3);
  border-bottom: 1px solid var(--ds-border);
  color: var(--ds-ink);
}
.ds-table tbody tr { transition: background var(--ds-transition); }
.ds-table tbody tr:hover { background: var(--ds-surface-sunken); }
.ds-table tbody tr:last-child td { border-bottom: none; }
.ds-table--compact th, .ds-table--compact td { padding: var(--ds-space-1) var(--ds-space-2); }

/* Numeric / telemetry text — always the mono face, tabular by nature */
.ds-num {
  font-family: var(--ds-font-mono);
  font-size: 0.96em;
  font-variant-numeric: tabular-nums;
}
.ds-table td.ds-num, .ds-table th.ds-num { text-align: right; }

/* Metric tile (KPI) — rev B: values at hero scale; this is a data-dense
   monitoring product, the numbers ARE the interface. */
.ds-metric {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow-sm);
  padding: var(--ds-space-3) var(--ds-space-4);
  min-width: 120px;
}
.ds-metric__label {
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-medium);
  letter-spacing: var(--ds-tracking-wide);
  text-transform: uppercase;
  color: var(--ds-ink-muted);
  margin-bottom: var(--ds-space-1);
  white-space: nowrap;
}
.ds-metric__value {
  font-family: var(--ds-font-mono);
  font-size: var(--ds-text-2xl);
  font-weight: 640;
  letter-spacing: var(--ds-tracking-tight);
  color: var(--ds-ink);
  line-height: 1.1;
}
.ds-metric__unit {
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-normal);
  letter-spacing: 0;
  color: var(--ds-ink-faint);
  margin-left: 3px;
}
.ds-metric--accent { border-left: 3px solid var(--ds-status-rule-accent); }
/* Secondary figure inside a metric value, e.g. the "/ 0" of "13 / 0" —
   the headline number stays loud, the denominator steps back. */
.ds-metric__value small {
  font-size: 0.55em;
  font-weight: var(--ds-weight-medium);
  color: var(--ds-ink-faint);
  letter-spacing: 0;
}

/* Buttons */
.ds-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-border-strong);
  background: var(--ds-surface);
  color: var(--ds-ink);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-medium);
  line-height: 1.5;
  cursor: pointer;
  box-shadow: var(--ds-shadow-sm);
  transition: background var(--ds-transition), border-color var(--ds-transition),
    box-shadow var(--ds-transition);
}
.ds-btn:hover { background: var(--ds-surface-sunken); border-color: var(--ds-ink-faint); }
.ds-btn:focus-visible { outline: 2px solid var(--ds-flow); outline-offset: 1px; }
.ds-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.ds-btn--primary {
  background: var(--ds-header-bg);
  border-color: var(--ds-header-bg);
  color: #ffffff;
}
.ds-btn--primary:hover { background: #232e44; border-color: #232e44; }
/* Uses the -fg step (not -accent) as the fill: -fg is the step already
   validated >= 4.5:1 against --ds-surface in both themes (the same pairing
   the solid badge variant uses), so button text stays AA-legible whichever
   theme is active — -accent alone fails ~3.8:1 white-on-pink in dark mode. */
.ds-btn--danger {
  background: var(--ds-status-critical-fg);
  border-color: var(--ds-status-critical-fg);
  color: var(--ds-surface);
}
.ds-btn--danger:hover { box-shadow: var(--ds-shadow), 0 0 0 3px var(--ds-status-critical-bg); }
.ds-btn--ghost { border-color: transparent; background: transparent; box-shadow: none; }
.ds-btn--ghost:hover { background: var(--ds-surface-sunken); }
.ds-btn--sm { padding: 2px 8px; font-size: var(--ds-text-xs); }

/* Utility text + shared states */
.ds-muted { color: var(--ds-ink-muted); }
.ds-empty {
  color: var(--ds-ink-muted);
  font-style: italic;
  font-size: var(--ds-text-sm);
  text-align: center;
  padding: var(--ds-space-4) 0;
}
/* Stale-poll banner ("showing last known data as of …") */
.ds-banner-stale {
  background: var(--ds-status-watch-bg);
  border: 1px solid var(--ds-status-watch-border);
  color: var(--ds-status-watch-fg);
  border-radius: var(--ds-radius);
  padding: var(--ds-space-2) var(--ds-space-3);
  font-size: var(--ds-text-sm);
}


/* Language switch (TR | EN), drawn by i18n.js into any element. Same segmented look as the page's other switches. */
.lang-toggle { display: inline-flex; border: 1px solid var(--ds-border-strong, rgba(127,127,127,.4)); border-radius: 999px; overflow: hidden; }
.lang-toggle button { font: inherit; font-size: 11px; font-weight: 650; letter-spacing: .04em; padding: 3px 10px; border: 0; background: transparent; color: inherit; cursor: pointer; opacity: .65; }
.lang-toggle button:hover { opacity: 1; }
.lang-toggle button[aria-pressed="true"] { background: var(--ds-header-link, #7fd0e0); color: #08111f; opacity: 1; }
