/* Isolated LandingDemo component styles */
.landing-demo {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-cream);
  color: var(--color-foreground);
  font-family: var(--font-sans);
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Screen Shell */
.demo-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-cream);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0);
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0.35s;
  z-index: 1;
}

.demo-screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

/* Slide up route transitions for loading / review / saving screens */
.screen--slide-up {
  transform: translateY(100%);
}

.screen--slide-up.is-active {
  transform: translateY(0);
}

/* Camera screen dark styling override */
.demo-screen--camera {
  background: var(--color-dark);
  color: #fff;
}

/* Scroll Area */
.demo-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.demo-scroll::-webkit-scrollbar {
  display: none;
}

/* ==================== DIARY SCREEN ==================== */
.diary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.5rem;
}

.diary-logo {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-sage);
}

.diary-icons {
  display: flex;
  gap: 0.25rem;
}

.diary-icon-btn {
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0.3rem;
  display: grid;
  place-items: center;
  transition: opacity var(--duration-fast);
}
.diary-icon-btn:hover {
  opacity: 0.7;
}

.diary-datebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 0.5rem;
  margin-bottom: 0.75rem;
}

.diary-date-btn {
  background: none;
  border: none;
  color: var(--color-muted);
  padding: 0.2rem;
  cursor: pointer;
}

.diary-date-center {
  text-align: center;
}

.diary-date-label {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  text-transform: uppercase;
}

.diary-date-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-foreground);
  margin-top: 0.05rem;
}

/* Ring & Balance */
.diary-ring-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.75rem;
}

.diary-ring {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
}

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

.diary-ring-circle-bg {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 8;
}

.diary-ring-circle-progress {
  fill: none;
  stroke: var(--color-sage);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 263.89; /* 2 * PI * 42 */
  stroke-dashoffset: 263.89;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.diary-ring-lbl {
  font-size: 0.42rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.diary-ring-val {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.diary-ring-sub {
  font-size: 0.42rem;
  color: var(--color-muted);
  margin-top: 0.15rem;
}

.diary-balance {
  font-size: 0.58rem;
  line-height: 1.45;
  color: var(--color-muted);
  text-align: center;
  max-width: 13rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

/* Macros */
.diary-macros {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding-inline: 1rem;
}

.diary-macro-pill {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  font-size: 0.45rem;
  font-weight: 600;
}

.diary-macro-dot {
  width: 0.22rem;
  height: 0.22rem;
  border-radius: var(--radius-full);
}

.diary-macro-dot--proteins { background: var(--color-sage); }
.diary-macro-dot--carbs { background: var(--color-amber-soft); }
.diary-macro-dot--fats { background: var(--color-terracotta); }

/* Card Widgets */
.diary-card-section {
  padding-inline: 1rem;
  margin-bottom: 0.75rem;
}

.diary-widget-card {
  padding: 0.65rem;
  border-radius: 1rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 16px rgba(45, 42, 38, 0.02);
}

/* Weight chart mockup */
.weight-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.weight-card__title {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  text-transform: uppercase;
}
.weight-card__value {
  font-size: 0.7rem;
  font-weight: 600;
}
.weight-card__chart {
  height: 2.2rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 0.4rem;
}
.weight-chart__bar {
  flex: 1;
  margin-inline: 2px;
  background: var(--color-linen);
  border-radius: 2px 2px 0 0;
  height: calc(var(--percent, 50) * 1%);
  transition: background 0.3s;
}
.weight-chart__bar.is-active {
  background: var(--color-terracotta);
}

/* Insight card */
.insight-card {
  border-color: var(--color-border);
}
.insight-card__title {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.52rem;
  font-weight: 600;
  color: var(--color-terracotta);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}
.insight-card__text {
  font-size: 0.48rem;
  line-height: 1.45;
  color: var(--color-muted);
}

/* Meals Section */
.meals-section-title {
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  text-transform: uppercase;
  padding-inline: 1rem;
  margin-block: 0.8rem 0.4rem;
}

.meals-list {
  padding-inline: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 5.5rem; /* Space for fixed scan button */
}

/* Meal Item Card */
.meal-item-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem;
  border-radius: 1rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(45, 42, 38, 0.02);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.meal-item-card:active {
  transform: scale(0.98);
}

.meal-item-icon-wrap {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.65rem;
  background: var(--color-linen);
  display: grid;
  place-items: center;
  color: var(--color-terracotta);
  font-size: 0.8rem;
}
.meal-item-icon-wrap--breakfast {
  background: rgba(156, 175, 136, 0.12);
  color: var(--color-sage);
}

.meal-item-details {
  flex: 1;
}

.meal-item-type {
  font-size: 0.42rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  text-transform: uppercase;
}

.meal-item-name {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--color-foreground);
  margin-top: 0.08rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meal-item-cals-group {
  text-align: right;
}

.meal-item-cals-val {
  font-size: 0.62rem;
  font-weight: 700;
}

.meal-item-cals-lbl {
  font-size: 0.38rem;
  color: var(--color-muted);
  text-transform: uppercase;
}

/* Empty Meal Card */
.meal-item-card--empty {
  border: 1px dashed var(--color-border);
  background: transparent;
  box-shadow: none;
}
.meal-item-card--empty .meal-item-icon-wrap {
  background: var(--color-linen);
  color: var(--color-muted);
}
.meal-item-card--empty .meal-item-name {
  font-weight: 600;
}
.meal-item-card--empty .meal-item-type {
  color: var(--color-muted);
  font-weight: 500;
}
.meal-item-chevron {
  color: var(--color-muted);
}

/* Floating Bottom Trigger */
.diary-bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  background: linear-gradient(to top, var(--color-cream) 60%, rgba(253, 251, 247, 0));
  z-index: 5;
}

.btn-scan-trigger {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: var(--color-terracotta);
  border: none;
  color: var(--color-cream);
  font-size: 0.58rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(196, 115, 74, 0.35);
  animation: pulse-shadow 2.4s infinite alternate;
  transition: transform 0.2s;
}
.btn-scan-trigger:active {
  transform: scale(0.96);
}

@keyframes pulse-shadow {
  0% {
    box-shadow: 0 4px 12px rgba(196, 115, 74, 0.25);
  }
  100% {
    box-shadow: 0 10px 24px rgba(196, 115, 74, 0.45);
  }
}

/* ==================== CAMERA SCREEN ==================== */
.camera-top-bar {
  display: flex;
  align-items: center;
  padding: 0.8rem 0.6rem;
}

.camera-cancel-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.52rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.4rem;
}

.camera-title-group {
  flex: 1;
  text-align: center;
  padding-right: 2rem; /* Balance offset of cancel button */
}

.camera-title {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--color-cream);
  margin: 0;
}

.camera-subtitle {
  font-size: 0.44rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.05rem;
}

.camera-viewport-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 1rem;
}

.camera-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 14rem;
  border-radius: 1.5rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.camera-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.65;
  transition: opacity 0.3s;
}
.camera-viewport.has-captured .camera-preview-img {
  opacity: 1;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0,0,0,0.3);
  text-align: center;
  transition: opacity 0.3s;
}
.camera-viewport.has-captured .camera-placeholder {
  opacity: 0;
  pointer-events: none;
}

.camera-placeholder-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.65rem;
}

.camera-placeholder-text {
  font-size: 0.52rem;
  line-height: 1.45;
  font-weight: 500;
  color: #fff;
  max-width: 9rem;
}

/* Framing brackets */
.camera-bracket {
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  border: 3px solid transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.camera-viewport.has-captured .camera-bracket {
  opacity: 0.85;
}

.camera-bracket--tl { top: 0.6rem; left: 0.6rem; border-top-color: #fff; border-left-color: #fff; border-top-left-radius: 8px; }
.camera-bracket--tr { top: 0.6rem; right: 0.6rem; border-top-color: #fff; border-right-color: #fff; border-top-right-radius: 8px; }
.camera-bracket--bl { bottom: 0.6rem; left: 0.6rem; border-bottom-color: #fff; border-left-color: #fff; border-bottom-left-radius: 8px; }
.camera-bracket--br { bottom: 0.6rem; right: 0.6rem; border-bottom-color: #fff; border-right-color: #fff; border-bottom-right-radius: 8px; }

/* Camera Flash */
.camera-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
.camera-flash.trigger-flash {
  animation: flash-anim 0.35s ease-out;
}
@keyframes flash-anim {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Camera Controls */
.camera-controls-wrap {
  padding: 0.8rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.camera-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-gallery {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  margin-right: auto;
}

.shutter-btn-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  padding-right: 2.2rem; /* offset gallery button to keep shutter centered */
}

.btn-shutter {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 50%;
  background: transparent;
  border: 4px solid rgba(255, 255, 255, 0.9);
  padding: 4px;
  cursor: pointer;
}
.btn-shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
}

.camera-reassurance {
  font-size: 0.44rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

/* Post-Capture Buttons */
.camera-captured-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  height: 0;
  overflow: hidden;
}
.camera-viewport.has-captured ~ .camera-controls-wrap .camera-captured-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  height: auto;
  overflow: visible;
}
.camera-viewport.has-captured ~ .camera-controls-wrap .camera-controls-row {
  display: none;
}

.btn-analyze {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.65rem;
  border-radius: 1.25rem;
  background: var(--color-terracotta);
  color: var(--color-cream);
  border: none;
  font-size: 0.58rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(196, 115, 74, 0.3);
}

.btn-retake {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.52rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.3rem;
  margin-inline: auto;
}

/* ==================== SCANNING LOAD SCREEN ==================== */
.scan-load-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2.2rem;
}

.scan-load-pulse-wrap {
  position: relative;
  width: 7rem;
  height: 7rem;
  margin-bottom: 2rem;
}

.scan-load-circle-outer {
  position: absolute;
  inset: -0.5rem;
  border-radius: 50%;
  border: 1px solid rgba(196, 115, 74, 0.15);
}

.scan-load-circle-mid {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--color-linen);
  display: grid;
  place-items: center;
}

.scan-load-circle-inner {
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 50%;
  background: var(--color-terracotta-light);
  display: grid;
  place-items: center;
  animation: pulse-scale 1.8s infinite ease-in-out;
}

.scan-load-circle-inner svg {
  color: var(--color-terracotta);
}

@keyframes pulse-scale {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.15); opacity: 1; }
}

.scan-load-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-foreground);
  text-align: center;
  height: 2.5rem; /* prevent layout shift on content changes */
  margin-bottom: 1.25rem;
  transition: opacity 0.25s;
}

.scan-load-progress {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 2rem;
}

.scan-load-pill {
  width: 0.5rem;
  height: 0.25rem;
  border-radius: 999px;
  background: var(--color-border);
  transition: width 0.3s, background 0.3s;
}

.scan-load-pill.is-active {
  width: 1.25rem;
  background: var(--color-terracotta);
}

.scan-load-hint {
  font-size: 0.5rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==================== AI REVIEW SCREEN ==================== */
.review-header-visual {
  height: 7.2rem;
  position: relative;
  background: var(--color-linen);
}
.review-header-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.review-header-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0%, transparent 40%, var(--color-cream) 100%);
}

.review-btn-close {
  position: absolute;
  left: 0.8rem;
  top: 0.8rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgba(253, 251, 247, 0.9);
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.review-approx-badge {
  position: absolute;
  right: 0.8rem;
  top: 0.8rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(253, 251, 247, 0.9);
  font-size: 0.5rem;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.review-sheet {
  flex: 1;
  background: var(--color-cream);
  border-radius: 1.25rem 1.25rem 0 0;
  margin-top: -1rem;
  z-index: 10;
  position: relative;
  display: flex;
  flex-direction: column;
}

.review-sheet-scroll {
  padding: 1rem;
}

.review-ai-banner {
  display: flex;
  gap: 0.4rem;
  padding: 0.65rem;
  border-radius: 1rem;
  background: rgba(229, 201, 138, 0.15); /* light soft amber background */
  margin-bottom: 0.9rem;
}
.review-ai-banner svg {
  flex-shrink: 0;
  color: var(--color-terracotta);
}
.review-ai-banner-text {
  font-size: 0.54rem;
  line-height: 1.45;
  color: var(--color-foreground);
}

.review-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-bottom: 2rem;
}

/* Review Item Card */
.review-item-card {
  padding: 0.65rem;
  border-radius: 1rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(45, 42, 38, 0.02);
  transition: opacity 0.3s, transform 0.3s;
}

.review-item-main {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.review-item-emoji {
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  background: var(--color-linen);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.review-item-info {
  flex: 1;
}

.review-item-title {
  font-size: 0.62rem;
  font-weight: 700;
  margin: 0 0 0.1rem;
}

.review-item-cals {
  font-size: 0.5rem;
  color: var(--color-muted);
}

.review-item-macros {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.review-macro-tag {
  font-size: 0.4rem;
  font-weight: 700;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
}
.review-macro-tag--p { background: rgba(156, 175, 136, 0.12); color: var(--color-sage); }
.review-macro-tag--f { background: rgba(229, 201, 138, 0.16); color: #b38600; }
.review-macro-tag--c { background: rgba(196, 115, 74, 0.1); color: var(--color-terracotta); }

.review-item-btn-delete {
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0.2rem;
  display: grid;
  place-items: center;
}

/* Bumper weight input */
.review-item-bumper {
  margin-block: 0.65rem 0.5rem;
  padding: 0.25rem;
  background: var(--color-linen);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-bumper {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: var(--color-card);
  border: none;
  color: var(--color-foreground);
  box-shadow: 0 2px 6px rgba(45, 42, 38, 0.05);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.btn-bumper:active {
  transform: scale(0.95);
}

.review-bumper-text {
  text-align: center;
}
.review-bumper-val {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}
.review-bumper-lbl {
  font-size: 0.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* Portion chips */
.review-item-chips {
  display: flex;
  gap: 0.35rem;
}

.review-portion-chip {
  flex: 1;
  padding-block: 0.4rem;
  border-radius: 999px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  color: rgba(45, 42, 38, 0.8);
  font-size: 0.5rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.review-portion-chip.is-selected {
  background: var(--color-terracotta-light);
  border-color: var(--color-terracotta);
  color: var(--color-terracotta);
}

.review-bottom-nav {
  padding: 0.5rem 1rem 1rem;
  background: var(--color-cream);
  border-top: 1px solid var(--color-border);
  z-index: 12;
}

.btn-review-confirm {
  width: 100%;
  padding: 0.65rem;
  border-radius: 1rem;
  background: var(--color-terracotta);
  color: var(--color-cream);
  border: none;
  font-size: 0.58rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  cursor: pointer;
}
.btn-review-confirm:active {
  transform: scale(0.98);
}

/* Empty review fallback */
.review-empty-state {
  text-align: center;
  padding: 1.5rem;
  color: var(--color-muted);
  font-size: 0.54rem;
}

/* ==================== SAVING MEAL SCREEN ==================== */
.saving-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1.5rem;
}

.saving-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 11rem;
  margin-bottom: 1.25rem;
}

.saving-check-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  border-radius: 1rem;
  background: var(--color-card);
  box-shadow: 0 4px 12px rgba(45, 42, 38, 0.03);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.saving-check-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.saving-check-emoji {
  font-size: 0.8rem;
}
.saving-check-name {
  font-size: 0.55rem;
  font-weight: 600;
}

.saving-spinner-wrap {
  margin-block: 0.8rem 0.4rem;
}

.saving-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-terracotta);
  border-radius: 50%;
  animation: rotate-spinner 0.8s linear infinite;
}
@keyframes rotate-spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.saving-label {
  font-size: 0.46rem;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  text-transform: uppercase;
}

/* ==================== SYSTEM POPUPS & REPLAY ==================== */
/* Success toast */
.demo-toast {
  position: absolute;
  left: 50%;
  bottom: 5.5rem;
  transform: translate(-50%, 20px);
  background: var(--color-foreground);
  color: var(--color-cream);
  padding: 0.45rem 0.8rem;
  border-radius: 12px;
  font-size: 0.52rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.3s, transform 0.3s;
}
.demo-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Replay Overlay */
.demo-replay-overlay {
  position: absolute;
  inset: 0;
  background: rgba(253, 251, 247, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 99;
}
.demo-replay-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.demo-replay-box {
  text-align: center;
  padding: 1.5rem;
}

.demo-replay-title {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.demo-replay-desc {
  font-size: 0.52rem;
  color: var(--color-muted);
  line-height: 1.45;
  margin-bottom: 1rem;
  max-width: 10rem;
}

.btn-replay {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--color-terracotta);
  color: var(--color-cream);
  border: none;
  font-size: 0.54rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(196, 115, 74, 0.25);
}
.btn-replay:active {
  transform: scale(0.95);
}
