/* ============================================================
   Vine & Stride — wine-country design system (v2)
   Cream paper, burgundy ink, gold accents. No frameworks.
   Contrast: gold text uses #8f7212 on cream (WCAG); #c9a227 is
   decorative only. Secondary text #6a5a60.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --bg: #faf6ef;
  --card: #ffffff;
  --ink: #2a1220;
  --muted: #6a5a60;
  --wine: #722343;
  --wine-deep: #4a1228;
  --wine-soft: #8d3a58;
  --gold: #c9a227;
  --gold-ink: #8f7212;
  --green: #5d7a4e;
  --line: rgba(42, 18, 32, 0.1);
  --shadow: 0 10px 30px rgba(42, 18, 32, 0.08);
  --radius: 20px;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

svg { display: block; }
p { margin-top: 0; }
a { color: var(--wine); }

::selection { background: rgba(201, 162, 39, 0.35); }

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

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

main.wrap { padding-top: 26px; padding-bottom: 44px; }

.view[hidden] { display: none !important; }

/* ---------- utilities ---------- */
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.mt10 { margin-top: 10px; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.stack > * + * { margin-top: 18px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 246, 239, 0.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 11px;
  padding-bottom: 11px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.mark { width: 34px; height: 34px; border-radius: 9px; }

.wordmark {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.amp { color: var(--gold); font-style: italic; }

.tabs { display: flex; gap: 4px; margin-left: auto; }

.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  transition: color 0.18s ease, background 0.18s ease;
}

.tabs a:hover { color: var(--wine); background: rgba(114, 35, 67, 0.07); }

.tabs a[aria-current="page"] {
  color: #faf6ef;
  background: linear-gradient(135deg, var(--wine), var(--wine-deep));
  box-shadow: 0 6px 16px rgba(114, 35, 67, 0.25);
}

.auth-slot { display: flex; align-items: center; gap: 8px; }

.me-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: rgba(114, 35, 67, 0.07);
  color: var(--wine);
  white-space: nowrap;
}

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(42, 18, 32, 0.04);
  padding: 24px 26px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.card-title.sm { font-size: 1.15rem; }

.card-sub { color: var(--muted); font-size: 0.86rem; margin: 3px 0 0; }

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 4px 0 2px;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--wine) 0%, var(--wine-deep) 100%);
  color: #faf6ef;
  padding: 30px 32px 26px;
}

.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(201, 162, 39, 0.28), rgba(201, 162, 39, 0) 70%);
  pointer-events: none;
}

.hero-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hero-copy { min-width: 0; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(250, 246, 239, 0.72);
  margin: 0 0 8px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.hero-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: rgba(250, 246, 239, 0.85);
  margin: 0 0 16px;
}

.pills { display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(250, 246, 239, 0.14);
  border: 1px solid rgba(250, 246, 239, 0.28);
  color: #faf6ef;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.pill.goal {
  background: rgba(201, 162, 39, 0.24);
  border-color: rgba(201, 162, 39, 0.6);
  color: #f7e8b8;
}

.pill.near {
  background: rgba(201, 162, 39, 0.14);
  border-color: rgba(201, 162, 39, 0.42);
  color: #f3dfa2;
}

.pill.goal.pop { animation: vs-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }

.streak-note {
  margin: 10px 0 0;
  font-size: 0.85rem;
  font-style: italic;
  color: rgba(250, 246, 239, 0.78);
}

.hero-today {
  position: relative;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(250, 246, 239, 0.18);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ht-left { min-width: 0; }

.today-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
}

.big-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.7rem, 9vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.today-meta { color: rgba(250, 246, 239, 0.85); font-size: 1.02rem; }
.today-meta strong { font-weight: 600; }
.today-meta .dot { margin: 0 7px; opacity: 0.5; }

.goal-note {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  color: #f3dfa2;
}

/* goal-pace pill (Google Fit pattern) */
.pace-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #faf6ef;
  background: rgba(250, 246, 239, 0.14);
  border: 1px solid rgba(250, 246, 239, 0.26);
}

.pace-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.pace-pill.ok {
  background: rgba(93, 122, 78, 0.42);
  border-color: rgba(185, 209, 168, 0.5);
  color: #d8e6c9;
}

.pace-pill.warn {
  background: rgba(201, 162, 39, 0.22);
  border-color: rgba(243, 223, 162, 0.45);
  color: #f3dfa2;
}

.pace-pill.zero {
  font-style: italic;
  font-weight: 500;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

.pace-pill.zero::before { display: none; }

.ht-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}

.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.cheer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(250, 246, 239, 0.32);
  background: rgba(250, 246, 239, 0.12);
  color: #faf6ef;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.cheer-btn svg { width: 21px; height: 21px; }

.cheer-btn:hover:not(:disabled) {
  background: rgba(250, 246, 239, 0.2);
  border-color: rgba(250, 246, 239, 0.5);
  transform: translateY(-1px);
}

.cheer-btn:disabled { cursor: default; }

.cheer-btn.cheered {
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.38), rgba(201, 162, 39, 0.22));
  border-color: rgba(201, 162, 39, 0.65);
  color: #f7e8b8;
}

.cheer-count { font-variant-numeric: tabular-nums; }

.cheer-btn.bounce { animation: vs-cheer 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); }

.hero-ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(250, 246, 239, 0.32);
  background: transparent;
  color: rgba(250, 246, 239, 0.92);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.hero-ghost-btn:hover { background: rgba(250, 246, 239, 0.12); border-color: rgba(250, 246, 239, 0.5); }

.hgb-ico svg { width: 17px; height: 17px; }

.updated {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(250, 246, 239, 0.7);
}

/* ---------- progress ring (dual) ---------- */
.ring { width: 168px; height: 168px; flex: 0 0 auto; }
.ring text { font-family: var(--font-body); }
.ring-pct {
  fill: #faf6ef;
  font-family: var(--font-display) !important;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ring-sub {
  fill: rgba(250, 246, 239, 0.74);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ring-sub2 {
  fill: rgba(250, 246, 239, 0.6);
  font-size: 10px;
  letter-spacing: 0.04em;
}
#ringArcOuter, #ringArcInner {
  transition: stroke-dashoffset 0.9s cubic-bezier(0.34, 1.3, 0.64, 1) 0.15s;
}
#goalCheck {
  transition: stroke-dashoffset 0.55s ease 0.6s;
}

/* ---------- week chart ---------- */
.chart-svg { width: 100%; height: auto; }
.chart-svg text { font-family: var(--font-body); }

.wk-bar {
  transition: transform 0.18s ease;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.wk-bar:hover { transform: scaleY(1.045); }

.wk-dot { filter: drop-shadow(0 1px 1px rgba(42, 18, 32, 0.25)); }

.wk-goal-line {
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-dasharray: 5 6;
  opacity: 0.9;
}

.wk-goal-text { fill: var(--gold-ink); font-size: 12px; font-weight: 600; }

.wk-label { fill: var(--muted); font-size: 12px; font-weight: 500; }
.wk-label.today { fill: var(--wine); font-weight: 700; }

.legend {
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.lg-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold);
  display: inline-block;
  margin-right: 6px;
}

.lg-bar {
  width: 12px; height: 9px; border-radius: 2px;
  background: linear-gradient(#8d3a58, #4a1228);
  display: inline-block;
  margin-right: 6px;
}

/* ---------- trend chips ---------- */
.trend-card { padding: 16px 22px; }

.trend-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.trend-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(114, 35, 67, 0.06);
  border: 1px solid rgba(114, 35, 67, 0.12);
  font-size: 0.88rem;
  color: var(--ink);
}

.trend-chip strong { font-weight: 700; font-variant-numeric: tabular-nums; }

.tc-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.tc-delta.up { color: var(--green); }
.tc-delta.down { color: #a33b2e; }

.tc-ok {
  color: var(--green);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}

/* ---------- 90-day heatmap ---------- */
.heat-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 30px 26px 8px 0;
  margin: -12px -6px 0;
}

.heat-grid { display: flex; gap: 3px; width: max-content; }

.heat-col {
  display: grid;
  grid-template-rows: 14px repeat(7, 12px);
  gap: 3px;
}

.heat-wd { margin-right: 6px; }

.heat-month {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  line-height: 14px;
  white-space: nowrap;
}

.heat-wdl {
  font-size: 9px;
  color: var(--muted);
  font-style: normal;
  line-height: 12px;
}

.heat-cell {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #efe8da;
}

.heat-cell.lv1 { background: #eddcaa; }
.heat-cell.lv2 { background: #e0c668; }
.heat-cell.lv3 { background: #c9a227; }
.heat-cell.lv4 { background: #722343; }
.heat-cell.pad { background: transparent; }

.heat-cell.today {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--wine);
}

.heat-cell:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.heat-cell[data-tip]:hover::after,
.heat-cell[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #faf6ef;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding: 4px 9px;
  border-radius: 7px;
  white-space: nowrap;
  z-index: 30;
  pointer-events: none;
}

.heat-col:nth-child(2) .heat-cell[data-tip]::after { left: 0; transform: none; }
.heat-col:nth-last-child(2) .heat-cell[data-tip]::after,
.heat-col:last-child .heat-cell[data-tip]::after {
  left: auto;
  right: 0;
  transform: none;
}

.heat-card .legend { gap: 5px; }

/* ---------- trophy case ---------- */
.trophy-case { padding: 20px 22px; }

.trophies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
}

.trophy {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf8, #fbf5ea);
  border: 1px solid rgba(201, 162, 39, 0.25);
}

.tr-ico {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--wine), var(--wine-deep));
  color: var(--gold);
}

.tr-ico svg { width: 20px; height: 20px; }

.tr-body { min-width: 0; display: flex; flex-direction: column; }

.tr-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.tr-val small {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: 1px;
}

.tr-lab {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-top: 2px;
}

.tr-spark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.22);
  animation: vs-sparkle 2.2s ease-in-out infinite;
}

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

.stat { padding: 20px 22px; }

.stat-label {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.stat-note { color: var(--muted); font-size: 0.84rem; margin: 4px 0 0; }

/* ---------- top walkers + footnote ---------- */
.duo {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
  align-items: start;
}

.top-list { list-style: none; margin: 0 0 18px; padding: 0; }

.tl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px dashed var(--line);
}

.tl-row:last-child { border-bottom: 0; }

.tl-rank { width: 18px; color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.tl-row:first-child .tl-rank { color: var(--gold-ink); }

.tl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-row.owner .tl-name { font-weight: 700; color: var(--wine); }

.tl-steps { font-weight: 700; font-variant-numeric: tabular-nums; }

.foot-card { background: linear-gradient(180deg, #fffefb, #fbf6ec); }

/* ---------- leaderboard ---------- */
.lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.seg {
  display: inline-flex;
  background: rgba(42, 18, 32, 0.06);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}

.seg-btn {
  border: 0;
  background: transparent;
  padding: 8px 16px;
  min-height: 44px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.seg-btn:hover { color: var(--wine); }

.seg-btn[aria-selected="true"] {
  background: #ffffff;
  color: var(--wine);
  box-shadow: 0 3px 10px rgba(42, 18, 32, 0.12);
}

.lb-list { list-style: none; margin: 0; padding: 4px 2px 2px; }
.lb-list.refreshing { opacity: 0.55; transition: opacity 0.2s ease; }

.lb-item {
  padding: 14px 12px;
  min-height: 62px;
  border-radius: 14px;
  border-left: 3px solid transparent;
}

.lb-item + .lb-item { margin-top: 6px; }

.lb-item.owner {
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.1), rgba(201, 162, 39, 0) 60%);
}

.lb-item.self {
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.14), rgba(201, 162, 39, 0.02) 60%);
}

.lb-item.self:focus-visible { outline-offset: -2px; }

.lb-line { display: flex; align-items: center; gap: 12px; }

.rank {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  background: rgba(42, 18, 32, 0.06);
  color: var(--muted);
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.rank.r1 { background: linear-gradient(135deg, #e7c65c, #c9a227); color: #4a3a06; }
.rank.r2 { background: linear-gradient(135deg, #d9dde3, #aab1ba); color: #3d434b; }
.rank.r3 { background: linear-gradient(135deg, #cf9b6a, #b07a45); color: #4a2f14; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  user-select: none;
}

.avatar.sm { width: 24px; height: 24px; font-size: 0.6rem; }
.avatar.lg { width: 52px; height: 52px; font-size: 1rem; }

.lb-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-weight: 600;
}

.lb-nm {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-self-line {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  white-space: normal;
  margin-top: 1px;
}

.owner-tag {
  background: rgba(201, 162, 39, 0.16);
  color: var(--gold-ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: middle;
}

.chip.you {
  background: rgba(201, 162, 39, 0.18);
  color: var(--gold-ink);
  text-transform: uppercase;
}

.chip.streak {
  background: rgba(114, 35, 67, 0.08);
  color: var(--wine);
}

.lb-nums {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lb-nums em {
  display: block;
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.8rem;
}

.lb-bar {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: rgba(42, 18, 32, 0.07);
  margin-top: 9px;
  margin-left: 42px;
  overflow: hidden;
}

.lb-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--wine-soft), var(--wine));
  transition: width 0.5s ease;
}

.lb-item.owner .lb-bar i { background: linear-gradient(90deg, #c9a227, #dfc069); }

/* sticky "You" bar (shown while the self row is offscreen) */
.lb-sticky {
  position: sticky;
  bottom: 10px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 26px rgba(42, 18, 32, 0.18);
  border: 1px solid rgba(201, 162, 39, 0.4);
  width: fit-content;
  max-width: 100%;
}

.lbs-txt {
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- empty / offline ---------- */
.empty, .offline { text-align: center; padding: 42px 18px; }
.empty .glyph, .offline .glyph { font-size: 2.1rem; margin-bottom: 8px; }
.empty .btn, .offline .btn { margin-top: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  min-height: 44px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--wine), var(--wine-deep));
  color: #faf6ef;
  box-shadow: 0 8px 20px rgba(114, 35, 67, 0.28);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(114, 35, 67, 0.34); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.btn.gold {
  background: linear-gradient(135deg, #d9b23a, #c9a227);
  color: #3d2f05;
  box-shadow: 0 8px 20px rgba(201, 162, 39, 0.35);
}

.btn.gold:hover { box-shadow: 0 12px 26px rgba(201, 162, 39, 0.42); }

.btn.ghost {
  background: #ffffff;
  color: var(--wine);
  border: 1.5px solid rgba(114, 35, 67, 0.28);
  box-shadow: none;
}

.btn.ghost:hover { border-color: var(--wine); box-shadow: 0 6px 16px rgba(42, 18, 32, 0.1); }

.btn.tiny { min-height: 44px; padding: 10px 14px; font-size: 0.8rem; border-radius: 9px; box-shadow: none; }
.btn.tiny:hover { transform: none; box-shadow: none; border-color: var(--wine); }
.btn.wide { width: 100%; }

.link-btn {
  background: none;
  border: 0;
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.18s ease, background 0.18s ease;
}

.link-btn:hover { color: var(--wine); background: rgba(114, 35, 67, 0.06); }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(42, 18, 32, 0.16);
  background: #ffffff;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(114, 35, 67, 0.12);
  outline: none;
}

.form-err {
  color: #a33b2e;
  background: rgba(163, 59, 46, 0.08);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.86rem;
  margin: 0 0 12px;
}

.form-ok {
  color: var(--green);
  background: rgba(93, 122, 78, 0.12);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  margin: 0 0 12px;
}

/* ---------- join ---------- */
.join-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
  align-items: start;
}

.lede { color: var(--muted); margin: 2px 0 20px; }

.live-line {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 20px;
  margin-bottom: 18px;
  font-size: 0.94rem;
  background: linear-gradient(180deg, #fffdf8, #fbf5ea);
}

.live-line strong { font-variant-numeric: tabular-nums; }

.live-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.5);
  animation: vs-pulse 2.4s ease-out infinite;
}

/* you vs the uncle */
.vs-card { margin-bottom: 18px; }

.vs-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.vs-legend {
  display: flex;
  gap: 14px;
  font-size: 0.8rem;
  color: var(--muted);
  align-items: center;
}

.vs-legend span { display: inline-flex; align-items: center; }

.lg-you, .lg-owner {
  width: 12px; height: 9px; border-radius: 2px;
  display: inline-block;
  margin-right: 6px;
}

.lg-you { background: #722343; }
.lg-owner { background: #c9a227; }

.vs-bar { transition: transform 0.18s ease; transform-box: fill-box; transform-origin: center bottom; }
.vs-bar:hover { transform: scaleY(1.05); }

.vs-empty { fill: var(--muted); font-size: 14px; font-family: var(--font-body); }

.vs-totals {
  margin: 12px 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.vs-verdict {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.vs-verdict.ok {
  background: rgba(93, 122, 78, 0.14);
  color: #3f5c33;
}

.vs-verdict.warn {
  background: rgba(201, 162, 39, 0.16);
  color: var(--gold-ink);
}

.vs-today { margin: 2px 0 0; font-variant-numeric: tabular-nums; }

.vs-owner-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.vs-crown { font-size: 1.6rem; line-height: 1.2; }

.vs-owner-note p { margin: 0; font-size: 0.98rem; }

.vs-skel .skel { margin-bottom: 0; }

.me-row { display: flex; align-items: center; gap: 14px; margin: 14px 0 4px; }
.me-name { font-weight: 700; font-size: 1.08rem; margin: 0 0 3px; }

.steps-list { list-style: none; margin: 14px 0; padding: 0; counter-reset: step; }

.steps-list li {
  position: relative;
  padding-left: 38px;
  margin-bottom: 14px;
  counter-increment: step;
  font-size: 0.93rem;
  color: var(--ink);
}

.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(114, 35, 67, 0.08);
  color: var(--wine);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps-list a { font-weight: 600; }
.steps-list code, .code-box code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 0.82em;
  background: rgba(42, 18, 32, 0.05);
  border-radius: 5px;
  padding: 1px 5px;
}

.code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f6efe4;
  border: 1px solid rgba(42, 18, 32, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
}

.code-box code {
  flex: 1;
  background: none;
  padding: 0;
  word-break: break-all;
  color: var(--ink);
  font-size: 0.8rem;
}

.pad-box {
  background: rgba(42, 18, 32, 0.04);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 4px;
}

/* ---------- share modal ---------- */
.modal-veil {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(42, 18, 32, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: vs-fade 0.2s ease;
}

.modal {
  background: var(--bg);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(42, 18, 32, 0.4);
  width: 100%;
  max-width: 430px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  animation: vs-rise 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.modal-veil.closing { animation: vs-fade-out 0.16s ease forwards; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 0;
}

.modal-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(42, 18, 32, 0.06);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.modal-x:hover { background: rgba(42, 18, 32, 0.12); color: var(--ink); }

.modal-x svg { width: 16px; height: 16px; }

.modal-body {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 18px;
}

.modal-body canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  background: #722343;
}

.modal-actions {
  display: flex;
  gap: 10px;
  padding: 4px 18px 18px;
}

.modal-actions .btn { flex: 1; }

/* ---------- confetti ---------- */
.confetti {
  position: fixed;
  z-index: 95;
  pointer-events: none;
}

.cf {
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 12px;
  opacity: 0;
  animation: vs-cf var(--dur, 0.9s) cubic-bezier(0.16, 0.84, 0.44, 1) var(--delay, 0s) forwards;
}

.cf.round {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

/* ---------- skeleton ---------- */
.skel {
  position: relative;
  overflow: hidden;
  background: rgba(42, 18, 32, 0.06);
  border-radius: 12px;
}

.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: vs-shimmer 1.4s infinite;
}

.skel-dark { background: rgba(250, 246, 239, 0.14); }
.skel-dark::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: #faf6ef;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(42, 18, 32, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 90;
  max-width: calc(100vw - 40px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 0 28px;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p { margin: 0; }

/* ---------- animations ---------- */
@keyframes vs-shimmer { 100% { transform: translateX(100%); } }
@keyframes vs-pop { 50% { transform: scale(1.14); } }
@keyframes vs-cheer { 30% { transform: scale(1.16); } }
@keyframes vs-pulse {
  0% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(201, 162, 39, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0); }
}
@keyframes vs-sparkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}
@keyframes vs-cf {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  80% { opacity: 0.9; }
  100% { transform: translate(var(--tx, 0), var(--ty, -60px)) rotate(var(--rot, 180deg)) scale(0.35); opacity: 0; }
}
@keyframes vs-fade { from { opacity: 0; } }
@keyframes vs-fade-out { to { opacity: 0; } }
@keyframes vs-rise {
  from { transform: translateY(18px) scale(0.97); opacity: 0; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .duo { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .hero { padding: 24px 20px 22px; }
  .hero-top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .ring { margin: 2px auto 0; width: 150px; height: 150px; }
  .card { padding: 20px 18px; }
  .lb-bar { margin-left: 42px; }
  .ht-right { align-items: flex-start; }
}

@media (max-width: 640px) {
  .tabs { order: 3; width: 100%; }
  .tabs a { flex: 1; text-align: center; padding: 9px 6px; font-size: 0.88rem; }
  .auth-slot { margin-left: auto; }
  .wordmark { font-size: 1.1rem; }
  .mark { width: 30px; height: 30px; }
  .header-inner { padding-top: 10px; padding-bottom: 10px; }
  .card-head { flex-direction: column; gap: 2px; align-items: flex-start; }
  .trend-chips { flex-direction: column; align-items: flex-start; }
  .heat-scroll { padding-right: 12px; }
}

@media (max-width: 420px) {
  .wrap { padding: 0 14px; }
  main.wrap { padding-top: 18px; }
  .lb-line { gap: 9px; }
  .lb-nums em { font-size: 0.74rem; }
  .avatar { width: 34px; height: 34px; }
  .rank { width: 27px; height: 27px; font-size: 0.82rem; }
  .hero-actions { width: 100%; }
  .hero-actions .cheer-btn, .hero-actions .hero-ghost-btn { flex: 1; justify-content: center; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .skel::after { animation: none; }
  .live-dot, .tr-spark { animation: none; }
}

/* ============================================================
   v3 — status strip (offline + install), challenge strip,
   journey card, plan card, form chip, duels
   ============================================================ */

/* ---------- status strip ---------- */
.status-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.status-strip[hidden] { display: none !important; }

.chip-off {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(163, 59, 46, 0.1);
  border: 1px solid rgba(163, 59, 46, 0.35);
  color: #a33b2e;
  font-size: 0.84rem;
  font-weight: 600;
}

.chip-install {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px 6px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdf8, #fbf5ea);
  border: 1px solid rgba(201, 162, 39, 0.5);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
}

.chip-install strong { color: var(--wine); }

.ci-act {
  border: 0;
  border-radius: 999px;
  min-height: 32px;
  padding: 4px 13px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  background: linear-gradient(135deg, #d9b23a, #c9a227);
  color: #3d2f05;
}

.ci-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.ci-x:hover { background: rgba(42, 18, 32, 0.08); color: var(--ink); }

/* ---------- countdown chip ---------- */
.chip-count {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(114, 35, 67, 0.08);
  border: 1px solid rgba(114, 35, 67, 0.16);
  color: var(--wine);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- monthly challenge strip ---------- */
.chal-card { padding: 20px 24px; }

.chal-tiers {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.chal-tier {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  align-items: center;
  gap: 12px;
}

.chal-tname {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.chal-bar {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: rgba(42, 18, 32, 0.07);
  overflow: hidden;
}

.chal-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.chal-bar.sm { height: 7px; width: 90px; display: inline-block; vertical-align: middle; }
.chal-bar.sm i { background: var(--wine-soft); }

.chal-done {
  font-size: 0.8rem;
  font-weight: 700;
  color: #3f5c33;
  white-space: nowrap;
}

.chal-togo {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- journey card ---------- */
.journey-card { padding: 20px 24px; }

.jr-svg { width: 100%; height: auto; margin-top: 6px; }

.jr-svg text { font-family: var(--font-body); }

.jr-line {
  fill: none;
  stroke: var(--wine);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.jr-km { fill: var(--muted); font-size: 10.5px; font-weight: 600; }

.jr-stop { cursor: pointer; }

.jr-stop circle {
  transition: transform 0.15s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.jr-stop:hover circle { transform: scale(1.25); }

.jr-stop:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 50%; }

.jr-next {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--ink);
}

.jr-note {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.6;
}

.jr-coach {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(114, 35, 67, 0.06);
  font-size: 0.9rem;
}

.jr-coach strong { color: var(--wine); }

/* ---------- plan ---------- */
.plan-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 14px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: linear-gradient(180deg, #fffdf8, #fbf5ea);
  color: var(--gold-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.plan-chip::after {
  content: "\2192";
  margin-left: auto;
  color: var(--wine);
}

.plan-pitch {
  list-style: none;
  margin: 14px 0 18px;
  padding: 0;
}

.plan-pitch li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  color: var(--ink);
}

.plan-pitch li::before {
  content: "\2022";
  position: absolute;
  left: 8px;
  color: var(--gold);
  font-weight: 700;
}

.plan-weeks {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
}

.plan-wk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.plan-wk.done {
  background: rgba(93, 122, 78, 0.14);
  color: #3f5c33;
}

.plan-wk.lock {
  background: rgba(42, 18, 32, 0.05);
  color: var(--muted);
  border: 1px dashed rgba(42, 18, 32, 0.22);
}

.plan-wk.lock svg { width: 13px; height: 13px; }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 4px 0 16px;
}

.plan-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  border-radius: 12px;
  background: rgba(42, 18, 32, 0.04);
  border: 1px solid transparent;
}

.plan-day.rec { background: rgba(42, 18, 32, 0.02); border-color: rgba(42, 18, 32, 0.08); }

.plan-day.met { background: rgba(93, 122, 78, 0.14); border-color: rgba(93, 122, 78, 0.4); }

.plan-day.miss { background: rgba(201, 162, 39, 0.1); }

.pd-lab { font-size: 0.68rem; font-weight: 600; color: var(--muted); }

.plan-day.rec .pd-lab::after { content: " \00b7 rec"; color: var(--gold-ink); }

.pd-steps {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.pd-mark { font-size: 0.8rem; font-weight: 700; color: #3f5c33; min-height: 1em; }

.plan-gate {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.plan-leave { margin-top: 6px; }

.plan-cert-note { margin: 12px 0 16px; font-size: 0.92rem; }

.cert-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  background: #722343;
}

/* ---------- form chip + Go Gold ---------- */
.spark { width: 60px; height: 20px; flex: 0 0 auto; }

.spark polyline {
  fill: none;
  stroke: var(--wine-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.go-gold {
  background: rgba(201, 162, 39, 0.14);
  border-color: var(--gold);
  color: var(--gold-ink);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---------- tier badge ---------- */
.tr-ico.tier-bronze { color: #d9a06b; }
.tr-ico.tier-silver { color: #d9dde3; }
.tr-ico.tier-gold { color: var(--gold); }

.tr-ico.tier-bronze, .tr-ico.tier-silver, .tr-ico.tier-gold { font-size: 1.2rem; }

/* ---------- duels ---------- */
.duel-list { list-style: none; margin: 12px 0 18px; padding: 0; }

.duel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--line);
}

.duel-item:last-child { border-bottom: 0; }

.duel-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.duel-name {
  font-weight: 700;
  font-size: 0.94rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duel-line { font-size: 0.86rem; color: var(--ink); }

.duel-item.s-live .duel-line { font-weight: 700; color: var(--wine); font-variant-numeric: tabular-nums; }

.duel-item.s-done .duel-line { color: var(--muted); }

.duel-meta { font-size: 0.76rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.duel-acts { display: flex; gap: 6px; flex: 0 0 auto; }

.chip.taunt {
  background: rgba(114, 35, 67, 0.08);
  color: var(--wine);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.duel-form { border-top: 1px solid var(--line); padding-top: 16px; }

.join-grid + .v3-card, .v3-card + .v3-card { margin-top: 18px; }

/* ---------- v3 responsive ---------- */
@media (max-width: 640px) {
  .chal-tier { grid-template-columns: 1fr auto; grid-template-areas: "name name" "bar status"; row-gap: 6px; }
  .chal-tname { grid-area: name; }
  .chal-bar { grid-area: bar; }
  .chal-done, .chal-togo { grid-area: status; }
  .plan-grid { gap: 5px; }
  .plan-day { padding: 8px 2px; }
  .pd-steps { font-size: 0.7rem; }
}

/* ============================================================
   v3.2 — profile pages, WhatsApp family card, linked rows
   ============================================================ */

/* ---------- leaderboard rows as links ---------- */
.lb-item-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.lb-list > * + * { margin-top: 6px; }

.lb-item-link:hover .lb-item,
.lb-item-link:focus-visible .lb-item {
  background: linear-gradient(90deg, rgba(114, 35, 67, 0.07), rgba(114, 35, 67, 0) 60%);
}

.lb-item-link:hover .lb-item.owner {
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.16), rgba(201, 162, 39, 0) 60%);
}

.lb-item-link:focus-visible { outline: none; }
.lb-item-link:focus-visible .lb-item {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.lb-go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.lb-item-link:hover .lb-go { color: var(--wine); }

/* ---------- header chip as profile link ---------- */
a.me-chip { text-decoration: none; }
a.me-chip:hover { background: rgba(114, 35, 67, 0.13); }

/* ---------- streak share button (hero, on dark) ---------- */
.pill-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin-left: -2px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(250, 246, 239, 0.28);
  background: rgba(250, 246, 239, 0.12);
  color: rgba(250, 246, 239, 0.92);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.pill-share:hover { background: rgba(250, 246, 239, 0.2); border-color: rgba(250, 246, 239, 0.5); }

.pill-share svg { width: 17px; height: 17px; }

/* ---------- WhatsApp compact chip (dashboard) ---------- */
.wa-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin: 14px 0;
  padding: 8px 15px;
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 39, 0.5);
  background: linear-gradient(180deg, #fffdf8, #fbf5ea);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
}

.wa-chip:hover { border-color: var(--gold); box-shadow: 0 6px 16px rgba(42, 18, 32, 0.08); }

.wa-chip-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(93, 122, 78, 0.16);
  color: #3f5c33;
  flex: 0 0 auto;
}

.wa-chip-ico svg { width: 15px; height: 15px; }

/* ---------- WhatsApp join card (Join view) ---------- */
.wa-body {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.wa-copy { flex: 1 1 240px; min-width: 0; }
.wa-copy .btn { margin-top: 2px; }
.wa-copy .muted { margin: 10px 0 0; }

.wa-qr-box {
  flex: 0 0 auto;
  padding: 10px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(42, 18, 32, 0.1);
  box-shadow: var(--shadow);
}

.wa-qr { display: block; width: 180px; height: 180px; }

/* ---------- profile ---------- */
.pf-back-row { margin-bottom: 14px; }

.pf-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px 8px 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}

.pf-back:hover { color: var(--wine); }

.pf-head {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 26px 28px;
  background: linear-gradient(135deg, #fffdf8, #fbf5ea);
}

.avatar.xl {
  width: 76px;
  height: 76px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.35), 0 8px 20px rgba(42, 18, 32, 0.18);
}

.pf-head-copy { min-width: 0; flex: 1; }

.pf-name {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.pf-meta { color: var(--muted); font-size: 0.92rem; margin: 0; }

.pf-bio {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ink);
}

.pf-nudge {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--gold-ink);
  font-weight: 600;
}

/* compact 90-day calendar (same cells, smaller) */
.pf-heat .heat-col { grid-template-rows: 12px repeat(7, 10px); gap: 2.5px; }
.pf-heat .heat-cell { width: 10px; height: 10px; border-radius: 2.5px; }
.pf-heat .heat-cell.today { box-shadow: 0 0 0 1.5px #ffffff, 0 0 0 3px var(--wine); }
.pf-heat-card .heat-scroll { padding: 26px 22px 6px 0; }

/* records */
.pf-recs { padding: 20px 22px; }
#pfDuelRec { display: block; }

/* settings */
.pf-divider {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 20px 0;
  height: 0;
}

.pf-count {
  margin: 6px 0 0;
  text-align: right;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

textarea.input {
  resize: vertical;
  min-height: 84px;
  font-family: inherit;
  line-height: 1.5;
}

/* ---------- profile responsive ---------- */
@media (max-width: 640px) {
  .pf-head { flex-direction: column; align-items: flex-start; gap: 14px; padding: 22px 18px; }
  .wa-body { flex-direction: column; align-items: flex-start; }
  .pf-heat .heat-col { grid-template-rows: 12px repeat(7, 9px); }
  .pf-heat .heat-cell { width: 9px; height: 9px; }
}

/* ============================================================
   v4 — bottom tab bar, 5-range boards, personal "today" card,
   connect-your-steps card, group invite card
   ============================================================ */
.tabs svg {
  width: 20px; height: 20px; margin-right: 6px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.seg-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; max-width: 520px; border-radius: 14px; }
.seg-5 .seg-btn { padding: 8px 2px; border-radius: 10px; }
.lb-sub { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; }
.metric { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.metric-btn {
  border: 0; background: transparent; min-height: 44px; padding: 0 16px; cursor: pointer;
  font: 600 0.85rem var(--font-body); color: var(--muted);
}
.metric-btn[aria-pressed="true"] { background: var(--ink); color: #faf6ef; }

.me-today { margin-bottom: 18px; display: flex; flex-direction: column; gap: 14px; }
.mt-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mt-top .eyebrow { margin: 0; color: var(--gold-ink); }
.mt-name { font-family: var(--font-display); font-size: 1.45rem; margin: 2px 0 0; }
.sync-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  font-size: 0.8rem; font-weight: 600; color: #3d5a30; text-decoration: none; white-space: nowrap;
}
.sync-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.mt-body { display: flex; align-items: center; gap: 18px; }
.mt-body p { margin: 0; }
.mt-ring { width: 104px; height: 104px; flex: 0 0 104px; }
.mt-track { fill: none; stroke: rgba(114, 35, 67, 0.12); stroke-width: 12; }
.mt-fill { fill: none; stroke: var(--wine); stroke-width: 12; stroke-linecap: round; }
.mt-ring text { font: 700 24px var(--font-display); fill: var(--ink); }
.mt-steps { font: 700 2.2rem/1 var(--font-display); margin-bottom: 6px !important; }
.mt-steps span { font: 500 0.95rem var(--font-body); color: var(--muted); }
.mt-rank {
  display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; min-height: 56px; padding: 8px 14px;
  border-radius: 14px; background: rgba(201, 162, 39, 0.14); color: var(--ink); text-decoration: none;
}
.mt-rank strong { color: var(--wine); }
.mt-rank span { color: var(--muted); font-size: 0.86rem; flex: 1; }
.mt-rank span[aria-hidden] { flex: none; color: var(--wine); font-size: 1.4rem; }

.connect-card .cc-h { font-size: 1rem; margin: 18px 0 6px; }
.cc-steps { margin: 6px 0 12px; padding-left: 20px; font-size: 0.92rem; }
.cc-steps li + li { margin-top: 6px; }
.cc-steps code, .cc-key code {
  font-size: 0.8rem; background: rgba(42, 18, 32, 0.06); padding: 1px 5px; border-radius: 5px; word-break: break-all;
}
.cc-key { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.cc-key .muted { width: 100%; }

.invite-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ic-qr .wa-qr { width: 132px; height: 132px; border-radius: 12px; }
.ic-body { flex: 1 1 220px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ic-body p { margin: 0; }
.ic-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.form-err:empty { display: none; }

@media (max-width: 640px) {
  /* backdrop-filter makes the header a containing block for fixed children — drop it on phones */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; order: initial; width: auto; margin: 0; gap: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(42, 18, 32, 0.06);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .tabs a {
    flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 4px 2px;
    border-radius: 12px; font-size: 0.72rem;
  }
  .tabs svg { margin: 0; width: 22px; height: 22px; }
  .auth-slot { display: none; } /* the Me tab carries profile + log out on phones */
  .tabs a[aria-current="page"] { background: transparent; box-shadow: none; color: var(--wine); font-weight: 700; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .seg-5 .seg-btn { font-size: 0.82rem; }
  .lb-sticky { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .lb-nm { white-space: normal; }
}

/* v4.1 — sync status ("is Mum's phone still syncing?") */
.sync-state { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: #3d5a30; }
.sync-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sync-state.stale { color: #8a5200; }
.lb-name .sync-state { margin-top: 2px; font-size: 0.74rem; }
.pf-sync { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 0; }
.quiet-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: rgba(201, 162, 39, 0.14); margin-top: 16px; }
.quiet-card p { margin: 0; flex: 1 1 220px; font-size: 0.92rem; }

.google-slot { margin: 14px 0 4px; min-height: 44px; }
.pf-google { margin: 4px 0; }

/* v5 timelines */
.tl, .cm { max-width: 760px; margin: 0 auto; }
.tl-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tl-pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--wine); background: #fff; font-size: 0.8rem; font-weight: 700; text-decoration: none; }
.tl-sub { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.tl-units { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 4px; margin-top: 12px; border-radius: 14px; background: rgba(114, 35, 67, 0.08); }
.cm-modes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tl-units button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; font: 600 0.85rem var(--font-body); color: var(--muted); cursor: pointer; padding: 0 2px; }
.tl-units button[aria-selected="true"], .tl-units button[aria-pressed="true"] { background: #fff; color: var(--wine); box-shadow: 0 3px 10px rgba(42, 18, 32, 0.12); }
.tl-nav { display: flex; gap: 8px; margin-top: 8px; }
.tl-step { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(42, 18, 32, 0.14); background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tl-step[aria-disabled="true"] { opacity: 0.35; cursor: default; }
.tl-title { flex: 1; min-width: 0; min-height: 44px; border-radius: 12px; border: 1px solid rgba(42, 18, 32, 0.14); background: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; font: 700 0.82rem var(--font-body); color: var(--ink); cursor: pointer; padding: 0 8px; }
.tl-title.static { cursor: default; }
.tl-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-card { background: #fff; border-radius: 18px; border: 1px solid rgba(42, 18, 32, 0.08); padding: 14px; margin-top: 10px; }
.tl-read { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 68px; touch-action: pan-y; }
.tl-when { font-size: 0.74rem; font-weight: 700; color: var(--wine); letter-spacing: 0.06em; text-transform: uppercase; }
.tl-val { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.tl-val span { font: 500 0.82rem var(--font-body); color: var(--muted); }
.tl-subline { font-size: 0.78rem; color: var(--muted); }
.tl-chips { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tl-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.tl-chip.met { background: rgba(93, 122, 78, 0.16); color: #3d5a30; }
.tl-chip.pb { background: rgba(201, 162, 39, 0.22); color: var(--wine); }
.tl-chart { display: flex; margin-top: 8px; }
.tl-axis { flex: none; width: 34px; font: 11px var(--font-body); fill: var(--muted); }
.tl-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; touch-action: pan-y; }
.tl-scroll.scrolls { touch-action: pan-x pan-y; }
.tl-plot { position: relative; }
.tl-svg text { font-size: 11px; fill: var(--muted); }
.tl-svg .cm-ll { fill: var(--ink); font-weight: 600; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.tl-hit { position: absolute; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 3px; }
.tl-hit:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.tl-tip { position: absolute; transform: translate(-50%, -100%); pointer-events: none; background: var(--ink); color: #fff; font-size: 0.74rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; z-index: 2; }
.tl-hollow { fill: none; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font-size: 0.74rem; color: var(--muted); }
.tl-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.tl-legend .lg.met { background: #722343; }
.tl-legend .lg.below { background: #a8607e; }
.tl-legend .lg.live { background: repeating-linear-gradient(45deg, #fff 0 2px, #722343 2px 4px); border: 1px solid #722343; }
.tl-legend .lg.best { background: #c9a227; border: 1px solid #2a1220; }
.tl-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(42, 18, 32, 0.05); font-size: 0.8rem; }
.tl-note.warn { background: rgba(201, 162, 39, 0.16); color: #5a4607; }
.tl-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.tl-tile { padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.tl-tl { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.tl-tv { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.tl-ts { font-size: 0.74rem; color: var(--muted); }
.tl-trend { margin: 12px 0 0; font-size: 0.86rem; font-weight: 600; color: var(--wine); }
.tl-err p { margin: 0 0 10px; }
.tl-dialog { border: 0; border-radius: 18px; padding: 18px; width: min(92vw, 360px); box-shadow: 0 20px 60px rgba(42, 18, 32, 0.3); }
.tl-dialog::backdrop { background: rgba(42, 18, 32, 0.45); }
.tl-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tl-grow { transform-box: fill-box; transform-origin: 50% 100%; animation: tl-grow 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes tl-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.cm-reveal { animation: cm-reveal 0.6s ease-out both; }
@keyframes cm-reveal { from { clip-path: inset(-8px 100% -8px -8px); } to { clip-path: inset(-8px -8px -8px -8px); } }
.cm-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.cm-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: 4px; border-radius: 14px; border: 1.5px solid rgba(42, 18, 32, 0.12); background: #fff; color: var(--ink); font: 600 0.78rem var(--font-body); cursor: pointer; position: relative; min-width: 0; }
.cm-chip:not(.on) { opacity: 0.7; }
.cm-cn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-ck { position: absolute; top: 3px; right: 3px; color: var(--wine); line-height: 0; }
.cm-glyph { flex: none; }
.cm-dot { width: 14px; height: 14px; border-radius: 50%; display: block; }
.cm-more { grid-column: 1 / -1; }
.cm-more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; font-size: 0.85rem; color: var(--wine); }
.cm-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-height: 240px; overflow-y: auto; }
.cm-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cm-lay { margin-top: 0; grid-template-columns: repeat(3, auto); }
.cm-lay button { padding: 0 12px; min-height: 36px; }
.cm-pace { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 0.85rem; font-weight: 600; }
.cm-insight { background: linear-gradient(135deg, var(--wine), var(--wine-deep)); color: #faf6ef; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.cm-it { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.cm-is { font-size: 0.78rem; line-height: 1.4; color: rgba(250, 246, 239, 0.88); margin-top: 3px; }
.cm-hint { margin: 6px 0 0; }
.cm-rt-h { font-size: 0.74rem; font-weight: 700; color: var(--wine); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 10px; }
.cm-rt { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.cm-rt td { padding: 6px 4px; border-top: 1px solid var(--line); vertical-align: middle; }
.cm-rk { width: 20px; color: var(--muted); }
.cm-rn { font-weight: 600; }
.cm-rv { text-align: right; }
.cm-rv b { display: block; }
.cm-rv span { display: block; font-size: 0.74rem; color: var(--muted); }
.cm-race { display: grid; gap: 6px; margin-top: 8px; }
.cm-presets { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 420px) {
  .tl, .cm { margin-left: -4px; margin-right: -4px; }
}
@media (max-width: 360px) {
  .cm-chips, .cm-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .tl-grow, .cm-reveal { animation: none; }
}


/* ============ profiles, photos, near you, admin (v12) ============ */
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* (i): explanation behind a button */
.info { position: relative; display: inline-block; vertical-align: middle; }
.info-btn {
  width: 24px; height: 24px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1.5px solid currentColor; background: transparent; color: var(--wine);
  font: italic 700 0.8rem/1 var(--font-display); display: inline-grid; place-items: center;
  position: relative;
}
.info-btn::after { content: ""; position: absolute; inset: -10px; } /* 44px touch target */
.info.on-dark .info-btn { color: #f3dfa2; }
.info-pop {
  position: absolute; z-index: 30; top: calc(100% + 8px); right: -8px; width: max-content; max-width: min(250px, 72vw);
  background: var(--ink); color: #faf6ef; border-radius: 12px; padding: 10px 12px;
  font: 500 0.85rem/1.4 var(--font-body); text-transform: none; letter-spacing: 0; text-align: left;
  box-shadow: 0 10px 30px rgba(42, 18, 32, 0.3);
}
.info.left .info-pop { right: auto; left: -8px; }
.info-pop[hidden] { display: none; }
.eyebrow .info { margin-left: 4px; }

/* today: units + goal */
.goal-line { margin: 4px 0 0; font: 600 1.05rem/1.2 var(--font-body); color: rgba(250, 246, 239, 0.85); }
.mt-goal { font-weight: 600; color: var(--muted); margin-bottom: 2px !important; }
.mt-km { color: var(--muted); font-size: 0.9rem; }
.mt-group {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-radius: 14px; background: rgba(114, 35, 67, 0.06);
}
.mt-glabel { font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.mt-group strong { font: 700 1.35rem/1 var(--font-display); color: var(--wine); }
.mt-group strong small, .tl-steps small, .stat-value small { font: 500 0.75rem var(--font-body); color: var(--muted); }
.lb-nums em { font-size: 0.72rem; }

/* icons */
.ico-pin, .ico-cam, .ico-people { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -3px; margin-right: 4px; }
.ico-people { margin: 0 0 0 4px; }
.btn .ico-cam { width: 18px; height: 18px; vertical-align: -4px; }

/* profile header + editor */
.pf-status { margin: 2px 0 4px; font-weight: 600; color: var(--ink); }
.pf-city { display: inline-flex; align-items: center; }
.pf-edit { display: grid; gap: 12px; }
.pf-photo { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pf-photo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; font-weight: 600; cursor: pointer; margin-bottom: 8px; }
.switch {
  appearance: none; -webkit-appearance: none; width: 52px; height: 30px; border-radius: 999px; flex: none; cursor: pointer;
  background: rgba(42, 18, 32, 0.22); position: relative; transition: background 0.15s; margin: 0;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: transform 0.15s; }
.switch:checked { background: var(--wine); }
.switch:checked::after { transform: translateX(22px); }
.switch:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }

/* near you */
.near-card { margin-bottom: 16px; }
.near-card .card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.near-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line); }
.near-row:first-of-type { border-top: 0; }
.near-main { flex: 1; min-width: 0; display: grid; }
.near-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-num { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.near-num small { font-weight: 500; color: var(--muted); }
.near-ico { width: 38px; height: 38px; border-radius: 50%; background: rgba(114, 35, 67, 0.1); color: var(--wine); display: grid; place-items: center; flex: none; }
.near-ico .ico-people { margin: 0; width: 20px; height: 20px; }
.near-empty { margin: 8px 0 0; }
.near-add { display: flex; align-items: center; gap: 10px; min-height: 56px; margin-bottom: 16px; text-decoration: none; font-weight: 600; color: var(--wine); }
.near-add span:nth-child(2) { flex: 1; }

/* group admin */
.lb-row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.lb-row-wrap .lb-item-link { flex: 1; min-width: 0; }
.rm-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: transparent; color: #9b1c1c; cursor: pointer; display: grid; place-items: center; }
.rm-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rm-btn:hover { background: rgba(155, 28, 28, 0.08); }
.rm-confirm { flex-basis: 100%; display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 4px 8px 10px; font-weight: 600; }
.rm-confirm span { margin-right: auto; }
.btn.danger { background: #9b1c1c; border-color: #9b1c1c; color: #fff; }
.gset { margin-top: 18px; }

.lb-row-wrap .lb-self-line, .lb-row-wrap .lb-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row-wrap .sync-state { display: none; }

/* banked streak freezes: small snowflake + number next to the flame */
.frz { font-weight: 600; font-size: 0.85em; white-space: nowrap; }

/* group co-op bar and "Most improved" (Ranks) */
.coop { margin-top: 18px; }
.coop-num { margin: 4px 0 10px; font-size: 0.95rem; color: var(--muted); }
.coop-num b { color: var(--wine); font-size: 1.35rem; font-family: "Playfair Display", Georgia, serif; }
.coop-bar { display: block; height: 10px; border-radius: 999px; background: rgba(42, 18, 32, 0.08); overflow: hidden; }
.coop-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--wine)); transition: width 0.5s ease; }
.mi-list { display: grid; gap: 10px; margin-top: 10px; }
.mi-row { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.mi-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-pct { font-weight: 700; color: var(--wine); white-space: nowrap; }
