@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --primary: #1A237E;
  --primary-dark: #303F9F;
  --primary-light: #3F51B5;
  --secondary: #7986CB;
  --secondary-light: #C5CAE9;
  --accent: #F77F00;
  --accent-light: #FCBF49;
  --bg: #F8F9FA;
  --bg-card: #FFFFFF;
  --bg-dark: #1A1A2E;
  --text: #212529;
  --text-secondary: #6C757D;
  --text-light: #ADB5BD;
  --border: #E9ECEF;
  --border-light: #F1F3F5;
  --success: #2D6A4F;
  --success-light: #D8F3DC;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --cat-strength: #E63946;
  --cat-cardio: #F77F00;
  --cat-flexibility: #7209B7;
  --cat-core: #457B9D;
  --cat-recovery: #2D6A4F;
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Loading screen */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
}

.loading-screen p {
  color: var(--text-secondary);
  font-weight: 500;
}

.loading-pulse {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
  padding: 1.25rem 1.5rem;
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 960px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  font-size: 2rem;
  animation: flicker 2s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.8rem;
  opacity: 0.8;
  font-weight: 400;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  max-width: 960px;
  margin: 0 auto;
  position: sticky;
  top: 64px;
  z-index: 90;
}

.tab-btn {
  flex: 1;
  padding: 0.85rem 0.5rem;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--border-light);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.tab-icon {
  font-size: 1rem;
}

/* Main content */
.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* Progress Banner */
.progress-banner {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.5s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.progress-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.progress-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.2);
  stroke-width: 6;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--accent-light);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}

.progress-ring-text {
  fill: white;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  transform: rotate(90deg);
  transform-origin: 50px 50px;
}

.progress-count {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  display: block;
}

.progress-label {
  font-size: 0.8rem;
  opacity: 0.85;
}

.streak-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  backdrop-filter: blur(4px);
}

.streak-fire {
  font-size: 1.5rem;
}

.streak-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.streak-label {
  font-size: 0.7rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Day Grid */
.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  text-align: center;
  animation: cardIn 0.4s ease both;
  border-top: 3px solid var(--border);
}

.day-card.category-strength { border-top-color: var(--cat-strength); }
.day-card.category-cardio { border-top-color: var(--cat-cardio); }
.day-card.category-flexibility { border-top-color: var(--cat-flexibility); }
.day-card.category-core { border-top-color: var(--cat-core); }
.day-card.category-recovery { border-top-color: var(--cat-recovery); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.day-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.day-card.completed {
  background: var(--success-light);
  border-color: var(--success);
  border-top-color: var(--success);
}

.day-card.completed::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(45,106,79,0.08), transparent 70%);
  pointer-events: none;
}

.day-number {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.day-emoji {
  font-size: 1.6rem;
  margin: 0.2rem 0;
}

.day-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.day-check {
  margin-top: 0.25rem;
  font-size: 1.1rem;
  min-height: 1.5rem;
}

.check-empty {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  transition: all 0.2s;
}

.day-card:hover .check-empty {
  border-color: var(--primary);
}

.category-badge {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  color: white;
}

.category-badge.strength { background: var(--cat-strength); }
.category-badge.cardio { background: var(--cat-cardio); }
.category-badge.flexibility { background: var(--cat-flexibility); }
.category-badge.core { background: var(--cat-core); }
.category-badge.recovery { background: var(--cat-recovery); }

/* Leaderboard */
.leaderboard {
  animation: slideDown 0.4s ease;
}

.lb-header {
  margin-bottom: 1.25rem;
}

.lb-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
}

.lb-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Podium */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem 0 0;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  animation: podiumUp 0.6s ease both;
}

@keyframes podiumUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.podium-avatar-wrap {
  position: relative;
}

.podium-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--accent-light);
  box-shadow: var(--shadow-sm);
}

.podium-name {
  font-size: 0.8rem;
  font-weight: 600;
  max-width: 80px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-pct {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
}

.podium-bar {
  width: 80px;
  background: linear-gradient(180deg, var(--secondary-light), var(--secondary));
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.5rem;
  min-height: 60px;
}

.podium-medal {
  font-size: 1.5rem;
}

/* Leaderboard list */
.lb-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
  animation: cardIn 0.4s ease both;
}

.lb-row:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--secondary-light);
}

.lb-row.is-me {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(230,57,70,0.04), rgba(230,57,70,0.01));
  border-left: 4px solid var(--primary);
}

.lb-rank {
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.rank-medal {
  font-size: 1.3rem;
}

.rank-num {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.lb-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.lb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: #40C057;
  border: 2px solid white;
  border-radius: 50%;
}

.lb-info {
  flex: 1;
  min-width: 0;
}

.lb-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.you-badge {
  font-size: 0.65rem;
  background: var(--primary);
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: 100px;
  font-weight: 600;
}

.lb-bar-track {
  height: 6px;
  background: var(--border-light);
  border-radius: 100px;
  margin-top: 0.35rem;
  overflow: hidden;
}

.lb-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 100px;
  transition: width 0.6s ease;
  min-width: 4px;
}

.lb-pct {
  text-align: right;
  flex-shrink: 0;
}

.pct-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  display: block;
  color: var(--primary);
}

.pct-days {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Setup */
.setup {
  animation: slideDown 0.4s ease;
}

.setup-header {
  margin-bottom: 1.25rem;
}

.setup-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
}

.setup-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.setup-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.setup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  animation: cardIn 0.3s ease both;
  gap: 0.5rem;
}

.setup-row-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.setup-day {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-secondary);
  width: 48px;
  flex-shrink: 0;
}

.setup-emoji {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.setup-title {
  font-weight: 600;
  font-size: 0.85rem;
  flex: 1;
  min-width: 80px;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.btn-icon:hover {
  background: var(--border-light);
}

/* Edit Form */
.edit-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.edit-input {
  flex: 1;
  min-width: 120px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.edit-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230,57,70,0.12);
}

.edit-selectors {
  display: flex;
  gap: 0.4rem;
}

.edit-select {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: white;
  cursor: pointer;
  outline: none;
}

.edit-select:focus {
  border-color: var(--primary);
}

.edit-actions {
  display: flex;
  gap: 0.4rem;
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--border-light);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  animation: slideDown 0.4s ease;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
}

.empty-state h2, .empty-state h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.modal p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Skeletons */
.skeleton-banner {
  height: 120px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  animation: shimmer 1.5s infinite;
}

.skeleton-card {
  height: 140px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-md);
  animation: shimmer 1.5s infinite;
}

.skeleton-row {
  height: 56px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 640px) {
  .app-header {
    padding: 1rem;
  }

  .brand-title {
    font-size: 1.2rem;
  }

  .tab-btn {
    font-size: 0.75rem;
    padding: 0.7rem 0.25rem;
  }

  .tab-icon {
    display: block;
    font-size: 1.1rem;
  }

  .main-content {
    padding: 1rem 0.75rem;
  }

  .progress-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem;
  }

  .progress-stats {
    justify-content: center;
  }

  .streak-info {
    display: flex;
    justify-content: center;
  }

  .day-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.5rem;
  }

  .day-card {
    padding: 0.75rem 0.5rem;
  }

  .day-emoji {
    font-size: 1.3rem;
  }

  .day-title {
    font-size: 0.72rem;
  }

  .podium {
    gap: 0.25rem;
  }

  .podium-bar {
    width: 60px;
  }

  .podium-avatar {
    width: 44px;
    height: 44px;
  }

  .podium-name {
    font-size: 0.7rem;
    max-width: 65px;
  }

  .setup-row {
    flex-wrap: wrap;
  }

  .setup-row-left {
    flex-wrap: wrap;
  }

  .edit-form {
    flex-direction: column;
    align-items: stretch;
  }

  .edit-selectors {
    flex-wrap: wrap;
  }

  .edit-actions {
    justify-content: flex-end;
  }

  .lb-row {
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
  }

  .lb-name {
    font-size: 0.82rem;
  }
}

@media (max-width: 380px) {
  .day-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

input:focus-visible, select:focus-visible {
  outline: none;
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to the 30-Day Fitness Challenge! Your progress tracker is the first thing you see. Each card represents a daily challenge — tap any card to mark it complete.", "view": "user", "highlight_selector": ".day-grid", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "The progress banner at the top shows your overall completion percentage and current streak. Complete consecutive days to build your streak!", "view": "user", "highlight_selector": ".progress-banner", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "Tap a challenge card to toggle it complete. Green cards mean you've done that day's workout. Tap again to undo.", "view": "user", "highlight_selector": ".day-card", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Switch to the Leaderboard tab to see how everyone in your group is doing. The podium shows the top 3 challengers, and everyone's completion percentage is displayed.", "view": "user", "highlight_selector": ".tab-btn:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 5, "narration": "The green dots show who's online right now. Your row is highlighted so you can quickly find yourself on the board.", "view": "user", "highlight_selector": ".lb-row.is-me", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Head to the Challenges tab to customize the 30-day program. Load the defaults first, then tap the pencil icon to edit any day's challenge.", "view": "user", "highlight_selector": ".tab-btn:nth-child(3)", "wait_for": "user_interaction"},
  {"step": 7, "narration": "Share this app's access code with your group. Everyone who joins will appear on the leaderboard. Let the challenge begin! 🔥", "view": "user", "highlight_selector": ".brand", "wait_for": "tap_to_continue"}
]
-->

/* Auth gate */
.auth-gate {
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  text-align: left;
}

.auth-brand {
  margin-bottom: 1rem;
}

.auth-copy {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.auth-login-btn {
  width: 100%;
  margin-bottom: 0.75rem;
}

.auth-note {
  color: var(--text-light);
  font-size: 0.8rem;
  line-height: 1.4;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sign-out-btn {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .header-content {
    align-items: flex-start;
    flex-direction: column;
  }

  .sign-out-btn {
    align-self: flex-end;
  }
}

.today-presence-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.today-presence-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.today-presence-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.today-presence-header p {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.presence-count {
  background: var(--success-light);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 100px;
  white-space: nowrap;
}

.presence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.presence-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border-radius: 100px;
  background: var(--success-light);
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 600;
}

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #40C057;
  box-shadow: 0 0 0 4px rgba(64,192,87,0.16);
}

.presence-empty {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.skeleton-presence {
  height: 72px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  animation: shimmer 1.5s infinite;
}

@media (max-width: 640px) {
  .today-presence-header {
    flex-direction: column;
  }

  .presence-count {
    align-self: flex-start;
  }
}

.reaction-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.reaction-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.reaction-panel-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.reaction-panel-header p {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.reaction-panel-pill {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 100px;
  white-space: nowrap;
}

.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  border-radius: 100px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.reaction-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

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

.reaction-emoji {
  font-size: 1rem;
}

.reaction-count {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--primary);
}

.reaction-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.reaction-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 100px;
  background: var(--border-light);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.skeleton-reactions {
  height: 62px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  animation: shimmer 1.5s infinite;
}

@media (max-width: 640px) {
  .reaction-panel-header {
    flex-direction: column;
  }

  .reaction-panel-pill {
    align-self: flex-start;
  }
}

.fitness-level-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.fitness-level-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.fitness-level-header p {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.fitness-level-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.fitness-level-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 0.45rem 0.8rem;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: capitalize;
}

.fitness-level-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.fitness-level-preview {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.9rem;
  padding: 0.75rem;
  background: var(--border-light);
  border-radius: var(--radius-md);
}

.fitness-level-preview-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 640px) {
  .fitness-level-options {
    gap: 0.4rem;
  }
}

.certificate-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.certificate-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.certificate-panel-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.certificate-panel-header p {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.certificate-status {
  background: var(--success-light);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 100px;
  white-space: nowrap;
}

.certificate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.certificate-preview {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  background: linear-gradient(180deg, #fff, #fafafa);
}

.certificate-badge {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
}

.certificate-preview h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}

.certificate-preview h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.certificate-preview p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.certificate-preview strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
  margin: 0.4rem 0 0.6rem;
}

.certificate-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.certificate-meta span {
  background: var(--border-light);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.55rem;
  border-radius: 100px;
}

@media (max-width: 640px) {
  .certificate-panel-header {
    flex-direction: column;
  }

  .certificate-status {
    align-self: flex-start;
  }

  .certificate-actions {
    flex-direction: column;
  }

  .certificate-actions .btn-primary,
  .certificate-actions .btn-secondary {
    width: 100%;
  }
}
