/* ===== StrideNest — design tokens =====
   Mood: calm + premium. Dark navy canvas, sunrise gradient accents.
   Fitness = orange→pink ring. Calories = violet→cyan ring. Spending = mint.
*/
:root {
  --bg: #0b0f17;
  --bg-elev: #11161f;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #f4f6fb;
  --text-dim: #aab2c5;
  --text-muted: #7c8499;

  --grad-fit: linear-gradient(135deg, #ff8a4c 0%, #ff3d7f 100%);
  --grad-cal: linear-gradient(135deg, #7a5bff 0%, #22d3ee 100%);
  --grad-spend: linear-gradient(135deg, #34e0a1 0%, #a7f3d0 100%);
  --grad-sun: radial-gradient(120% 80% at 50% 0%, rgba(255, 138, 76, 0.25) 0%, rgba(255, 61, 127, 0.05) 35%, transparent 70%);

  --accent: #ff3d7f;
  --accent-2: #ff8a4c;
  --good: #34e0a1;
  --warn: #fbbf24;
  --danger: #ff5d6c;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-fab: 0 10px 24px rgba(255, 61, 127, 0.45), 0 2px 6px rgba(0, 0, 0, 0.4);

  --font-display: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  background:
    var(--grad-sun),
    radial-gradient(60% 40% at 80% 100%, rgba(122, 91, 255, 0.18), transparent 60%),
    var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
  padding-bottom: calc(110px + var(--safe-bottom));
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; }
input, select { background: transparent; border: 0; outline: none; }

/* ===== App shell ===== */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 18px;
  padding-top: calc(8px + var(--safe-top));
}

/* ===== Top bar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display:block; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.iconbtn {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.iconbtn:hover { color: var(--text); background: var(--bg-card-strong); }
.iconbtn:active { transform: scale(.96); }

/* ===== Typography ===== */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 28px;
  margin: 0;
}
.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin: 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 22px 4px 10px;
}
.link {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
}
.link.inline { font-weight: 600; color: var(--accent); }

/* ===== Date row ===== */
.date-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 6px 4px 14px;
}
.streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 138, 76, .14), rgba(255, 61, 127, .14));
  color: #ffcdb2;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(255, 138, 76, .22);
}
.streak svg { color: #ff8a4c; }

/* ===== Rings card ===== */
.rings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.ring-stage {
  position: relative;
  width: 168px;
  height: 168px;
  flex: 0 0 168px;
}
.rings { width: 100%; height: 100%; display: block; }
.rings circle {
  transition: stroke-dashoffset .8s cubic-bezier(.2,.7,.2,1);
}
.ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}
.ring-center-label {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ring-center-num {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.ring-legend {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  gap: 10px;
  flex: 1;
}
.ring-legend li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.dot {
  width: 10px; height: 10px;
  border-radius: 999px;
  margin-top: 5px;
  flex-shrink: 0;
}
.leg-name {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}
.leg-val {
  margin: 1px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}
.leg-val span:last-child { color: var(--text-muted); font-weight: 600; }

/* ===== Quick stat tiles ===== */
.quickgrid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.stat:active { transform: scale(.98); background: var(--bg-card-strong); }
.stat-label { margin: 0; font-size: 11px; color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; }
.stat-num { margin: 4px 0 2px; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.stat-sub { margin: 0; font-size: 11px; color: var(--text-muted); }

/* ===== Entries ===== */
.entries {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 8px;
}
.entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.entry-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: grid; place-items: center;
  color: #fff;
}
.entry-icon.steps { background: var(--grad-fit); }
.entry-icon.cal { background: var(--grad-cal); }
.entry-icon.spend { background: var(--grad-spend); color: #082c1f; }
.entry-main { flex: 1; min-width: 0; }
.entry-title { margin: 0; font-weight: 600; font-size: 15px; }
.entry-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }
.entry-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.entry-del {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--text-muted);
}
.entry-del:hover { color: var(--danger); background: rgba(255, 93, 108, .08); }

.empty {
  margin-top: 6px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--bg-card);
  color: var(--text-dim);
  text-align: center;
  font-size: 14px;
}

/* ===== Card baseline ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.card + .card { margin-top: 12px; }
.card-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.card-sub {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-dim);
}

/* Nudge bar */
.nudge {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nudge > div:first-child { flex: 1; }
.nudge-title { margin: 0; font-weight: 600; font-size: 14px; }
.nudge-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }

/* ===== Settings fields ===== */
.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.field:first-of-type { border-top: 0; padding-top: 4px; }
.field > span { font-size: 14px; color: var(--text-dim); }
.field input[type=number],
.field input[type=time],
.field input[type=text],
.field select {
  text-align: right;
  font-weight: 600;
  font-size: 15px;
  min-width: 110px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
}
.field select { padding-right: 28px; }
.inline { display: inline-flex; align-items: center; gap: 6px; }
.inline .prefix { color: var(--text-muted); font-weight: 600; }
.row {
  display: flex; flex-wrap: wrap;
  gap: 8px; padding: 8px 0 4px;
  border-top: 1px solid var(--border);
}
.row:first-child { border-top: 0; padding-top: 0; }

.switch {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 14px; color: var(--text-dim);
  cursor: pointer; user-select: none;
}
.switch input { display: none; }
.switch .slider {
  width: 44px; height: 26px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  position: relative;
  transition: background .15s;
}
.switch .slider::after {
  content: ""; position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 999px;
  background: #fff;
  transition: transform .18s cubic-bezier(.2,.7,.2,1);
}
.switch input:checked + .slider {
  background: linear-gradient(135deg, #ff8a4c, #ff3d7f);
}
.switch input:checked + .slider::after { transform: translateX(18px); }

.hint {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.hint summary {
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  color: var(--accent-2);
  font-weight: 600;
}
.hint summary::-webkit-details-marker { display: none; }
.hint summary::after { content: " ↓"; }
.hint[open] summary::after { content: " ↑"; }
.hint p { margin: 8px 0 12px; font-size: 13px; color: var(--text-dim); }

/* ===== Premium card ===== */
.premium {
  position: relative;
  overflow: hidden;
}
.premium::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(255,138,76,.18), transparent 60%);
  pointer-events: none;
}
.prem-head { display: flex; align-items: center; justify-content: space-between; }
.badge {
  font-size: 11px; padding: 4px 8px; border-radius: 999px;
  background: rgba(255,255,255,.06); color: var(--text-dim);
  border: 1px solid var(--border);
  letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
}
.bullets {
  margin: 0 0 14px; padding: 0; list-style: none;
  display: grid; gap: 8px;
}
.bullets li {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  color: var(--text);
}
.bullets li::before {
  content: ""; position: absolute;
  left: 0; top: 7px;
  width: 12px; height: 12px;
  background: var(--grad-fit);
  border-radius: 4px;
  transform: rotate(45deg);
}
.bullets.tall li { padding-left: 4px; padding-bottom: 4px; }
.bullets.tall li::before { display: none; }
.bullets.tall li strong { color: var(--text); }

.plans {
  display: grid; gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 10px;
}
.plan {
  text-align: left;
  padding: 12px 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
  position: relative;
}
.plan:active { transform: scale(.98); }
.plan.is-best {
  border-color: rgba(255,138,76,.45);
  background: linear-gradient(180deg, rgba(255,138,76,.08), rgba(255,61,127,.05));
}
.plan.is-best::after {
  content: "Most loved";
  position: absolute;
  top: -9px; left: 10px;
  background: var(--grad-fit);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
}
.plan-name { margin: 0; font-size: 12px; color: var(--text-dim); font-weight: 600; }
.plan-name .save { color: var(--good); font-size: 10px; font-weight: 700; margin-left: 4px; }
.plan-price {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.plan-price span { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-left: 2px; }
.plan-sub { margin: 2px 0 0; font-size: 11px; color: var(--text-muted); }
.fineprint { margin: 4px 0 0; font-size: 11px; color: var(--text-muted); }
.fineprint a { color: var(--accent-2); text-decoration: none; }

/* ===== About ===== */
.about p { margin-top: 8px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 15px;
  transition: transform .12s ease, filter .15s ease, background .15s ease;
  width: 100%;
}
.btn.small { width: auto; padding: 9px 14px; font-size: 13px; border-radius: 10px; }
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--grad-fit);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255,61,127,.32);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg-card-strong); }
.btn-danger {
  background: rgba(255, 93, 108, .12);
  border: 1px solid rgba(255, 93, 108, .35);
  color: #ffb1b9;
}

/* ===== FAB ===== */
.app[data-view="settings"] ~ .fab { display: none; }
.fab {
  position: fixed;
  bottom: calc(82px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--grad-fit);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: var(--shadow-fab);
  z-index: 20;
  transition: transform .15s cubic-bezier(.2,.7,.2,1);
}
.fab:active { transform: translateX(-50%) scale(.94); }

/* ===== Bottom nav ===== */
.tabbar {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(11,15,23,.78);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 10;
}
.tabbar::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
}
.tabbtn {
  display: grid; place-items: center; gap: 2px;
  padding: 8px 4px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  border-radius: 12px;
  transition: color .15s ease;
}
.tabbtn.is-active { color: var(--text); }
.tabbtn.is-active svg { color: transparent; -webkit-text-fill-color: transparent; }
.tabbtn.is-active svg path,
.tabbtn.is-active svg circle { stroke: url(#g-steps); }
/* Fallback active style (gradient stroke can fail across browsers) — also color icon directly */
.tabbtn.is-active { color: #ff6ba0; }

/* ===== History view ===== */
.chart-card { margin-top: 14px; }
.tabs {
  display: flex; gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  margin-bottom: 14px;
}
.tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color .15s, background .15s;
}
.tab.is-active { background: rgba(255,255,255,.08); color: var(--text); }
.trend-chart {
  width: 100%;
  height: 160px;
  display: block;
}
.chart-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.ks-label { margin: 0; font-size: 11px; color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; }
.ks-num { margin: 2px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }

.day-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.day-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.day-date { font-family: var(--font-display); font-weight: 700; font-size: 13px; }
.day-date small { display: block; color: var(--text-muted); font-weight: 500; font-size: 11px; margin-top: 2px; }
.day-bars { display: grid; gap: 4px; }
.day-bar-track {
  position: relative;
  height: 6px;
  background: rgba(255,255,255,.05);
  border-radius: 999px;
  overflow: hidden;
}
.day-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.day-bar-fill.steps { background: var(--grad-fit); }
.day-bar-fill.cal { background: var(--grad-cal); }
.day-bar-fill.spend { background: var(--grad-spend); }
.day-pct { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--text-dim); }

/* ===== Bottom sheet ===== */
.sheet, .modal {
  position: fixed; inset: 0;
  z-index: 50;
  display: flex; flex-direction: column;
  justify-content: flex-end;
}
.modal { justify-content: center; align-items: center; padding: 24px; }
.sheet-backdrop, .modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 8, 14, .55);
  backdrop-filter: blur(6px);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet-card {
  position: relative;
  background: linear-gradient(180deg, #161c28 0%, #0f141d 100%);
  border-top: 1px solid var(--border-strong);
  border-radius: 24px 24px 0 0;
  padding: 8px 20px calc(28px + var(--safe-bottom));
  max-width: 480px; width: 100%;
  margin: 0 auto;
  animation: slideUp .28s cubic-bezier(.2,.7,.2,1);
  max-height: 92dvh;
  overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(100%); } }
.sheet-grab {
  width: 38px; height: 4px;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  margin: 6px auto 14px;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.sheet-head h2 { font-size: 20px; }

/* Segmented control */
.seg {
  display: flex; gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,.05);
  border-radius: 14px;
  margin-bottom: 18px;
}
.seg-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background .2s ease, color .15s ease;
}
.seg-btn.is-active {
  background: rgba(255,255,255,.1);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset;
}

/* Big numeric input */
.bigfield { display: block; margin-bottom: 16px; }
.bigfield-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.bigfield-row {
  display: flex; align-items: baseline;
  gap: 8px;
  padding: 14px 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.bigfield-row input {
  flex: 1; min-width: 0;
  background: transparent;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.bigfield-row input::placeholder { color: rgba(255,255,255,.18); }
.bigfield-prefix {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--text-dim);
}
.bigfield-suffix {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: .02em;
}

.chips {
  display: flex; flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { color: var(--text); background: var(--bg-card-strong); }

.sheet-foot {
  margin: 12px 0 0;
  font-size: 12px;
  text-align: center;
  color: var(--text-muted);
}

/* ===== Modal ===== */
.modal-card {
  position: relative;
  background: linear-gradient(180deg, #161c28 0%, #0f141d 100%);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 26px 22px 22px;
  max-width: 420px;
  width: 100%;
  animation: pop .25s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 30px 60px rgba(0,0,0,.55);
  max-height: 88dvh;
  overflow-y: auto;
}
@keyframes pop { from { transform: scale(.94) translateY(8px); opacity: 0; } }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-card h2 { font-size: 20px; margin-bottom: 4px; }
.modal-sub { margin: 0 0 16px; color: var(--text-dim); font-size: 14px; }
.steps {
  margin: 0 0 16px; padding: 0; list-style: none;
  counter-reset: step;
  display: grid; gap: 10px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 12px 14px 12px 44px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 12px; top: 12px;
  width: 22px; height: 22px;
  background: var(--grad-fit);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  border-radius: 999px;
  display: grid; place-items: center;
}
.kbd {
  display: inline-block;
  padding: 0 6px;
  border-radius: 5px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border-strong);
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.callout {
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(122,91,255,.1), rgba(34,211,238,.06));
  border: 1px solid rgba(122,91,255,.22);
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 14px;
}
.callout strong { color: var(--text); }

/* ===== First-run onboarding ===== */
.onboarding { z-index: 70; }
.onboarding .modal-backdrop {
  background:
    radial-gradient(80% 50% at 50% 0%, rgba(52,224,161,.18), transparent 65%),
    rgba(5, 8, 14, .78);
}
.onboarding-card {
  overflow: hidden;
  background:
    radial-gradient(90% 45% at 50% 0%, rgba(34,211,238,.15), transparent 60%),
    linear-gradient(180deg, #171e2a 0%, #0f141d 100%);
}
.onboarding-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.onboarding-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(34,211,238,.22);
}
#onboarding-count {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.onboarding-kicker {
  margin: 0 0 8px;
  color: #7ee7d2;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.onboarding-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.035);
}
.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 18px 0;
}
.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  transition: width .2s ease, background .2s ease;
}
.onboarding-dot.is-active {
  width: 24px;
  background: linear-gradient(90deg, #34E0A1, #22D3EE);
}
.onboarding-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  align-items: center;
}
.onboarding-actions .btn[hidden] { display: none; }
.onboarding-actions:has(.btn[hidden]) { grid-template-columns: 1fr; }
.onboarding-skip {
  display: block;
  width: max-content;
  margin: 14px auto 0;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(150px + var(--safe-bottom));
  background: rgba(11,15,23,.94);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 60;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  animation: toastIn .22s cubic-bezier(.2,.7,.2,1);
}
@keyframes toastIn { from { transform: translate(-50%, 8px); opacity: 0; } }

/* Hidden helper */
[hidden] { display: none !important; }

/* Smaller phones */
@media (max-width: 360px) {
  .display { font-size: 24px; }
  .ring-stage { width: 148px; height: 148px; flex-basis: 148px; }
  .stat-num { font-size: 20px; }
}

/* Larger / tablet — still constrain */
@media (min-width: 520px) {
  body { padding: 0; }
}

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