/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg: #F0F4FF;
  --surface: #FFFFFF;
  --surface2: #F8F0FF;
  --primary: #8B7CF8;
  --primary-soft: #EDE9FE;
  --accent: #F472B6;
  --accent-soft: #FCE7F3;
  --green: #34D399;
  --green-soft: #D1FAE5;
  --orange: #FB923C;
  --orange-soft: #FED7AA;
  --text: #1E1B4B;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --shadow: 0 2px 12px rgba(139, 124, 248, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

body.dark {
  --bg: #12111F;
  --surface: #1E1C2E;
  --surface2: #252340;
  --text: #F0EEFF;
  --text-muted: #9CA3AF;
  --border: #2D2B42;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  position: fixed;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
}

/* ── App shell ──────────────────────────────────────────────────────────────── */
#app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 100vw;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  padding: 0 16px calc(env(safe-area-inset-bottom) + 16px);
  max-width: 100%;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 2px; opacity: 0.4; }

/* ── Welcome screen ─────────────────────────────────────────────────────────── */
#welcome-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px calc(40px + env(safe-area-inset-bottom));
  background: linear-gradient(145deg, #EDE9FE 0%, #FCE7F3 50%, #F0F4FF 100%);
  text-align: center;
  overflow-y: auto;
  overscroll-behavior: none;
}

body.dark #welcome-screen {
  background: linear-gradient(145deg, #1E1C2E 0%, #252340 50%, #12111F 100%);
}

.welcome-emoji {
  font-size: 72px;
  margin-bottom: 24px;
  animation: bounceIn 0.6s ease;
}

.welcome-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.welcome-sub {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 40px;
  line-height: 1.5;
}

.welcome-form {
  width: 100%;
  max-width: 320px;
}

.welcome-input {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 16px;
}

.welcome-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

/* ── Bottom nav ─────────────────────────────────────────────────────────────── */
.bottom-nav {
  flex-shrink: 0;
  width: 100%;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
  border: none;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.nav-tab.active {
  color: var(--primary);
}

.nav-tab-icon {
  font-size: 22px;
  line-height: 1;
}

.nav-tab-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ── Page header ────────────────────────────────────────────────────────────── */
.page-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
}

.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

/* ── Summary grid ───────────────────────────────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.summary-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-icon {
  font-size: 22px;
  margin-bottom: 4px;
}

.summary-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.summary-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Progress ring ──────────────────────────────────────────────────────────── */
.progress-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.progress-ring-wrap svg {
  transform: rotate(-90deg);
}

.progress-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.progress-ring-value {
  font-size: 20px;
  font-weight: 800;
}

.progress-ring-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

input[type="range"] {
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  accent-color: var(--primary);
  height: 6px;
  cursor: pointer;
}

input[type="range"]:focus {
  box-shadow: none;
  border: none;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-secondary:hover {
  opacity: 0.85;
}

.btn-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-danger {
  background: #FEE2E2;
  color: #DC2626;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-icon {
  padding: 8px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 18px;
}

/* ── Mood selector ──────────────────────────────────────────────────────────── */
.mood-selector {
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
}

.mood-emoji {
  font-size: 32px;
  cursor: pointer;
  transition: transform 0.2s;
  padding: 8px;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}

.mood-emoji:hover {
  transform: scale(1.15);
}

.mood-emoji.selected {
  transform: scale(1.35);
  filter: drop-shadow(0 4px 8px rgba(139, 124, 248, 0.35));
}

/* ── Tags ───────────────────────────────────────────────────────────────────── */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--surface2);
  font-size: 13px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
  font-weight: 500;
  user-select: none;
}

.tag.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.tag.tag-add {
  border: 2px dashed var(--border);
  color: var(--text-muted);
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  padding: 4px 12px;
  line-height: 1.4;
}

.tag.tag-add:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Habit grid ─────────────────────────────────────────────────────────────── */
.habit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.habit-row:last-child {
  border-bottom: none;
}

.habit-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
}

.habit-streak {
  font-size: 12px;
  color: var(--orange);
  font-weight: 700;
}

.habit-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.day-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  border: 2px solid transparent;
  -webkit-tap-highlight-color: transparent;
}

.day-dot:hover {
  transform: scale(1.1);
}

.day-dot.done {
  background: var(--green);
}

.day-dot.today {
  border-color: var(--primary);
}

/* ── Week day dots ──────────────────────────────────────────────────────────── */
.week-dots {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.week-dot-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.week-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}

.week-dot.active {
  background: var(--primary);
}

.week-dot-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ── Progress bar ───────────────────────────────────────────────────────────── */
.progress-bar-wrap {
  width: 100%;
  height: 10px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.6s ease;
  min-width: 4px;
}

/* ── Charts ─────────────────────────────────────────────────────────────────── */
.chart-wrap {
  position: relative;
  height: 200px;
  margin: 16px 0;
}

/* ── Toast ──────────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--text);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  max-width: calc(100% - 32px);
  text-align: center;
}

#toast.toast-show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-8px);
}

/* ── Section tabs ───────────────────────────────────────────────────────────── */
.section-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border-radius: 999px;
  margin-bottom: 16px;
}

.section-tab {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.section-tab.active {
  background: var(--primary);
  color: white;
}

/* ── Phase badge ────────────────────────────────────────────────────────────── */
.phase-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.phase-badge.menstrual { background: #FCA5A5; color: #7F1D1D; }
.phase-badge.follicular { background: #6EE7B7; color: #064E3B; }
.phase-badge.ovulation { background: #FDE68A; color: #78350F; }
.phase-badge.luteal { background: #C4B5FD; color: #3B0764; }
.phase-badge.unknown { background: var(--surface2); color: var(--text-muted); }

/* ── Stat highlight ─────────────────────────────────────────────────────────── */
.stat-highlight {
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 8px;
}

.stat-highlight .stat-label {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-highlight .stat-value {
  font-size: 20px;
  font-weight: 800;
}

/* ── Goal card ──────────────────────────────────────────────────────────────── */
.goal-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}

.goal-card.completed {
  opacity: 0.6;
}

.goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.goal-name {
  font-weight: 700;
  font-size: 15px;
}

.goal-category {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.goal-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.goal-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ── Personal best ──────────────────────────────────────────────────────────── */
.pb-badge {
  background: #FEF3C7;
  color: #D97706;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── Animations ─────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.page { animation: fadeIn 0.2s ease; }

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Utilities ──────────────────────────────────────────────────────────────── */
.hidden         { display: none !important; }
.text-muted     { color: var(--text-muted); }
.text-center    { text-align: center; }
.text-sm        { font-size: 13px; }
.text-xs        { font-size: 11px; }
.font-bold      { font-weight: 700; }
.mt-2           { margin-top: 8px; }
.mt-4           { margin-top: 16px; }
.mb-2           { margin-bottom: 8px; }
.mb-4           { margin-bottom: 16px; }
.p-4            { padding: 16px; }
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2          { gap: 8px; }
.gap-4          { gap: 16px; }
.w-full         { width: 100%; }
.flex-1         { flex: 1; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-emoji {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ── AI tip card ────────────────────────────────────────────────────────────── */
.ai-tip-card {
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.ai-tip-card::before {
  content: '✨';
  position: absolute;
  top: -8px;
  right: -4px;
  font-size: 48px;
  opacity: 0.15;
}

.ai-tip-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  margin-bottom: 6px;
}

.ai-tip-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

/* ── Alert card ─────────────────────────────────────────────────────────────── */
.alert-card {
  background: var(--orange-soft);
  border-left: 4px solid var(--orange);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 8px;
  line-height: 1.45;
}

/* ── Run log item ───────────────────────────────────────────────────────────── */
.run-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.run-item:last-child { border-bottom: none; }

.run-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.run-details { flex: 1; }
.run-primary { font-weight: 700; font-size: 15px; }
.run-secondary { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.run-actions { display: flex; gap: 6px; }

/* ── Weight log item ────────────────────────────────────────────────────────── */
.weight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.weight-item:last-child { border-bottom: none; }

/* ── Mood history item ──────────────────────────────────────────────────────── */
.mood-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.mood-item:last-child { border-bottom: none; }
.mood-score-emoji { font-size: 28px; }

/* ── Toggle switch (dark mode) ──────────────────────────────────────────────── */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  left: 3px;
  top: 3px;
  transition: transform 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Profile settings ───────────────────────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.settings-row:last-child { border-bottom: none; }

.settings-label { font-weight: 600; font-size: 15px; }
.settings-value { color: var(--text-muted); font-size: 14px; }

/* ── Insight tooltip button ─────────────────────────────────────────────────── */
.insight-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* ── Greeting ───────────────────────────────────────────────────────────────── */
.greeting {
  padding: 8px 16px 16px;
}

.greeting-name {
  font-size: 26px;
  font-weight: 800;
}

.greeting-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Divider ────────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── Pill input row (duration) ──────────────────────────────────────────────── */
.input-row {
  display: flex;
  gap: 10px;
}

.input-row .form-group {
  flex: 1;
}

/* ── Missing utility classes ────────────────────────────────────────────────── */
.habit-check { display: none; }
.habit-check:checked + .habit-check-box { background: var(--primary); border-color: var(--primary); }
.habit-check:checked + .habit-check-box::after { opacity: 1; }
.habit-check-box {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border);
  background: var(--surface); flex-shrink: 0; margin-right: 10px; position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.habit-check-box::after {
  content: '✓'; position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: white; font-size: 14px; font-weight: 700; opacity: 0;
  transition: opacity 0.1s;
}
.habit-check-label { display: flex; align-items: center; cursor: pointer; flex: 1; gap: 0; }

.list-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border); gap: 8px;
}
.list-item:last-child { border-bottom: none; }
.list-item-title { font-weight: 600; font-size: 14px; }
.list-item-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.quick-btn {
  padding: 14px 8px; border-radius: var(--radius-sm); border: 2px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: center; transition: all 0.15s;
}
.quick-btn:hover { border-color: var(--primary); background: var(--primary-soft); }

/* ── Encouragement banner ───────────────────────────────────────────────────── */
.encouragement {
  background: linear-gradient(90deg, var(--green-soft), var(--primary-soft));
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
  animation: fadeIn 0.3s ease;
}

/* ── Layout helpers ──────────────────────────────────────────────────────────── */
.pad { padding: 0 16px; }
.page-content { overflow-y: auto; }

/* ── Progress ring center text ───────────────────────────────────────────────── */
.progress-ring-wrap { position: relative; width: 120px; height: 120px; margin: 0 auto; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-value { font-size: 22px; font-weight: 800; color: var(--primary); }
.ring-sub { font-size: 11px; color: var(--text-muted); text-align: center; }

/* ── Habit today progress bar ────────────────────────────────────────────────── */
.habit-today-bar { height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.habit-today-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--primary)); border-radius: 5px; transition: width 0.5s ease; }

/* ── Stats row (runs page) ───────────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stat-card { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 8px; text-align: center; box-shadow: var(--shadow); }
.stat-val { font-size: 20px; font-weight: 800; color: var(--primary); }
.stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Sliders ─────────────────────────────────────────────────────────────────── */
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-val { font-size: 15px; font-weight: 700; color: var(--primary); min-width: 36px; text-align: right; }

/* ── BMI display ─────────────────────────────────────────────────────────────── */
.bmi-value { font-size: 48px; font-weight: 900; margin: 8px 0 4px; }
.bmi-label { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.bmi-normal { color: var(--green); }
.bmi-under { color: #60A5FA; }
.bmi-over { color: var(--orange); }
.bmi-obese { color: #F87171; }

/* ── Streak badge ────────────────────────────────────────────────────────────── */
.streak-badge { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Goal completed style ────────────────────────────────────────────────────── */
.completed-goal { opacity: 0.6; }
.completed-goal .goal-progress-fill { background: var(--green); }

/* ── Card label ──────────────────────────────────────────────────────────────── */
.card-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); }

/* ── Page header ─────────────────────────────────────────────────────────────── */
.page-header-sub { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.page-header-title { font-size: 22px; font-weight: 800; color: var(--text); }
.icon-btn { background: var(--surface2); border: none; border-radius: 50%; width: 38px; height: 38px; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.15s; }
.icon-btn:hover { transform: scale(1.1); }

/* ── AI tip card ─────────────────────────────────────────────────────────────── */
.ai-tip-header { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--primary); margin-bottom: 8px; }
.ai-tip-text { font-size: 14px; line-height: 1.5; color: var(--text); }
.ai-tip-card { background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft)); border: 1px solid rgba(139,124,248,0.2); }

/* ── Del button ──────────────────────────────────────────────────────────────── */
.del-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 4px; transition: color 0.15s, background 0.15s; flex-shrink: 0; }
.del-btn:hover { color: #DC2626; background: #FEE2E2; }
