/* ==========================================================================
   SUMMIT OS — Design System
   Dark, premium, mountain-serious. Tokens → base → components → views.
   ========================================================================== */

/* ---------- 1. TOKENS ---------- */
:root {
  /* color — deep alpine charcoal slate */
  --bg-0: #07090d;
  --bg-1: #0c1017;
  --bg-2: #111722;
  --bg-3: #161e2c;
  --surface: rgba(20, 27, 40, 0.72);
  --surface-solid: #141b28;
  --glass: rgba(255, 255, 255, 0.035);
  --glass-strong: rgba(255, 255, 255, 0.06);

  --text-0: #f2f5f9;
  --text-1: #b9c2cf;
  --text-2: #7c8798;
  --text-3: #4d5768;

  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-strong: rgba(255, 255, 255, 0.16);

  --accent: #f59e0b;          /* summit gold */
  --accent-2: #fb7185;        /* sunset rose */
  --accent-3: #38bdf8;        /* high-altitude blue */
  --accent-4: #34d399;        /* valley green */
  --danger: #f87171;
  --warn: #fbbf24;
  --info: #60a5fa;

  --grad-sunset: linear-gradient(135deg, #f59e0b 0%, #fb7185 100%);
  --grad-peak: linear-gradient(180deg, #38bdf8 0%, #6366f1 100%);

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-full: 999px;

  --shadow-1: 0 1px 2px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
  --shadow-2: 0 8px 32px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 0 1px rgba(245,158,11,0.2), 0 8px 40px rgba(245,158,11,0.10);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.28s;

  --nav-w: 232px;
  --radius: 20px;
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text-0);
  font-size: 14.5px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(245,158,11,0.30); color: #fff; }

a { color: var(--accent-3); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-0);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: var(--r-full);
  border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: #223047; }

/* ambient background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(99, 102, 241, 0.10), transparent 60%),
    radial-gradient(800px 600px at -10% 30%, rgba(245, 158, 11, 0.05), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(56, 189, 248, 0.06), transparent 60%),
    var(--bg-0);
}

/* ---------- 3. LAYOUT ---------- */
.app-shell { display: flex; min-height: 100vh; }

.nav {
  width: var(--nav-w);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--stroke);
  background: rgba(7, 9, 13, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 30;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
}

.nav-brand svg { width: 30px; height: 30px; flex: none; }

.nav-brand-name {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.nav-brand-sub {
  font-size: 10px;
  color: var(--text-2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: -2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text-1);
  font-weight: 550;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  position: relative;
}

.nav-item svg { width: 18px; height: 18px; opacity: 0.85; flex: none; }

.nav-item:hover { background: var(--glass); color: var(--text-0); text-decoration: none; }

.nav-item.active {
  background: var(--glass-strong);
  color: var(--text-0);
  border-color: var(--stroke);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: var(--r-full);
  background: var(--grad-sunset);
}

.nav-spacer { flex: 1; }

.nav-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--stroke);
}

.nav-foot-avatar {
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  background: var(--grad-peak);
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px;
  color: white;
  flex: none;
}

.nav-foot-name { font-size: 13px; font-weight: 650; line-height: 1.2; }
.nav-foot-sub { font-size: 11px; color: var(--text-2); }

/* ---------- 4. CONTENT ---------- */
.content {
  flex: 1;
  min-width: 0;
  padding: 26px 32px 56px;
  max-width: 1280px;
}

.page-head { margin-bottom: 22px; }

.page-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title .date-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--stroke);
  padding: 4px 12px;
  border-radius: var(--r-full);
}

.page-sub { color: var(--text-2); margin-top: 4px; font-size: 13.5px; }

/* ---------- 5. COMPONENTS ---------- */

/* cards */
.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  padding: 20px;
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.card:hover { border-color: var(--stroke-strong); }

.card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title .link { font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--accent-3); }

/* grid */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-main { grid-template-columns: 1.35fr 1fr; }

/* stat tiles */
.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.stat-value small { font-size: 15px; font-weight: 600; color: var(--text-2); }

.stat-delta { font-size: 12px; font-weight: 600; }
.stat-delta.up { color: var(--accent-4); }
.stat-delta.down { color: var(--danger); }
.stat-delta.flat { color: var(--text-2); }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 650;
  border: 1px solid var(--stroke-strong);
  background: var(--glass);
  color: var(--text-0);
  transition: all var(--dur) var(--ease);
}

.btn:hover { background: var(--glass-strong); border-color: var(--stroke-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--grad-sunset);
  border: none;
  color: #1a0f00;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.22);
}

.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 6px 26px rgba(245,158,11,0.30); }

.btn-ghost { background: transparent; border-color: var(--stroke); color: var(--text-1); }
.btn-ghost:hover { color: var(--text-0); }

.btn-danger { background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.3); color: var(--danger); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-block { width: 100%; }

/* badges & pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: var(--text-1);
}

.pill.run { color: var(--accent-4); border-color: rgba(52,211,153,0.25); background: rgba(52,211,153,0.08); }
.pill.hike { color: var(--accent); border-color: rgba(245,158,11,0.25); background: rgba(245,158,11,0.08); }
.pill.walk { color: var(--accent-3); border-color: rgba(56,189,248,0.25); background: rgba(56,189,248,0.08); }
.pill.bike { color: var(--accent-2); border-color: rgba(251,113,133,0.25); background: rgba(251,113,133,0.08); }
.pill.strength { color: #c4b5fd; border-color: rgba(196,181,253,0.25); background: rgba(196,181,253,0.08); }
.pill.rest { color: var(--text-2); }
.pill.done { color: var(--accent-4); border-color: rgba(52,211,153,0.3); }
.pill.partial { color: var(--warn); border-color: rgba(251,191,36,0.3); }
.pill.missed { color: var(--danger); border-color: rgba(248,113,113,0.3); }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  color: #1a0f00;
  background: var(--grad-sunset);
}

/* progress */
.progress { height: 6px; border-radius: var(--r-full); background: var(--bg-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--grad-sunset); transition: width 0.8s var(--ease); }
.progress.blue > span { background: var(--grad-peak); }
.progress.green > span { background: linear-gradient(90deg, #34d399, #22d3ee); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 11.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }

.field input, .field select, .field textarea {
  background: var(--bg-2);
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  width: 100%;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ---------- 6. LOGIN ---------- */
.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg-0);
}

.login-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }

.login-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; }
.orb-a { width: 520px; height: 520px; background: rgba(245,158,11,0.22); top: -160px; right: -120px; }
.orb-b { width: 460px; height: 460px; background: rgba(99,102,241,0.25); bottom: -160px; left: -120px; }

.login-grain {
  position: absolute; inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 44px 36px 32px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-2);
  z-index: 1;
  text-align: center;
  animation: rise 0.5s var(--ease);
}

.login-mark svg { width: 56px; height: 56px; margin-bottom: 14px; }

.login-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.login-sub { color: var(--text-2); font-size: 13.5px; margin: 6px 0 26px; }

.login-form { display: flex; flex-direction: column; gap: 16px; text-align: left; }

.login-error {
  color: var(--danger);
  font-size: 13px;
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.25);
  padding: 9px 12px;
  border-radius: var(--r-sm);
}

.login-hint { color: var(--text-3); font-size: 11.5px; margin-top: 18px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 7. EXPEDITION HERO ---------- */
.exp-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  margin-bottom: 16px;
}

.exp-cols { display: flex; flex-direction: column; gap: 16px; }

.exp-card {
  padding: 24px;
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--stroke);
  background: var(--surface);
  position: relative;
}

.exp-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 260px at 85% -20%, rgba(245,158,11,0.12), transparent 60%);
  pointer-events: none;
}

.exp-card.peek::after {
  background: radial-gradient(600px 260px at 85% -20%, rgba(56,189,248,0.12), transparent 60%);
}

.exp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

.exp-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.exp-op { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }

.exp-countdown {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin: 18px 0 6px;
}

.exp-countdown small { font-size: 14px; color: var(--text-2); font-weight: 600; letter-spacing: 0; }
.exp-countdown .unit { font-size: 13px; color: var(--text-2); font-weight: 650; margin-left: 4px; }

.exp-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.exp-3d {
  min-height: 260px;
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, #0b1220 0%, #0a0f1a 100%);
}

/* ---------- 8. WEEK STRIP / CALENDAR ---------- */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }

.day-cell {
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: var(--glass);
  padding: 12px 8px;
  text-align: center;
  transition: all var(--dur) var(--ease);
  position: relative;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.day-cell:hover { border-color: var(--stroke-strong); background: var(--glass-strong); }
.day-cell.today { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.day-cell.dim { opacity: 0.45; }

.day-dow { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); }
.day-num { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.day-type { font-size: 10.5px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.day-load { font-size: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------- 9. TABLES / LISTS ---------- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--stroke);
}
.list-item:last-child { border-bottom: none; }

.li-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  flex: none;
}
.li-icon svg { width: 18px; height: 18px; }

.li-body { flex: 1; min-width: 0; }
.li-title { font-weight: 650; font-size: 13.5px; }
.li-sub { color: var(--text-2); font-size: 12px; }
.li-right { text-align: right; font-variant-numeric: tabular-nums; }
.li-right .v { font-weight: 750; font-size: 14px; }
.li-right .u { color: var(--text-3); font-size: 11px; }

/* ---------- 10. CHART SHELL ---------- */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }

.chart-tooltip {
  position: fixed;
  z-index: 100;
  background: var(--surface-solid);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  box-shadow: var(--shadow-2);
  max-width: 240px;
}

.chart-tooltip .tt-title { font-weight: 700; margin-bottom: 3px; }
.chart-tooltip .tt-row { color: var(--text-1); font-variant-numeric: tabular-nums; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-1); }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; }

/* ---------- 11. FLAGS / ALERTS ---------- */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 16px;
  border-radius: var(--r-md);
  border: 1px solid;
  font-size: 13px;
  margin-bottom: 10px;
}

.alert.warn { background: rgba(251,191,36,0.07); border-color: rgba(251,191,36,0.25); color: #fde68a; }
.alert.danger { background: rgba(248,113,113,0.07); border-color: rgba(248,113,113,0.25); color: #fecaca; }
.alert.info { background: rgba(96,165,250,0.07); border-color: rgba(96,165,250,0.25); color: #bfdbfe; }
.alert.ok { background: rgba(52,211,153,0.07); border-color: rgba(52,211,153,0.25); color: #a7f3d0; }

.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.alert strong { display: block; font-size: 13px; margin-bottom: 1px; }

/* ---------- 12. RESPONSIVE ---------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-main { grid-template-columns: 1fr; }
  .exp-hero { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .content { padding: 18px 16px 90px; }

  .app-shell { flex-direction: column; }

  .nav {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 0;
    top: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-right: none;
    border-top: 1px solid var(--stroke);
    background: rgba(7, 9, 13, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 50;
  }

  .nav-brand, .nav-spacer, .nav-foot { display: none; }

  .nav-item { flex-direction: column; gap: 2px; padding: 6px 12px; font-size: 10px; border-radius: var(--r-sm); }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-item.active::before { display: none; }
  .nav-item.active { background: var(--glass-strong); }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }

  /* week strip: keep 7 columns but compact + scrollable instead of crushed */
  .week-strip {
    grid-template-columns: repeat(7, 68px);
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .day-cell { scroll-snap-align: start; min-height: 76px; padding: 10px 6px; }

  .page-title { font-size: 21px; flex-wrap: wrap; }
  .exp-countdown { font-size: 36px; }
}

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

/* accessible focus ring — keyboard users see it, mouse users don't */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---------- 13. MISC ---------- */
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.grow { flex: 1; }
.center { text-align: center; }

.skeleton {
  border-radius: var(--r-md);
  background: linear-gradient(100deg, var(--bg-2) 40%, var(--bg-3) 50%, var(--bg-2) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  min-height: 40px;
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* view enter animation */
.view { animation: viewIn 0.35s var(--ease); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* toast */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(420px, calc(100vw - 32px)); }
.toast {
  background: var(--surface-solid);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--r-md);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-2);
  animation: rise 0.3s var(--ease);
}
.toast.ok { border-color: rgba(52,211,153,0.4); color: var(--accent-4); }
.toast.err { border-color: rgba(248,113,113,0.4); color: var(--danger); }

/* empty state */
.empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-2);
  font-size: 13.5px;
  border: 1px dashed var(--stroke-strong);
  border-radius: var(--r-lg);
}

.empty svg { width: 30px; height: 30px; margin-bottom: 10px; opacity: 0.5; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s;
}

.modal {
  width: 100%; max-width: 520px;
  background: var(--surface-solid);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--r-xl);
  padding: 26px;
  box-shadow: var(--shadow-2);
  animation: rise 0.3s var(--ease);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}

@keyframes fadeIn { from { opacity: 0; } }

.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-title { font-size: 17px; font-weight: 750; }

/* kpi sparkline variant */
.kpi-spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 10px; }
.kpi-spark i { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, rgba(245,158,11,0.55), rgba(245,158,11,0.08)); min-height: 4px; }

/* Garmin-synced indicator dot inside pills */
.sync-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: var(--r-full);
  background: var(--accent-4);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.7);
  vertical-align: middle;
  margin-right: 2px;
}