/* ============================================================
   acco — Dark accountability fitness app
   ============================================================ */

:root, [data-theme="dark"] {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.2vw, 0.9375rem);
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.375rem, 1.1rem + 0.8vw, 1.75rem);
  --text-2xl: clamp(1.75rem, 1.3rem + 1.2vw, 2.25rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Colors — matching acco.fit live */
  --color-bg: #0B0B14;
  --color-surface: #12121E;
  --color-surface-2: #181827;
  --color-surface-3: #1F1F30;
  --color-surface-offset: #151522;
  --color-border: rgba(255,255,255,0.08);
  --color-border-strong: rgba(255,255,255,0.14);
  --color-divider: rgba(255,255,255,0.06);

  --color-text: #F2F2F7;
  --color-text-muted: #9898A8;
  --color-text-faint: #5F5F72;
  --color-text-inverse: #0B0B14;

  /* Acid lime accent (acco signature) */
  --color-primary: #C6F24E;
  --color-primary-hover: #B4E63B;
  --color-primary-dim: rgba(198, 242, 78, 0.12);
  --color-primary-glow: rgba(198, 242, 78, 0.35);

  /* Secondary link blue (from your screens) */
  --color-link: #8FB3FF;

  /* Semantic */
  --color-success: #7FE07F;
  --color-success-dim: rgba(127, 224, 127, 0.14);
  --color-warning: #FFB366;
  --color-warning-dim: rgba(255, 179, 102, 0.14);
  --color-danger: #FF6B7A;
  --color-danger-dim: rgba(255, 107, 122, 0.14);
  --color-info: #8FB3FF;

  /* Radius */
  --radius-xs: 0.375rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.75rem;
  --radius-full: 9999px;

  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-med: 240ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.5);
  --glow-primary: 0 0 24px rgba(198, 242, 78, 0.25);

  --font-body: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Clash Display', 'Satoshi', sans-serif;

  /* Phone dimensions */
  --phone-w: 390px;
  --phone-h: 844px;
}

/* =============== Base =============== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  line-height: 1.5;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  /* Ambient gradient for desktop frame view */
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(198, 242, 78, 0.06), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(143, 179, 255, 0.05), transparent 60%);
  overflow: hidden;
}

img, svg { display: block; max-width: 100%; }
button { cursor: pointer; background: none; border: none; color: inherit; font: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

::selection { background: var(--color-primary-glow); color: var(--color-text); }

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

/* =============== App Frame (mobile-only, portrait) =============== */
.device-frame {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  overflow: hidden;
}

.device-screen {
  position: relative;
  width: 100%;
  height: 100dvh;
  background: var(--color-bg);
  overflow: hidden;
}

/* =============== Desktop / Landscape Gates =============== */
.gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 32px 24px;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.gate-inner {
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.gate-logo { transform: scale(1.2); margin-bottom: 8px; }
.gate-title {
  font-family: var(--font-display, inherit);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: var(--color-text);
}
.gate-body {
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-dim, rgba(255,255,255,0.7));
  margin: 0;
}
.gate-body strong { color: var(--color-accent, #C6F24E); font-weight: 600; }
.gate-url {
  margin-top: 8px;
  padding: 14px 28px;
  border: 1px solid rgba(198, 242, 78, 0.4);
  border-radius: 999px;
  color: var(--color-accent, #C6F24E);
  font-family: var(--font-display, inherit);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.gate-footnote {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
}
.gate-footnote em { color: rgba(255,255,255,0.7); font-style: normal; font-weight: 500; }
.gate-rotate-icon {
  width: 64px;
  height: 64px;
  color: var(--color-accent, #C6F24E);
  margin-bottom: 4px;
}
.gate-rotate-icon svg {
  width: 100%; height: 100%;
  animation: rotateHint 2.4s ease-in-out infinite;
  transform-origin: center;
}
@keyframes rotateHint {
  0%, 35% { transform: rotate(0deg); }
  55%, 80% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

/* Show desktop gate on wide viewports (laptops/desktops) */
@media (min-width: 768px) and (min-height: 600px) {
  .device-frame { display: none; }
  #desktop-gate { display: flex; }
}

/* Show landscape “rotate” gate on short screens (rotated phones).
   This wins over the desktop gate because phones in landscape are short. */
@media (max-height: 500px) and (orientation: landscape) {
  .device-frame { display: none; }
  #desktop-gate { display: none; }
  #landscape-gate { display: flex; }
}

/* =============== App Shell =============== */
.app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
  transition: opacity var(--transition-med), transform var(--transition-med);
}

.screen.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 2;
}

.screen.exiting {
  transform: translateX(-20px);
  z-index: 1;
}

/* =============== Status Bar =============== */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5) var(--space-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.2px;
  flex-shrink: 0;
}

.status-bar .right {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.status-bar svg { width: 14px; height: 14px; }

/* =============== App Header =============== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5) var(--space-4);
  flex-shrink: 0;
  gap: var(--space-3);
}

.app-header .title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.app-header .subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: grid;
  place-items: center;
  color: var(--color-text);
  position: relative;
  flex-shrink: 0;
}

.icon-btn:hover { background: var(--color-surface-2); border-color: var(--color-border-strong); }
.icon-btn svg { width: 18px; height: 18px; }

.icon-btn .dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--color-surface);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}
.back-btn:hover { color: var(--color-text); background: var(--color-surface); }
.back-btn svg { width: 18px; height: 18px; }

/* =============== Screen body (scroll area) =============== */
.screen-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 var(--space-5) var(--space-8);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}

.screen-body::-webkit-scrollbar { width: 4px; }
.screen-body::-webkit-scrollbar-track { background: transparent; }
.screen-body::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

.screen-body.with-tabbar { padding-bottom: 96px; }
.screen-body.no-padding { padding: 0; }
.screen-body.centered { display: flex; flex-direction: column; justify-content: center; padding: var(--space-8) var(--space-6); }

/* =============== Tab Bar =============== */
.tabbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: rgba(11, 11, 20, 0.85);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--space-2) 18px;
  z-index: 100;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-2);
  color: var(--color-text-faint);
  font-size: 11px;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--color-primary); }
.tab:hover { color: var(--color-text); }
.tab.active:hover { color: var(--color-primary); }

.tab-fab {
  width: 54px;
  height: 54px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  margin-top: -20px;
  box-shadow: var(--glow-primary), 0 8px 20px rgba(0,0,0,0.4);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}
.tab-fab:hover { transform: translateY(-2px) scale(1.03); }
.tab-fab:active { transform: translateY(0) scale(0.98); }
.tab-fab svg { width: 24px; height: 24px; }

/* =============== Logo =============== */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.04em;
  color: var(--color-text);
  line-height: 1;
}
.logo-mark {
  width: 26px;
  height: 26px;
  border: 3px solid var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(198, 242, 78, 0.4);
}
.logo .wordmark { position: relative; top: 1px; }
.logo .wordmark em { font-style: normal; color: var(--color-primary); }

/* =============== Buttons =============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  min-height: 48px;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: var(--glow-primary);
}
.btn-primary:hover { background: var(--color-primary-hover); }

.btn-secondary {
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: var(--color-surface-3); border-color: var(--color-border-strong); }

.btn-ghost {
  background: transparent;
  color: var(--color-text);
}
.btn-ghost:hover { background: var(--color-surface); }

.btn-danger {
  background: var(--color-danger-dim);
  color: var(--color-danger);
  border: 1px solid transparent;
}
.btn-danger:hover { background: rgba(255, 107, 122, 0.2); }

.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }

/* =============== Cards =============== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.card-compact { padding: var(--space-4); }

.card.clickable { cursor: pointer; transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast); }
.card.clickable:hover { background: var(--color-surface-2); border-color: var(--color-border-strong); }
.card.clickable:active { transform: scale(0.99); }

/* =============== Inputs =============== */
.field { margin-bottom: var(--space-4); }
.field-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.input, .textarea, .select {
  width: 100%;
  padding: var(--space-4) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-surface-2);
}
.input::placeholder, .textarea::placeholder { color: var(--color-text-faint); }
.textarea { resize: none; min-height: 100px; font-family: inherit; }

.input-icon {
  position: relative;
}
.input-icon svg {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--color-text-faint);
  pointer-events: none;
}
.input-icon .input { padding-left: 46px; }

/* =============== Badges / Chips =============== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.badge svg { width: 12px; height: 12px; }

/* =============== Week progress pips =============== */
.week-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding: 10px 12px;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.week-progress-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}
.week-pips {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}
.week-pip {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  transition: background 200ms ease, box-shadow 200ms ease;
}
.week-pip.filled {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 6px rgba(198, 242, 78, 0.45);
}

/* =============== Icon tiles (framed icons) =============== */
/* Use on any square container wrapping a single icon. Provides consistent
   inner padding so icons never touch the frame edge. Size variants set the
   outer box; the inner SVG is sized as a ratio of that box (~50%). */
.icon-tile {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
}
.icon-tile > svg { width: 50%; height: 50%; }
.icon-tile-sm  { width: 32px; height: 32px; }
.icon-tile-md  { width: 40px; height: 40px; }
.icon-tile-lg  { width: 48px; height: 48px; }
.icon-tile-xl  { width: 56px; height: 56px; }
.icon-tile-2xl { width: 64px; height: 64px; }
.icon-tile-round { border-radius: var(--radius-full); }

/* Variants */
.icon-tile-primary {
  background: linear-gradient(135deg, var(--color-primary-dim), rgba(198,242,78,0.02));
  border: 1px solid rgba(198,242,78,0.3);
  color: var(--color-primary);
}
.icon-tile-primary-solid {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.icon-tile-primary-dim {
  background: var(--color-primary-dim);
  color: var(--color-primary);
}
.icon-tile-success-dim {
  background: var(--color-success-dim);
  color: var(--color-success);
}
.icon-tile-muted {
  background: var(--color-surface-3);
  color: var(--color-text-faint);
}

.badge-primary { background: var(--color-primary-dim); color: var(--color-primary); border-color: transparent; }
.badge-success { background: var(--color-success-dim); color: var(--color-success); border-color: transparent; }
.badge-warn { background: var(--color-warning-dim); color: var(--color-warning); border-color: transparent; }
.badge-danger { background: var(--color-danger-dim); color: var(--color-danger); border-color: transparent; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.chip:hover { color: var(--color-text); border-color: var(--color-border-strong); }
.chip.active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

/* =============== Avatar =============== */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #6B6B82 0%, #3A3A4E 100%);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text);
  flex-shrink: 0;
  letter-spacing: -0.02em;
  position: relative;
  overflow: hidden;
}
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }

.avatar-ring {
  box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-primary);
}

/* Deterministic palette for avatars */
.avatar[data-color="1"] { background: linear-gradient(135deg, #C6F24E, #7FA030); color: #0B0B14; }
.avatar[data-color="2"] { background: linear-gradient(135deg, #8FB3FF, #3A5FBF); }
.avatar[data-color="3"] { background: linear-gradient(135deg, #FF9EB5, #C14665); }
.avatar[data-color="4"] { background: linear-gradient(135deg, #FFB366, #C47A3A); }
.avatar[data-color="5"] { background: linear-gradient(135deg, #A88FFF, #5E47B5); }
.avatar[data-color="6"] { background: linear-gradient(135deg, #7FE0C4, #2E9C7A); color: #0B0B14; }
.avatar[data-color="7"] { background: linear-gradient(135deg, #FFE066, #BFA030); color: #0B0B14; }

.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid var(--color-bg); margin-left: -10px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* =============== Progress =============== */
.progress {
  width: 100%;
  height: 6px;
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-ring {
  transform: rotate(-90deg);
}
.progress-ring-track {
  fill: none;
  stroke: var(--color-surface-3);
}
.progress-ring-fill {
  fill: none;
  stroke: var(--color-primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 800ms cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 6px rgba(198, 242, 78, 0.4));
}

/* =============== Lists =============== */
.list { display: flex; flex-direction: column; gap: var(--space-3); }
.list-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { background: var(--color-surface); }
.list-row-main { flex: 1; min-width: 0; }
.list-row-title { font-weight: 600; color: var(--color-text); }
.list-row-sub { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
.list-row-meta { color: var(--color-text-faint); font-size: var(--text-xs); }

/* =============== Section =============== */
.section { margin-top: var(--space-6); }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.section-title h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.section-title a { font-size: var(--text-xs); color: var(--color-primary); font-weight: 600; text-decoration: none; }
.section-title a:hover { text-decoration: underline; }

/* =============== Goal Card =============== */
.goal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.goal-card:hover { border-color: var(--color-border-strong); transform: translateY(-1px); }
.goal-card:active { transform: translateY(0); }

.goal-card-featured {
  background: linear-gradient(135deg, rgba(198, 242, 78, 0.08) 0%, rgba(198, 242, 78, 0.02) 100%);
  border-color: rgba(198, 242, 78, 0.18);
}

.goal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.goal-card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.goal-card-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 4px;
}

.goal-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-4);
  gap: var(--space-3);
}

.goal-card-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.goal-card-stat .num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--color-text);
}
.goal-card-stat .num em { color: var(--color-primary); font-style: normal; }
.goal-card-stat .lbl {
  font-size: 11px;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* =============== Streak =============== */
.streak-display {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: linear-gradient(135deg, rgba(255, 179, 102, 0.1), rgba(255, 107, 122, 0.05));
  border: 1px solid rgba(255, 179, 102, 0.2);
  border-radius: var(--radius-lg);
}
.streak-flame {
  width: 48px; height: 48px;
  border-radius: var(--radius-full);
  background: rgba(255, 179, 102, 0.15);
  display: grid; place-items: center;
  color: var(--color-warning);
  flex-shrink: 0;
}
.streak-flame svg { width: 24px; height: 24px; }
.streak-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}
.streak-lbl { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* =============== Buddy Feed / Activity =============== */
.activity-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-divider);
}
.activity-item:last-child { border-bottom: none; }

.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: var(--text-sm); line-height: 1.4; }
.activity-text strong { font-weight: 600; color: var(--color-text); }
.activity-text .accent { color: var(--color-primary); }
.activity-time { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: 4px; }

.activity-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.activity-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.activity-action:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
  border-color: var(--color-border-strong);
}
.activity-action svg { width: 12px; height: 12px; }
.activity-action.liked { color: var(--color-danger); background: var(--color-danger-dim); border-color: transparent; }
.activity-action.cheered { color: var(--color-primary); background: var(--color-primary-dim); border-color: transparent; }

/* =============== Splash screen =============== */
.splash {
  position: absolute;
  inset: 0;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: splash-container 2400ms ease forwards;
  pointer-events: none;
}
.splash .splash-logo {
  font-size: 52px;
  gap: 10px;
  animation: splash-logo 2400ms ease forwards;
  transform-origin: center;
}
.splash .splash-logo .logo-mark {
  width: 44px;
  height: 44px;
  border-width: 4px;
  box-shadow: 0 0 28px rgba(198, 242, 78, 0.55);
}
.splash.splash-done {
  display: none;
}
@keyframes splash-container {
  0%   { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
@keyframes splash-logo {
  0%   { opacity: 0; transform: scale(0.92); }
  25%  { opacity: 1; transform: scale(1.02); }
  65%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.14); }
}

/* =============== Landing / Splash =============== */
.landing {
  flex: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--space-8) var(--space-6) var(--space-8);
  position: relative;
  overflow: hidden;
}

/* Rotating background photos */
.landing-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.landing-bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: landing-bg-fade 35s infinite ease-in-out;
  will-change: opacity, transform;
  transform: scale(1.05);
}
.landing-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11,11,20,0.55) 0%, rgba(11,11,20,0.78) 55%, rgba(11,11,20,0.96) 100%);
  z-index: 1;
}
/* Each slide visible ~9s of 35s cycle (26%). Crossfade ~1.5s (4%).
   Neighbors are offset 7s (20%) so fades overlap by ~6% for smooth handoff. */
@keyframes landing-bg-fade {
  0%, 26%, 100% { opacity: 0; transform: scale(1.08); }
  4%            { opacity: 1; transform: scale(1.06); }
  22%           { opacity: 1; transform: scale(1.00); }
}

.landing::before {
  content: '';
  position: absolute;
  top: -20%; left: -20%;
  width: 140%; height: 60%;
  background: radial-gradient(ellipse at center, rgba(198, 242, 78, 0.18), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
  animation: pulse-glow 4s ease-in-out infinite;
  z-index: 2;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.05); }
}

.landing-content { position: relative; z-index: 3; margin-top: auto; }
.landing-top { position: relative; z-index: 3; padding-top: var(--space-10); }

.landing h1 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-3);
}
.landing h1 em { font-style: normal; color: var(--color-primary); }
.landing p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  max-width: 30ch;
}
.landing-actions { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-4); }
.landing-footer { text-align: center; font-size: var(--text-xs); color: var(--color-text-faint); margin-top: var(--space-4); padding-bottom: var(--space-2); }

/* =============== Auth forms =============== */
.auth-form { padding: var(--space-4) var(--space-5) var(--space-6); }
.auth-form h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}
.auth-form .lead {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

.divider-or {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.divider-or::before, .divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-divider);
}

.social-btn {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--color-text);
  font-weight: 600;
  font-size: var(--text-sm);
  min-height: 48px;
  transition: all var(--transition-fast);
}
.social-btn:hover { background: var(--color-surface-2); border-color: var(--color-border-strong); }
.social-btn svg { width: 18px; height: 18px; }

/* =============== Dashboard specific =============== */
.hero-greeting {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--space-2);
}
.hero-sub { color: var(--color-text-muted); font-size: var(--text-sm); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-5);
}
.stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-num .accent { color: var(--color-primary); }
.stat-lbl {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =============== Check-in =============== */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
}
.mood-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}
.mood-btn svg {
  width: 24px;
  height: 24px;
}
.mood-btn .mood-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.mood-btn:hover { background: var(--color-surface-2); border-color: var(--color-border-strong); color: var(--color-text); transform: translateY(-2px); }
.mood-btn.selected {
  background: var(--color-primary-dim);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: scale(1.04);
}

.slider-wrap { padding: var(--space-4) 0; }
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(198, 242, 78, 0.2), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform var(--transition-fast);
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.1); }
.slider::-moz-range-thumb {
  width: 28px; height: 28px;
  background: var(--color-primary);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(198, 242, 78, 0.2), 0 2px 8px rgba(0,0,0,0.3);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-2);
}

/* =============== Segmented control =============== */
.segmented {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 2px;
}
.segmented button {
  padding: 10px var(--space-3);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  transition: all var(--transition-fast);
}
.segmented button:hover { color: var(--color-text); }
.segmented button.active {
  background: var(--color-surface-3);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

/* =============== Leaderboard =============== */
.leader-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  transition: all var(--transition-fast);
}
.leader-row:hover { border-color: var(--color-border-strong); background: var(--color-surface-2); }

.leader-rank {
  width: 32px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  letter-spacing: -0.02em;
}
.leader-rank.top1 { color: #FFD84A; }
.leader-rank.top2 { color: #D4D4E0; }
.leader-rank.top3 { color: #E8A16A; }

.leader-info { flex: 1; min-width: 0; }
.leader-name { font-weight: 600; font-size: var(--text-sm); }
.leader-meta { font-size: var(--text-xs); color: var(--color-text-muted); }
.leader-points {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-primary);
  font-size: var(--text-base);
  letter-spacing: -0.02em;
}

.leader-row.you {
  background: var(--color-primary-dim);
  border-color: var(--color-primary);
}
.leader-row.you .leader-points { color: var(--color-primary); }

/* =============== Notifications =============== */
.notif-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-divider);
  position: relative;
}
.notif-item.unread::before {
  content: '';
  position: absolute;
  left: -6px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-primary-glow);
}
.notif-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  display: grid; place-items: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.notif-icon.green { background: var(--color-primary-dim); color: var(--color-primary); }
.notif-icon.blue { background: rgba(143, 179, 255, 0.14); color: var(--color-info); }
.notif-icon.pink { background: rgba(255, 158, 181, 0.14); color: #FF9EB5; }
.notif-icon.orange { background: var(--color-warning-dim); color: var(--color-warning); }
.notif-icon svg { width: 18px; height: 18px; }
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: var(--text-sm); line-height: 1.4; }
.notif-text strong { font-weight: 600; }
.notif-time { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: 4px; }

/* =============== Toast =============== */
.toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-surface-3);
  color: var(--color-text);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med), transform var(--transition-med);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 320px;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 16px; height: 16px; color: var(--color-primary); }

/* Toast anchored inside phone on desktop frame */
@media (min-width: 481px) and (min-height: 901px) {
  .toast {
    position: absolute;
    bottom: 110px;
  }
}

/* =============== Sheet / Modal =============== */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
  z-index: 200;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--color-surface);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  border-top: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-5) var(--space-8);
  transform: translateY(100%);
  transition: transform var(--transition-med);
  z-index: 201;
  max-height: 85%;
  overflow-y: auto;
}
.sheet.open { transform: translateY(0); }
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--color-border-strong);
  border-radius: 2px;
  margin: 0 auto var(--space-4);
}
.sheet-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

/* =============== Empty state =============== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-10) var(--space-6);
  color: var(--color-text-muted);
}
.empty-state-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: grid; place-items: center;
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}
.empty-state-icon svg { width: 28px; height: 28px; }
.empty-state h3 { color: var(--color-text); font-family: var(--font-display); font-size: var(--text-lg); margin-bottom: var(--space-2); }
.empty-state p { max-width: 30ch; margin-bottom: var(--space-5); font-size: var(--text-sm); }

/* =============== Misc utilities =============== */
.row { display: flex; align-items: center; gap: var(--space-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.col { display: flex; flex-direction: column; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.flex-1 { flex: 1; min-width: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }
.text-accent { color: var(--color-primary); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-lg { font-size: var(--text-lg); font-family: var(--font-display); letter-spacing: -0.02em; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* =============== Intro animations =============== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-in > * { animation: fadeSlideUp 400ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.anim-in > *:nth-child(1) { animation-delay: 0ms; }
.anim-in > *:nth-child(2) { animation-delay: 60ms; }
.anim-in > *:nth-child(3) { animation-delay: 120ms; }
.anim-in > *:nth-child(4) { animation-delay: 180ms; }
.anim-in > *:nth-child(5) { animation-delay: 240ms; }
.anim-in > *:nth-child(6) { animation-delay: 300ms; }
.anim-in > *:nth-child(7) { animation-delay: 360ms; }
.anim-in > *:nth-child(8) { animation-delay: 420ms; }

/* =============== Celebration confetti =============== */
.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 500;
}
.confetti span {
  position: absolute;
  width: 8px; height: 14px;
  top: -20px;
  animation: fall 1.8s cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
}
@keyframes fall {
  to { transform: translateY(900px) rotate(720deg); opacity: 0; }
}

/* ================================================================
   INTEGRATIONS / CHALLENGES / GROUPS / SHARE PROFILE
   ================================================================ */

/* Source rows (health integrations) */
.source-row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.source-brand {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-surface-3);
  color: var(--color-text);
  flex-shrink: 0;
}
.source-brand svg { width: 22px; height: 22px; }
.source-brand[data-brand="apple"]    { background: #fff; color: #000; }
.source-brand[data-brand="strava"]   { background: rgba(252, 82, 0, 0.12); color: #fc5200; }
.source-brand[data-brand="whoop"]    { background: rgba(255, 255, 255, 0.08); color: #e7e7e7; }
.source-brand[data-brand="oura"]     { background: rgba(160, 200, 255, 0.15); color: #a0c8ff; }
.source-brand[data-brand="garmin"]   { background: rgba(0, 124, 195, 0.15); color: #4aa8e0; }
.source-brand[data-brand="mfp"]      { background: rgba(0, 93, 170, 0.18); color: #6bb0ff; }
.source-brand[data-brand="calendar"] { background: rgba(66, 133, 244, 0.15); color: #6fa1ff; }

/* Smaller chip version for inline use */
.source-chip {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-surface-3);
  color: var(--color-text);
  flex-shrink: 0;
}
.source-chip svg { width: 18px; height: 18px; }
.source-chip[data-brand="apple"]  { background: #fff; color: #000; }
.source-chip[data-brand="strava"] { background: rgba(252, 82, 0, 0.15); color: #fc5200; }

.detected-row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}
.detected-row:last-child { border-bottom: none; }

/* Auto-detected prompt card on dashboard */
.card-detected {
  background: linear-gradient(135deg, rgba(198, 242, 78, 0.08), rgba(198, 242, 78, 0.02));
  border-color: rgba(198, 242, 78, 0.2);
}

/* Challenges */
.card-challenge { padding: var(--space-5); }
.card-challenge-featured {
  background: linear-gradient(135deg, rgba(198, 242, 78, 0.10), rgba(198, 242, 78, 0.02));
  border-color: rgba(198, 242, 78, 0.25);
}
.challenge-progress { margin-top: var(--space-3); }
.challenge-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.challenge-progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #a4d93a);
  border-radius: var(--radius-full);
  transition: width 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Groups */
.card-group { padding: var(--space-4) var(--space-5); }
.group-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-3);
  color: var(--color-text);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  border: 1px solid var(--color-border);
}
.group-icon svg {
  width: 50%;
  height: 50%;
}
.group-icon-xl {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
}
.group-icon-xl svg {
  width: 44%;
  height: 44%;
}
.group-icon-primary {
  background: rgba(198, 242, 78, 0.14);
  color: var(--color-primary);
  border-color: rgba(198, 242, 78, 0.28);
}
.group-icon-warm {
  background: rgba(255, 154, 86, 0.14);
  color: #ff9a56;
  border-color: rgba(255, 154, 86, 0.28);
}
.group-icon-cool {
  background: rgba(122, 162, 247, 0.14);
  color: #7aa2f7;
  border-color: rgba(122, 162, 247, 0.28);
}

.inline-check {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--color-primary);
  vertical-align: -2px;
}
.inline-check svg {
  width: 14px;
  height: 14px;
}
.group-chip {
  flex-shrink: 0;
  width: 168px;
  min-height: 140px;
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}
.group-chip > .fw-600 {
  white-space: normal !important;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.group-chip:hover { background: var(--color-surface-2); border-color: var(--color-border-strong); }
.group-chip:active { transform: scale(0.99); }
.group-chip .group-icon { width: 40px; height: 40px; }

.group-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  align-items: center;
}
.group-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  white-space: nowrap;
}
.group-meta-ico {
  display: inline-flex;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.group-meta-ico svg {
  width: 13px;
  height: 13px;
}

/* Also constrain stray inline icons in buddy / activity badges */
.card-group > .row > span > svg { width: 18px; height: 18px; }

/* QR code container for share profile */
.qr-frame {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qr-frame svg { color: var(--color-text); }

/* ==================== PLANS ==================== */
.plan-card {
  position: relative;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: border-color var(--transition-fast);
}
.plan-card.plan-current {
  border-color: rgba(198, 242, 78, 0.35);
  background: linear-gradient(180deg, rgba(198,242,78,0.06), rgba(198,242,78,0.01));
}
.plan-card.plan-popular {
  border-color: rgba(198, 242, 78, 0.4);
}
.plan-ribbon {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.plan-price {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}
.plan-price .unit {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  margin-left: 4px;
  letter-spacing: 0;
}
.feature-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: var(--text-sm);
}
.feature-row .feature-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  margin-top: 1px;
}
.feature-row.ok .feature-ico { background: rgba(198, 242, 78, 0.16); color: var(--color-primary); }
.feature-row.no .feature-ico { background: var(--color-surface-3); color: var(--color-text-faint); }
.feature-row.ok .feature-ico svg { width: 11px; height: 11px; }
.feature-row.no .feature-ico svg { width: 10px; height: 10px; }
.feature-row.no { color: var(--color-text-muted); }

/* Trainee cards */
.trainee-card {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.crushing { background: var(--color-primary); box-shadow: 0 0 0 3px rgba(198,242,78,0.22); }
.status-dot.on-track { background: var(--color-primary); }
.status-dot.needs-nudge { background: #ff9a56; box-shadow: 0 0 0 3px rgba(255,154,86,0.22); }
.status-label.crushing { color: var(--color-primary); }
.status-label.on-track { color: var(--color-text-muted); }
.status-label.needs-nudge { color: #ff9a56; }

/* Coach-led group badge */
.coach-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 154, 86, 0.14);
  color: #ff9a56;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255, 154, 86, 0.24);
}
.coach-badge svg { width: 11px; height: 11px; }
