/* ═══════════════════════════════════════════════════════════════
   PUMP BEAST v2 — Styles
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg0: #0d0d14; --bg1: #131320; --bg2: #1b1b2e; --bg3: #222238;
  --border: rgba(255,255,255,0.07);
  --text0: #f0f0f8; --text1: #b0b0cc; --text2: #7070a0;
  --accent: #a855f7; --accent2: #6366f1;
  --green: #22c55e; --red: #ef4444; --yellow: #f59e0b;
  --radius: 16px;
  --tab-h: 62px; --top-h: 50px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg0); color: var(--text0); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; overflow: hidden; }

/* ─── APP SHELL ─────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100dvh; max-width: 480px; margin: 0 auto; }

/* ─── TOP BAR ───────────────────────────────────────────────── */
#topBar { height: var(--top-h); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--bg1); border-bottom: 1px solid var(--border); flex-shrink: 0; z-index: 10; }
.top-left, .top-right { font-size: 14px; font-weight: 600; color: var(--text1); min-width: 64px; }
.top-right { text-align: right; }
.top-title { font-size: 15px; font-weight: 800; letter-spacing: 2px; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
/* ─── TAB NAV (with labels) ─────────────────────────────────── */
#tabBar { height: var(--tab-h); display: flex; align-items: stretch; justify-content: space-around; background: var(--bg1); border-top: 1px solid var(--border); order: 99; flex-shrink: 0; }
.tab-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: none; border: none; cursor: pointer; position: relative; transition: transform 0.15s; padding: 6px 0; }
.tab-icon { font-size: 22px; line-height: 1; transition: transform 0.2s; }
.tab-label { font-size: 10px; font-weight: 700; color: var(--text2); letter-spacing: 0.3px; transition: color 0.2s, opacity 0.2s; white-space: nowrap; opacity: 0; max-height: 0; overflow: hidden; }
.tab-btn.active .tab-icon { transform: scale(1.1); }
.tab-btn.active .tab-label { color: var(--accent); opacity: 1; max-height: 16px; }
.tab-btn.active::after { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 3px; border-radius: 0 0 4px 4px; background: var(--accent); }
.tab-btn:active { transform: scale(0.9); }

/* ─── SCREENS ───────────────────────────────────────────────── */
.tab-screen { display: none; flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.tab-screen.active { display: block; }
.tab-inner { padding: 16px 16px 24px; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text2); margin-bottom: 12px; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   HOME — BEAR SECTION
   ═══════════════════════════════════════════════════════════════ */
#bearSection {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0 0;
  position: relative;
}

/* ── Bear mood badge ── */
.bear-mood-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 20px;
  margin: 2px 0 4px;
  min-height: 18px;
}
.mood-happy  { background: rgba(34,197,94,0.15);   color: var(--green); }
.mood-good   { background: rgba(251,191,36,0.12);   color: #fbbf24; }
.mood-meh    { background: rgba(255,255,255,0.07);  color: var(--text2); }
.mood-sad    { background: rgba(239,68,68,0.12);    color: #ef4444; }

/* ── Bear hero wrapper (ring + bear) ── */
.bear-hero {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 4px 0 2px;
}
.bear-progress-ring {
  position: absolute;
  top: 0; left: 0;
  width: 220px; height: 220px;
  pointer-events: none;
  z-index: 1;
}
.bear-progress-ring .ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.07);
  stroke-width: 8;
}
.bear-progress-ring .ring-progress {
  fill: none;
  stroke: #ef4444;
  stroke-width: 8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 110px 110px;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.4,0,0.2,1), stroke 0.5s ease;
}
.bear-hero .bear-stage {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

/* ── Main chips grid (5 items, 2 cols) ── */
.chips-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: calc(100% - 24px);
  margin: 6px 0 0;
}

/* ── Custom chips row (3 items) ── */
.chips-custom-row {
  display: flex;
  gap: 8px;
  width: calc(100% - 24px);
  margin: 6px 0 0;
}

/* ── Main chip ── */
.bear-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1.5px solid;
  cursor: pointer;
  min-height: 58px;
  transition: all 0.18s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.bear-chip.chip-red    { background: rgba(239,68,68,0.10);  border-color: rgba(239,68,68,0.35);  }
.bear-chip.chip-yellow { background: rgba(251,191,36,0.10); border-color: rgba(251,191,36,0.35); }
.bear-chip.chip-green  { background: rgba(34,197,94,0.10);  border-color: rgba(34,197,94,0.35);  }
.bear-chip.chip-purple { background: rgba(168,85,247,0.10); border-color: rgba(168,85,247,0.35); }
.bear-chip:active { transform: scale(0.96); opacity: 0.85; }
/* Inner row — icon + text + status */
.bc-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.bc-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.bc-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.bc-name { font-size: 12px; font-weight: 600; color: var(--text0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-pts  { font-size: 10px; color: var(--text2); white-space: nowrap; }
.bc-status { flex-shrink: 0; display: flex; align-items: center; }
.bc-check { font-size: 16px; font-weight: 800; color: var(--green); }
.bear-chip.chip-purple .bc-check { color: var(--accent); }
.bc-right-val { flex-shrink: 0; font-size: 15px; font-weight: 700; color: var(--text2); }
.bear-chip.chip-green  .bc-right-val { color: var(--green); }
.bear-chip.chip-yellow .bc-right-val { color: #fbbf24; }
.bear-chip.chip-red    .bc-right-val { color: rgba(239,68,68,0.7); }
.bc-dash { color: var(--text2); font-weight: 400; font-size: 14px; }
/* Empty state indicators — communicate tappability */
.bc-todo-ring {
  display: inline-block;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(239,68,68,0.45);
  background: transparent;
}
.bc-todo-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(239,68,68,0.45);
  color: rgba(239,68,68,0.7);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
/* Stepper input (−/+) — matches Settings style */
.bc-num-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.bc-num-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text0);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  padding: 7px 4px;
  min-width: 0;
}
.bc-num-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text0);
  font-size: 20px;
  line-height: 1;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.bc-num-btn:active { background: var(--bg2); }
.bc-save-btn { background: var(--accent); border: none; border-radius: 10px; color: #fff; font-size: 16px; font-weight: 700; padding: 7px 14px; cursor: pointer; flex-shrink: 0; }

/* ── Custom chip (in custom row) ── */
.bear-chip-custom {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 6px;
  border-radius: 12px;
  border: 1.5px solid;
  cursor: pointer;
  min-height: 48px;
  transition: all 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.bear-chip-custom.chip-red    { background: rgba(239,68,68,0.10);  border-color: rgba(239,68,68,0.35);  }
.bear-chip-custom.chip-green  { background: rgba(34,197,94,0.10);  border-color: rgba(34,197,94,0.35);  }
.bear-chip-custom.chip-locked { background: rgba(255,255,255,0.03); border-color: var(--border); cursor: default; opacity: 0.45; }
.bear-chip-custom:active { transform: scale(0.95); }
.bear-chip-custom .bc-icon { font-size: 18px; }
.bear-chip-custom .bc-label-sm { font-size: 10px; color: var(--text2); text-align: center; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Breathing wrapper ──────────────────────────────────────── */
.bear-breathe-wrap {
  position: relative;
  transform-origin: bottom center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Home bear */
.bear-home {
  display: block;
  height: 210px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  object-position: bottom center;
  transform-origin: bottom center;
  pointer-events: none;
}

/* Motivation modal bear uses same height */
.mot-bear-wrap .bear-img {
  height: 220px;
  width: auto;
  display: block;
  transform-origin: bottom center;
  pointer-events: none;
}

/* ── Breathing keyframes ────────────────────────────────────── */
@keyframes breatheFat {
  0%, 100% { transform: scaleX(1)    scaleY(1); }
  38%      { transform: scaleX(0.990) scaleY(1.028); }
  60%      { transform: scaleX(0.991) scaleY(1.025); }
  80%      { transform: scaleX(1.002) scaleY(0.997); }
}
.fat-breathe { animation: breatheFat 3.8s ease-in-out infinite; }

@keyframes breatheMuscle {
  0%, 100% { transform: scaleX(1)    scaleY(1); }
  35%      { transform: scaleX(0.993) scaleY(1.020); }
  58%      { transform: scaleX(0.993) scaleY(1.018); }
  80%      { transform: scaleX(1.001) scaleY(0.998); }
}
.muscle-breathe { animation: breatheMuscle 3.1s ease-in-out infinite; animation-delay: 0.9s; }

/* ── Bear state filters ─────────────────────────────────────── */
.bear-breathe-wrap.state-sad     .bear-img { filter: saturate(0.55) brightness(0.85); transition: filter 0.7s; }
.bear-breathe-wrap.state-happy   .bear-img,
.bear-breathe-wrap.state-excited .bear-img { filter: saturate(1.15) brightness(1.06) drop-shadow(0 0 10px rgba(255,200,80,0.35)); transition: filter 0.3s; }
.bear-breathe-wrap.state-sleeping .bear-img { filter: saturate(0.4) brightness(0.75); transition: filter 1s; }
.bear-breathe-wrap.state-sleeping { animation: none !important; transform: rotate(4deg) scaleY(0.97); transform-origin: bottom center; transition: transform 1.2s ease-out; }
.bear-breathe-wrap.state-sleeping .bear-img { animation: sleepBreathe 5.5s ease-in-out infinite; }
@keyframes sleepBreathe { 0%,100%{transform:scaleX(1) scaleY(1);} 45%{transform:scaleX(0.988) scaleY(1.032);} }

/* ── Click counter ──────────────────────────────────────────── */
#clickDisplay {
  display: flex; align-items: center; gap: 5px;
  margin-top: 6px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 14px;
  font-size: 14px; font-weight: 700; color: var(--text0);
}
.click-label { font-size: 12px; color: var(--text2); font-weight: 400; }
#clickCountDisplay { color: var(--accent); }

/* ── Particles ──────────────────────────────────────────────── */
.bear-particles { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 5; }
.particle {
  position: absolute; font-size: 22px; line-height: 1; pointer-events: none;
  animation: particleRise var(--dur, 1.1s) ease-out forwards;
}
@keyframes particleRise {
  0%   { transform: translateY(0) scale(0.4) rotate(var(--rot0,-10deg)); opacity: 1; }
  18%  { transform: translateY(-14px) scale(1.25) rotate(var(--rot1,6deg)); opacity: 1; }
  100% { transform: translateY(-75px) scale(0.85) rotate(var(--rot2,-5deg)); opacity: 0; }
}
/* +N click float */
.click-float {
  position: absolute; font-size: 16px; font-weight: 800; color: var(--accent);
  pointer-events: none; animation: clickFloatAnim 0.8s ease-out forwards; z-index: 10;
}
@keyframes clickFloatAnim {
  0%   { transform: translateY(0) scale(0.8); opacity: 1; }
  100% { transform: translateY(-50px) scale(1.1); opacity: 0; }
}

/* ─── THOUGHT BUBBLE ────────────────────────────────────────── */
.thought-bubble {
  position: absolute;
  top: 70px; left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(255,255,255,0.96);
  color: #1e1e30;
  border-radius: 18px;
  padding: 9px 16px;
  font-size: 12px; font-weight: 700;
  max-width: 175px; min-width: 110px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  z-index: 20; pointer-events: none;
  white-space: normal; line-height: 1.4;
  animation: bubbleIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.thought-bubble.hiding { animation: bubbleOut 0.3s ease-in forwards; }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(0.7); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes bubbleOut {
  to { opacity: 0; transform: translateX(-50%) translateY(-115%) scale(0.8); }
}
/* Triangle tail */
.thought-tail {
  position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 10px solid rgba(255,255,255,0.96);
}
/* Dots (thought cloud) */
.thought-dots { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); display: flex; gap: 3px; }
.thought-dots span { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.6); display: block; }
.thought-dots span:nth-child(2) { width: 4px; height: 4px; }
.thought-dots span:nth-child(3) { width: 3px; height: 3px; }

/* ─── MOTIVATION BUTTON ─────────────────────────────────────── */
#motivationRow { display: flex; justify-content: center; padding: 10px 16px 4px; }
.btn-motivation {
  width: 100%; max-width: 320px;
  padding: 12px 24px; border-radius: 24px;
  border: 2px solid var(--accent);
  background: rgba(168,85,247,0.1);
  color: var(--accent); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.btn-motivation:active { background: rgba(168,85,247,0.25); transform: scale(0.97); }

/* ═══════════════════════════════════════════════════════════════
   MOTIVATION OVERLAY
   ═══════════════════════════════════════════════════════════════ */
.mot-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.mot-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.mot-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px;
  background: var(--bg1);
  border-radius: 28px 28px 0 0;
  padding: 24px 20px 40px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  animation: slideUp 0.35s cubic-bezier(0.34,1.1,0.64,1);
}
.mot-card.closing { animation: slideDown 0.3s ease-in forwards; }
@keyframes slideUp   { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideDown { to   { transform: translateY(100%); } }
.mot-close { position: absolute; top: 16px; right: 16px; background: var(--bg3); border: none; color: var(--text1); width: 32px; height: 32px; border-radius: 50%; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mot-title { font-size: 18px; font-weight: 800; color: var(--text0); }
.mot-bear-wrap { display: flex; justify-content: center; }
.mot-text { font-size: 20px; font-weight: 800; color: var(--accent); text-align: center; }
.mot-hint { font-size: 13px; color: var(--text2); text-align: center; line-height: 1.5; max-width: 300px; }

/* ═══════════════════════════════════════════════════════════════
   SCORE / STREAK
   ═══════════════════════════════════════════════════════════════ */
#scoreRing, .score-ring-sm { position: relative; width: 84px; height: 84px; }
.score-ring-sm { width: 90px; height: 90px; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg  { fill: none; stroke: var(--bg3); stroke-width: 6; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.8s cubic-bezier(.4,0,.2,1), stroke 0.4s; }
#scoreValue, .ring-val-sm { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 21px; font-weight: 800; color: var(--text0); }
.ring-val-sm { font-size: 20px; }

/* ═══════════════════════════════════════════════════════════════
   BODY TAB
   ═══════════════════════════════════════════════════════════════ */
.body-form { background: var(--bg2); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-bottom: 16px; }
.body-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.body-row:last-child { border-bottom: none; }
.body-row label { font-size: 14px; color: var(--text1); flex: 1; }
.body-row.primary-row { background: rgba(168,85,247,0.05); }
.body-row.primary-row label { color: var(--text0); font-weight: 700; }
.input-num-wrap { display: flex; align-items: center; gap: 8px; }
.num-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg3); color: var(--text0); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; flex-shrink: 0; }
.num-btn:active { background: var(--accent); }
.body-row input[type="number"] { width: 64px; text-align: center; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text0); font-size: 15px; font-weight: 700; padding: 6px 4px; -moz-appearance: textfield; }
.body-row input[type="number"]::-webkit-outer-spin-button,
.body-row input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.btn-primary { width: 100%; padding: 14px; border-radius: var(--radius); border: none; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: opacity 0.2s, transform 0.15s; }
.btn-primary:active { transform: scale(0.98); opacity: 0.9; }
.btn-secondary { width: 100%; padding: 13px; border-radius: var(--radius); border: 1px solid var(--accent); background: transparent; color: var(--accent); font-size: 15px; font-weight: 700; cursor: pointer; transition: background 0.2s; }
.btn-secondary:active { background: rgba(168,85,247,0.1); }
.feedback-box { margin-top: 16px; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.feedback-box.success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: var(--green); }
.feedback-box.error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.3);  color: var(--red); }

/* ═══════════════════════════════════════════════════════════════
   CHECKLIST TAB
   ═══════════════════════════════════════════════════════════════ */
.date-label { font-size: 13px; color: var(--text2); margin-bottom: 16px; }
#scoreRing2 { margin: 0 auto 10px; display: block; }
.score-label-full { text-align: center; font-size: 13px; color: var(--text2); margin-bottom: 20px; }
.checklist-list { display: flex; flex-direction: column; gap: 10px; }
.checklist-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg2); cursor: pointer; transition: all 0.2s; user-select: none; }
.checklist-item.done { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.3); }
.checklist-item.done .ci-name { color: var(--green); }
.ci-checkbox { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.checklist-item.done .ci-checkbox { background: var(--green); border-color: var(--green); }
.ci-check-mark { width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px,-1px); opacity: 0; transition: opacity 0.15s; }
.checklist-item.done .ci-check-mark { opacity: 1; }
.checklist-item.rest-day { background: rgba(168,85,247,0.08); border-color: rgba(168,85,247,0.3); }
.checklist-item.rest-day .ci-name { color: var(--accent); }
.checklist-item.rest-day .ci-checkbox { background: var(--accent); border-color: var(--accent); }
.ci-icon { font-size: 22px; flex-shrink: 0; }
.ci-info { flex: 1; }
.ci-name { font-size: 14px; font-weight: 600; color: var(--text0); transition: color 0.2s; }
.ci-desc { font-size: 12px; color: var(--text2); margin-top: 2px; }
.ci-pts  { font-size: 12px; font-weight: 700; color: var(--text1); padding: 3px 8px; border-radius: 10px; background: var(--bg3); }
.ci-num-val { font-size: 12px; font-weight: 600; color: var(--accent); margin-left: 4px; }
.ci-num-input { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.ci-num-input input { flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; color: var(--text1); font-size: 13px; padding: 4px 6px; max-width: 90px; }
.ci-num-input span { font-size: 12px; color: var(--text2); }
.ci-num-input button { background: var(--accent); border: none; border-radius: 6px; color: #fff; font-size: 13px; padding: 4px 10px; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════════
   PROGRESS TAB
   ═══════════════════════════════════════════════════════════════ */
canvas { width: 100%; border-radius: 12px; background: var(--bg2); padding: 8px; }
.measure-list { display: flex; flex-direction: column; gap: 8px; }
.measure-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; background: var(--bg2); border-radius: 12px; border: 1px solid var(--border); font-size: 13px; }
.measure-date { color: var(--text2); }
.measure-vals { color: var(--text0); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   SETTINGS TAB — PROFILE CARD
   ═══════════════════════════════════════════════════════════════ */
.settings-profile-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border); border-radius: 20px;
  padding: 16px 18px; margin-bottom: 14px;
}
.spc-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; color: #fff;
}
.spc-info { flex: 1; min-width: 0; }
.spc-name { font-size: 16px; font-weight: 800; color: var(--text0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spc-bear { font-size: 12px; color: var(--text2); margin-top: 2px; }
.spc-stats { display: flex; gap: 12px; flex-shrink: 0; }
.spc-stat { display: flex; flex-direction: column; align-items: center; }
.spc-stat-num { font-size: 18px; font-weight: 900; color: var(--accent); line-height: 1; }
.spc-stat-label { font-size: 10px; color: var(--text2); font-weight: 600; margin-top: 1px; }

/* ═══════════════════════════════════════════════════════════════
   SETTINGS TAB — ACCORDION
   ═══════════════════════════════════════════════════════════════ */
.acc-section {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; overflow: hidden;
}
.acc-header {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 15px 16px; background: none; border: none; cursor: pointer;
  color: var(--text0); text-align: left; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.acc-header:active { background: var(--bg2); }
.acc-icon  { font-size: 18px; flex-shrink: 0; }
.acc-title { font-size: 15px; font-weight: 700; flex: 1; }
.acc-sub   { font-size: 12px; color: var(--text2); flex-shrink: 0; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-badge {
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--accent); border-radius: 10px; padding: 2px 7px;
  flex-shrink: 0;
}
.acc-arrow {
  font-size: 20px; color: var(--text2); flex-shrink: 0;
  transition: transform 0.28s ease; display: block;
  transform: rotate(0deg);
}
.acc-section.acc-open .acc-arrow { transform: rotate(90deg); }
.acc-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease, padding 0.2s ease;
  padding: 0 16px;
}
.acc-section.acc-open .acc-body {
  max-height: 1400px;
  padding: 0 16px 16px;
}
.acc-subsection-title {
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text2);
  margin: 16px 0 8px;
}
.acc-save-btn { margin-top: 12px; }
.acc-account-section { margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--border); }

/* Settings card wrapper for grouped sections */
.settings-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 16px;
}
.settings-card .setting-row input[type="text"],
.settings-card .setting-row input[type="number"] {
  background: var(--bg3);
}
.setting-row { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.setting-row label { font-size: 12px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text2); }
.setting-row input[type="text"] { width: 100%; padding: 12px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; color: var(--text0); font-size: 15px; }
.gender-select { display: flex; gap: 12px; }
.gender-option { display: flex; align-items: center; gap: 8px; flex: 1; padding: 12px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: all 0.2s; font-size: 13px; }
.gender-option input[type="radio"] { cursor: pointer; width: 16px; height: 16px; }
.gender-option input[type="radio"]:checked + span { color: var(--accent); font-weight: 600; }
.gender-option:has(input:checked) { border-color: var(--accent); background: rgba(168,85,247,0.1); }
.setting-info { background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.info-row { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--text2); }
.info-row span:last-child  { font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   ONBOARDING
   ═══════════════════════════════════════════════════════════════ */
.onb-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.onb-card {
  background: var(--bg1);
  border-radius: 24px;
  padding: 28px 24px 24px;
  max-width: 360px; width: 100%;
  max-height: 90dvh; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  animation: onbCardIn 0.4s cubic-bezier(0.34,1.2,0.64,1);
}
@keyframes onbCardIn { from { opacity:0; transform: scale(0.85) translateY(20px); } to { opacity:1; transform: none; } }
.onb-steps { width: 100%; }
.onb-step { display: none; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.onb-step.active { display: flex; animation: onbStepIn 0.35s ease; }
@keyframes onbStepIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform:none; } }
.onb-bear-preview { height: 180px; display: flex; align-items: flex-end; justify-content: center; }
.onb-bear-img { height: 100%; width: auto; object-fit: contain; object-position: bottom; }
.onb-icon-big { font-size: 48px; line-height: 1; margin-bottom: 4px; }
.onb-title { font-size: 18px; font-weight: 800; color: var(--text0); }
.onb-text  { font-size: 14px; color: var(--text1); line-height: 1.6; }
.onb-text strong { color: var(--accent); }
.onb-dots { display: flex; gap: 8px; }
.onb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bg3); transition: all 0.2s; }
.onb-dot.active { background: var(--accent); width: 22px; border-radius: 4px; }
.onb-skip { background: none; border: none; color: var(--text2); font-size: 13px; cursor: pointer; padding: 4px; margin-top: -4px; }

/* ═══════════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════════ */
#toastContainer { position: fixed; bottom: calc(var(--tab-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: 340px; width: 90%; }
.toast { padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; text-align: center; animation: toastIn 0.3s ease, toastOut 0.4s ease 2.6s forwards; pointer-events: auto; }
.toast.success { background: rgba(34,197,94,0.92);  color: #fff; }
.toast.error   { background: rgba(239,68,68,0.92);   color: #fff; }
.toast.info    { background: rgba(99,102,241,0.92);   color: #fff; }
@keyframes toastIn  { from{opacity:0;transform:translateY(20px) scale(0.9);} to{opacity:1;transform:none;} }
@keyframes toastOut { to{opacity:0;transform:translateY(20px) scale(0.9);} }

.tab-screen::-webkit-scrollbar { width: 3px; }
.tab-screen::-webkit-scrollbar-track { background: transparent; }
.tab-screen::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════════
   BEAR STAGE — two-layer transformation
   ═══════════════════════════════════════════════════════════════ */
.bear-stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 200px;
  height: 215px;
  overflow: hidden;
}

/* Current bear group — slides out on preview */
#bearCurrentGroup {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: center;
  will-change: transform;
}

/* Film strip wrap — clipping window that slides in from side */
#bearStripWrap {
  position: absolute; inset: 0;
  overflow: hidden;
  transform: translateX(110%);
  will-change: transform;
  pointer-events: none;
}

/* Film strip row — scrolls horizontally inside the wrap */
#bearStrip {
  position: absolute; top: 0; bottom: 0; left: 0;
  display: flex; align-items: flex-end;
  height: 100%;
  will-change: transform;
}

.bear-strip-slot {
  width: 200px; height: 100%; flex-shrink: 0;
  display: flex; align-items: flex-end; justify-content: center;
}

.bear-tap-area {
  position: absolute;
  inset: 0;
  z-index: 10;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.bear-muscle-over {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
}

/* ── Bear identity row ── */
.bear-identity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.bear-name-badge {
  background: rgba(168,85,247,0.15);
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 14px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}


/* ═══════════════════════════════════════════════════════════════
   HERO STREAK SECTION
   ═══════════════════════════════════════════════════════════════ */
#heroStreakSection {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px 4px;
  gap: 10px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.hero-streak-block {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 10px 20px; min-width: 120px; flex: 1;
}

.hero-streak-num {
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
  color: var(--text2);
  transition: color 0.4s, text-shadow 0.4s;
}

.hero-streak-num.streak-active {
  color: var(--yellow);
  text-shadow: 0 0 16px rgba(245,158,11,0.4);
}

.hero-streak-num.streak-hot {
  color: #f97316;
  text-shadow: 0 0 22px rgba(249,115,22,0.55);
}

.hero-streak-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}

/* ── Today task chips ── */
.today-tasks {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 4px 4px;
  max-width: 100%;
}

.today-task-dot {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  width: calc(20% - 4px); /* exactly 5 per row with gap:5px */
  min-height: 58px;
  padding: 9px 2px 7px;
  border-radius: 14px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  transition: all 0.22s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.today-task-dot:active { transform: scale(0.93); }

.ttd-icon { font-size: 20px; line-height: 1; }
.ttd-label {
  font-size: 10px; font-weight: 700;
  color: var(--text1); text-align: center;
  line-height: 1.2; letter-spacing: 0.1px;
  width: 100%; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
  padding: 0 4px;
}

.today-task-dot.done {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.4);
}
.today-task-dot.done .ttd-icon { filter: drop-shadow(0 0 4px rgba(34,197,94,0.5)); }
.today-task-dot.done .ttd-label { color: var(--green); }

.tasks-bar-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text1);
  width: 100%; text-align: center;
  padding: 4px 0 6px;
}

/* ═══════════════════════════════════════════════════════════════
   CONFETTI / EMPTY STATES / MISC
   ═══════════════════════════════════════════════════════════════ */
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.empty-state {
  padding: 32px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  margin-top: 6px;
  cursor: pointer;
}
.empty-state-cta {
  display: inline-block; margin-top: 8px;
  color: var(--accent); font-weight: 700; font-size: 13px;
}

/* Friends empty state */
.friends-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 40px 16px 24px; text-align: center;
}
.friends-empty-icon { font-size: 52px; line-height: 1; }
.friends-empty-title { font-size: 17px; font-weight: 800; color: var(--text0); }
.friends-empty-sub { font-size: 14px; color: var(--text1); line-height: 1.5; max-width: 280px; }
.friends-empty-bonus { font-size: 12px; color: var(--text2); line-height: 1.5; max-width: 280px; background: var(--bg2); border-radius: 12px; padding: 10px 14px; border: 1px solid var(--border); }
.friends-invite-btn { max-width: 240px; padding: 13px 24px; font-size: 15px; margin-top: 4px; }

/* Hide old click counter */
#clickDisplay { display: none; }

/* ── Progress header + share ── */
.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.chart-hint {
  font-size: 12px;
  color: var(--text1);
  margin-bottom: 8px;
}

/* Spacing between charts */
.chart-section + .chart-section { margin-top: 28px; }

/* ── Body last date ── */
.body-last-date {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 10px;
  min-height: 16px;
}

/* ── Onboarding bear name input ── */
.onb-name-input-wrap {
  width: 100%;
}

.onb-name-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1.5px solid rgba(168,85,247,0.4);
  border-radius: 14px;
  color: var(--text0);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.onb-name-input:focus { border-color: var(--accent); }
.onb-name-input::placeholder { color: var(--text2); font-weight: 400; }

/* ═══════════════════════════════════════════════════════════════
   AUTH PROMPT  (soft nudge, above nav bar)
   ═══════════════════════════════════════════════════════════════ */
.auth-prompt {
  position: fixed;
  bottom: calc(var(--tab-h) + 10px);
  left: 50%; transform: translateX(-50%);
  width: calc(100% - 24px); max-width: 460px;
  background: linear-gradient(135deg, #1e1e3c, #2d1b69);
  border: 1px solid rgba(168,85,247,0.35);
  border-radius: 20px; padding: 14px 16px 16px;
  z-index: 90;
  box-shadow: 0 8px 40px rgba(0,0,0,0.55);
  animation: slideUp 0.4s cubic-bezier(0.34,1.1,0.64,1);
}
.auth-prompt-inner { display: flex; align-items: center; gap: 12px; }
.auth-prompt-icon  { font-size: 28px; flex-shrink: 0; }
.auth-prompt-text  { flex: 1; }
.auth-prompt-text h4 { font-size: 14px; font-weight: 700; color: var(--text0); margin-bottom: 2px; }
.auth-prompt-text p  { font-size: 12px; color: var(--text1); }
.auth-prompt-x { background: none; border: none; color: var(--text2); font-size: 14px; cursor: pointer; padding: 2px 4px; flex-shrink: 0; }
.auth-prompt-actions { display: flex; gap: 8px; margin-top: 12px; }
.auth-prompt-actions .btn-primary { flex: 1; padding: 11px; font-size: 13px; }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--text1); border-radius: 12px; padding: 11px 20px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.btn-ghost:active { background: var(--bg2); }

/* ═══════════════════════════════════════════════════════════════
   AUTH MODAL  (bottom sheet)
   ═══════════════════════════════════════════════════════════════ */
.auth-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.auth-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
}
.auth-card {
  position: relative;
  width: 100%; max-width: 480px;
  background: var(--bg1);
  border-radius: 28px 28px 0 0;
  padding: 28px 24px 44px;
  animation: slideUp 0.35s cubic-bezier(0.34,1.1,0.64,1);
  max-height: 92dvh; overflow-y: auto;
}
.auth-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--bg2); border: none; border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--text1); cursor: pointer;
}
.auth-logo   { font-size: 40px; text-align: center; margin-bottom: 10px; }
.auth-title  { font-size: 22px; font-weight: 800; color: var(--text0); text-align: center; margin-bottom: 6px; }
.auth-subtitle { font-size: 14px; color: var(--text1); text-align: center; margin-bottom: 24px; line-height: 1.5; }
.auth-field  { margin-bottom: 14px; }
.auth-field input {
  width: 100%; padding: 16px 18px;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 14px; color: var(--text0);
  font-size: 16px; /* 16px prevents zoom on iOS */
  outline: none; transition: border-color 0.2s;
  -webkit-appearance: none;
}
.auth-field input:focus { border-color: var(--accent); }
.auth-field input::placeholder { color: var(--text2); }
.auth-error {
  color: #f87171; font-size: 13px; font-weight: 500;
  padding: 10px 14px; background: rgba(239,68,68,0.1);
  border-radius: 10px; margin-bottom: 12px;
  border: 1px solid rgba(239,68,68,0.2);
}
.auth-btn    { width: 100%; padding: 16px; font-size: 15px; margin-top: 4px; }

/* ── Telegram auth ── */
.tg-auth-wrap { margin: 8px 0 4px; }
.btn-tg-login {
  width: 100%; padding: 14px 20px;
  background: #2AABEE; border: none; border-radius: 14px;
  color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.btn-tg-login:active { background: #1a9ede; transform: scale(0.98); }
.tg-pending {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 12px 0;
}
.tg-pending-text { font-size: 13px; color: var(--text1); text-align: center; }
.tg-cancel {
  background: none; border: 1px solid var(--border);
  color: var(--text2); border-radius: 8px; padding: 6px 16px;
  font-size: 12px; cursor: pointer;
}
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0; color: var(--text2); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-switch { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text1); }
.auth-switch span { color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ─── Settings account section ─────────────────────────────── */
.auth-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: var(--bg2);
  border-radius: 14px; border: 1px solid var(--border);
  font-size: 14px; font-weight: 600; margin-bottom: 8px;
}
.auth-status.guest      { border-color: rgba(168,85,247,0.3); }
.auth-status.registered { border-color: rgba(34,197,94,0.35); }
.auth-hint { font-size: 12px; color: var(--text2); line-height: 1.5; }
.btn-accent-sm { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 7px 14px; font-size: 12px; font-weight: 700; cursor: pointer; }
.btn-ghost-sm  { background: none; border: 1px solid var(--border); color: var(--text2); border-radius: 8px; padding: 7px 14px; font-size: 12px; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════════
   TOP USER BUTTON
   ═══════════════════════════════════════════════════════════════ */
.top-user-btn {
  background: rgba(168,85,247,0.15); border: 1px solid rgba(168,85,247,0.35);
  color: var(--accent); border-radius: 10px; padding: 4px 10px;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: background 0.2s;
  max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top-user-btn.logged-in { color: var(--text0); border-color: var(--border); background: var(--bg2); }
.top-user-btn:active { background: rgba(168,85,247,0.3); }

/* ── Telegram Mini App adaptations ── */
.tg-mode .auth-prompt { display: none !important; }
.tg-mode #authModal   { display: none !important; }
.tg-mode .tg-auth-wrap,
.tg-mode .auth-divider,
.tg-mode #authRegisterForm,
.tg-mode #authLoginForm { display: none !important; }
/* Safe area for iOS/Android status bars inside Telegram */
.tg-mode #app {
  height: calc(100dvh - env(safe-area-inset-top, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* 6-tab bar */
#tabBar .tab-btn { padding: 4px 0; }
#tabBar .tab-icon { font-size: 19px; }
#tabBar .tab-label { font-size: 9px; }

/* Top-right: icon-only gear for logged-in, text for guest */
.top-user-btn.icon-only {
  background: none; border: none; font-size: 18px;
  padding: 4px 8px; color: var(--text1);
}

/* ═══════════════════════════════════════════════════════════════
   ONBOARDING v2 — redesigned
   ═══════════════════════════════════════════════════════════════ */

/* Bears comparison (step 0) */
.onb-bears-compare {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin: 12px 0 16px;
}
.onb-bear-col {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex: 1;
}
.onb-bear-img-cmp {
  width: 130px; height: 130px; object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5));
}
.onb-bear-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  padding: 3px 10px; border-radius: 20px;
}
.onb-label-bad  { background: rgba(239,68,68,0.15); color: #f87171; }
.onb-label-good { background: rgba(34,197,94,0.15); color: #4ade80; }
.onb-compare-arrow {
  font-size: 28px; color: var(--accent);
  font-weight: 900; flex-shrink: 0; margin: 0 4px;
}

/* Gender selection (step 1) */
.onb-gender-row {
  display: flex; gap: 16px; justify-content: center;
  margin: 12px 0 16px;
}
.onb-gender-opt {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 18px;
  border: 2px solid var(--border); background: var(--bg2);
  cursor: pointer; transition: all 0.2s; flex: 1; max-width: 140px;
}
.onb-gender-opt.selected {
  border-color: var(--accent);
  background: rgba(168,85,247,0.12);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.2);
}
.onb-gender-opt:active { transform: scale(0.96); }
.onb-gender-bear {
  width: 80px; height: 80px; object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}
.onb-gender-label {
  font-size: 13px; font-weight: 700; color: var(--text1);
}
.onb-gender-opt.selected .onb-gender-label { color: var(--accent); }

/* Body form in onboarding — matches settings .body-form / .body-row */
.onb-body-form {
  width: 100%; display: flex; flex-direction: column; margin: 12px 0;
  background: var(--bg2); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
}
.onb-body-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.onb-body-row:last-child { border-bottom: none; }
.onb-body-row label {
  font-size: 14px; color: var(--text1); font-weight: 500; flex: 1; text-align: left;
}

/* Task list (step 3) */
.onb-tasks-list {
  display: flex; flex-direction: column; gap: 6px;
  margin: 12px 0; width: 100%;
}
.onb-task-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 12px;
  background: var(--bg2); border: 1px solid var(--border);
}
.onb-task-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.onb-task-name { flex: 1; font-size: 13px; color: var(--text0); font-weight: 600; }
.onb-task-pts  { font-size: 14px; font-weight: 900; color: var(--accent); background: rgba(168,85,247,0.12); border-radius: 8px; padding: 2px 8px; }

/* Registration form (step 4) */
.onb-reg-form { width: 100%; margin: 12px 0; }

/* Small text variant */
.onb-text-sm {
  font-size: 13px; color: var(--text1); text-align: center;
  line-height: 1.5; margin-bottom: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   CALENDAR TAB
   ═══════════════════════════════════════════════════════════════ */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-month-label {
  font-size: 16px; font-weight: 800; color: var(--text0);
  text-transform: capitalize; letter-spacing: 0.3px;
}
.cal-nav-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg2);
  color: var(--text0); font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, opacity 0.2s;
}
.cal-nav-btn:active { background: var(--bg3); }
.cal-nav-btn:disabled { opacity: 0.25; cursor: not-allowed; pointer-events: none; }

.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; margin-bottom: 6px;
}
.cal-weekdays div {
  font-size: 10px; font-weight: 700; color: var(--text2);
  padding: 3px 0; letter-spacing: 0.3px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
}
.cal-cell.cal-empty { pointer-events: none; }

/* SVG ring */
.cal-ring-svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.cal-ring-bg  { fill: var(--bg2); stroke: var(--bg3); stroke-width: 3; }
.cal-ring-fill { fill: none; stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.cal-today-ring { fill: none; stroke: var(--accent); stroke-width: 3; opacity: 0.9; }
.cal-cell.cal-today .cal-day-num { color: var(--accent); font-weight: 900; }

/* Day number + score overlay */
.cal-day-content {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 1px; pointer-events: none; line-height: 1;
}
.cal-day-num   { font-size: 12px; font-weight: 700; color: var(--text0); }
.cal-day-score { font-size: 8px; font-weight: 600; color: var(--text2); }
.cal-future .cal-day-num { color: var(--text2); opacity: 0.35; }
.cal-cell:has(.cal-future) .cal-ring-bg { stroke: rgba(255,255,255,0.03); }
.cal-future-cell .cal-ring-bg { stroke: rgba(255,255,255,0.03); }

/* Legend */
.cal-legend {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.cal-legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text2);
}
.cal-legend-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid; flex-shrink: 0;
}

/* Calendar responsive — small screens */
@media (max-width: 360px) {
  .cal-day-num   { font-size: 10px; }
  .cal-day-score { font-size: 7px; }
  .cal-legend { gap: 8px; }
  .cal-legend-item { font-size: 10px; }
}

/* ═══════════════════════════════════════════════════════════════
   EXTRA METRICS (Progress tab mini charts)
   ═══════════════════════════════════════════════════════════════ */
.mini-chart-wrap { margin-bottom: 4px; }
.mini-chart-wrap canvas { display: block; width: 100%; border-radius: 10px; }

/* ═══════════════════════════════════════════════════════════════
   REFERRAL SECTION (Settings tab)
   ═══════════════════════════════════════════════════════════════ */
.referral-card {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px;
}
.ref-stats-row {
  display: flex; gap: 12px; margin-bottom: 14px;
}
.ref-stat {
  flex: 1; text-align: center; background: var(--bg1);
  border-radius: 12px; padding: 10px 8px;
}
.ref-stat-num { font-size: 28px; font-weight: 900; color: var(--accent); line-height: 1; }
.ref-stat-label { font-size: 11px; color: var(--text2); margin-top: 3px; }

.ref-unlock-hint {
  font-size: 12px; color: var(--text2); text-align: center;
  margin-bottom: 14px; line-height: 1.4;
}
.ref-unlock-hint.done { color: var(--green); }

.btn-invite {
  width: 100%; padding: 12px; border-radius: 12px;
  background: linear-gradient(135deg, #2AABEE, #1c8cc5);
  color: #fff; font-size: 14px; font-weight: 700;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 12px;
}
.btn-invite:active { opacity: 0.85; transform: scale(0.98); }

.ref-link-row {
  display: flex; gap: 8px; align-items: center;
}
.ref-link-input {
  flex: 1; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg1);
  color: var(--text2); font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ref-copy-btn {
  padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--accent); background: rgba(168,85,247,0.1);
  color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; flex-shrink: 0;
}

/* Custom tasks form */
.custom-tasks-form { display: flex; flex-direction: column; gap: 8px; }
.custom-task-row {
  display: flex; align-items: center; gap: 10px;
}
.custom-task-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(168,85,247,0.2); color: var(--accent);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.custom-task-input {
  flex: 1; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg1);
  color: var(--text0); font-size: 13px;
}
.custom-task-input:focus { outline: none; border-color: var(--accent); }

/* Emoji picker button */
.ct-emoji-btn {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg3); cursor: pointer;
  font-size: 22px; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.ct-emoji-btn:active { background: var(--bg2); }

/* Emoji picker grid */
.ct-emoji-picker {
  display: flex; flex-wrap: wrap; gap: 4px;
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px;
  margin-top: 4px; margin-bottom: 6px;
  animation: onbStepIn 0.2s ease;
}
.ct-emoji-opt {
  width: 38px; height: 38px; border-radius: 8px;
  border: 1px solid transparent; background: var(--bg2);
  cursor: pointer; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}
.ct-emoji-opt:hover, .ct-emoji-opt:active {
  background: rgba(168,85,247,0.18); border-color: var(--accent);
}

/* Custom checklist items */
.checklist-item.custom-cl { border-left: 2px solid var(--accent); }

/* Locked checklist slot */
.checklist-item.ci-locked {
  opacity: 0.55;
  cursor: default;
  background: var(--bg1);
  border-style: dashed;
}
.ci-lock-icon { font-size: 20px; margin-right: 4px; flex-shrink: 0; }
.ci-invite-btn {
  padding: 6px 12px; border-radius: 10px; flex-shrink: 0;
  border: 1px solid #2AABEE; background: rgba(42,171,238,0.12);
  color: #2AABEE; font-size: 12px; font-weight: 700; cursor: pointer;
}
.ci-invite-btn:active { opacity: 0.7; }

/* Unlocked but unnamed slot */
.checklist-item.ci-unnamed { opacity: 0.65; cursor: pointer; }
.ci-checkbox-empty {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px dashed var(--accent); flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   FRIENDS TAB
   ═══════════════════════════════════════════════════════════════ */
.friends-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 16px; gap: 10px; text-align: center;
}
.friends-empty-icon { font-size: 52px; }
.friends-empty-title { font-size: 16px; font-weight: 700; color: var(--text0); }
.friends-empty-sub { font-size: 13px; color: var(--text2); max-width: 260px; line-height: 1.4; }

.friend-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 10px;
}
.friend-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.friend-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: #fff;
}
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-size: 14px; font-weight: 700; color: var(--text0); }
.friend-bear { font-size: 11px; color: var(--text2); margin-top: 2px; }
.friend-total { font-size: 13px; font-weight: 800; color: var(--accent); flex-shrink: 0; }

.friend-stats {
  display: flex; align-items: center;
  background: var(--bg1); border-radius: 12px; padding: 10px 14px;
}
.friend-stat-block { flex: 1; text-align: center; }
.friend-stat-label { font-size: 10px; color: var(--text2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.friend-score { font-size: 22px; font-weight: 900; color: var(--accent); line-height: 1; }
.friend-score-label { font-size: 10px; font-weight: 400; color: var(--text2); }
.friend-stat-divider { width: 1px; height: 32px; background: var(--border); flex-shrink: 0; margin: 0 12px; }
.friend-weight { font-size: 18px; font-weight: 800; line-height: 1; }
.friend-weight.weight-loss { color: var(--green); }
.friend-weight.weight-gain { color: var(--red); }

/* Top user button — gear variant */
.top-user-btn.logged-in {
  color: var(--text0); border-color: var(--border);
  background: var(--bg2); max-width: 110px;
}

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATION TIME PICKER (onboarding + settings)
   ═══════════════════════════════════════════════════════════════ */
.onb-time-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin: 16px 0 8px;
}
.onb-time-btn {
  padding: 10px 18px; border-radius: 12px;
  border: 2px solid var(--border); background: var(--bg2);
  color: var(--text1); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.onb-time-btn.selected {
  border-color: var(--accent); background: rgba(168,85,247,0.2);
  color: var(--accent); font-weight: 800;
  box-shadow: 0 0 0 3px rgba(168,85,247,0.2);
}
.onb-no-remind {
  display: block; margin: 12px auto 0;
  background: none; border: none; color: var(--text2);
  font-size: 13px; cursor: pointer; padding: 4px 8px;
  text-decoration: underline;
}
.onb-no-remind.active { color: var(--text0); font-weight: 700; text-decoration: none; }

/* Activity level picker */
.onb-act-grid {
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
}
.onb-act-btn {
  flex: 1; min-width: 54px; max-width: 70px;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 8px 4px; cursor: pointer;
  color: var(--text1); font-size: 11px; text-align: center; line-height: 1.4;
  transition: all 0.18s;
}
.onb-act-btn span { display: block; margin-top: 4px; }
.onb-act-btn.selected {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 700;
}

/* Goal type picker */
.onb-goal-grid {
  display: flex; gap: 8px; justify-content: center;
}
.onb-goal-btn {
  flex: 1; padding: 10px 6px; border-radius: 12px;
  background: var(--bg2); border: 1.5px solid var(--border);
  cursor: pointer; color: var(--text1); font-size: 13px;
  text-align: center; transition: all 0.18s;
}
.onb-goal-btn.selected {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 700;
}

/* Recommendation preview chips (onboarding) */
.onb-rec-preview {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  margin-top: 16px; padding: 12px; background: var(--bg2);
  border-radius: 14px; border: 1px solid var(--border);
}
.onb-rec-chip {
  font-size: 13px; color: var(--text0); font-weight: 600;
  padding: 4px 10px; background: var(--bg3);
  border-radius: 20px;
}

/* Recommendation card in settings */
.settings-rec-card {
  background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(59,130,246,0.08));
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 12px;
}
.settings-rec-card.hidden { display: none; }
.rec-title {
  font-size: 12px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}
.rec-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.rec-chip {
  font-size: 13px; font-weight: 600; color: var(--text0);
  padding: 5px 12px; background: var(--bg2); border-radius: 20px;
}
.rec-meta { font-size: 11px; color: var(--text2); }

/* Select fields in settings */
#tab-settings select {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; color: var(--text0);
  font-size: 14px; width: 100%; appearance: none;
  -webkit-appearance: none; cursor: pointer;
}

/* ─── Activity & Goal pickers (settings) ─── */
.setting-section-label {
  font-size: 11px; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 14px 0 8px;
}
.act-picker, .goal-picker { display: flex; flex-direction: column; gap: 6px; }
.act-opt, .goal-opt {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 10px 14px; cursor: pointer;
  transition: all 0.18s;
}
.act-opt.selected, .goal-opt.selected {
  border-color: var(--accent); background: rgba(168,85,247,0.1);
}
.act-opt-icon, .goal-opt-icon { font-size: 20px; flex-shrink: 0; }
.act-opt-text, .goal-opt-text { flex: 1; }
.act-opt-name, .goal-opt-name { font-size: 14px; font-weight: 600; color: var(--text0); }
.act-opt-desc, .goal-opt-desc { font-size: 11px; color: var(--text2); margin-top: 2px; }
.act-opt-check, .goal-opt-check {
  font-size: 15px; color: var(--accent); opacity: 0;
  transition: opacity 0.18s; flex-shrink: 0;
}
.act-opt.selected .act-opt-check,
.goal-opt.selected .goal-opt-check { opacity: 1; }

/* ─── Per-item notifications ─── */
.notif-item {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 8px; overflow: hidden;
}
.notif-item-header {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
}
.notif-item-icon { font-size: 18px; }
.notif-item-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text0); }
.notif-item-body { padding: 0 14px 14px; }
.notif-item-body.hidden { display: none; }
.notif-hint { font-size: 11px; color: var(--text2); margin-bottom: 10px; }
.notif-days-wrap { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.notif-day-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg3); border: 1.5px solid var(--border);
  color: var(--text1); font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.notif-day-btn.selected {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.notif-row-inline {
  display: flex; align-items: center; gap: 10px;
}
.notif-row-label { font-size: 13px; color: var(--text2); min-width: 60px; }
.notif-time-input {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 10px; color: var(--text0);
  font-size: 15px; font-weight: 600; width: 110px;
  -webkit-appearance: none; appearance: none;
}
.notif-times-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.notif-time-row {
  display: flex; align-items: center; gap: 8px;
}
.notif-time-del {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(239,68,68,0.15); border: none;
  color: #ef4444; font-size: 16px; cursor: pointer; line-height: 1;
}
.notif-add-btn {
  background: none; border: 1.5px dashed var(--border);
  border-radius: 10px; padding: 7px 14px;
  color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer;
  width: 100%; transition: all 0.15s;
}
.notif-add-btn:hover { border-color: var(--accent); background: rgba(168,85,247,0.06); }

/* ─── Reset profile button ─── */
.btn-reset-profile {
  width: 100%; margin-top: 16px; padding: 13px;
  background: rgba(239,68,68,0.1); border: 1.5px solid rgba(239,68,68,0.4);
  border-radius: 14px; color: #ef4444; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.18s;
}
.btn-reset-profile:active { background: rgba(239,68,68,0.2); }

/* ─── Confirm dialog ─── */
.confirm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 20px;
}
.confirm-box {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: 20px; padding: 24px; max-width: 320px; width: 100%;
}
.confirm-title { font-size: 17px; font-weight: 800; color: var(--text0); margin-bottom: 10px; }
.confirm-msg   { font-size: 14px; color: var(--text1); line-height: 1.5; margin-bottom: 20px; }
.confirm-btns  { display: flex; gap: 10px; }
.confirm-cancel {
  flex: 1; padding: 12px; border-radius: 12px;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text1); font-size: 14px; font-weight: 600; cursor: pointer;
}
.confirm-ok {
  flex: 1; padding: 12px; border-radius: 12px;
  background: var(--accent); border: none;
  color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
}
.confirm-ok.danger {
  background: #ef4444;
}

/* Notification settings in settings tab (legacy, kept for compatibility) */
.notif-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0 8px;
}
.notif-label { font-size: 14px; font-weight: 600; color: var(--text0); }
.notif-time-grid { margin: 0 0 4px; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 24px; transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; left: 3px; top: 3px; transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ═══════════════════════════════════════════════════════════════
   LANDING SCREEN
   ═══════════════════════════════════════════════════════════════ */
.landing-screen {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg0);
  overflow-y: auto; overflow-x: hidden;
  display: flex; align-items: flex-start; justify-content: center;
}
.landing-screen.hidden { display: none; }

.landing-inner {
  width: 100%; max-width: 390px;
  padding: 48px 24px 40px;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  min-height: 100%;
}

.landing-logo {
  font-size: 22px; font-weight: 900; letter-spacing: 2px;
  color: var(--text2); margin-bottom: 28px;
}
.landing-logo span { color: var(--accent); }

/* Bears transform block */
.landing-transform {
  display: flex; align-items: flex-end; gap: 12px;
  margin-bottom: 28px;
}
.landing-bear-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.landing-bear-img {
  width: 110px; height: 110px; object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(168,85,247,0.2));
}
.landing-bear-muscle {
  filter: drop-shadow(0 4px 24px rgba(168,85,247,0.5));
  animation: bearPulse 3s ease-in-out infinite;
}
@keyframes bearPulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}
.landing-bear-label {
  font-size: 12px; color: var(--text2); font-weight: 600; letter-spacing: 0.5px;
}
.landing-bear-label-goal { color: var(--accent); }
.landing-arrow-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding-bottom: 36px;
}
.landing-days { font-size: 10px; color: var(--accent); font-weight: 700; letter-spacing: 0.5px; }

/* Copy */
.landing-title {
  font-size: 26px; font-weight: 900; line-height: 1.2;
  text-align: center; color: var(--text0);
  margin-bottom: 14px;
}
.landing-sub {
  font-size: 14px; line-height: 1.6; color: var(--text1);
  text-align: center; max-width: 300px;
  margin-bottom: 24px;
}

/* Features */
.landing-features {
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; margin-bottom: 32px;
}
.landing-feature {
  font-size: 14px; color: var(--text0); background: var(--bg2);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; font-weight: 500;
  display: flex; align-items: center; gap: 12px;
}
.lf-icon { font-size: 22px; flex-shrink: 0; }

/* CTA */
.landing-tg-btn {
  width: 100%; max-width: 320px; font-size: 16px;
  padding: 15px 20px; border-radius: 14px;
  gap: 10px; font-weight: 800;
  box-shadow: 0 0 32px rgba(168,85,247,0.4);
}
.landing-hint {
  margin-top: 12px; font-size: 12px; color: var(--text2); text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   EVOLUTION STRIP — compact stage progress dots
   ═══════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════
   BEAR TASK RINGS — tamagotchi-style chips near bear
   ═══════════════════════════════════════════════════════════════ */
.bear-tasks-ring {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  padding: 6px 12px 0; width: 100%;
}
.task-ring-chip {
  position: relative; width: 44px; height: 44px; cursor: pointer;
  flex-shrink: 0; transition: transform 0.15s;
}
.task-ring-chip:active { transform: scale(0.9); }
.task-ring-chip svg {
  width: 44px; height: 44px;
  transform: rotate(-90deg);
}
.trc-bg { fill: var(--bg2); stroke: var(--bg3); stroke-width: 3; }
.trc-fill {
  fill: none; stroke: rgba(168,85,247,0.35); stroke-width: 3;
  stroke-linecap: round; transition: stroke-dashoffset 0.5s ease;
}
.task-ring-chip.done .trc-fill { stroke: var(--accent); }
.trc-icon {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 17px; line-height: 1; pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   FRIENDS TOP-3
   ═══════════════════════════════════════════════════════════════ */
.friends-top3 {
  background: linear-gradient(135deg, rgba(168,85,247,0.1), rgba(59,130,246,0.06));
  border: 1px solid rgba(168,85,247,0.2); border-radius: 16px;
  padding: 14px 16px; margin-bottom: 8px;
}
.friends-top3-title {
  font-size: 13px; font-weight: 800; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}
.friends-top3-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.friends-top3-row:last-child { border-bottom: none; }
.friends-top3-medal { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.friends-top3-name  { flex: 1; font-size: 14px; font-weight: 700; color: var(--text0); }
.friends-top3-bear  { font-size: 12px; color: var(--text2); }
.friends-top3-score {
  font-size: 13px; font-weight: 800; color: var(--accent);
  background: rgba(168,85,247,0.12); border-radius: 8px; padding: 2px 8px;
}

.evo-strip { width: 100%; padding: 8px 0 2px; }

.evo-stage-bar {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 24px;
}

/* 5 dots with track line */
.evo-dots-wrap {
  position: relative; width: 100%; max-width: 260px;
  height: 36px; display: flex; align-items: center;
}
.evo-track-bg {
  position: absolute; left: 16px; right: 16px; height: 3px;
  background: var(--bg3); border-radius: 2px; overflow: hidden;
}
.evo-track-fg {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 2px; transition: width 0.8s cubic-bezier(.4,0,.2,1);
}
.evo-dots {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; position: relative; z-index: 1;
}
.evo-dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800;
  background: var(--bg3); border: 2px solid var(--border);
  color: var(--text2); transition: all 0.3s; flex-shrink: 0;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.evo-dot:active { transform: scale(0.85); }
.evo-dot.past {
  background: rgba(34,197,94,0.15); border-color: var(--green); color: var(--green);
}
.evo-dot.active {
  width: 32px; height: 32px;
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-size: 13px; font-weight: 900;
  box-shadow: 0 0 0 4px rgba(168,85,247,0.2);
  animation: evo-dot-pulse 2.5s ease-in-out infinite;
}
.evo-dot.future { opacity: 0.35; }
.evo-dot.future:hover { opacity: 0.6; }

/* Hint "нажми для просмотра" под полоской */
.evo-tap-hint {
  font-size: 10px; color: var(--text2); text-align: center;
  letter-spacing: 0.3px; margin-top: -4px;
  opacity: 0.7;
}

@keyframes evo-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(168,85,247,0.2); }
  50%       { box-shadow: 0 0 0 7px rgba(168,85,247,0.3); }
}

/* Stage name + % row */
.evo-stage-info {
  display: flex; align-items: center; gap: 8px;
}
.evo-stage-title {
  font-size: 14px; font-weight: 700; color: var(--text0);
}
.evo-stage-pct {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: rgba(168,85,247,0.12); border: 1px solid rgba(168,85,247,0.25);
  padding: 2px 8px; border-radius: 10px;
}

/* Next milestone hint */
.evo-stage-next {
  font-size: 11px; color: var(--text2); text-align: center; line-height: 1.4;
}
.evo-stage-next b { color: var(--accent); }

.evo-tap-hint {
  font-size: 10px; color: var(--text2); opacity: 0.55;
  letter-spacing: 0.3px;
}

/* Bear stage preview badge */
.bear-preview-badge {
  position: absolute;
  top: 8px; left: 50%; transform: translateX(-50%);
  background: rgba(168,85,247,0.92);
  color: #fff; font-size: 12px; font-weight: 800;
  padding: 5px 16px; border-radius: 20px;
  white-space: nowrap; z-index: 20;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  box-shadow: 0 4px 16px rgba(168,85,247,0.4);
}
.bear-preview-badge.visible { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   BEAR EVOLUTION PREVIEW SHEET
   ═══════════════════════════════════════════════════════════════ */
.bear-evo-sheet {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.bear-evo-sheet.hidden { display: none; }

.bes-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
}
.bes-card {
  position: relative; z-index: 1;
  background: var(--bg1); border-radius: 24px 24px 0 0;
  padding: 8px 16px 44px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34,1.1,0.64,1);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.bear-evo-sheet.open .bes-card { transform: translateY(0); }

.bes-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--bg3); margin-bottom: 2px;
}
.bes-title {
  font-size: 16px; font-weight: 800; color: var(--text0);
}

/* Horizontal row of 5 stages */
.bes-stages {
  display: flex; gap: 10px;
  overflow-x: auto; width: 100%;
  padding: 4px 4px 8px; scrollbar-width: none;
}
.bes-stages::-webkit-scrollbar { display: none; }

.bes-stage {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex-shrink: 0; width: 90px;
}

.bes-bear-wrap {
  position: relative; width: 80px; height: 80px;
  border-radius: 16px; overflow: hidden;
  border: 2px solid var(--border); background: var(--bg2);
  transition: all 0.3s;
}
.bes-bear-fat, .bes-bear-mus {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain;
}
.bes-bear-fat { z-index: 1; }
.bes-bear-mus { z-index: 2; }

.bes-stage.past   .bes-bear-wrap { border-color: var(--green); }
.bes-stage.active .bes-bear-wrap {
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(168,85,247,0.45);
}
.bes-stage.future .bes-bear-wrap {
  filter: grayscale(1) brightness(0.65);
  opacity: 0.7;
}

.bes-done {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  background: rgba(34,197,94,0.2); color: var(--green);
  font-size: 22px; font-weight: 900;
}
.bes-you {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  z-index: 4; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 800; padding: 1px 8px; border-radius: 8px;
  white-space: nowrap;
}

.bes-stage-name {
  font-size: 11px; font-weight: 700; color: var(--text1); text-align: center;
}
.bes-stage-score { font-size: 10px; color: var(--text2); text-align: center; }
.bes-stage.active .bes-stage-name { color: var(--accent); }
.bes-stage.future .bes-stage-name { color: var(--text2); }

.bes-hint {
  font-size: 12px; color: var(--text2); text-align: center;
  padding: 0 8px; line-height: 1.5;
}

/* ── Top score chip ── */
.top-score-chip {
  font-size: 13px; font-weight: 700; color: var(--yellow);
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25);
  padding: 3px 9px; border-radius: 12px;
}

/* ── Hero streak row (side by side) ── */
.hero-streak-row {
  display: flex; align-items: stretch; justify-content: center; gap: 12px;
  width: 100%;
}
.hero-score-block {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 10px 20px; min-width: 120px; flex: 1;
}
.hero-score-num {
  font-size: 40px; font-weight: 900; line-height: 1;
  color: var(--text2); transition: color 0.4s, text-shadow 0.4s;
}
.hero-score-num.score-good {
  color: var(--green);
  text-shadow: 0 0 16px rgba(34,197,94,0.4);
}
.hero-score-num.score-perfect {
  color: #f59e0b;
  text-shadow: 0 0 22px rgba(245,158,11,0.55);
}
.hero-score-label {
  font-size: 12px; font-weight: 600; color: var(--text2);
}
.hero-streak-num.streak-zero {
  color: var(--accent2);
  text-shadow: 0 0 16px rgba(99,102,241,0.4);
  font-size: 32px;
}

/* ── Checklist separator ── */
.checklist-separator {
  display: flex; align-items: center; gap: 10px; margin: 6px 0 2px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text2);
}
.checklist-separator::before,
.checklist-separator::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Locked checklist — bigger touch target ── */
.checklist-item.ci-locked { min-height: 60px; }
.ci-invite-btn { min-height: 44px; padding: 8px 14px; }

/* ── Friend transform badge ── */
.friend-transform {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0; margin-left: 4px;
}
.friend-transform-pct {
  font-size: 16px; font-weight: 900; color: var(--accent); line-height: 1;
}
.friend-transform-label {
  font-size: 9px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.4px;
}

/* ── Friend no-data ── */
.friend-no-data { font-size: 18px; font-weight: 800; color: var(--text2); }
