/* ==========================================================================
   myCHOscan — Interactive 1:1 Pixel-Faithful App Demo Modal
   Uses native <dialog closedby="any"> + scroll containment (Modern Web Guidance)
   ========================================================================== */

dialog.demo-modal {
  padding: 0;
  margin: auto;
  border: none;
  background: transparent;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  overflow: visible;
  color: #0f172a;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

dialog.demo-modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mandatory Modern Web Guidance scroll-containment rules */
dialog.demo-modal:modal {
  overscroll-behavior: contain;
}

dialog.demo-modal::backdrop {
  background: rgba(10, 22, 40, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  overscroll-behavior: contain;
}

/* Fixed canonical 768x816 stage scaled uniformly via --demo-scale:
   guarantees the smartphone ALWAYS keeps its exact 378:764 aspect ratio
   without EVER stretching or squishing on any PC or tablet viewport. */
.demo-scale-frame {
  position: relative;
  width: calc(768px * var(--demo-scale, 1));
  height: calc(816px * var(--demo-scale, 1));
  flex: 0 0 auto;
}

.demo-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 768px;
  height: 816px;
  transform: scale(var(--demo-scale, 1));
  transform-origin: top left;
  display: grid;
  grid-template-columns: 394px 348px;
  gap: 26px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.demo-close-fab {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 40;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.16s ease, background 0.16s ease;
}

.demo-close-fab:hover {
  transform: scale(1.06);
  background: #ff9500;
  border-color: #ff9500;
}

/* --------------------------------------------------------------------------
   Realistic Pixel Smartphone Bezel + External Scroll Rail (Locked 378x764)
   -------------------------------------------------------------------------- */
.demo-phone-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 394px;
  height: 764px;
  flex: 0 0 auto;
}

.demo-ext-scroll-rail {
  width: 6px;
  height: 220px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  position: relative;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
  flex: 0 0 auto;
}

.demo-ext-scroll-rail.visible {
  opacity: 1;
}

.demo-ext-scroll-thumb {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(180deg, #00a3ff 0%, #ff9500 100%);
  box-shadow: 0 0 10px rgba(0, 163, 255, 0.55);
  transition: top 0.08s linear, height 0.18s ease;
}

.demo-phone {
  width: 378px;
  height: 764px;
  aspect-ratio: 378 / 764;
  flex: 0 0 auto;
  box-sizing: border-box;
  background: #141821;
  border-radius: 44px;
  padding: 11px;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.56),
    0 0 0 1.5px rgba(255, 255, 255, 0.16) inset;
  display: flex;
  flex-direction: column;
  position: relative;
}

.demo-phone-screen {
  flex: 1 1 auto;
  min-height: 0;
  background: #eaf5ff;
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Android Status Bar */
.demo-statusbar {
  flex: 0 0 auto;
  height: 32px;
  padding: 6px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
  background: #eaf5ff;
  position: relative;
  user-select: none;
}

.demo-camera-dot {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #111827;
}

.demo-status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-battery {
  background: #16a34a;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 5px;
}

/* Main Scrollable App Body (thin visible cyan scrollbar!) */
.demo-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 16px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 163, 255, 0.45) transparent;
}

.demo-body::-webkit-scrollbar {
  width: 4px;
}

.demo-body::-webkit-scrollbar-track {
  background: transparent;
}

.demo-body::-webkit-scrollbar-thumb {
  background: rgba(0, 163, 255, 0.42);
  border-radius: 999px;
}

.demo-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
  z-index: 15;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.demo-scroll-cue.visible {
  opacity: 1;
}

/* Exact Floating 7-Icon Bottom Nav Bar */
.demo-bottom-wrap {
  flex: 0 0 auto;
  padding: 4px 12px 12px;
  background: linear-gradient(180deg, rgba(234, 245, 255, 0) 0%, #eaf5ff 28%);
}

.demo-bottom-bar {
  height: 58px;
  background: #ffffff;
  border-radius: 30px;
  border: 1px solid rgba(0, 163, 255, 0.26);
  box-shadow: 0 4px 16px rgba(0, 163, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 0 6px;
}

.demo-nav-btn {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #00a3ff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.demo-nav-btn:hover {
  transform: translateY(-1px);
}

.demo-nav-btn.active {
  background: #ff9500;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(255, 149, 0, 0.32);
}

/* --------------------------------------------------------------------------
   1:1 App UI Components
   -------------------------------------------------------------------------- */
.app-greeting {
  text-align: center;
  font-size: 21px;
  font-weight: 400;
  color: #0f172a;
  margin: 4px 0 10px;
}

.app-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 12px;
}

.app-screen-title {
  font-size: 22px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  line-height: 1.15;
}

.app-quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(0, 163, 255, 0.38);
  background: rgba(0, 163, 255, 0.11);
  color: #008ee0;
  white-space: nowrap;
}

.app-quota-pill.low {
  border-color: rgba(255, 149, 0, 0.42);
  background: rgba(255, 149, 0, 0.13);
  color: #b45309;
}

.app-quota-pill.ean {
  border-color: rgba(16, 185, 129, 0.38);
  background: rgba(16, 185, 129, 0.11);
  color: #047857;
}

/* Search Bar */
.app-search-box {
  height: 46px;
  background: #ffffff;
  border-radius: 24px;
  border: 1.5px solid #00a3ff;
  display: flex;
  align-items: center;
  padding: 0 13px;
  gap: 8px;
  margin-bottom: 10px;
}

.app-search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: #0f172a;
}

.app-search-box input::placeholder {
  color: rgba(15, 23, 42, 0.42);
  font-weight: 300;
}

.app-search-clear {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
}

/* Liquid Glass Ring */
.app-ring-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 8px auto 14px;
  width: 214px;
  height: 214px;
}

.app-ring-svg {
  width: 214px;
  height: 214px;
  transform: rotate(-90deg);
}

.app-ring-arc {
  transition: stroke-dashoffset 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.app-ring-value {
  font-size: 48px;
  font-weight: 400;
  line-height: 0.96;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.app-ring-label {
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.8px;
  color: rgba(15, 23, 42, 0.44);
  margin-top: 3px;
}

.app-ring-sugars {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 400;
  color: rgba(15, 23, 42, 0.8);
}

.app-ring-sugars i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff9500;
  display: inline-block;
}

/* Exact Home Empty State Card (matches v3.19 real app!) */
.app-empty-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1.2px solid rgba(0, 163, 255, 0.24);
  box-shadow: 0 4px 14px rgba(0, 163, 255, 0.06);
  padding: 18px 18px 16px;
  text-align: center;
  margin-top: 6px;
}

.app-empty-card p {
  margin: 0;
  font-size: 13.4px;
  line-height: 1.5;
  color: #475569;
  font-weight: 400;
}

.app-empty-card strong {
  color: #0f172a;
  font-weight: 700;
}

.app-empty-buon {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: #ff9500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.app-empty-buon img {
  width: 68px;
  height: auto;
  border-radius: 0;
  object-fit: contain;
  display: block;
}

.demo-inert {
  pointer-events: none;
  cursor: default;
}

.app-tip-subcard {
  background: #ffffff;
  border-radius: 16px;
  border: 1.2px solid rgba(0, 163, 255, 0.28);
  padding: 11px 13px;
  margin-bottom: 9px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.app-tip-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #e5f4ff;
  color: #00a3ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* General Cards */
.app-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1.4px solid #00a3ff;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 163, 255, 0.06);
}

.app-card.soft {
  border-color: rgba(0, 163, 255, 0.26);
  border-width: 1.2px;
}

.app-card.amber {
  border-color: #ff9500;
  box-shadow: 0 4px 14px rgba(255, 149, 0, 0.08);
}

.app-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-thumb {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #d0e8ff;
  flex-shrink: 0;
  background: #f1f5f9;
}

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

.app-item-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.app-item-sub {
  font-size: 11.5px;
  color: #475569;
  margin-top: 2px;
  line-height: 1.35;
}

.app-cho-pill {
  font-size: 12.5px;
  font-weight: 800;
  color: #008ee0;
  background: #e5f4ff;
  padding: 4px 9px;
  border-radius: 10px;
  white-space: nowrap;
}

.app-sug-pill {
  font-size: 11.5px;
  font-weight: 700;
  color: #ea580c;
  background: #fff3e0;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.app-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f7fd;
  border-radius: 999px;
  padding: 2px 6px;
  margin-top: 5px;
}

.app-stepper button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: #00a3ff;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.app-stepper span {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  min-width: 42px;
  text-align: center;
}

.app-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.app-icon-btn.fav-active {
  color: #ef4444;
  border-color: #fecaca;
  background: #fef2f2;
}

.app-btn-primary {
  width: 100%;
  border: none;
  border-radius: 15px;
  padding: 11px 14px;
  background: #00a3ff;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 5px 14px rgba(0, 163, 255, 0.24);
}

.app-btn-orange {
  background: #ff9500;
  box-shadow: 0 5px 14px rgba(255, 149, 0, 0.26);
}

.app-btn-outline {
  width: 100%;
  border: 1.4px solid #00a3ff;
  border-radius: 14px;
  padding: 9px 12px;
  background: #ffffff;
  color: #008ee0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Scanner Mode Tabs */
.app-mode-tabs {
  height: 44px;
  padding: 4px;
  background: #ffffff;
  border-radius: 26px;
  border: 1.2px solid rgba(0, 163, 255, 0.45);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}

.app-mode-tab {
  border: none;
  border-radius: 22px;
  background: #dceeff;
  color: #6e859c;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.app-mode-tab.active {
  background: #ff9500;
  color: #ffffff;
}

/* Circular Action Buttons (Galleria / Fotocamera / Chef) */
.app-scan-actions {
  display: flex;
  justify-content: space-evenly;
  margin: 4px 0 14px;
}

.app-circle-action {
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-family: inherit;
}

.app-circle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #00a3ff;
  color: #00a3ff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 163, 255, 0.16);
}

.app-circle-action.active .app-circle-btn {
  background: #ff9500;
  border-color: #ff9500;
  color: #ffffff;
}

.app-circle-action span {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}

.app-circle-action.active span {
  color: #ff9500;
  font-weight: 800;
}

/* Photo Tips Collapsible (exact real app card!) */
.app-tips-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1.2px solid rgba(0, 163, 255, 0.35);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.app-tips-head {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

/* Simulated Camera Viewfinder & Floating Demo Picker Overlay */
.app-camera-overlay {
  position: absolute;
  inset: 0;
  z-index: 26;
  background: #0b1120;
  display: flex;
  flex-direction: column;
}

.app-demo-float-banner {
  background: linear-gradient(90deg, #ff9500 0%, #f97316 100%);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-camera-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px;
  background: rgba(15, 23, 42, 0.94);
}

.app-camera-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 4px 9px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.app-camera-pill.active {
  background: #00a3ff;
  border-color: #00a3ff;
  color: #ffffff;
}

.app-camera-viewport {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.app-camera-viewport img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-camera-reticle {
  position: absolute;
  inset: 28px;
  border: 2px dashed rgba(0, 210, 255, 0.65);
  border-radius: 22px;
  pointer-events: none;
}

.app-camera-controls {
  padding: 16px 20px 22px;
  background: #0b1120;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-shutter-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease;
}

.app-shutter-btn:active {
  transform: scale(0.92);
}

.app-shutter-inner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
}

/* Exact AnimatedScanMascot Overlay (matches animated_scan_mascot.dart!) */
.app-scan-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid #00a3ff;
  margin-bottom: 10px;
  background: #0f172a;
}

.app-scan-frame img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
}

.app-mascot-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.54);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-mascot-ring-box {
  position: relative;
  width: 146px;
  height: 146px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-mascot-ring-svg {
  position: absolute;
  inset: 0;
  width: 146px;
  height: 146px;
  transform: rotate(-90deg);
}

.app-mascot-disc {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #f3efea;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
}

.app-mascot-pct {
  color: #f39200;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Post-Scan Hero Card & Calibration Slider */
.app-hero-cho-box {
  background: #eaf5ff;
  border: 1.2px solid rgba(0, 163, 255, 0.42);
  border-radius: 16px;
  padding: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.app-raw-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-raw-btn {
  width: 56px;
  height: 22px;
  border-radius: 11px;
  border: 1px solid rgba(0, 163, 255, 0.55);
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.app-raw-btn.active {
  background: #ff9500;
  border-color: #ff9500;
  color: #ffffff;
}

.app-cal-box {
  background: #f8fbff;
  border: 1px solid rgba(0, 163, 255, 0.22);
  border-radius: 14px;
  padding: 9px 11px;
  margin-bottom: 10px;
}

.app-cal-box input[type="range"] {
  width: 100%;
  accent-color: #ff9500;
  margin-top: 4px;
}

.app-ing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
}

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

/* Profile & Sources Exact Details */
.app-field-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-field-box {
  background: #ffffff;
  border: 1.2px solid rgba(0, 163, 255, 0.35);
  border-radius: 12px;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 9px;
}

.app-field-box.locked {
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-chip-static {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.app-chip-static.on {
  background: rgba(0, 163, 255, 0.16);
  color: #008ee0;
  border-color: rgba(0, 163, 255, 0.45);
}

/* Modal Sheets inside phone */
.app-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.54);
  z-index: 30;
  display: flex;
  align-items: flex-end;
  padding: 10px;
}

.app-sheet {
  width: 100%;
  background: #ffffff;
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  max-height: 82%;
  overflow-y: auto;
}

.app-meal-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0 14px;
}

.app-meal-type-btn {
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  border-radius: 12px;
  padding: 9px 10px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.app-meal-type-btn.active {
  border-color: #ff9500;
  background: #fff7ed;
  color: #c2410c;
}

/* Gallery Floating Picker Cards */
.app-gallery-tile {
  width: 100%;
  border: 1.5px solid rgba(0, 163, 255, 0.25);
  background: #f8fbff;
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  text-align: left;
  font-family: inherit;
  margin-bottom: 10px;
}

.app-gallery-tile:hover {
  border-color: #ff9500;
}

.app-gallery-tile img {
  width: 88px;
  height: 84px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Phone internal toast */
.app-toast {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 76px;
  z-index: 35;
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  padding: 10px 13px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Right Status Checklist Panel (Non-clickable guide + external copy hints!)
   -------------------------------------------------------------------------- */
.demo-guide {
  width: 348px;
  max-height: 764px;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 26px;
  padding: 20px 20px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.45);
  overflow-y: auto;
}

.demo-guide-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.demo-guide-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #0284c7;
  background: #e0f2fe;
  padding: 4px 10px;
  border-radius: 999px;
}

.demo-guide-progress {
  font-size: 11.5px;
  font-weight: 800;
  color: #ff9500;
}

.demo-guide h1 {
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
  line-height: 1.2;
}

.demo-guide-sub {
  font-size: 12.5px;
  color: #475569;
  margin: 0 0 13px;
  line-height: 1.45;
}

.demo-missions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.demo-mission-item {
  border: 1.3px solid #e2e8f0;
  background: #f8fbff;
  border-radius: 14px;
  padding: 9px 11px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.demo-mission-item.done {
  border-color: rgba(16, 185, 129, 0.45);
  background: #ecfdf5;
}

.demo-mission-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
  background: #e0f2fe;
  color: #0284c7;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.demo-mission-item.done .demo-mission-check {
  background: #10b981;
  color: #ffffff;
}

.demo-mission-title {
  display: block;
  font-size: 12.8px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.demo-mission-desc {
  display: block;
  font-size: 11.4px;
  color: #475569;
  margin-top: 2px;
  line-height: 1.35;
}

.demo-mission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.demo-mission-tag {
  font-size: 10.4px;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid rgba(0, 163, 255, 0.25);
  border-radius: 999px;
  padding: 2px 7px;
  line-height: 1.3;
}

.demo-hint-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  border: 1px solid rgba(0, 163, 255, 0.35);
  background: #ffffff;
  color: #0284c7;
  border-radius: 8px;
  padding: 2px 8px;
  font-family: inherit;
  font-size: 10.8px;
  font-weight: 700;
  cursor: pointer;
}

.demo-hint-copy:hover {
  background: #e0f2fe;
}

.demo-guide-footer {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.demo-guide-reset {
  flex: 1;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  border-radius: 12px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.demo-guide-reset:hover {
  border-color: #00a3ff;
  color: #008ee0;
}

/* Demo disabilitata e nascosta su smartphone (< 768px): disponibile solo su PC e Tablet */
@media (max-width: 767px) {
  [data-open-demo],
  .hero-demo-row,
  .demo-cta-wrap,
  dialog.demo-modal {
    display: none !important;
  }
}
