/*
  Möbius portal — Interoception-grade visual language, ported from the
  native iOS / macOS app. All tokens here mirror StacksDesign.swift:
  petrol-teal brand, dark teal-charcoal surfaces, big rounded numerals,
  all-caps tracked headers, soft cards.
*/

:root {
  /* Brand */
  --brand-1: #2C8A9E;
  --brand-2: #5FB0BD;
  --brand-soft: #B8DDD9;
  --brand-grad: linear-gradient(135deg, #2C8A9E, #5FB0BD);

  /* Surface — slightly cooler than the playground at /src/ */
  --bg: #0A1418;
  --bg-deep: #050A0D;
  --surface: #101F24;          /* mobiusCardDark */
  --surface-2: #15262C;        /* mobiusCardDarkHi */
  --stroke: rgba(255, 255, 255, 0.06);
  --stroke-strong: rgba(255, 255, 255, 0.12);
  --stroke-brand: rgba(168, 212, 208, 0.15);

  /* Text */
  --text: #EAF0F6;
  --text-muted: #8B97A7;
  --text-dim: #5A6371;

  /* Per-metric accents — same hex as MetricAccent.swift */
  --accent-sleep:    #5FB0BD;
  --accent-energy:   #4A8E9A;
  --accent-hrv:      #6BA8C7;
  --accent-steps:    #7AC1B5;
  --accent-vagal:    #8499D6;
  --accent-recovery: #6FB89E;
  --accent-weight:   #5891B0;
  --accent-food:     #87B5C2;
  --accent-pattern:  #6E8FA0;
  --accent-pantry:   #3F7D87;
  --accent-intero:   #B084B8;
  --accent-warn:     #E6B265;
  --accent-bad:      #E07060;
  --accent-good:     #5FB089;

  /* Spacing scale — 4 / 8 / 12 / 16 / 24 / 32 / 48 */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-card: 22px;       /* matches StacksSpacing.cardCornerRadius */
  --r-pill: 999px;

  /* Shadows */
  --shadow-card:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-card-hover:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px var(--stroke-brand);

  /* Type stack — match SF on Apple, Inter as a near-clone fallback */
  --font:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text',
    'Inter', system-ui, 'Helvetica Neue', Arial, sans-serif;
  --font-num:
    'SF Pro Rounded', -apple-system, ui-rounded,
    'SF Pro Display', system-ui, sans-serif;

  /* Transitions */
  --t-fast: 120ms cubic-bezier(.2, .9, .2, 1);
  --t-spring: 420ms cubic-bezier(.2, .8, .2, 1);
}

/* ============================================================
   Reset
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  /* Static teal-charcoal vertical gradient — matches MobiusBackground */
  background-image: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
button { font-family: inherit; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { color: var(--brand-soft); }
img, svg { display: block; max-width: 100%; }
::selection { background: rgba(95, 176, 189, 0.35); color: var(--text); }

/* Scrollbar — slim, dark */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.06);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); background-clip: padding-box; }

/* ============================================================
   Boot splash — fades out once app.js mounts the real shell
   ============================================================ */

.boot-splash {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: var(--bg);
  z-index: 100;
  animation: boot-fade 600ms ease 700ms forwards;
}
.boot-mark {
  font-family: var(--font-num);
  font-size: 42px;
  font-weight: 300;
  color: var(--text);
  letter-spacing: -0.012em;
}
@keyframes boot-fade { to { opacity: 0; visibility: hidden; } }

/* ============================================================
   App shell
   ============================================================ */

.app-root { min-height: 100vh; }

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: linear-gradient(180deg, rgba(10, 20, 24, 0.85), rgba(10, 20, 24, 0.55));
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--stroke);
}
.topbar .wordmark {
  font-family: var(--font-num);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.008em;
  color: var(--text);
  user-select: none;
}
.topbar nav { display: flex; gap: var(--s-1); }
.topbar nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-radius: var(--r-pill);
  transition: color var(--t-fast), background var(--t-fast);
}
.topbar nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.topbar nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(95, 176, 189, 0.14);
  box-shadow: inset 0 0 0 1px rgba(95, 176, 189, 0.2);
}
.topbar .grow { flex: 1; }
.topbar .who {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted);
}
.topbar .who .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-good);
  box-shadow: 0 0 8px rgba(95, 176, 137, 0.6);
}
.topbar .who.offline .dot { background: var(--accent-bad); box-shadow: 0 0 8px rgba(224,112,96,0.6); }
.topbar .who button {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px 8px; border-radius: var(--r-pill);
  font-size: 12px;
}
.topbar .who button:hover { color: var(--text); background: rgba(255,255,255,0.04); }

.page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s-6) var(--s-5) var(--s-7);
}

@media (max-width: 640px) {
  .topbar { padding: var(--s-3) var(--s-4); gap: var(--s-2); }
  .topbar nav a { padding: 5px 10px; font-size: 11px; }
  .page { padding: var(--s-5) var(--s-4) var(--s-7); }
}

/* ============================================================
   Cards (MobiusCard equivalent)
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-card);
  padding: var(--s-5);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--t-spring), transform var(--t-spring), border-color var(--t-fast);
}
.card.is-hero {
  background:
    radial-gradient(1200px 200px at 0% 0%, rgba(95,176,189,0.06), transparent 60%),
    var(--surface);
}
.card.is-hover:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}
.card[data-accent] { /* optional 1px accent edge */
  border-color: color-mix(in srgb, var(--card-accent, var(--brand-2)) 18%, var(--stroke));
}
.card .card-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: var(--s-3);
}
.card .card-header .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--card-accent, var(--brand-2));
  box-shadow: 0 0 8px color-mix(in srgb, var(--card-accent, var(--brand-2)) 60%, transparent);
}
.card .card-header .label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted);
}
.card .card-header .grow { flex: 1; }
.card .card-header .right {
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ============================================================
   Section header
   ============================================================ */

.section-header {
  display: flex; align-items: center; gap: 10px;
  margin: var(--s-6) 0 var(--s-3);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted);
}
.section-header .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--section-accent, var(--brand-2));
  box-shadow: 0 0 8px color-mix(in srgb, var(--section-accent, var(--brand-2)) 60%, transparent);
}
.section-header .grow { flex: 1; }
.section-header .more {
  text-transform: none; letter-spacing: 0.02em;
  font-weight: 500; font-size: 12px; color: var(--brand-2);
}
.section-header .more:hover { color: var(--brand-soft); }

/* ============================================================
   Stat — hero numeral
   ============================================================ */

.stat {
  display: flex; flex-direction: column; gap: 6px;
}
.stat .stat-caption {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted);
}
.stat .stat-row {
  display: flex; align-items: baseline; gap: 8px;
  flex-wrap: wrap;
}
.stat .stat-value {
  font-family: var(--font-num);
  font-weight: 300;
  font-size: clamp(40px, 8vw, 80px);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--stat-color, var(--text));
  font-variant-numeric: tabular-nums;
}
.stat .stat-unit {
  font-family: var(--font-num);
  font-weight: 500;
  font-size: clamp(14px, 1.8vw, 18px);
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.stat .stat-sub {
  font-size: 12px; color: var(--text-muted);
}
.stat.is-hero .stat-value { font-size: clamp(56px, 10vw, 96px); font-weight: 200; }

/* deltas / chips */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-3); }
.chip {
  display: inline-flex; flex-direction: column; gap: 2px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  min-width: 84px;
}
.chip .chip-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim);
}
.chip .chip-value {
  font-family: var(--font-num);
  font-weight: 500; font-size: 16px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.chip.is-up    .chip-value { color: var(--accent-good); }
.chip.is-down  .chip-value { color: var(--accent-bad); }
.chip.is-flat  .chip-value { color: var(--text-muted); }

/* ============================================================
   Buttons — primary uses brand gradient (one per screen)
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
  user-select: none;
}
.btn:hover { background: rgba(255,255,255,0.04); }
.btn:active { transform: translateY(1px); }
.btn.btn-primary {
  background: var(--brand-grad);
  color: #06181B;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(44,138,158,0.35), 0 0 0 1px rgba(184,221,217,0.15) inset;
}
.btn.btn-primary:hover { filter: brightness(1.06); background: var(--brand-grad); }
.btn.btn-ghost {
  border-color: var(--stroke-strong);
  color: var(--text-muted);
}
.btn.btn-ghost:hover { color: var(--text); border-color: var(--stroke-strong); }
.btn.btn-danger { color: var(--accent-bad); }
.btn.btn-danger:hover { background: rgba(224,112,96,0.08); }
.btn.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ============================================================
   Sign-in screen
   ============================================================ */

.signin {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: var(--s-5);
  background:
    radial-gradient(800px 500px at 50% 18%, rgba(95,176,189,0.08), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}
.signin .signin-card {
  width: 100%; max-width: 440px;
  text-align: center;
  padding: var(--s-7) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
/* Möbius bare-strip glyph — same artwork the landing boot splash uses.
   PNG is 1806×1204; using aspect-ratio: 3/2 guarantees no squash even
   if the parent ever clips/resizes; mix-blend-mode: screen drops the
   PNG's black background against the dark card surface. */
.signin .wordmark-icon {
  display: block;
  width: 180px;
  height: auto;
  aspect-ratio: 3 / 2;
  margin: 0 auto var(--s-3);
  object-fit: contain;
  mix-blend-mode: screen;
}
.signin .wordmark-big {
  font-family: var(--font-num);
  font-weight: 300;
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: -0.012em;
  color: var(--text);
  margin: 0 0 var(--s-2);
  line-height: 1;
  font-style: normal;
}

/* No cursive anywhere on the portal either. */
em, i, cite, dfn, address {
  font-style: normal;
  font-family: inherit;
}

/* Custom HIG-compliant "Sign in with Apple" button.
   Apple HIG: 44 pt height, capsule corner radius (≤ half-height = 22),
   black bg + white text + white Apple glyph for dark surfaces, SF Pro
   Display Medium 17 pt label, glyph + label centred horizontally. */
.apple-signin-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  width: 320px;
  max-width: 100%;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 22px;
  background: #000;
  color: #fff;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
               'SF Pro Text', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-style: normal;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 200ms ease;
  -webkit-appearance: none; appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.apple-signin-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.apple-signin-btn:active {
  transform: translateY(0);
}
.apple-signin-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.apple-signin-glyph {
  flex-shrink: 0;
  margin-bottom: 1px; /* visual centring against the label baseline */
}
.apple-signin-label {
  font-family: inherit;
  font-style: normal;
}
.signin .tagline {
  font-size: 13px; color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 0 0 var(--s-6);
}
.signin .apple-mount {
  display: flex; justify-content: center;
  min-height: 48px;
  margin-bottom: var(--s-3);
}
.signin .apple-mount > div { width: 100%; max-width: 320px; }
.signin .footnote {
  margin-top: var(--s-5);
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 0.06em;
}
.signin .footnote a { color: var(--text-muted); }
.signin .alt-cta {
  margin-top: var(--s-4);
  font-size: 12px; color: var(--text-muted);
}
.signin .err {
  margin-top: var(--s-3);
  font-size: 12px; color: var(--accent-bad);
}

/* ============================================================
   Home — greeting + grid
   ============================================================ */

.greeting {
  display: flex; align-items: flex-end; gap: var(--s-5);
  flex-wrap: wrap;
}
.greeting .date-num {
  font-family: var(--font-num);
  font-weight: 200;
  font-size: clamp(56px, 10vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.greeting .date-meta {
  display: flex; flex-direction: column; gap: 2px;
  padding-bottom: 6px;
}
.greeting .date-meta .day {
  font-family: var(--font-num);
  font-size: 22px; font-weight: 300;
  color: var(--text);
  letter-spacing: -0.005em;
}
.greeting .date-meta .month {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted);
}

.grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: var(--s-4);
}
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Vagal/residual placeholder card — breathes when waiting */
.vagal-placeholder {
  display: flex; align-items: center; gap: var(--s-4);
}
.vagal-placeholder .glyph {
  font-family: var(--font-num);
  font-size: 64px; font-weight: 200;
  color: var(--accent-vagal);
  opacity: 0.55;
  animation: breathe 4s ease-in-out infinite;
  line-height: 1;
}
.vagal-placeholder .copy { flex: 1; }
.vagal-placeholder .copy h3 {
  margin: 0 0 4px;
  font-size: 15px; font-weight: 500;
}
.vagal-placeholder .copy p {
  margin: 0;
  font-size: 12px; color: var(--text-muted);
}
@keyframes breathe {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}
@media (prefers-reduced-motion: reduce) {
  .vagal-placeholder .glyph { animation: none; opacity: 0.65; }
}

/* Devices summary card */
.dev-summary {
  display: flex; align-items: center; gap: var(--s-4);
}
.dev-summary .count {
  font-family: var(--font-num);
  font-size: 56px; font-weight: 200; line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dev-summary .meta { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.dev-summary .meta .lab {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted);
}
.dev-summary .dots { display: flex; gap: 6px; }
.dev-summary .dots .d {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--d-color, var(--brand-2));
  box-shadow: 0 0 6px color-mix(in srgb, var(--d-color, var(--brand-2)) 50%, transparent);
}

/* ============================================================
   Devices view
   ============================================================ */

.dev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-4);
}
.dev-card { display: flex; flex-direction: column; gap: var(--s-3); }
.dev-card .head {
  display: flex; align-items: center; gap: var(--s-3);
}
.dev-card .glyph {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--d-color, var(--brand-2)) 14%, var(--surface-2));
  color: var(--d-color, var(--brand-2));
  font-size: 22px;
  border: 1px solid color-mix(in srgb, var(--d-color, var(--brand-2)) 25%, transparent);
}
.dev-card .name {
  font-size: 16px; font-weight: 500; color: var(--text);
}
.dev-card .kind-line {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
}
.dev-card .meta-row {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--text-muted);
}
.dev-card .actions { margin-top: auto; display: flex; justify-content: flex-end; }

/* ============================================================
   Events
   ============================================================ */

.events-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--stroke);
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden;
}
.event-row {
  display: grid;
  grid-template-columns: 28px 110px 1fr auto;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--stroke);
  font-size: 13px;
}
.event-row:last-child { border-bottom: none; }
.event-row .ico {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  font-size: 14px;
  color: var(--ev-color, var(--brand-2));
}
.event-row .when {
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.event-row .summary {
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.event-row .kind {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim);
}

@media (max-width: 640px) {
  .event-row { grid-template-columns: 22px 1fr auto; }
  .event-row .when { display: none; }
}

.filters {
  display: flex; gap: var(--s-3); flex-wrap: wrap;
  margin-bottom: var(--s-4);
}
.select, .input {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  font-size: 13px;
  min-height: 38px;
}
.select:focus, .input:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(95,176,189,0.15);
}

.pager {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: var(--s-4);
  font-size: 12px; color: var(--text-muted);
}

/* ============================================================
   Chart
   ============================================================ */

.chart {
  width: 100%; height: 220px;
  position: relative;
}
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .axis-y {
  font-size: 10px; fill: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.chart .axis-x {
  font-size: 10px; fill: var(--text-dim);
}
.chart .grid-line {
  stroke: var(--stroke);
  stroke-width: 1;
}
.chart .value-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.chart .ema-line {
  fill: none;
  stroke-width: 1.4;
  stroke-dasharray: 4 4;
  stroke-linecap: round;
  opacity: 0.7;
}
.chart .area { stroke: none; }
.chart .focus-dot {
  fill: var(--text);
  stroke: var(--bg);
  stroke-width: 2;
}

/* ============================================================
   Empty / loading / error
   ============================================================ */

.empty {
  text-align: center;
  padding: var(--s-7) var(--s-4);
  color: var(--text-muted);
}
.empty .glyph {
  font-family: var(--font-num);
  font-size: 64px; font-weight: 200;
  color: var(--text-dim);
  margin-bottom: var(--s-3);
}
.empty h3 { margin: 0 0 var(--s-2); font-size: 16px; color: var(--text); font-weight: 500; }
.empty p { margin: 0; font-size: 13px; }

.loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: var(--s-6);
  color: var(--text-muted);
  font-size: 13px;
}
.loading .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-2);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1); }
}

.err-banner {
  margin: var(--s-3) 0;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--accent-bad) 30%, transparent);
  background: color-mix(in srgb, var(--accent-bad) 8%, var(--surface));
  color: var(--text);
  font-size: 13px;
}
.err-banner .lab {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-bad);
  margin-bottom: 2px;
}

/* ============================================================
   Utilities
   ============================================================ */

.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.col { display: flex; flex-direction: column; gap: var(--s-3); }
.spacer { flex: 1; }
.tabular { font-variant-numeric: tabular-nums; }
.mono-num { font-family: var(--font-num); }
.center { text-align: center; }

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