/* ============================================================
   PlanXFit — design tokens
   Light palette on bare :root; dark redefined twice so both
   the OS setting and an explicit data-theme stamp resolve.
   ============================================================ */
:root {
  --ground:      #F3F5EE;
  --surface:     #FFFFFF;
  --surface-2:   #F1F4EA;
  --surface-3:   #E6EAD8;
  --ink:         #14160F;
  --ink-2:       #40433A;
  --ink-mute:    #6E7268;
  --line:        #E2E6D7;
  --line-strong: #C9CFBB;
  --accent:      #5E7F00;
  --accent-ink:  #FFFFFF;
  --accent-soft: #E9F6C2;
  --accent-line: #C3DB79;
  --live:        #E4602A;
  --live-soft:   #FCE9DF;
  --ok:          #4E7C00;
  --ok-soft:     #E4F4C4;
  --warn:        #9A6A05;
  --warn-soft:   #FBEFD6;
  --crit:        #C93A34;
  --crit-soft:   #FBE4E2;

  /* Training zones — an ordered scale, not categorical identity.
     z2 leans lime to tie into the brand accent. */
  --z1: #8FBCDD;
  --z2: #6FA31E;
  --z3: #C08D1C;
  --z4: #AC4A12;
  --z5: #74202E;

  --shadow-sm: 0 1px 2px rgba(14, 20, 36, .06), 0 1px 3px rgba(14, 20, 36, .04);
  --shadow-md: 0 4px 12px rgba(14, 20, 36, .08), 0 1px 3px rgba(14, 20, 36, .05);
  --shadow-lg: 0 18px 50px rgba(14, 20, 36, .16);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --font-display: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-data: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --tab-h: 60px;
  --shell-w: 430px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:      #0F1011;
    --surface:     #1B1C1E;
    --surface-2:   #232527;
    --surface-3:   #2D2F31;
    --ink:         #F1F4EC;
    --ink-2:       #B6BBAF;
    --ink-mute:    #7C817A;
    --line:        #2A2C2E;
    --line-strong: #3B3D3F;
    --accent:      #CBF23D;
    --accent-ink:  #141800;
    --accent-soft: #2A3410;
    --accent-line: #4A5A18;
    --live:        #FF8B4D;
    --live-soft:   #3A1F10;
    --ok:          #A6E635;
    --ok-soft:     #26310C;
    --warn:        #E7B443;
    --warn-soft:   #33280C;
    --crit:        #FF7A72;
    --crit-soft:   #3A1815;

    --z1: #7FB8E0;
    --z2: #A6E635;
    --z3: #E0BA52;
    --z4: #F0844A;
    --z5: #FF7A72;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, .55);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .7);
  }
}

:root[data-theme="dark"] {
  --ground:      #0F1011;
  --surface:     #1B1C1E;
  --surface-2:   #232527;
  --surface-3:   #2D2F31;
  --ink:         #F1F4EC;
  --ink-2:       #B6BBAF;
  --ink-mute:    #7C817A;
  --line:        #2A2C2E;
  --line-strong: #3B3D3F;
  --accent:      #CBF23D;
  --accent-ink:  #141800;
  --accent-soft: #2A3410;
  --accent-line: #4A5A18;
  --live:        #FF8B4D;
  --live-soft:   #3A1F10;
  --ok:          #A6E635;
  --ok-soft:     #26310C;
  --warn:        #E7B443;
  --warn-soft:   #33280C;
  --crit:        #FF7A72;
  --crit-soft:   #3A1815;

  --z1: #7FB8E0;
  --z2: #A6E635;
  --z3: #E0BA52;
  --z4: #F0844A;
  --z5: #FF7A72;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .55);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .7);
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ============================================================
   App shell — full bleed on phones, framed column on desktop
   ============================================================ */
.shell {
  position: relative;
  width: 100%;
  max-width: var(--shell-w);
  margin: 0 auto;
  height: 100dvh;
  height: 100svh;
  background: var(--ground);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 620px) {
  body {
    background:
      radial-gradient(1200px 600px at 50% -10%, var(--surface-3), transparent 70%),
      var(--ground);
    padding: 26px 0;
  }
  .shell {
    height: min(880px, calc(100dvh - 52px));
    border-radius: 30px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
  }
}

/* --- header --- */
.appbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) 12px calc(16px + env(safe-area-inset-left, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 5;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.wordmark .wx { color: var(--accent); font-weight: 800; }
.wordmark .tick {
  display: inline-block;
  width: 4px;
  height: 15px;
  background: var(--accent);
  border-radius: 1px;
  transform: skewX(-14deg);
  position: relative;
  top: 1px;
}
.appbar-sub {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: .02em;
}

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--surface-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }

.appbar-right { display: flex; align-items: center; gap: 8px; }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: -0.02em;
  color: var(--accent-ink);
  background: var(--accent);
  flex: 0 0 auto;
}

/* --- scroll body --- */
.view {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 calc(var(--tab-h) + 26px);
  scroll-behavior: smooth;
}

.section {
  padding: 18px 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section + .section { padding-top: 20px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.section-head h2 { font-size: 16.5px; }
.section-head .link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- event card --- */
.event {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 12px;
  align-items: start;
  text-align: left;
  width: 100%;
  transition: border-color .15s, transform .12s;
}
.event:hover { border-color: var(--line-strong); }
.event:active { transform: scale(.994); }

.event-when {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 0 5px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.event-when .dow {
  font-size: 9.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-mute);
}
.event-when .dom {
  font-family: var(--font-display); font-weight: 800;
  font-size: 18px; line-height: 1.05; letter-spacing: -0.03em;
}
.event-when .hm {
  font-family: var(--font-data); font-size: 10px;
  color: var(--ink-mute); font-variant-numeric: tabular-nums;
}
.event-when.is-today { background: var(--accent-soft); border-color: var(--accent-line); }
.event-when.is-today .dow, .event-when.is-today .hm { color: var(--accent); }
.event-when.is-today .dom { color: var(--accent); }

.event-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 14.5px;
  letter-spacing: -0.015em; line-height: 1.25;
}
.event-meta {
  font-size: 11.5px; color: var(--ink-mute);
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
}
.event-meta .dot { opacity: .5; }

.event-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 9px;
}

/* --- chips / pills --- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2.5px 8px;
  border-radius: 999px;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface-3); color: var(--ink-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.chip.live   { background: var(--live-soft); color: var(--live); }
.chip.ok     { background: var(--ok-soft); color: var(--ok); }
.chip.warn   { background: var(--warn-soft); color: var(--warn); }
.chip.crit   { background: var(--crit-soft); color: var(--crit); }
.chip .pulse {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.sport {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 5px;
  font-size: 10.5px;
  background: var(--surface-3); color: var(--ink-2);
  flex: 0 0 auto;
}
.sport svg { width: 12px; height: 12px; }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 700; letter-spacing: -0.005em;
  background: var(--accent); color: var(--accent-ink);
  transition: filter .15s, transform .12s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.96); }
.btn.ghost {
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: var(--surface-3); }
.btn.going {
  background: var(--ok-soft); color: var(--ok);
  border: 1px solid transparent;
}
.btn.full { width: 100%; }
.btn.sm { padding: 5px 11px; font-size: 11.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* --- attendee stack --- */
.faces { display: flex; align-items: center; }
.faces .face {
  width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700;
  font-family: var(--font-display);
  color: var(--surface);
  border: 1.5px solid var(--surface);
  margin-left: -6px;
}
.faces .face:first-child { margin-left: 0; }
.faces .count {
  font-size: 11px; color: var(--ink-mute); margin-left: 7px;
  font-family: var(--font-data); font-variant-numeric: tabular-nums;
}

/* --- capacity meter --- */
.cap { display: flex; align-items: center; gap: 7px; }
.cap-bar {
  width: 46px; height: 4px; border-radius: 2px;
  background: var(--surface-3); overflow: hidden;
}
.cap-bar i { display: block; height: 100%; border-radius: 2px; background: var(--ok); }
.cap-bar.warn i { background: var(--warn); }
.cap-bar.crit i { background: var(--crit); }
.cap-txt { font-size: 10.5px; color: var(--ink-mute); font-family: var(--font-data); }

/* ============================================================
   Hero / today strip
   ============================================================ */
.hero {
  padding: 16px;
  margin: 14px 16px 0;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 14px;
}
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hero h1 { font-size: 21px; line-height: 1.15; letter-spacing: -0.035em; }
.hero .greeting { font-size: 12px; color: var(--ink-mute); margin-bottom: 3px; }

.countdown {
  text-align: right; flex: 0 0 auto;
  padding-left: 12px; border-left: 1px solid var(--line);
}
.countdown .n {
  font-family: var(--font-display); font-weight: 800;
  font-size: 25px; line-height: 1; letter-spacing: -0.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.countdown .l { font-size: 9.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-mute); margin-top: 3px; }

/* week strip */
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.wsday {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 7px 2px 6px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--surface-2);
  transition: background .15s, border-color .15s;
}
.wsday:hover { background: var(--surface-3); }
.wsday.today { border-color: var(--accent-line); background: var(--accent-soft); }
.wsday.selected { border-color: var(--accent); background: var(--accent-soft); }
.wsday .d { font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); }
.wsday .n { font-family: var(--font-data); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 500; }
.wsday.today .d, .wsday.today .n { color: var(--accent); }
.wsday .load {
  width: 100%; height: 20px;
  display: flex; align-items: flex-end; justify-content: center; gap: 1.5px;
}
.wsday .load i {
  width: 4px; border-radius: 1px 1px 0 0;
  background: var(--z2); min-height: 2px;
}
.wsday .load .rest {
  width: 9px; height: 1.5px; border-radius: 1px;
  background: var(--line-strong); align-self: center;
}

/* ============================================================
   Calendar
   ============================================================ */
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0 2px;
}
.cal-head .m { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.nav-btn {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
}
.nav-btn:hover { background: var(--surface-3); }
.nav-btn svg { width: 13px; height: 13px; }

.sesh {
  display: grid; grid-template-columns: 3px 1fr auto;
  gap: 11px; align-items: center;
  padding: 10px 12px 10px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  text-align: left; width: 100%;
}
.sesh .zbar { align-self: stretch; background: var(--z2); }
.sesh-title { font-weight: 600; font-size: 13.5px; letter-spacing: -0.005em; }
.sesh-meta { font-size: 11px; color: var(--ink-mute); display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.sesh-time {
  font-family: var(--font-data); font-size: 11px; font-variant-numeric: tabular-nums;
  color: var(--ink-mute); text-align: right; flex: 0 0 auto;
}
.sesh.done { opacity: .58; }
.sesh.done .sesh-title { text-decoration: line-through; text-decoration-color: var(--line-strong); }

.daygroup { display: flex; flex-direction: column; gap: 7px; }
.daygroup > .dayhead {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-mute);
  padding-top: 4px;
}
.daygroup > .dayhead .rule { flex: 1; height: 1px; background: var(--line); }
.daygroup > .dayhead.is-today { color: var(--accent); }

.shared-note {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  font-size: 11.5px; color: var(--ink-2); line-height: 1.4;
}
.shared-note svg { width: 14px; height: 14px; color: var(--accent); flex: 0 0 auto; margin-top: 1px; }

/* toggle */
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.switch {
  width: 36px; height: 21px; border-radius: 999px;
  background: var(--line-strong); position: relative;
  transition: background .18s;
  flex: 0 0 auto;
}
.switch::after {
  content: ""; position: absolute; top: 2.5px; left: 2.5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .18s;
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(15px); }

/* segmented control */
.seg {
  display: flex; padding: 3px; gap: 3px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px;
}
.seg button {
  flex: 1; padding: 6px 4px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--ink-mute);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* filter rail */
.rail {
  display: flex; gap: 7px; overflow-x: auto; padding: 2px 16px 2px;
  margin: 0 -16px; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.fchip {
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  transition: background .15s, border-color .15s, color .15s;
}
.fchip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ============================================================
   Clubs
   ============================================================ */
.club {
  display: grid; grid-template-columns: 44px 1fr auto;
  gap: 12px; align-items: center; padding: 12px;
  text-align: left; width: 100%;
}
.club-badge {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
  letter-spacing: -0.03em; color: #fff;
}
.club-name { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; letter-spacing: -0.015em; }
.club-meta { font-size: 11.5px; color: var(--ink-mute); }

.streak {
  display: flex; gap: 3px; align-items: center; margin-top: 6px;
}
.streak i {
  width: 7px; height: 13px; border-radius: 2px;
  background: var(--surface-3);
}
.streak i.hit { background: var(--z2); }
.streak i.miss { background: var(--surface-3); }
.streak .lbl { font-size: 10px; color: var(--ink-mute); margin-left: 5px; font-family: var(--font-data); }

/* ============================================================
   Find / matchmaking
   ============================================================ */
.athlete {
  display: grid; grid-template-columns: 42px 1fr auto;
  gap: 12px; padding: 12px; align-items: center;
  text-align: left; width: 100%;
}
.athlete .avatar { width: 42px; height: 42px; font-size: 14px; }
.athlete-name { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; letter-spacing: -0.015em; }
.athlete-meta { font-size: 11.5px; color: var(--ink-mute); }

.match {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: 0 0 auto; padding-left: 4px;
}
.match .ring {
  width: 38px; height: 38px; position: relative;
  display: grid; place-items: center;
}
.match .ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.match .ring .v {
  font-family: var(--font-data); font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.match .l { font-size: 8.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-mute); }

.paceband {
  display: flex; align-items: center; gap: 5px; margin-top: 6px;
}
.paceband .bar {
  flex: 1; height: 5px; border-radius: 3px; position: relative;
  background: linear-gradient(90deg, var(--z1), var(--z2), var(--z3), var(--z4), var(--z5));
  opacity: .35;
}
.paceband .bar i {
  position: absolute; top: -2px; width: 3px; height: 9px;
  border-radius: 2px; background: var(--ink);
}
.paceband .t { font-size: 10px; color: var(--ink-mute); font-family: var(--font-data); white-space: nowrap; }

/* ============================================================
   Me / profile
   ============================================================ */
.profile-head {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 16px 16px; text-align: center;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.profile-head .avatar { width: 66px; height: 66px; font-size: 22px; }
.profile-head h2 { font-size: 20px; letter-spacing: -0.03em; }
.profile-head .loc { font-size: 12.5px; color: var(--ink-mute); }

.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  padding: 11px 10px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.stat .v {
  font-family: var(--font-display); font-weight: 800; font-size: 17px;
  letter-spacing: -0.035em; font-variant-numeric: tabular-nums;
}
.stat .v small { font-size: 10.5px; font-weight: 600; color: var(--ink-mute); letter-spacing: 0; }
.stat .k { font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-mute); }

.zones { display: flex; flex-direction: column; gap: 6px; }
.zone { display: grid; grid-template-columns: 26px 1fr 78px; gap: 9px; align-items: center; }
.zone .zn { font-size: 10.5px; font-weight: 700; color: var(--ink-mute); font-family: var(--font-data); }
.zone .zt { height: 9px; border-radius: 3px; }
.zone .zv { font-family: var(--font-data); font-size: 10.5px; color: var(--ink-mute); text-align: right; font-variant-numeric: tabular-nums; }

.loadchart { display: flex; align-items: flex-end; gap: 4px; height: 62px; padding-top: 4px; }
.loadchart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.loadchart .col .bar {
  width: 100%; border-radius: 3px 3px 0 0;
  background: var(--accent); opacity: .85; min-height: 3px;
}
.loadchart .col.dim .bar { background: var(--line-strong); }
.loadchart .col .lb { font-size: 9px; color: var(--ink-mute); font-family: var(--font-data); }

.privacy {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px dashed var(--line-strong);
  font-size: 11px; color: var(--ink-mute); line-height: 1.45;
}
.privacy svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; color: var(--ink-mute); }

/* ============================================================
   Tab bar
   ============================================================ */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 10;
}
@supports not (backdrop-filter: blur(1px)) {
  .tabbar { background: var(--surface); }
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--ink-mute);
  transition: color .15s;
  position: relative;
}
.tab svg { width: 20px; height: 20px; }
.tab span { font-size: 9.5px; font-weight: 600; letter-spacing: .01em; }
.tab.on { color: var(--accent); }
.tab.on::before {
  content: ""; position: absolute; top: 0;
  width: 22px; height: 2px; border-radius: 0 0 2px 2px;
  background: var(--accent);
}
.tab .badge {
  position: absolute; top: 7px; left: 50%; margin-left: 4px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; background: var(--live); color: #fff;
  font-size: 9px; font-weight: 700; display: grid; place-items: center;
  font-family: var(--font-data);
}

/* ============================================================
   Sheet (detail overlay)
   ============================================================ */
.scrim {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(6, 10, 22, .5);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 21;
  max-height: 86%;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateY(102%);
  transition: transform .28s cubic-bezier(.22,.8,.3,1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sheet.open { transform: translateY(0); }
.sheet-grab {
  width: 34px; height: 4px; border-radius: 2px;
  background: var(--line-strong);
  margin: 9px auto 2px; flex: 0 0 auto;
}
.sheet-body { overflow-y: auto; padding: 8px 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.sheet-foot {
  flex: 0 0 auto; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); background: var(--surface);
  display: flex; gap: 9px;
}

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

/* toast */
.toast {
  position: absolute; left: 50%; bottom: calc(var(--tab-h) + 18px);
  transform: translate(-50%, 14px);
  z-index: 40;
  padding: 9px 15px; border-radius: 999px;
  background: var(--ink); color: var(--ground);
  font-size: 12.5px; font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap; max-width: 88%;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty {
  padding: 30px 18px; text-align: center;
  color: var(--ink-mute); font-size: 12.5px; line-height: 1.5;
}
.empty svg { width: 26px; height: 26px; opacity: .4; margin-bottom: 8px; }


/* ============================================================
   Recovery dashboard
   ============================================================ */
.hero-ring {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.ring { position: relative; flex: 0 0 auto; display: grid; place-items: center; }
.ring svg { display: block; transform: rotate(-90deg); }
.ring .ring-mid {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; text-align: center;
}
.ring .rv {
  font-family: var(--font-display); font-weight: 800;
  letter-spacing: -0.045em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ring .rl {
  font-size: 8.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-mute);
}

.readout { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.readout .head {
  font-family: var(--font-display); font-weight: 700;
  font-size: 17px; letter-spacing: -0.028em; line-height: 1.15;
}
.readout .sub { font-size: 12px; color: var(--ink-mute); line-height: 1.4; }

.metric-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.metric {
  padding: 11px 10px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.metric .k {
  font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.metric .v {
  font-family: var(--font-display); font-weight: 800; font-size: 17px;
  letter-spacing: -0.035em; font-variant-numeric: tabular-nums;
}
.metric .v small { font-size: 10px; font-weight: 600; color: var(--ink-mute); letter-spacing: 0; }
.metric .d { font-size: 10.5px; font-family: var(--font-data); }
.metric .d.up { color: var(--ok); }
.metric .d.down { color: var(--crit); }
.metric .d.flat { color: var(--ink-mute); }

/* sparkline strip */
.spark { display: block; width: 100%; height: 34px; overflow: visible; }

/* sleep stack */
.sleepbar { display: flex; height: 12px; border-radius: 4px; overflow: hidden; gap: 2px; }
.sleepbar i { display: block; }
.sleep-legend {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 10.5px; color: var(--ink-mute);
}
.sleep-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sleep-legend i { width: 8px; height: 8px; border-radius: 2px; }

/* ============================================================
   Zones
   ============================================================ */
.donut-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0 2px;
}
.donut { position: relative; display: grid; place-items: center; }
.donut svg { display: block; transform: rotate(-90deg); }
.donut .donut-mid {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
.donut .dv {
  font-family: var(--font-display); font-weight: 800; font-size: 26px;
  letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums;
}
.donut .dl {
  font-size: 9px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-mute);
}

.zone-row {
  display: grid; grid-template-columns: 34px 1fr auto;
  gap: 10px; align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.zone-row:last-child { border-bottom: none; }
.zone-key {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-data); font-size: 11.5px; font-weight: 600;
}
.zone-key i { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }
.zone-name { font-size: 13px; font-weight: 600; }
.zone-band { font-size: 10.5px; color: var(--ink-mute); font-family: var(--font-data); }
.zone-track {
  height: 7px; border-radius: 4px; background: var(--surface-3);
  overflow: hidden; margin-top: 5px;
}
.zone-track i { display: block; height: 100%; border-radius: 4px; }
.zone-time {
  text-align: right; font-family: var(--font-data);
  font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 600;
  white-space: nowrap;
}
.zone-time small { display: block; font-size: 10px; color: var(--ink-mute); font-weight: 400; }

.daybars { display: flex; align-items: flex-end; gap: 5px; height: 78px; }
.daybars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.daybars .stackwrap {
  flex: 1; width: 100%; display: flex; flex-direction: column-reverse;
  justify-content: flex-start; gap: 2px; align-items: stretch;
}
.daybars .stackwrap i { display: block; border-radius: 2px; min-height: 2px; }
.daybars .lb { font-size: 9px; color: var(--ink-mute); font-family: var(--font-data); }
.daybars .col.today .lb { color: var(--accent); font-weight: 700; }

/* ============================================================
   Onboarding
   ============================================================ */
.onboard {
  position: absolute; inset: 0; z-index: 30;
  background: var(--ground);
  display: flex; flex-direction: column;
}
.onboard-top {
  flex: 0 0 auto; padding: 18px 16px 10px;
  display: flex; flex-direction: column; gap: 12px;
}
.steps { display: flex; gap: 5px; }
.steps i {
  flex: 1; height: 3px; border-radius: 2px; background: var(--surface-3);
  transition: background .25s;
}
.steps i.on { background: var(--accent); }
.onboard-body {
  flex: 1 1 auto; overflow-y: auto; padding: 4px 16px 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.onboard-foot {
  flex: 0 0 auto; padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); background: var(--surface);
  display: flex; gap: 9px;
}
.onboard h1 { font-size: 23px; letter-spacing: -0.038em; line-height: 1.15; }
.onboard .lede { font-size: 13.5px; color: var(--ink-mute); line-height: 1.5; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field input, .field select {
  padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 15px; width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field .hint { font-size: 11px; color: var(--ink-mute); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.unit-row { display: flex; align-items: center; gap: 8px; }
.unit-row .suffix {
  font-family: var(--font-data); font-size: 12px; color: var(--ink-mute);
  flex: 0 0 auto;
}

.pickgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.pickcard {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 12px; border-radius: 13px;
  background: var(--surface); border: 1.5px solid var(--line);
  text-align: left; transition: border-color .15s, background .15s;
}
.pickcard.on { border-color: var(--accent); background: var(--accent-soft); }
.pickcard .sport { width: 26px; height: 26px; border-radius: 8px; }
.pickcard .nm { font-size: 13.5px; font-weight: 600; }
.pickcard.on .nm { color: var(--accent); }

/* ============================================================
   Integrations
   ============================================================ */
.provider {
  display: grid; grid-template-columns: 38px 1fr auto;
  gap: 11px; align-items: flex-start;
  padding: 12px; width: 100%; text-align: left;
}
.provider .logo {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 13px;
  letter-spacing: -0.03em; color: #fff;
}
.provider .nm {
  display: block;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: -0.015em;
}
.provider .cv {
  display: block;
  font-size: 11px; color: var(--ink-mute); line-height: 1.4; margin-top: 3px;
}
.provider > .grow { display: flex; flex-direction: column; }
.provider .caps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.provider .caps span {
  font-size: 9.5px; padding: 2px 6px; border-radius: 5px;
  background: var(--surface-2); color: var(--ink-mute);
  border: 1px solid var(--line);
}

.callout {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-2); line-height: 1.45;
}
.callout svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; color: var(--ink-mute); }
.callout.accent { background: var(--accent-soft); border-color: var(--accent-line); }
.callout.accent svg { color: var(--accent); }

/* 6 tabs need a little more room */
.tabbar { grid-template-columns: repeat(6, 1fr); }
.tab span { font-size: 9px; }
.tab svg { width: 19px; height: 19px; }

/* ============================================================
   Sign in / sign up — full-screen branded splash
   ============================================================ */
body.authing .appbar,
body.authing .tabbar { display: none; }
body.authing .view { padding: 0; }

.auth {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(46px + env(safe-area-inset-top, 0px))
           calc(22px + env(safe-area-inset-right, 0px))
           calc(30px + env(safe-area-inset-bottom, 0px))
           calc(22px + env(safe-area-inset-left, 0px));
  color: #E8ECF6;
  background: radial-gradient(125% 80% at 50% -8%, #2A3A08 0%, #16180E 46%, #0F1011 100%);
}
.auth-top { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; min-height: 200px; }
.auth-logo { display: flex; align-items: center; gap: 10px; }
.auth-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, #DAFF52, #A6D42B);
  display: flex; align-items: center; justify-content: center;
  color: #0A0F1E; font-family: var(--font-display); font-weight: 800; font-size: 22px;
}
.auth-word { font-family: var(--font-display); font-weight: 800; letter-spacing: -.01em; font-size: 19px; }
.auth-title { font-family: var(--font-display); font-size: 40px; line-height: 1.02; letter-spacing: -.04em; margin: 28px 0 0; color: #F4F6FC; }
.auth-tag { font-size: 15px; line-height: 1.5; color: #AEB7D2; margin: 14px 0 0; max-width: 19em; }

.auth-card { flex: 0 0 auto; display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.auth-input {
  width: 100%; padding: 15px 16px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06);
  color: #F4F6FC; font-size: 16px;
}
.auth-input::placeholder { color: #8892B4; }
.auth-input:focus { outline: none; border-color: #CBF23D; background: rgba(255,255,255,.09); }
.auth-code { text-align: center; letter-spacing: .4em; font-family: var(--font-data); font-size: 24px; }
.auth-cta {
  padding: 15px; border-radius: 14px; font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, #DAFF52, #B4E42E); color: #141800; border: none;
}
.auth-cta:active { transform: translateY(1px); }
.auth-or { display: flex; align-items: center; gap: 12px; color: #8892B4; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin: 2px 0; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.12); }
.auth-fine { font-size: 12px; color: #8892B4; line-height: 1.5; text-align: center; margin: 4px 2px 0; }
.auth-back { align-self: flex-start; color: #AEB7D2; font-size: 14px; padding: 4px 2px; margin-bottom: 2px; background: none; }
.auth-h2 { font-family: var(--font-display); font-size: 24px; letter-spacing: -.03em; color: #F4F6FC; }
.auth-p { font-size: 14px; color: #AEB7D2; margin: -4px 0 0; line-height: 1.5; }
.auth-link { color: #CBF23D; font-size: 13.5px; font-weight: 600; padding: 6px; align-self: center; background: none; }

/* The auth splash is always dark-on-brand, so its Google button keeps its own colors. */
.auth-card .btn.full { border-radius: 14px; padding: 14px; font-size: 15.5px; }

/* ============================================================
   Social post — the Today feed's core card
   ============================================================ */
.post {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 15px 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  width: 100%;
  transition: border-color .15s ease, transform .12s ease;
}
.post.is-session { cursor: pointer; }
.post.is-session:active { transform: scale(.994); }
.post.is-session:hover { border-color: var(--line-strong); }

.post-head { display: flex; gap: 11px; align-items: center; }
.post-av {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  color: #fff; flex: 0 0 auto;
}
.post-who { min-width: 0; flex: 1; }
.post-name { font-weight: 700; font-size: 14px; letter-spacing: -.01em; color: var(--ink); display: block; }
.post-sub { font-size: 11.5px; color: var(--ink-mute); margin-top: 1px; display: block; }
.post-sport {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; flex: 0 0 auto;
  background: var(--surface-2); border: 1px solid var(--line);
}
.post-sport svg { width: 17px; height: 17px; }
.post-sport.lg { width: 42px; height: 42px; border-radius: 12px; }
.post-sport.lg svg { width: 21px; height: 21px; }

.post-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.03em; margin-top: 11px; color: var(--ink); }
.post-note { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin-top: 8px; }

.post-stats { display: flex; gap: 20px; margin-top: 10px; }
.post-stat { display: flex; flex-direction: column; gap: 1px; }
.post-stat .v { font-family: var(--font-data); font-weight: 600; font-size: 15px; color: var(--ink); }
.post-stat .v small { font-size: 11px; color: var(--ink-mute); font-weight: 500; }
.post-stat .k { font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-mute); }

.post-zonebar { display: flex; gap: 2px; height: 6px; margin-top: 12px; }
.post-zonebar i { display: block; height: 100%; border-radius: 2px; }
.post-zonebar i:first-child { border-top-left-radius: 3px; border-bottom-left-radius: 3px; }
.post-zonebar i:last-child { border-top-right-radius: 3px; border-bottom-right-radius: 3px; }

.post-going { display: flex; align-items: center; gap: 9px; margin-top: 13px; }
.post-faces { display: flex; }
.post-face {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700; color: #fff;
  border: 2px solid var(--surface); margin-left: -8px;
}
.post-face:first-child { margin-left: 0; }
.post-going-n { font-size: 12px; color: var(--ink-mute); font-weight: 600; }

.post-actions { display: flex; gap: 8px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.post-act {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px; border-radius: 12px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 13px; font-weight: 650; letter-spacing: -.01em;
  transition: background .14s ease, color .14s ease, transform .1s ease;
}
.post-act svg { width: 16px; height: 16px; }
.post-act:active { transform: scale(.96); }
.post-act.primary { background: var(--accent); color: var(--accent-ink); flex: 1.4; }
.post-act.primary.on { background: var(--ok-soft); color: var(--ok); }
.post-act.liked { color: var(--live); }
.post-act.liked svg { fill: var(--live); stroke: var(--live); }

/* Section headers get a touch more air in the new system */
.section-head h2 { font-size: 15px; letter-spacing: -.02em; }

/* ============================================================
   Skeleton loader — first paint while data arrives
   ============================================================ */
@keyframes sl-shimmer { 0%,100% { opacity: .5 } 50% { opacity: 1 } }
.skel { background: var(--surface-2); border-radius: 8px; animation: sl-shimmer 1.25s ease-in-out infinite; }
.skel-wrap { padding: 18px 16px; }
.skel-hero { height: 150px; border-radius: 18px; margin-bottom: 20px; }
.skel-post { border: 1px solid var(--line); border-radius: 18px; padding: 15px; margin-bottom: 12px; background: var(--surface); animation: none; }
.skel-row { display: flex; gap: 11px; align-items: center; }

/* ============================================================
   Signal polish — Plan rows, hero, week strip, sheet
   ============================================================ */
.hero {
  border-radius: 22px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface)) 0%, var(--surface) 60%);
}
.hero h1 { font-size: 22px; letter-spacing: -.035em; }

.wsday { border-radius: 12px; transition: background .14s ease, border-color .14s ease; }
.wsday.today { box-shadow: inset 0 0 0 1px var(--accent-line); }

.sesh { border-radius: 14px; transition: border-color .14s ease, transform .1s ease; }
.sesh:hover { border-color: var(--line-strong); }
.sesh:active { transform: scale(.995); }
.sesh .zbar { border-radius: 0 3px 3px 0; }
.sesh.done { opacity: .6; }

.club-badge { border-radius: 14px; }
.card.club { border-radius: 16px; transition: border-color .14s ease, transform .1s ease; }
.card.club:hover { border-color: var(--line-strong); }
.card.club:active { transform: scale(.994); }

/* Buttons feel a touch more tactile */
.btn { transition: background .14s ease, transform .1s ease, border-color .14s ease; }
.btn:active { transform: scale(.98); }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

/* ============================================================
   Me — social stats + commitment score
   ============================================================ */
.me-social { display: flex; margin-top: 15px; width: 100%; max-width: 300px; }
.me-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0 6px; position: relative; }
.me-stat + .me-stat::before { content: ''; position: absolute; left: 0; top: 14%; height: 72%; width: 1px; background: var(--line); }
.me-stat .v { font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.me-stat .k { font-size: 10px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .05em; }

.commit-card { display: flex; gap: 14px; align-items: center; padding: 14px 15px; margin-bottom: 12px; }
.commit-card .ring { flex: 0 0 auto; }

/* ============================================================
   Activity detail — three metric rings + recovery
   ============================================================ */
.ring-row { display: flex; gap: 6px; justify-content: space-between; margin-top: 4px; }
.ring-cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; min-width: 0; }
.ring-cell .ring, .ring-cell .donut { flex: 0 0 auto; }
.ring-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); font-weight: 700; }

.recover-card { display: flex; gap: 12px; align-items: center; padding: 13px 14px; }
.rec-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--accent); }
.rec-ic svg { width: 18px; height: 18px; }

/* ============================================================
   Editable profile avatar (Me)
   ============================================================ */
.me-avatar { position: relative; padding: 0; background: none; display: inline-flex; border-radius: 50%; }
.me-avatar .avatar { box-shadow: 0 0 0 4px var(--ground); }
.me-avatar-cam {
  position: absolute; right: 0; bottom: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  border: 3px solid var(--ground);
}
.me-avatar-cam svg { width: 15px; height: 15px; }
.me-avatar:active { transform: scale(.97); }

/* ============================================================
   Unique features: launcher card, pacts, finish-together
   ============================================================ */
.feature-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 14px; margin-bottom: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 70%);
  border: 1px solid var(--accent-line); border-radius: 16px; transition: transform .1s ease;
}
.feature-card:active { transform: scale(.994); }
.fc-emoji { font-size: 26px; flex: 0 0 auto; }
.fc-title { display: block; font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.fc-sub { display: block; font-size: 11.5px; color: var(--ink-mute); margin-top: 1px; }
.fc-go { color: var(--ink-mute); width: 18px; flex: 0 0 auto; }
.fc-go svg { width: 18px; height: 18px; }

.pact-card { display: flex; flex-direction: column; gap: 9px; padding: 14px; }
.pact-stake { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 8px 10px; }
.pact-stake svg { width: 14px; height: 14px; }
.pact-member { display: flex; align-items: center; gap: 10px; }
.pact-bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-3); margin-top: 4px; overflow: hidden; }
.pact-bar i { display: block; height: 100%; border-radius: 3px; transition: width .3s ease; }

.chip.pick { cursor: pointer; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }
.chip.pick.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

.ft-card { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-color: var(--accent-line); }
.ft-band { position: relative; flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--surface-3), var(--accent-soft)); }
.ft-band i { position: absolute; top: -3px; width: 10px; height: 12px; border-radius: 3px; background: var(--accent); }

/* ============================================================
   Offline indicator
   ============================================================ */
.offline-bar {
  position: absolute; left: 0; right: 0;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 7px 12px; font-size: 12px; font-weight: 600;
  background: var(--warn-soft); color: var(--warn);
  border-top: 1px solid var(--warn); z-index: 9;
}
.offline-bar[hidden] { display: none; }
.ob-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }

/* ---------- Upcoming events: big swipeable featured cards ---------- */
.ev-rail { display:flex; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch; padding-bottom:4px; scrollbar-width:none; }
.ev-rail::-webkit-scrollbar { display:none; }
.evcard { flex:0 0 79%; max-width:300px; scroll-snap-align:start; display:flex;
  flex-direction:column; gap:8px; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-xl); padding:18px; text-align:left; color:var(--ink);
  min-height:188px; transition:transform .12s ease; }
.evcard:active { transform:scale(.985); }
.evcard.feat { background:var(--accent); color:var(--accent-ink); border-color:transparent; }
.evcard-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.evcard-when { font:700 11px/1 var(--font-data); letter-spacing:.08em;
  text-transform:uppercase; opacity:.72; }
.evcard-ic { flex:none; width:44px; height:44px; border-radius:50%; display:grid;
  place-items:center; font-size:22px; background:var(--accent-soft); }
.evcard.feat .evcard-ic { background:rgba(0,0,0,.16); }
.evcard-title { font:700 21px/1.15 var(--font-display); letter-spacing:-.01em; margin-top:6px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.evcard-sub { font-size:12.5px; opacity:.72; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.evcard-stats { display:flex; gap:16px; margin-top:auto; padding-top:8px; font-size:12px; opacity:.88; }
.evcard-stat b { font-weight:800; }
.evcard-cta { align-self:flex-start; margin-top:12px; display:inline-flex; align-items:center;
  gap:7px; background:var(--accent); color:var(--accent-ink); border-radius:999px;
  padding:10px 17px; font-weight:800; font-size:13px; }
.evcard.feat .evcard-cta { background:var(--ground); color:#fff; }
.evcard-cta.on { background:rgba(0,0,0,.14); color:inherit; }
.evcard.feat .evcard-cta.on { background:rgba(0,0,0,.2); color:var(--accent-ink); }
.evcard-cta i { font-style:normal; font-weight:700; }

/* ---------- Progress tab (Day/Week/Month · max-zone ring · stats) ---------- */
.prog-seg { margin-bottom: 16px; }
.prog-ring { display:flex; justify-content:center; margin:6px 0 2px; }
.prog-ring .pr-eyebrow { display:block; font:700 10px/1 var(--font-data); letter-spacing:.14em;
  text-transform:uppercase; color:var(--ink-mute); }
.prog-ring .pr-big { display:block; font:800 46px/1 var(--font-display); letter-spacing:-.02em; margin-top:7px; }
.prog-ring .pr-sub { display:block; font-size:12px; color:var(--ink-mute); margin-top:5px; }
.prog-goal { width:max-content; max-width:100%; margin:2px auto 16px; background:var(--surface-2);
  border:1px solid var(--line); border-radius:999px; padding:8px 16px; font:600 12.5px/1 var(--font-data); }
.prog-goal b { font-weight:800; color:var(--accent); }
.prog-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:6px; }
.prog-stat { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  padding:15px 8px; display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center; }
.prog-stat .ps-ic { font-size:21px; line-height:1; }
.prog-stat .ps-val { font:800 20px/1 var(--font-display); letter-spacing:-.01em; }
.prog-stat .ps-unit { font-size:11px; font-weight:700; color:var(--ink-mute); margin-left:3px; }
.prog-stat .ps-lbl { font-size:10.5px; color:var(--ink-mute); line-height:1.25; }
.byday-chart { display:flex; align-items:flex-end; gap:5px; height:128px; padding:12px;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); }
.byday-col { flex:1 1 0; display:flex; flex-direction:column; align-items:center; gap:7px; height:100%; min-width:0; }
.byday-wrap { flex:1; width:100%; display:flex; align-items:flex-end; justify-content:center; }
.byday-bar { width:72%; max-width:15px; min-height:2px; background:var(--surface-3); border-radius:4px 4px 2px 2px; display:block; }
.byday-col.today .byday-bar { background:var(--accent); }
.byday-lbl { font:600 9px/1 var(--font-data); color:var(--ink-mute); height:10px; }
.sport-row { display:flex; align-items:center; gap:11px; padding:9px 0; border-bottom:1px solid var(--line); }
.sport-row:last-child { border-bottom:0; }
.sport-ic { font-size:18px; flex:none; width:26px; text-align:center; }
.sport-nm { font-weight:650; font-size:13.5px; display:block; margin-bottom:5px; }
.sport-track { display:block; height:6px; border-radius:999px; background:var(--surface-3); overflow:hidden; }
.sport-track i { display:block; height:100%; background:var(--accent); border-radius:999px; }
.sport-val { font:700 12.5px/1 var(--font-data); color:var(--ink); flex:none; }

/* Completed session state — "🔥 You did it!" on event + session cards */
.evcard.done:not(.feat) { border-color: var(--accent); }
.evcard.done .evcard-when { opacity: 1; color: var(--accent); font-weight: 800; }
.evcard.feat.done .evcard-when { color: var(--accent-ink); opacity: .9; }
.evcard-cta.done, .post-act.primary.done { cursor: default; }
