:root {
  --pink-lightest: #BF360C;
  --pink-light: #D84315;
  --pink-medium: #E64A19;
  --pink-dark: #FF5722;
  --pink-darkest: #FFF3E0;
  --bg: #FFF0F5;
  --card-bg: #ffffff;
  --text-primary: #2d1b2e;
  --text-secondary: #6b4c6e;
  --text-muted: #9e7fa0;
  --border: #f3d4e0;
  --shadow-sm: 0 1px 3px rgba(173, 20, 87, 0.06);
  --shadow-md: 0 4px 12px rgba(173, 20, 87, 0.08);
  --shadow-lg: 0 8px 24px rgba(173, 20, 87, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-display: 'DM Sans', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

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

html {
  scroll-behavior: smooth;
}

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

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

/* === APP LAYOUT === */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: linear-gradient(135deg, var(--pink-darkest), var(--pink-dark), var(--pink-medium));
  padding: 24px 20px 20px;
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: 10%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

.app-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.5px;
}

.app-subtitle {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 400;
  margin-top: 2px;
}

/* === TAB NAVIGATION === */
.tab-nav {
  display: flex;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 10;
}

.tab-btn {
  flex: 1;
  padding: 14px 16px;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.tab-btn.active {
  color: var(--pink-dark);
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--pink-dark);
  border-radius: 3px 3px 0 0;
}

.tab-btn:hover:not(.active) {
  color: var(--pink-medium);
}

/* === MAIN CONTENT === */
.main-content {
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  padding: 16px;
}

/* === STATS ROW === */
.stats-row,
.overall-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.overall-stats {
  grid-template-columns: repeat(2, 1fr);
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-card.accent {
  border-top: 3px solid var(--pink-medium);
}

.stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pink-darkest);
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === SECTION TITLE === */
.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* === FORM CARD === */
.form-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
  animation: fadeInUp 0.4s ease both;
}

.form-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--pink-lightest);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--pink-medium);
  box-shadow: 0 0 0 3px rgba(240, 98, 146, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 60px;
}

/* === EXERCISE AUTOCOMPLETE === */
.exercise-input-group {
  position: relative;
}

.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 20;
  max-height: 200px;
  overflow-y: auto;
}

.suggestion-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s ease;
}

.suggestion-item:hover {
  background: var(--pink-lightest);
}

/* === SETS === */
.sets-section {
  margin-bottom: 14px;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  animation: fadeInUp 0.2s ease both;
}

.set-number {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pink-light);
  color: var(--pink-darkest);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.set-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.set-input {
  width: 80px;
  text-align: center;
  padding: 8px 6px;
}

.set-separator {
  color: var(--text-muted);
  font-weight: 600;
}

.weight-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.remove-set-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.remove-set-btn:hover {
  background: #fde8ef;
  color: var(--pink-dark);
}

.add-set-btn {
  padding: 8px 16px;
  border: 1px dashed var(--pink-light);
  background: none;
  color: var(--pink-medium);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  margin-top: 4px;
}

.add-set-btn:hover {
  background: var(--pink-lightest);
  border-color: var(--pink-medium);
}

/* === FORM ACTIONS === */
.form-actions {
  margin-top: 16px;
}

.save-btn {
  width: 100%;
  padding: 14px;
  border: none;
  background: linear-gradient(135deg, var(--pink-dark), var(--pink-darkest));
  color: white;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.save-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(233, 30, 99, 0.4);
}

.save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.save-btn.saved {
  background: linear-gradient(135deg, #4caf50, #388e3c);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* === TIMER SECTION === */
.timer-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  animation: fadeInUp 0.5s ease both;
}

.timer-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.timer-preset-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--pink-lightest);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-preset-btn.active {
  background: var(--pink-dark);
  color: white;
  border-color: var(--pink-dark);
}

.timer-preset-btn:hover:not(.active) {
  border-color: var(--pink-medium);
  color: var(--pink-dark);
}

.start-timer-btn {
  width: 100%;
  padding: 12px;
  border: none;
  background: var(--pink-medium);
  color: white;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.start-timer-btn:hover {
  background: var(--pink-dark);
  transform: translateY(-1px);
}

/* === TODAY'S EXERCISES === */
.today-exercises {
  margin-top: 16px;
  animation: fadeInUp 0.5s ease both;
}

.logged-exercise-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--pink-medium);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.logged-exercise-card:nth-child(1) { animation: fadeInUp 0.3s ease both; animation-delay: 0s; }
.logged-exercise-card:nth-child(2) { animation: fadeInUp 0.3s ease both; animation-delay: 0.05s; }
.logged-exercise-card:nth-child(3) { animation: fadeInUp 0.3s ease both; animation-delay: 0.1s; }
.logged-exercise-card:nth-child(4) { animation: fadeInUp 0.3s ease both; animation-delay: 0.15s; }
.logged-exercise-card:nth-child(5) { animation: fadeInUp 0.3s ease both; animation-delay: 0.2s; }

.logged-exercise-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.logged-exercise-header strong {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.logged-sets-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--pink-lightest);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.logged-sets-detail {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.logged-set-pill {
  background: var(--pink-light);
  color: var(--pink-darkest);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

.logged-notes {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* === TIMER OVERLAY === */
.timer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 27, 46, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.timer-modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  width: 90%;
  max-width: 340px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: scaleIn 0.3s ease;
}

.timer-modal.timer-finished {
  border: 2px solid var(--pink-medium);
  animation: scaleIn 0.3s ease, pulse-border 1.5s ease infinite;
}

.timer-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--pink-lightest);
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.timer-close-btn:hover {
  background: var(--pink-light);
  color: var(--pink-darkest);
}

.timer-display {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 24px;
}

.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring-bg {
  stroke: var(--pink-lightest);
}

.timer-ring-progress {
  stroke: var(--pink-dark);
  transition: stroke-dashoffset 0.5s linear;
}

.timer-time {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-digits {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--pink-darkest);
  letter-spacing: -1px;
}

.timer-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.timer-done-icon {
  font-size: 2rem;
  animation: blossom 1s ease infinite alternate;
}

.timer-done-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pink-dark);
}

.timer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}

.timer-control-btn {
  padding: 10px 20px;
  border: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pause-btn {
  background: var(--pink-dark);
  color: white;
}

.pause-btn:hover {
  background: var(--pink-darkest);
}

.reset-btn {
  background: var(--pink-lightest);
  color: var(--pink-darkest);
  border: 1px solid var(--border);
}

.reset-btn:hover {
  background: var(--pink-light);
}

.timer-adjust {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.timer-adjust-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--pink-lightest);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-adjust-btn:hover {
  background: var(--pink-light);
  border-color: var(--pink-medium);
}

/* === HISTORY === */
.history-container {
  animation: fadeInUp 0.3s ease both;
}

.pr-showcase {
  margin-bottom: 20px;
}

.pr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.pr-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.pr-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--pink-medium);
}

.pr-card.selected {
  border-color: var(--pink-dark);
  background: var(--pink-lightest);
  box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.15);
}

.pr-card:nth-child(1) { animation: fadeInUp 0.3s ease both; animation-delay: 0s; }
.pr-card:nth-child(2) { animation: fadeInUp 0.3s ease both; animation-delay: 0.04s; }
.pr-card:nth-child(3) { animation: fadeInUp 0.3s ease both; animation-delay: 0.08s; }
.pr-card:nth-child(4) { animation: fadeInUp 0.3s ease both; animation-delay: 0.12s; }
.pr-card:nth-child(5) { animation: fadeInUp 0.3s ease both; animation-delay: 0.16s; }
.pr-card:nth-child(6) { animation: fadeInUp 0.3s ease both; animation-delay: 0.2s; }

.pr-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.pr-card-stats {
  display: flex;
  gap: 12px;
}

.pr-stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pink-darkest);
}

.pr-stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* === EXERCISE SELECTOR === */
.exercise-selector {
  margin-bottom: 20px;
}

.search-input {
  margin-bottom: 12px;
}

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

.exercise-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.exercise-chip.active {
  background: var(--pink-dark);
  color: white;
  border-color: var(--pink-dark);
}

.exercise-chip:hover:not(.active) {
  border-color: var(--pink-medium);
  color: var(--pink-dark);
}

.chip-count {
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.08);
  padding: 1px 6px;
  border-radius: 10px;
}

.exercise-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.25);
}

/* === HISTORY LIST === */
.history-list {
  animation: fadeInUp 0.3s ease both;
}

.history-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.history-card:nth-child(2) { animation: fadeInUp 0.3s ease both; animation-delay: 0s; }
.history-card:nth-child(3) { animation: fadeInUp 0.3s ease both; animation-delay: 0.04s; }
.history-card:nth-child(4) { animation: fadeInUp 0.3s ease both; animation-delay: 0.08s; }
.history-card:nth-child(5) { animation: fadeInUp 0.3s ease both; animation-delay: 0.12s; }
.history-card:nth-child(6) { animation: fadeInUp 0.3s ease both; animation-delay: 0.16s; }

.history-card.volume-record {
  border-color: var(--pink-medium);
  background: linear-gradient(135deg, var(--pink-lightest), var(--card-bg));
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.history-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pr-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--pink-darkest);
  background: var(--pink-light);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.volume-badge {
  background: linear-gradient(135deg, var(--pink-light), var(--pink-medium));
  color: white;
}

.history-sets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-set {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--pink-lightest);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.history-set.is-pr {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  border: 1px solid #ffcc80;
}

.history-set-num {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 40px;
}

.history-set-detail {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.history-card-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.session-volume {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.history-notes {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  animation: fadeInUp 0.4s ease both;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  animation: blossom 2s ease infinite alternate;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.5;
}

/* === LOADING SKELETON === */
.loading-skeleton {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skeleton-block {
  background: linear-gradient(90deg, var(--pink-lightest) 0%, var(--pink-light) 50%, var(--pink-lightest) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-md);
}

.skeleton-wide {
  height: 80px;
}

.skeleton-medium {
  height: 120px;
}

.skeleton-narrow {
  height: 50px;
  width: 70%;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes blossom {
  from { transform: scale(1) rotate(0deg); }
  to { transform: scale(1.1) rotate(5deg); }
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--pink-medium); }
  50% { border-color: var(--pink-light); }
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .app-header {
    padding: 20px 16px 16px;
  }

  .app-title {
    font-size: 1.5rem;
  }

  .main-content {
    padding: 12px;
  }

  .stats-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .overall-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-value {
    font-size: 1.1rem;
  }

  .pr-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .set-input {
    width: 65px;
  }

  .timer-display {
    width: 160px;
    height: 160px;
  }

  .timer-digits {
    font-size: 2rem;
  }
}

@media (max-width: 360px) {
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .stats-row .stat-card:last-child {
    grid-column: span 2;
  }
}


<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to FitBloom! This is your personal workout tracker with a Cherry Blossom theme. The Log Workout tab is your main workspace.", "view": "user", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "At the top you can see today's session summary — exercises logged, total sets, and total volume lifted.", "view": "user", "highlight_selector": ".today-summary", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "Use the Log Exercise form to record each exercise. Start typing to see suggestions from common exercises and your history.", "view": "user", "highlight_selector": ".form-card", "wait_for": "tap_to_continue"},
  {"step": 4, "narration": "Add multiple sets with reps and weight. Click '+ Add Set' to log more sets for the same exercise.", "view": "user", "highlight_selector": ".sets-section", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "Need a rest between sets? Pick a preset duration and tap Start Rest to launch the countdown timer.", "view": "user", "highlight_selector": ".timer-section", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "The rest timer appears as an overlay with a circular progress ring. You can pause, reset, or add extra time.", "view": "user", "highlight_selector": ".timer-modal", "wait_for": "tap_to_continue"},
  {"step": 7, "narration": "Switch to the History tab to see your overall stats, personal records for each exercise, and detailed workout history.", "view": "user", "highlight_selector": ".tab-nav", "wait_for": "user_interaction"},
  {"step": 8, "narration": "Personal records are highlighted with trophy badges (🏆 PR for weight records, 🔥 for volume records). Tap any exercise card to view its full history.", "view": "user", "highlight_selector": ".pr-showcase", "wait_for": "tap_to_continue"}
]
-->

.auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.auth-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
}

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

.auth-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.google-btn {
  background: #ffffff;
  color: #3c4043;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

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

.signout-btn {
  width: auto;
  padding: 10px 14px;
  background: var(--pink-lightest);
  color: var(--pink-darkest);
  border: 1px solid var(--border);
}

.signout-btn:hover {
  background: var(--pink-light);
}

.auth-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.auth-user strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.auth-user span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.auth-avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--pink-light);
  color: var(--pink-darkest);
  font-weight: 700;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .auth-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .signout-btn {
    width: 100%;
  }
}

.charts-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-card {
  margin-bottom: 0;
}

.chart-wrap {
  width: 100%;
  min-height: 260px;
  position: relative;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 260px !important;
  display: block;
}

.empty-chart-copy {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.export-btn {
  width: auto;
  padding: 10px 14px;
  background: var(--pink-dark);
  color: white;
  border: 1px solid var(--pink-dark);
}

.export-btn:hover:not(:disabled) {
  background: var(--pink-darkest);
}

.export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.coach-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.coach-card {
  margin-bottom: 0;
}

.coach-copy {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.coach-btn {
  margin-top: 4px;
}

.coach-error {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #b00020;
}

.coach-data-preview,
.coach-results {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--pink-lightest);
}

.coach-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.coach-preview-copy,
.coach-output {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}
