* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #eeeef4;
  color: #2b2635;
  overflow-x: hidden;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #2196f3;
  color: #fff;
}

.app-title {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.app-logo {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
  background: #2196f3;
  object-fit: contain;
  box-sizing: border-box;
}

.pro-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 0.5rem;
  background: #2196f3;
  color: #fff;
  vertical-align: middle;
  line-height: 1.2;
}
.app-title .pro-badge {
  background: white;
  color: #2196f3;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: 0.25rem;
  padding: 0.25rem;
  font-size: 0.9rem;
  opacity: 0.95;
}

.connection-status .connection-status-icon {
  color: #fff;
  transition: color 0.2s ease;
}

.connection-status.offline .connection-status-icon {
  color: rgba(255, 255, 255, 0.5);
}

.app-menu {
  position: relative;
}

.icon-button {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Dashboard icon buttons: make them stand out on cards */
.dashboard-card .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.14);
  outline: 1px solid rgba(255, 255, 255, 0.18);
  outline-offset: -1px;
  transition: background 0.15s ease, outline-color 0.15s ease;
}

.dashboard-card .icon-button:hover {
  background: rgba(255, 255, 255, 0.22);
  outline-color: rgba(255, 255, 255, 0.28);
}

.dashboard-card .icon-button:active {
  background: rgba(255, 255, 255, 0.18);
}

.dropdown {
  position: absolute;
  right: 0;
  top: 120%;
  background: #fff;
  color: #2b2635;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  min-width: 180px;
  white-space: nowrap;
}

.dropdown li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.dropdown li .dropdown-icon {
  width: 1rem;
  text-align: center;
  color: #6b7280;
  flex-shrink: 0;
}

.dropdown li:hover {
  background: #fdf8f3;
}

.hidden {
  display: none !important;
}

#view-container {
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.dashboard-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  margin-bottom: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.date-nav .date-label {
  font-weight: 600;
}

.date-nav button {
  border-radius: 999px;
  background: #fdf8f3;
  padding: 0.25rem 0.6rem;
  border: none;
  cursor: pointer;
}

.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.plan-header-clickable {
  cursor: pointer;
  border-radius: 0.375rem;
  padding: 0.25rem;
}

.plan-header .plan-title {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.plan-header-icon {
  font-size: 0.9em;
  opacity: 0.4;
  flex-shrink: 0;
}

.plan-header .plan-meta {
  font-size: 0.8rem;
  color: #9a8fa5;
}

.clickable {
  cursor: pointer;
}

.clickable:hover {
  text-decoration: underline;
}

.progress-row {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.donut-wrapper {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1;
  max-width: 280px;
}

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

.donut-track {
  fill: none;
  stroke-width: 12;
}

.donut-track-days {
  stroke: rgba(255, 193, 7, 0.2);
}

.donut-track-weight {
  stroke: rgba(33, 150, 243, 0.2);
}

.donut-track-fat {
  stroke: rgba(248, 52, 54, 0.2);
}

.donut-fill {
  fill: none;
  stroke: #07c579;
  stroke-width: 12;
  stroke-linecap: round;
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.4s ease-out;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  pointer-events: none;
  color: #2b2635;
}

.donut-number {
  font-size: clamp(1.2rem, 5vw, 1.75rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.2rem;
}

.donut-label {
  font-size: clamp(0.85rem, 3.2vw, 1rem);
  color: #9a8fa5;
  line-height: 1;
  margin-top: -0.1rem;
}

/* Grey out donut center value when metric not updated today */
.donut-value-stale .donut-number,
.donut-value-stale .donut-label {
  color: #b0a8b8;
}

.donut-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: nowrap;
  width: 100%;
}

@media (min-width: 768px) {
  .donut-row {
    gap: 1rem;
  }
  
  .donut-medium {
    max-width: 35%;
  }
  
  .donut-large {
    max-width: 46%;
  }
  
  .donut-medium .donut-number {
    font-size: 1.5rem;
  }
  
  .donut-large .donut-number {
    font-size: 2rem;
  }
}

@media (min-width: 1024px) {
  .donut-row {
    gap: 1.5rem;
  }
  
  .donut-medium {
    max-width: 240px;
  }
  
  .donut-large {
    max-width: 320px;
  }
  
  .donut-medium .donut-number {
    font-size: 1.65rem;
  }
  
  .donut-large .donut-number {
    font-size: 2.25rem;
  }
}

.donut-medium {
  flex: 1 1 0;
  max-width: 175px;
}

.donut-large {
  flex: 1.45 1 0;
  max-width: 260px;
}

.donut-number-small {
  font-size: 1.1rem;
}

.donut-medium .donut-number {
  font-size: clamp(1.1rem, 4.5vw, 1.5rem);
}

.donut-large .donut-number {
  font-size: clamp(1.25rem, 5.5vw, 1.9rem);
}

.donut-fill-weight {
  stroke: #2196f3;
}

.donut-fill-days {
  stroke: #ffc107;
}

.donut-fill-fat {
  stroke: #f83436;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  font-size: 0.8rem;
}

.stats-grid .stat {
  padding: 0.4rem 0.6rem;
  border-radius: 0.6rem;
  background: #fdf8f3;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.stats-grid .stat .label {
  color: #9a8fa5;
  font-size: 0.7rem;
  line-height: 1.2;
  flex: 0 1 auto;
  min-width: 0;
  word-wrap: break-word;
}

.stats-grid .stat .value {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  flex: 0 0 auto;
  text-align: right;
}

.stats-grid .clickable {
  cursor: pointer;
}

.motivation-card {
  font-size: 0.9rem;
  line-height: 1.4;
  background: #4caf50;
  color: #fff;
}

.motivation-card .chip,
.motivation-card .section-title {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.meditation-today-card {
  font-size: 0.9rem;
  line-height: 1.4;
}

.meditation-today-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.meditation-today-title {
  margin-bottom: 0;
}

.meditation-today-play-btn {
  flex-shrink: 0;
  min-height: 0;
  height: auto;
  padding: 0.25rem 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  line-height: 1.25;
}

.meditation-today-card #meditation-play-icon,
.meditation-today-card #meditation-pause-icon {
  font-size: 1rem;
  line-height: 1;
}

.meditation-today-description {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #6b7280;
  width: 100%;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  background: #e8e6ea;
  color: #9a8fa5;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

/* Section titles: Motivation Quote, Water today, Sleep today, Meditation Today, Today's totals */
.weight-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

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

/* Same look as weight popup today/yesterday toggle */
.weight-chart-toggle {
  display: inline-flex;
  flex-shrink: 0;
  background: #e5e7eb;
  border-radius: 1rem;
  padding: 0.125rem;
  gap: 0;
}

.weight-chart-toggle-btn {
  padding: 0.2rem 0.5rem;
  min-width: 2rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.weight-chart-toggle-btn:hover {
  color: #374151;
}

.weight-chart-toggle-btn.active {
  background: #5fbccc;
  color: #fff;
  box-shadow: 0 1px 2px rgba(95, 188, 204, 0.3);
}

.weight-chart-container {
  position: relative;
  min-height: 180px;
  width: 100%;
  height: 200px;
}

/* Camera section */
.camera-card {
  background: #fff;
  position: relative;
}

.camera-container {
  position: relative;
  width: 100%;
}

/* Camera section loading – keep image and buttons visible, spinner + text underneath */
.camera-analysis-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 0;
  color: #9a8fa5;
  text-align: center;
}

.camera-analysis-loading .loading-spinner-large {
  flex-shrink: 0;
}

.camera-section-loading .camera-analysis-loading {
  display: flex !important;
}

.camera-section-loading .camera-analysis-description,
.camera-section-loading .camera-analysis-grid,
.camera-section-loading .camera-analysis-error {
  display: none !important;
}

.camera-section-loading #btn-retake-photo,
.camera-section-loading #btn-analyze-photo,
.camera-section-loading #btn-start-camera,
.camera-section-loading #btn-stop-camera {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

.camera-video-wrap {
  position: relative;
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #000;
}

#camera-video {
  width: 100%;
  max-width: 100%;
  display: block;
}

.camera-tap-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  pointer-events: auto;
  border-radius: 0.75rem;
}

.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: #f5f5f5;
  border-radius: 0.75rem;
  border: 2px dashed #d0d5e3;
  min-height: 200px;
  text-align: center;
}

.camera-placeholder-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.camera-placeholder p {
  margin: 0;
  color: #9a8fa5;
  font-size: 0.9rem;
}

.camera-preview {
  position: relative;
  width: 100%;
  margin-bottom: 0.75rem;
}

.camera-preview img {
  width: 100%;
  max-width: 100%;
  border-radius: 0.75rem;
  display: block;
}

.btn-camera-start,
.btn-camera-stop {
  width: 100%;
  margin-top: 0.75rem;
}

.btn-camera-action {
  width: 100%;
  margin-top: 0.5rem;
}

/* Camera analysis results – same colors as Today's totals */
.camera-analysis-results {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.camera-analysis-results .camera-analysis-title {
  margin-bottom: 0.4rem;
}

.camera-analysis-results .camera-analysis-description {
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.camera-analysis-results .summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.camera-analysis-results .summary-item {
  border-radius: 0.7rem;
  padding: 0.35rem 0.45rem;
  text-align: center;
  font-size: 0.75rem;
}

.camera-analysis-results .summary-item.kcal {
  background: #ff9800;
  color: white;
}

.camera-analysis-results .summary-item.carbs {
  background: #ffc107;
  color: white;
}

.camera-analysis-results .summary-item.protein {
  background: #4caf50;
  color: white;
}

.camera-analysis-results .summary-item.fat {
  background: #2196f3;
  color: white;
}

.camera-analysis-results .summary-item .label {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.15rem;
}

.camera-analysis-results .summary-item .value {
  font-weight: 600;
}

.camera-analysis-results .camera-analysis-error {
  font-size: 0.85rem;
  color: #b91c1c;
  margin-top: 0.5rem;
}

.section-title {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  background: #e8e6ea;
  color: #2b2635;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* First row: title left, icons right; then .section-content below */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.section-header-row .section-title {
  margin-bottom: 0;
}

.section-content {
  margin-top: 0.5rem;
}

/* Water today card: blue background, white text */
.water-today-card {
  background: #2196f3;
  color: #fff;
}

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

.water-header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.water-subtitle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.water-subtitle-row .water-today-subtitle {
  flex-shrink: 0;
}

.water-subtitle-row .water-glasses {
  flex-shrink: 0;
}

.water-today-card .water-chart-btn {
  color: rgba(255, 255, 255, 0.9);
  padding: 0.25rem;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.water-today-card .water-chart-btn:hover {
  color: #fff;
}

.water-chart-container {
  position: relative;
  min-height: 160px;
  width: 100%;
  height: 180px;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.water-chart-canvas-wrap {
  position: absolute;
  inset: 0.75rem 0.75rem 0.25rem;
  border-radius: 0.25rem;
}

.water-chart-container .water-chart-prev,
.water-chart-container .water-chart-next {
  position: absolute;
  bottom: 0.75rem;
  z-index: 1;
  color: #374151;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.water-chart-container .water-chart-prev {
  left: 0.75rem;
}

.water-chart-container .water-chart-next {
  right: 0.75rem;
}

.water-chart-container .water-chart-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.water-chart-container.hidden {
  display: none;
}

.water-today-card .section-title {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.water-today-card .water-today-subtitle {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.95);
}

.water-glasses {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.2rem;
}

.water-glasses .glass {
  width: 18px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 0.3rem;
  background: #e5f3ff;
  border: 1px solid #c4ddff;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.water-today-card .water-glasses .glass {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.8);
}

.water-glasses .glass.filled::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  background: #5fbccc;
}

.water-today-card .water-glasses .glass.filled::after {
  background: #1565c0;
}

.water-today-card .water-expected {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 0.5rem;
}

.water-today-card .water-congrats {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.98);
  margin-top: 0.5rem;
}

.water-today-card .water-congrats-icon {
  color: #ffd700;
}

.sleep-header {
  align-items: flex-start;
}

.sleep-content {
  margin-top: 0.75rem;
}

.sleep-header-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.sleep-today-card .sleep-chart-btn,
.sleep-today-card .sleep-target-edit-btn {
  color: rgba(255, 255, 255, 0.9);
  padding: 0.25rem;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sleep-today-card .sleep-chart-btn:hover,
.sleep-today-card .sleep-target-edit-btn:hover {
  color: #fff;
}

.sleep-chart-container {
  position: relative;
  min-height: 160px;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.sleep-chart-canvas-wrap {
  position: absolute;
  inset: 0.75rem 0.75rem 0.25rem;
}

.sleep-chart-container .sleep-chart-prev,
.sleep-chart-container .sleep-chart-next {
  position: absolute;
  bottom: 0.75rem;
  z-index: 1;
  color: #374151;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sleep-chart-container .sleep-chart-prev {
  left: 0.75rem;
}

.sleep-chart-container .sleep-chart-next {
  right: 0.75rem;
}

.sleep-chart-container .sleep-chart-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sleep-chart-container.hidden {
  display: none;
}

.sleep-debt {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.95);
}

.sleep-debt.sleep-debt-positive {
  color: #fff;
}

/* Sleep today card: yellow background, white text */
.sleep-today-card {
  background: #ffc107;
  color: #fff;
}

.sleep-today-card .section-title {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.sleep-today-card .sleep-today-subtitle {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.95);
  margin: 0.25rem 0;
}

.sleep-options {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  justify-content: space-between;
  width: 100%;
}

.sleep-chip {
  border: 1px solid #d0d5e3;
  background: #fdf8f3;
  color: #2b2635;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sleep-today-card .sleep-chip {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.sleep-chip.selected {
  border-color: #5fbccc;
  background: rgba(95, 188, 204, 0.18);
  box-shadow: 0 0 0 1px rgba(95, 188, 204, 0.25);
}

.sleep-today-card .sleep-chip.selected {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.45);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* Workouts today */
.workouts-today-card {
  background: #8e24aa;
  color: #fff;
}

.workouts-today-card .section-title {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.workouts-today-card .workouts-today-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.workouts-today-card #btn-add-workout {
  color: rgba(255, 255, 255, 0.9);
  padding: 0.25rem;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.workouts-today-card #btn-add-workout:hover {
  color: #fff;
}

.workouts-today-card .workouts-today-content {
  margin-top: 0.25rem;
}

.workouts-header-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.workouts-today-card .workout-chart-btn {
  color: rgba(255, 255, 255, 0.9);
  padding: 0.25rem;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.workouts-today-card .workout-chart-btn:hover {
  color: #fff;
}

.workout-chart-container {
  position: relative;
  min-height: 160px;
  width: 100%;
  height: 180px;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.workout-chart-canvas-wrap {
  position: absolute;
  inset: 0.75rem 0.75rem 0.25rem;
  border-radius: 0.25rem;
}

.workout-chart-container .workout-chart-prev,
.workout-chart-container .workout-chart-next {
  position: absolute;
  bottom: 0.75rem;
  z-index: 1;
  color: #374151;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.workout-chart-container .workout-chart-prev {
  left: 0.75rem;
}

.workout-chart-container .workout-chart-next {
  right: 0.75rem;
}

.workout-chart-container .workout-chart-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.workout-chart-container.hidden {
  display: none;
}

/* Wellbeing today card – match Motivation colors */
.wellbeing-today-card {
  background: #4caf50;
  color: #fff;
}

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

.wellbeing-header-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.wellbeing-today-card .section-title {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.wellbeing-today-card .wellbeing-chart-btn {
  color: rgba(255, 255, 255, 0.9);
  padding: 0.25rem;
  font-size: 0.9rem;
}

.wellbeing-today-card .wellbeing-chart-btn:hover {
  color: #fff;
}

.wellbeing-note.wellbeing-not-captured {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 0.5rem;
}

.wellbeing-chips-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: stretch;
  justify-content: space-between;
}

.wellbeing-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.7rem;
  flex: 1 1 0;
  text-align: center;
  cursor: pointer;
  min-width: 2.5rem;
}

.wellbeing-chip:hover {
  background: rgba(255, 255, 255, 0.35);
}

.wellbeing-chip.selected {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.wellbeing-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.wellbeing-comparison {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.95);
}

.wellbeing-comparison.hidden {
  display: none;
}

.wellbeing-chart-container {
  position: relative;
  min-height: 160px;
  width: 100%;
  height: 180px;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.wellbeing-chart-canvas-wrap {
  position: absolute;
  inset: 0.75rem 0.75rem 0.25rem;
  border-radius: 0.25rem;
}

.wellbeing-chart-container .wellbeing-chart-prev,
.wellbeing-chart-container .wellbeing-chart-next {
  position: absolute;
  bottom: 0.75rem;
  z-index: 1;
  color: #374151;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wellbeing-chart-container .wellbeing-chart-prev {
  left: 0.75rem;
}

.wellbeing-chart-container .wellbeing-chart-next {
  right: 0.75rem;
}

.wellbeing-chart-container .wellbeing-chart-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wellbeing-chart-container.hidden {
  display: none;
}

.workouts-empty {
  padding: 0.5rem 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.9rem;
}

.workouts-empty-title {
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.35rem;
}

.workouts-empty-description {
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}

.workouts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.workout-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  font-size: 0.85rem;
  gap: 0.5rem;
  width: 100%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.workout-item:hover {
  background: rgba(255, 255, 255, 0.28);
}

.workout-item-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.workout-item-type {
  color: #fff;
}

.workout-item-meta {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  white-space: nowrap;
}

.workout-delete-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.workout-delete-btn:hover {
  color: #fff;
}

/* Consumed card */
.consumed-card {
  /* Match Water today card palette (blue + white text) */
  background: #2196f3;
  color: #fff;
}

.consumed-card .section-title {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* Consumed list */
.consumed-card .consumed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.consumed-card .consumed-summary,
.consumed-card .consumed-empty {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.95);
}

.consumed-card .consumed-summary strong {
  font-weight: 600;
  color: #fff;
}

.consumed-card .consumed-total-pct,
.consumed-card .consumed-total-kcal {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.3;
}

.consumed-card .consumed-total-pct {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.consumed-card .consumed-total-pct.pct-low {
  background: rgba(33, 150, 243, 0.7); /* #2196f3 */
  color: #fff;
}

.consumed-card .consumed-total-pct.pct-good {
  background: rgba(76, 175, 80, 0.7); /* #4caf50 */
  color: #fff;
}

.consumed-card .consumed-total-pct.pct-high {
  background: rgba(248, 52, 54, 0.7); /* #f83436 */
  color: #fff;
}

.consumed-card .consumed-progress-wrap {
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
/* Consumed progress bar uses percent colors */
.consumed-card .consumed-progress-bar {
  height: 6px;
  background: #eeeef4; /* light track, matches plan-summary */
  border-radius: 999px;
  overflow: hidden;
}

.consumed-card .consumed-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  /* color: rgba(255, 255, 255, 0.85); */
  color: white;
}

.consumed-card .consumed-progress-kcal,
.consumed-card .consumed-progress-pct {
  font-weight: 400;
  color: white;
}

.consumed-card .consumed-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.consumed-card .consumed-progress-fill.pct-low {
  background: #ffc107;
}

.consumed-card .consumed-progress-fill.pct-good {
  background: #4caf50;
}

.consumed-card .consumed-progress-fill.pct-high {
  background: #ff9800;
}

.consumed-card .consumed-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  /* background: rgba(255, 255, 255, 0.25); */
  background:white;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  gap: 0.5rem;
  width: 100%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.consumed-card .consumed-item:hover {
  background: rgba(255, 255, 255, 0.35);
}

.consumed-card .consumed-item-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.consumed-card .consumed-item-label {
  /* color: #fff; */
  color: black;
}

.consumed-card .consumed-item-meta {
  /* color: rgba(255, 255, 255, 0.9); */
  color: black;
  font-size: 0.85rem;
  white-space: nowrap;
}

.consumed-card .consumed-expected,
.consumed-card .consumed-exceeded {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.consumed-card .consumed-expected {
  color: rgba(255, 255, 255, 0.95);
}

.consumed-card .consumed-exceeded {
  color: rgba(255, 255, 255, 0.95);
}

.consumed-card .consumed-exceeded i {
  color: rgba(255, 255, 255, 0.95);
}

.consumed-card .consumed-delete-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  /* color: rgba(255, 255, 255, 0.85); */
  color: black;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.consumed-card .consumed-delete-btn:hover {
  /* color: #fff; */
  color: black;
}

.consumed-card .btn-add-consumed-manual.icon-button {
  background: rgba(255, 255, 255, 0.25);
  outline-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 0.9rem;
}

.consumed-card .btn-add-consumed-manual.icon-button:hover {
  background: rgba(255, 255, 255, 0.35);
  outline-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.workouts-today-card .btn-primary {
  background: #fff !important;
  color: #8e24aa !important;
  font-weight: 500;
}

.workouts-today-card .btn-primary:hover {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #7b1fa2 !important;
}

.workout-calories-row .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.workout-calories-row .btn-icon:hover {
  opacity: 0.8;
}

.workouts-today-card .workouts-weekly-congrats {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.98);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.workouts-today-card .workouts-weekly-congrats-icon {
  color: #ffd700;
}

.workout-calories-row #workout-calories-edit {
  display: none;
}

.workout-calories-row #workout-calories-edit[style*="display:flex"],
.workout-calories-row #workout-calories-edit.show {
  display: flex !important;
}

.workout-calories-row #workout-calories-override {
  display: none;
}

.workout-calories-row #workout-calories-override[style*="display:flex"],
.workout-calories-row #workout-calories-override.show {
  display: flex !important;
}

.meal-prefs-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

/* Refresh menu icon button sits on white card, give it a visible bg */
.meal-prefs-row #btn-change-day-menu.icon-button {
  background: #fdf8f3;
  outline-color: rgba(15, 23, 42, 0.08);
  color: #374151;
  font-size: 0.9rem;
}

.meal-prefs-row #btn-week-shopping-list.icon-button {
  background: #fdf8f3;
  outline-color: rgba(15, 23, 42, 0.08);
  color: #374151;
  font-size: 0.9rem;
}

.meal-prefs-row #btn-change-day-menu.icon-button:hover {
  background: #f7efe6;
  outline-color: rgba(15, 23, 42, 0.12);
}

.meal-prefs-row #btn-week-shopping-list.icon-button:hover {
  background: #f7efe6;
  outline-color: rgba(15, 23, 42, 0.12);
}

.shopping-week-modal {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shopping-week-header-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.shopping-week-text-col {
  flex: 1 1 auto;
  min-width: 0;
}

.shopping-week-days-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.1rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.shopping-week-days-btn {
  appearance: none;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 0.35rem;
  border: 1px solid #2196f3;
  background: #2196f3;
  color: white;
  cursor: pointer;
  /* transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s; */
}

.shopping-week-days-btn:hover {
  background: #eff6ff;
  border-color: #1d4ed8;
  color: #1d4ed8;
}

.shopping-week-days-btn.active {
  background: white;
  border-color: #2196f3;
  color: #2196f3;
  /* box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25); */
}

.shopping-week-days-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.shopping-week-subtitle {
  margin: 0;
  color: #4b5563;
  font-size: 0.95rem;
}

.shopping-week-dates {
  display: block;
  margin-top: 0.25rem;
  color: #9ca3af;
  font-size: 0.85rem;
}

.shopping-week-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #374151;
}

.shopping-week-error {
  color: #b91c1c;
  font-size: 0.95rem;
}

.shopping-week-range {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.shopping-week-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 52vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.shopping-week-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.65rem;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.shopping-week-item-name {
  font-weight: 600;
  color: #111827;
  font-size: 0.92rem;
  line-height: 1.2;
}

.shopping-week-item-amounts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  color: #374151;
  align-items: flex-start;
}

.shopping-week-amount {
  display: inline-flex;
  align-items: center;
  height: 1.5rem;
  line-height: 1;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0 0.45rem;
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.meals-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.meal-card {
  border-radius: 0.75rem;
  background: #f7f7f7;
  padding: 0;
  border: none;
  display: flex;
  flex-direction: row;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.meal-card.current {
  box-shadow: 0 2px 12px rgba(95, 188, 204, 0.25);
  border-top: 2px solid;
  border-right: 2px solid;
  border-bottom: 2px solid;
  border-radius: 1rem;
}

.meal-card.current.meal-color-breakfast {
  border-color: #4caf50;
}

.meal-card.current.meal-color-snack1 {
  border-color: #ffc107;
}

.meal-card.current.meal-color-lunch {
  border-color: #ff9800;
}

.meal-card.current.meal-color-snack2 {
  border-color: #9c27b0;
}

.meal-card.current.meal-color-dinner {
  border-color: #2196f3;
}

.meal-card.current.meal-color-default {
  border-color: #9e9e9e;
}

.meal-card .meal-accent-bar {
  width: 25px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem 0 0 0.75rem;
  position: relative;
}

.meal-card .meal-type-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: lowercase;
  padding: 1rem 0;
}

.meal-card .meal-content {
  flex: 1;
  padding: 1rem 1rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
}

.meal-card .meal-content.meal-content-loading {
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  color: #9a8fa5;
}

.meal-card .meal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.4rem;
  gap: 1rem;
}

.meal-card .meal-header .meal-name {
  font-weight: 700;
  font-size: 1rem;
  color: #000;
  line-height: 1.3;
  flex: 1;
}

.meal-card .meal-header .meal-kcal {
  font-size: 1rem;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
}

.meal-card .meal-macros {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: #000;
  font-weight: 400;
}

.meal-card .meal-ingredients {
  font-size: 0.75rem;
  color: #000;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  flex: 1;
}

.meal-card .meal-actions {
  text-align: right;
  margin-top: auto;
}

.meal-card .meal-actions button {
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  background: #e8e8e8;
  color: #333;
  border: none;
  font-weight: 500;
}

.meal-card .meal-actions button:hover {
  background: #d8d8d8;
}

/* Meal type colors */
.meal-card.meal-color-breakfast .meal-accent-bar {
  background: #4caf50;
}

.meal-card.meal-color-snack1 .meal-accent-bar {
  background: #ffc107;
}

.meal-card.meal-color-lunch .meal-accent-bar {
  background: #ff9800;
}

.meal-card.meal-color-snack2 .meal-accent-bar {
  background: #9c27b0;
}

.meal-card.meal-color-dinner .meal-accent-bar {
  background: #2196f3;
}

.meal-card.meal-color-default .meal-accent-bar {
  background: #9e9e9e;
}

/* Blurred meal for test mode */
.meal-card.meal-blurred {
  opacity: 0.5;
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

.meal-card.meal-blurred .meal-content {
  position: relative;
}

.meal-card.meal-blurred .meal-content::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.total-kcal {
  text-align: right;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.day-summary-card .summary-title {
  margin-bottom: 0.4rem;
}

.day-summary-card .summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.day-summary-card .summary-item {
  border-radius: 0.7rem;
  padding: 0.35rem 0.45rem;
  text-align: center;
  font-size: 0.75rem;
}

/* Today's totals – same colors as meal accent bars */
.day-summary-card .summary-item.kcal {
  background: #ff9800; /* lunch */
  color: white;
}

.day-summary-card .summary-item.carbs {
  background: #ffc107; /* snack1 */
  color: white;
}

.day-summary-card .summary-item.protein {
  background: #4caf50; /* breakfast */
  color: white;
}

.day-summary-card .summary-item.fat {
  background: #2196f3; /* dinner */
  color: white;
}

.day-summary-card .summary-item .label {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.15rem;
}

.day-summary-card .summary-item .value {
  font-weight: 600;
}

.btn {
  border-radius: 999px;
  border: none;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn.btn-primary {
  background: #5fbccc;
  color: #fff;
}

.btn.btn-secondary {
  background: #fdf8f3;
  color: #2b2635;
}

.btn.btn-blue {
  background: #2196f3;
  color: #fff;
}

.btn.btn-blue:hover {
  background: #1976d2;
}

.btn:disabled,
.btn[disabled] {
  background: #b0a8b5;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.9;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: #fff;
  border-radius: 0.9rem;
  width: 90%;
  max-width: 420px;
  padding: 0.75rem 1rem 0.75rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.modal-header h2 {
  font-size: 1rem;
  margin: 0;
}

.modal-body {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-body label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 0.45rem;
  border: 1px solid #d0d5e3;
  font-size: 0.85rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.plan-summary-popup {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.plan-summary-badge {
  display: inline-block;
  align-self: flex-start;
  background: #ff9800;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  color: white;
}

.plan-summary-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.plan-summary-progress-bar {
  height: 6px;
  background: #eeeef4;
  border-radius: 999px;
  overflow: hidden;
}

.plan-summary-progress-fill {
  height: 100%;
  background: #ff9800;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.plan-summary-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #9a8fa5;
}

.plan-summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.plan-summary-stat {
  background: #f8f5ff;
  border-radius: 0.7rem;
  padding: 0.6rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.plan-summary-stat-value {
  font-weight: 700;
  font-size: 1.15rem;
  color: #374151;
}

.plan-summary-stat-label {
  font-size: 0.7rem;
  color: #9a8fa5;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.plan-summary-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.plan-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f0edf3;
}

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

.plan-summary-row-label {
  font-size: 0.82rem;
  color: #6b7280;
}

.plan-summary-row-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}

.centered-message {
  text-align: center;
  margin-top: 3rem;
  color: #9a8fa5;
}

.questionnaire-header {
  padding: 0.85rem 1rem;
}

.questionnaire-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #2b2635;
}

.questionnaire-subtitle {
  margin-top: 0.25rem;
  font-size: 0.85rem;
}

.verify-email-card {
  padding: 1.25rem 1rem;
}

.verify-email-text {
  margin: 0 0 1.25rem 0;
  font-size: 0.85rem;
  color: #2b2635;
  line-height: 1.45;
}

.verify-email-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.card-title {
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: #2b2635;
}

.questionnaire-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.questionnaire-grid label {
  display: block;
  color: #2b2635;
}

.questionnaire-grid .label-title {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.questionnaire-grid .label-title.required::after {
  content: "*";
  color: #f83436;
  font-weight: 800;
}

.questionnaire-grid input,
.questionnaire-grid select,
.questionnaire-grid textarea {
  margin-top: 0;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 0.55rem;
  border: 1px solid #d0d5e3;
  font-size: 0.9rem;
}

.questionnaire-grid .field-invalid {
  border-color: #f83436 !important;
  box-shadow: 0 0 0 2px rgba(248, 52, 54, 0.14);
}

/* Invalid fields in modals and other forms */
#modal-body input.field-invalid,
#modal-body select.field-invalid,
#modal-body textarea.field-invalid {
  border-color: #f83436 !important;
  box-shadow: 0 0 0 2px rgba(248, 52, 54, 0.14);
}

.questionnaire-grid .span-2 {
  grid-column: span 2;
}

/* Body type field: dropdown + info icon row, expandable explanation */
.questionnaire-grid .body-type-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.questionnaire-grid .body-type-input-row select {
  flex: 1;
  min-width: 0;
  width: 0; /* allow flex to size; 100% would ignore flex */
}

.questionnaire-grid .body-type-input-row .info-icon-btn {
  flex-shrink: 0;
}

.questionnaire-grid .body-type-field .label-title {
  display: block;
}

.questionnaire-grid .info-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  color: #6b5b73;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  border-radius: 50%;
  transition: color 0.15s ease, transform 0.15s ease;
}

.questionnaire-grid .info-icon-btn:hover {
  color: #8b7b93;
}

.questionnaire-grid .info-icon-btn:focus-visible {
  outline: 2px solid #7c6b84;
  outline-offset: 2px;
}

.body-type-explanation {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.25s ease;
  margin-top: 0;
}

.body-type-explanation.is-open {
  max-height: 1200px;
  opacity: 1;
  margin-top: 0.75rem;
}

.body-type-explanation-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #2b2635;
  margin-bottom: 0.35rem;
}

.body-type-explanation-intro {
  font-size: 0.85rem;
  color: #4a4452;
  margin: 0 0 0.5rem 0;
}

.body-type-explanation-img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid #e0dce6;
}

.body-type-explanation-list {
  font-size: 0.8rem;
  color: #4a4452;
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.45;
}

.body-type-explanation-list li {
  margin-bottom: 0.25rem;
}

.inline-note {
  font-size: 0.8rem;
  color: #9a8fa5;
  font-weight: 500;
}

.questionnaire-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin: 1rem 0 1.25rem;
}

.bmr-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.bmr-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.bmr-unit {
  font-size: 0.9rem;
  color: #9a8fa5;
  font-weight: 600;
}

.intensity-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.intensity-chip {
  border: 1px solid #d0d5e3;
  background: #fdf8f3;
  color: #2b2635;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.intensity-chip.selected {
  border-color: #5fbccc;
  background: rgba(95, 188, 204, 0.18);
  box-shadow: 0 0 0 1px rgba(95, 188, 204, 0.25);
}

@media (max-width: 420px) {
  .questionnaire-grid {
    grid-template-columns: 1fr;
  }
  .questionnaire-grid .span-2 {
    grid-column: auto;
  }
}

/* Loading overlay with spinner */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.50);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.hidden {
  display: none !important;
}

.loading-spinner-large {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(95, 188, 204, 0.2);
  border-radius: 50%;
  border-top-color: #5fbccc;
  border-right-color: #5d63ba;
  animation: spin 0.8s linear infinite;
  position: relative;
}

.loading-spinner-large::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(95, 188, 204, 0.1);
  border-radius: 50%;
  border-top-color: #5fbccc;
  animation: spin-reverse 1s linear infinite;
}

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

@keyframes spin-reverse {
  to {
    transform: translate(-50%, -50%) rotate(-360deg);
  }
}

/* Disable all buttons when loading */
body.loading .btn,
body.loading button:not(.icon-button),
body.loading .clickable {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Meals section loading state – inline under buttons */
.menu-section {
  position: relative;
}

.menu-section-loading .date-nav button,
.menu-section-loading #btn-prev-day,
.menu-section-loading #btn-next-day,
.menu-section-loading #btn-meal-prefs,
.menu-section-loading #btn-change-day-menu {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

.meals-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  color: #9a8fa5;
  text-align: center;
}

.meals-loading-state .loading-spinner-large {
  flex-shrink: 0;
}

/* ========== Header landing (when not logged in) ========== */
.header-nav-landing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-language-toggle {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.375rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  min-width: 2.5rem;
  text-align: center;
}

.btn-language-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.header-nav-landing .header-link {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.header-nav-landing .header-link:hover {
  text-decoration: underline;
}

.btn-outline-header {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-outline-header:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-header {
  background: rgba(255, 255, 255, 0.95);
  color: #5d63ba;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-header:hover {
  background: #fff;
}

/* ========== Landing page ========== */
.landing {
  padding: 0;
  max-width: calc(100% + 2rem);
  /* margin: -1rem -1rem 0; */
  margin: -1rem;
}

.landing-hero {
  /* background: #ffc107; */
  background: url(/images/forest_original.jpg) center / cover no-repeat;
  color: #fff;
  padding: clamp(2.5rem, 8vw, 4rem) 1rem;
  text-align: center;
  /* added lines */
  /* max-width: 900px; */
  min-height: 80vh;
  /* height: 320px; */
  margin: 0 auto;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.landing-hero-content {
  max-width: 900px;
  margin: 0 auto;
}

.landing-hero-title {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 0.9;
  display: block;
  text-align: center;
}

.landing-hero-subtitle {
  margin: 3rem 0 3rem;
  max-width: 100%;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  opacity: 0.95;
  line-height: 1.5;
  display: block;
  text-align: center;
}
@media (min-width: 600px) {
  .landing-hero-title {
    margin: 0 0 1rem;    
    font-size: clamp(1.5rem, 8vw, 5rem);
    line-height: 0.9;
    text-align: left;
  }
  .landing-hero-subtitle {
    margin: 3rem 0 3rem;
    max-width: 70%;
    font-size: clamp(0.95rem, 3vw, 1.5rem);
    line-height: 1.5;
    text-align: left;
  }
}

.landing-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn-hero {
  padding: 0.6rem 1.25rem;
  font-size: 1rem;
}

.landing-hero .btn-primary {
  background: #fff;
  color: #2b2635;
}

.landing-hero .btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
}

.landing-hero .btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.landing-hero .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.landing-section {
  padding: clamp(2rem, 6vw, 3.5rem) 1rem;
  margin: 0 auto;
}

.landing-section-content {
  max-width: 900px;
  margin: 0 auto;
}

.landing-section-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.25rem, 3.5vw, 1.6rem);
  color: #2b2635;
  text-align: center;
}

.landing-section-text {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  color: #5a5568;
  line-height: 1.6;
  text-align: center;
}

.landing-about {
  background: #fff;
}

.landing-diets {
  background: linear-gradient(180deg, #f8f7fa 0%, #fff 100%);
}

.landing-habits {
  background: #eeeef4;
}

.landing-phones-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.landing-phones-image {
  width: 100%;
  height: auto;
  max-width: 420px;
  border-radius: 1rem;
  margin-top: -1.5rem;  
}

.landing-phone-mockup {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.phone-frame {
  width: min(280px, 75vw);
  border-radius: 2rem;
  padding: 0.5rem;
  background: #1a1a1a;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.phone-screen {
  border-radius: 1.5rem;
  aspect-ratio: 9 / 19;
  background: #eeeef4;
  overflow: hidden;
}

.phone-status-bar {
  height: 2rem;
  background: linear-gradient(135deg, #5fbccc, #5d63ba);
}

.phone-app-preview {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.phone-card {
  height: 3.5rem;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.phone-card.short {
  height: 2.5rem;
}

.phone-meal-list {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.phone-meal-item {
  height: 2.5rem;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.landing-diets-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 0.5rem;
  align-items: center;
}

@media (min-width: 640px) {
  .landing-diets-content {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
  }
  .landing-diet-chips-wrap {
    flex: 1 1 280px;
    max-width: 360px;
  }
  .landing-diets-image-wrap {
    flex: 1 1 280px;
    max-width: 420px;
  }
}

.landing-diet-chips-wrap {
  width: 100%;
}

.landing-diet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.diet-chip {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: #fff;
  color: #2b2635;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}

.diet-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.landing-diets-image-wrap {
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  background: #fff;
}

.landing-diets-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
}

.landing-habits-visual {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.habit-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  font-weight: 500;
  color: #2b2635;
}

.habit-water { border-left: 4px solid #2196f3; }
.habit-sleep { border-left: 4px solid #9c27b0; }
.habit-wellbeing { border-left: 4px solid #26a69a; }

.habit-icon {
  font-size: 1.5rem;
}

/* Track your exercises */
.landing-exercises {
  background: #fff;
}

.landing-exercises-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.landing-exercise-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 2rem;
  background: #eeeef4;
  font-size: 0.9rem;
  font-weight: 500;
  color: #2b2635;
}

.landing-exercise-item i {
  font-size: 1.1rem;
  color: #2196f3;
}

.landing-exercise-item.landing-exercise-more {
  background: transparent;
  color: #6b7280;
  font-weight: 400;
}

.landing-exercise-dots {
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  margin-right: 0.15rem;
}

/* Camera meal analysis */
.landing-camera {
  background: #eeeef4;
  border-top: 1px solid rgba(33, 150, 243, 0.12);
}

.landing-camera-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: center;
}

.landing-camera-copy {
  display: flex;
  justify-content: center;
}

.landing-camera-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.landing-camera-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(43, 38, 53, 0.08);
  font-size: 0.9rem;
  font-weight: 600;
  color: #2b2635;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
}

.landing-camera-image-wrap {
  width: min(860px, 100%);
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.landing-camera-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  background: #fff;
}

@media (min-width: 820px) {
  .landing-camera-content {
    grid-template-columns: 1fr 1.35fr;
    gap: 1.75rem;
  }
  .landing-camera-copy {
    justify-content: flex-start;
  }
  .landing-camera-badges {
    justify-content: flex-start;
  }
}

/* Shopping list */
.landing-shopping {
  background: #fff;
  border-top: 1px solid rgba(33, 150, 243, 0.12);
}

.landing-shopping-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-top: 0.25rem;
}

.landing-shopping-image-wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 1rem;
  overflow: hidden;
  background: #f3f4f8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.landing-shopping-image {
  display: block;
  width: 100%;
  height: auto;
}

.landing-shopping-features {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.landing-shopping-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-radius: 0.85rem;
  background: #eeeef4;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #2b2635;
}

.landing-shopping-feature i {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 1.15rem;
  color: #2196f3;
}

@media (min-width: 820px) {
  .landing-shopping-content {
    grid-template-columns: 1.1fr 1fr;
    gap: 2rem;
    align-items: center;
  }

  .landing-shopping-image-wrap {
    margin: 0;
    max-width: none;
  }
}

.landing-basic {
  background: linear-gradient(180deg, #f8f7fa 0%, #fff 100%);
}

/* Pro section */
.landing-pro {
  background: #eeeef4;
  border-top: 1px solid rgba(33, 150, 243, 0.15);
}

.landing-pro-intro {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.landing-features {
  list-style: none;
  padding: 0;
  margin: 1.5rem auto 0;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .landing-features {
    max-width: 720px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

.landing-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: #fff;
  color: #2b2635;
  font-size: 0.95rem;
  line-height: 1.45;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  border-left: 4px solid #2196f3;
}

.landing-feature i {
  font-size: 1.25rem;
  color: #2196f3;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Pricing */
.landing-pricing {
  background: #fff;
  padding-bottom: 3rem;
}

.pricing-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.5rem, 2vw, 0.75rem);
  flex-wrap: nowrap;
  min-width: 0;
}

.pricing-card .pricing-toggle {
  display: inline-flex;
  flex-wrap: nowrap;
  background: #eeeef4;
  border-radius: 2rem;
  padding: 0.25rem;
  gap: 0;
  flex-shrink: 1;
  min-width: 0;
}

.pricing-card-pro .pricing-toggle {
  background: rgba(93, 99, 186, 0.12);
}

.pricing-toggle-btn {
  padding: clamp(0.25rem, 1vw, 0.4rem) clamp(0.5rem, 2vw, 1rem);
  border: none;
  border-radius: 1.5rem;
  font-size: clamp(0.7rem, 1.8vw + 0.3rem, 0.9rem);
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.pricing-toggle-btn:hover {
  color: #2b2635;
}

.pricing-toggle-btn.active {
  background: #fff;
  color: #2b2635;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Weight popup: today / yesterday date switch */
.metrics-date-toggle {
  display: inline-flex;
  background: #e5e7eb;
  border-radius: 1rem;
  padding: 0.125rem;
  gap: 0;
  margin-bottom: 0.5rem;
}

.metrics-date-toggle-btn {
  padding: 0.2rem 0.5rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.metrics-date-toggle-btn:hover {
  color: #374151;
}

.metrics-date-toggle-btn.active {
  background: #5fbccc;
  color: #fff;
  box-shadow: 0 1px 2px rgba(95, 188, 204, 0.3);
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 640px;
  margin: 0 auto;
}

.pricing-card {
  border: 1px solid #e0dde5;
  border-radius: 1rem;
  padding: 1.25rem;
  background: #fff;
  container-type: inline-size;
  container-name: pricing-card;
}

.pricing-card-pro {
  border-color: #5d63ba;
  background: linear-gradient(180deg, rgba(93, 99, 186, 0.06), #fff);
}

.pricing-name {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: #2b2635;
}

.pricing-price-row .pricing-price {
  min-width: 0;
  flex-shrink: 1;
  white-space: nowrap;
}

.pricing-price {
  margin-bottom: 0;
}

/* Scale with card width so price, /month and toggle never overlap (use cqw inside container) */
.pricing-card .pricing-amount {
  font-size: min(1.75rem, 7cqw);
  font-weight: 700;
  color: #2b2635;
  letter-spacing: -0.02em;
}

.pricing-card .pricing-period {
  font-size: min(1rem, 4cqw);
  color: #9a8fa5;
}

.pricing-card .pricing-toggle {
  padding: min(0.25rem, 1.2cqw);
}

.pricing-card .pricing-toggle-btn {
  padding: min(0.4rem, 1.5cqw) min(1rem, 4cqw);
  font-size: min(0.9rem, 3.5cqw);
}

/* Fallbacks when container queries aren't applied (e.g. modal in some contexts) */
.pricing-amount {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2b2635;
  letter-spacing: -0.02em;
}

.pricing-period {
  font-size: 1rem;
  color: #9a8fa5;
}

/* Scale down price + toggle at narrow card widths so they stay on one line */
@container pricing-card (max-width: 320px) {
  .pricing-price-row {
    gap: 0.35rem;
  }
  .pricing-card .pricing-amount {
    font-size: min(1.25rem, 7cqw);
  }
  .pricing-card .pricing-period {
    font-size: min(0.8rem, 4cqw);
  }
  .pricing-card .pricing-toggle {
    padding: 0.12rem;
  }
  .pricing-card .pricing-toggle-btn {
    padding: 0.2rem 0.45rem;
    font-size: min(0.75rem, 3.5cqw);
  }
}

@container pricing-card (max-width: 260px) {
  .pricing-card .pricing-amount {
    font-size: 0.95rem;
  }
  .pricing-card .pricing-period {
    font-size: 0.7rem;
  }
  .pricing-card .pricing-toggle-btn {
    padding: 0.15rem 0.35rem;
    font-size: 0.65rem;
  }
}

.pricing-alt {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: #9a8fa5;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.pricing-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: #2b2635;
}

.pricing-feature .tick {
  color: #4caf50;
  font-weight: 700;
}

.pricing-feature .cross {
  color: #b0a8b5;
}

.btn-pricing {
  width: 100%;
}

.btn-pricing:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.landing-stores {
  background: #eeeef4;
}

/* Show "Open the app" section only on desktop */
.landing-stores-desktop-only {
  display: none;
}

@media (min-width: 769px) {
  .landing-stores-desktop-only {
    display: block;
  }
}

.landing-open-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.landing-app-link {
  color: #2196f3;
  font-size: 1rem;
  word-break: break-all;
  text-decoration: none;
}

.landing-app-link:hover {
  text-decoration: underline;
}

.landing-qr-code {
  display: block;
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.landing-store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.store-badge.placeholder {
  padding: 0.75rem 1.25rem;
  border: 2px dashed #c0b8c5;
  border-radius: 0.5rem;
  color: #9a8fa5;
  font-size: 0.9rem;
}

.landing-cta-bottom {
  text-align: center;
  padding: 2rem 1rem 3rem;
  background: #2196f3;
  color: #fff;
}

.landing-cta-bottom p {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.landing-cta-bottom .landing-hero-cta {
  justify-content: center;
}

.landing-cta-bottom .btn-primary {
  background: #fff;
  color: #2b2635;
}

.landing-cta-bottom .btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Test banner container (at top of app, after header) */
.test-banner-container {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.test-banner-container.hidden {
  display: none;
}

/* Subscription grace period banner (purple notice when subscription has run out) */
.subscription-grace-banner-container {
  width: 100%;
  padding: 0.6rem 1rem;
  background: #6b21a8;
  color: #fff;
  text-align: center;
  font-size: 0.9rem;
}

.subscription-grace-banner-container.hidden {
  display: none;
}

.subscription-grace-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.subscription-grace-banner-text {
  font-weight: 500;
}

.subscription-grace-banner-container .btn-renew {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: #6b21a8;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.subscription-grace-banner-container .btn-renew:hover {
  background: #fff;
}

/* Subscription expired section (purple notice at start of app when subscription has ended) */
.subscription-expired-section {
  background: #6b21a8;
  color: #fff;
  padding: 1.25rem 1rem;
  text-align: center;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}
.subscription-expired-section .subscription-expired-note {
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 0 1rem 0;
  font-weight: 500;
}
.subscription-expired-section .btn-renew-subscription {
  padding: 0.5rem 1.25rem;
  border-radius: 0.375rem;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: #6b21a8;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.subscription-expired-section .btn-renew-subscription:hover {
  background: #fff;
}

/* Trial banner (above Motivation Quote in dashboard) */
.trial-banner {
  margin-bottom: 1rem;
}

.trial-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #9c27b0;
  color: #fff;
  border-radius: 0.5rem;
  font-size: 0.85rem;
}

.trial-banner-text {
  font-weight: 600;
}

.btn-trial-cta {
  flex-shrink: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: #9c27b0;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-trial-cta:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* Admin user list subscription badges */
.admin-sub-badge {
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}
.admin-sub-badge--pro {
  background: #2196f3;
}
.admin-sub-badge--basic {
  background: #10b981;
}
.admin-sub-badge--none {
  background: #4b5563;
}

.admin-subscription-filter-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-filter-btn-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  align-items: center;
}

.admin-filter-btn {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  border-radius: 0.55rem;
  padding: 0.45rem 0.5rem;
  font-size: 0.80rem;
  /* font-weight: 600; */
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.admin-filter-btn:hover {
  filter: brightness(0.97);
}

.admin-filter-btn.is-active {
  border: 1px solid #2b2635;
}

.admin-filter-btn--all {
  background: #eeeef4;
  color: #2b2635;
}

.admin-filter-btn--none {
  background: #9ca3af;
  border-color: #6b7280;
  color: #fff;
}

.admin-filter-btn--subscribed {
  background: #6366f1;
  border-color: #4f46e5;
  color: #fff;
}

.admin-filter-btn--basic {
  background: #10b981;
  border-color: #059669;
  color: #fff;
}

.admin-filter-btn--pro {
  background: #2196f3;
  border-color: #1976d2;
  color: #fff;
}

.admin-field-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.1rem 0;
  border-bottom: 1px solid #d0d5e3;
}

.admin-field-label {
  font-weight: 500;
  color: #2b2635;
  min-width: 120px;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.admin-field-display {
  word-break: break-word;
  min-width: 0;
  flex: 1;
  color: #2b2635;
  font-size: 0.85rem;
}

.admin-field-display-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.admin-edit-btn {
  padding: 0.3rem 0.5rem;
  flex-shrink: 0;
}

.admin-confirm-btn,
.admin-cancel-btn {
  padding: 0.4rem 0.6rem;
  flex-shrink: 0;
}

.admin-icon {
  font-size: 0.75rem;
}

/* Coach's Corner (Pro) */
.coach-no-coach-prompt {
  color: var(--muted-color, #6b7280);
  margin: 0 0 1rem;
  line-height: 1.5;
  font-size: 0.95rem;
}
.coach-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.coach-header-text {
  min-width: 0;
}
.coach-header-label {
  font-size: 0.9rem;
  color: var(--muted-color, #6b7280);
  margin-right: 0.35rem;
}
.coach-header-name {
  font-weight: 600;
  color: #374151;
  font-size: 1rem;
}
.coach-header-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.coach-notes-card .coach-header-btn {
  padding: 0.25rem;
  font-size: 0.9rem;
  color: var(--muted-color, #6b7280);
  transition: color 0.15s, background 0.15s;
  border-radius: 0.25rem;
}
.coach-notes-card .coach-header-btn:hover {
  color: #374151;
  background: var(--hover-bg, #f3f4f6);
}
.coach-notes-card .coach-header-btn-remove:hover {
  color: #dc2626;
  background: #fef2f2;
}
.coach-notes-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}
.coach-notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.coach-notes-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}
.coach-notes-list li:last-child {
  border-bottom: none;
}
.coach-notes-list .coach-note-item {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.35rem 0;
}
.coach-note-item:not(.read) {
  font-weight: 700;
}
.coach-note-date {
  font-size: 0.85rem;
  color: var(--muted-color, #6b7280);
  flex-shrink: 0;
  font-weight: 400;
  padding-right: 0.5rem;
}
.coach-note-new {
  flex-shrink: 0;
  font-size: 0.5rem;
  padding-right: 0.2rem;
}
.coach-note-new .bi-envelope {
  font-size: 0.9rem;
}
.coach-note-title {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.85rem;
  color: #6b7280;
}
.coach-note-body {
  display: none;
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  margin-top: 0.35rem;
  line-height: 1.4;
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 400;
}
.coach-note-item.expanded .coach-note-body {
  display: block;
}
.coach-notes-empty {
  color: var(--muted-color, #6b7280);
  margin: 0.5rem 0 0;
}
.coach-picker-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 16rem;
  overflow-y: auto;
}
.coach-picker-item {
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background 0.15s;
}
.coach-picker-item:hover {
  background: var(--hover-bg, #f3f4f6);
}
.coach-client-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.coach-client-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color, #e5e7eb);
  margin-bottom: 0.5rem;
  transition: background 0.15s;
}
.coach-client-item:hover {
  background: var(--hover-bg, #f3f4f6);
}
.coach-metrics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.coach-metrics-header .section-title {
  margin-bottom: 0;
}
.coach-metrics-nav {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}
.coach-metrics-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.coach-metrics-list li {
  padding: 0.25rem 0;
}
.coach-metrics-workouts {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
}
.coach-workouts-list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
}
.coach-workouts-list li {
  padding: 0.2rem 0;
}
.coach-note-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 0.375rem;
  font-size: 1rem;
  resize: vertical;
}
.coach-send-note-row {
  margin-top: 0.75rem;
}
.coach-send-note-row .btn {
  display: block;
}
.coach-notes-card #btn-add-coach {
  margin-top: 0.25rem;
}

.coach-find-error {
  color: var(--error-color, #dc2626);
  font-size: 0.875rem;
  margin: 0.25rem 0 0;
}
.coach-find-error:not(.hidden) {
  display: block;
}