:root {
  --bg: #F7FAF8;
  --surface: #FFFFFF;
  --surface-soft: #EEF4F1;
  --ink: #0F172A;
  --ink-muted: #475569;
  --border: #DCE6E1;
  --border-strong: #C2D1CA;
  --brand: #059669;
  --brand-hover: #047857;
  --brand-soft: #E8F7F1;
  --accent: #D97706;
  --accent-hover: #B45309;
  --accent-soft: #FEF3E2;
  --danger: #DC2626;
  --danger-soft: #FEECEC;

  /* Strict 0px Swiss architectural geometry — zero border-radius */
  --radius-xs: 0px;
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;

  /* Layered subtle depth only where elevation is meaningful */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 14px 32px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.05);

  --font-display: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: var(--font-display);
  text-wrap: balance;
}

p, li {
  text-wrap: pretty;
}

img {
  outline: 1px solid rgba(0, 0, 0, 0.08);
  outline-offset: -1px;
}

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

.tabular {
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

.ui-icon {
  display: inline-block;
  vertical-align: -2px;
  flex-shrink: 0;
}

.leftover-table {
  border: 1px solid var(--border);
  background: var(--surface);
  margin: 12px 0;
}

.leftover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  gap: 12px;
}

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

.carry-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  background: var(--brand-soft);
  color: var(--brand-hover);
  margin-left: 6px;
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 40px;
}

.wizard-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 60px);
}

.dashboard-container {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== Header & Progress ===== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  min-height: 44px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-badge {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--brand-soft);
  color: var(--brand-hover);
  letter-spacing: 0.03em;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition-property: background-color, border-color, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.icon-btn:hover {
  background: var(--surface-soft);
  border-color: var(--border-strong);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn.invisible {
  visibility: hidden;
  pointer-events: none;
}

.progress-segments {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 5px;
  margin-bottom: 10px;
}

.progress-seg {
  height: 4px;
  border-radius: 0;
  background: #DCE6E1;
  transition-property: background-color;
  transition-duration: 200ms;
  transition-timing-function: ease-out;
}

.progress-seg.done {
  background: var(--brand);
}

.progress-seg.active {
  background: var(--accent);
}

.step-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 14px;
}

.step-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.step-subtitle {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--ink-muted);
}

.step-content {
  flex: 1;
  padding-bottom: 12px;
}

/* ===== Wizard Hero Strip (Step 1) ===== */
.wizard-hero-strip {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 118px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.wizard-hero-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wizard-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(15, 23, 42, 0.84) 0%, rgba(15, 23, 42, 0.28) 100%);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
}

/* ===== Cards & Store Grid ===== */
.store-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.select-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition-property: border-color, background-color, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.select-card:hover {
  border-color: var(--border-strong);
  background: #FCFDFC;
}

.select-card:active {
  transform: scale(0.97);
}

.select-card.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.select-card .check-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-xs);
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
}

.select-card.selected .check-dot {
  display: flex;
}

.store-logo-svg {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-logo-svg svg,
.store-logo-sm svg {
  width: 100%;
  height: 100%;
  display: block;
}

.store-logo-sm {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.card-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.card-sub {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.3;
}

.geo-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.geo-bar-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.store-dist-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--brand-hover);
  background: var(--brand-soft);
  padding: 2px 5px;
  margin-top: -2px;
}

.select-card.unavailable {
  opacity: 0.45;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

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

@media (min-width: 440px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.emoji-lg {
  font-size: 30px;
  line-height: 1;
}

.emoji-md {
  font-size: 22px;
  line-height: 1;
}

/* ===== Panels, Counters & Toggles ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.panel-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-muted);
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: 0.04em;
}

.counter-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 6px 0 12px;
}

.counter-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition-property: background-color, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.counter-btn.plus {
  background: var(--brand-soft);
  border-color: #B4E2CE;
  color: var(--brand-hover);
}

.counter-btn:active {
  transform: scale(0.95);
}

.counter-val {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  color: var(--brand);
  min-width: 44px;
  text-align: center;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-pill {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: #CBD5D0;
  cursor: pointer;
  transition-property: background-color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.slider-pill::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: var(--radius-xs);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition-property: transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.switch input:checked + .slider-pill {
  background: var(--brand);
}

.switch input:checked + .slider-pill::before {
  transform: translateX(22px);
}

.callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  font-size: 14px;
  color: var(--ink);
  margin-top: 12px;
}

.callout.warm {
  background: var(--accent-soft);
  border-color: #F6D5A8;
  border-left-color: var(--accent);
}

.callout.good {
  background: var(--brand-soft);
  border-color: #B9E4D1;
  border-left-color: var(--brand);
}

.callout.warn {
  background: var(--danger-soft);
  border-color: #F5C2C2;
  border-left-color: var(--danger);
}

/* ===== Meal Checkboxes ===== */
.section-caption {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-muted);
  margin: 16px 0 8px;
  letter-spacing: 0.04em;
}

.check-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition-property: background-color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.check-row:hover {
  background: #F9FCFA;
}

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

.check-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 15px;
}

.check-box {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  border: 1.5px solid #B8C7BF;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  transition-property: background-color, border-color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.check-row.checked .check-box {
  background: var(--brand);
  border-color: var(--brand);
}

/* ===== Budget Slider ===== */
.budget-hero {
  text-align: center;
  margin: 10px 0 18px;
}

.budget-input-wrap {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  border-bottom: 2px solid var(--border-strong);
  padding-bottom: 4px;
}

.budget-input {
  width: 155px;
  text-align: center;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  color: var(--brand);
  outline: none;
}

.budget-currency {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--brand);
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #DCE6E1;
  outline: none;
  cursor: pointer;
  margin: 18px 0 10px;
  touch-action: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
  cursor: grab;
}

.range-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  background: var(--brand-hover);
  transform: scale(1.08);
}

.range-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 0;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
  cursor: grab;
}

.range-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* ===== Body Stats Inputs ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.stat-field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.stat-field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 3px;
}

.stat-field input {
  width: 100%;
  border: none;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  outline: none;
  background: transparent;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill-btn {
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition-property: background-color, border-color, color, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.pill-btn:hover {
  border-color: var(--border-strong);
}

.pill-btn:active {
  transform: scale(0.97);
}

.pill-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ===== Full-Bleed Photo Swipe Deck (Step 7) ===== */
.swipe-stage {
  position: relative;
  height: 380px;
  margin: 4px 0 16px;
}

.swipe-card {
  position: absolute;
  inset: 0;
  background: #0F172A;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grab;
  transition-property: transform, opacity;
  transition-duration: 200ms;
  transition-timing-function: ease-out;
}

.swipe-card.dragging {
  transition: none;
  cursor: grabbing;
}

.swipe-card.bg-card {
  transform: scale(0.95) translateY(12px);
  opacity: 0.6;
  pointer-events: none;
}

.swipe-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.swipe-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.42) 0%,
    rgba(15, 23, 42, 0.06) 36%,
    rgba(15, 23, 42, 0.80) 76%,
    rgba(15, 23, 42, 0.94) 100%
  );
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
}

.swipe-top-pill {
  align-self: flex-start;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.swipe-badge {
  position: absolute;
  top: 20px;
  z-index: 5;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  border: 2px solid;
  opacity: 0;
  pointer-events: none;
}

.swipe-badge.like {
  left: 16px;
  color: #fff;
  border-color: #34D399;
  background: rgba(5, 150, 105, 0.88);
}

.swipe-badge.nope {
  right: 16px;
  color: #fff;
  border-color: #F87171;
  background: rgba(220, 38, 38, 0.88);
}

.swipe-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.24;
  letter-spacing: -0.02em;
}

.swipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.glass-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.swipe-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.swipe-btn {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition-property: transform, background-color, border-color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.swipe-btn:active {
  transform: scale(0.94);
}

.swipe-btn.nope {
  color: var(--danger);
  border-color: #F3C4C4;
}

.swipe-btn.like {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.swipe-btn.undo {
  width: 44px;
  height: 44px;
  font-size: 17px;
  color: var(--ink-muted);
}

.swipe-done-box {
  height: 100%;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 8px;
}

/* ===== Custom Stop-list Input ===== */
.input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.text-input {
  flex: 1;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition-property: border-color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.text-input:focus {
  border-color: var(--brand);
}

.add-btn {
  width: 46px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}

.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.chip-tag button {
  border: none;
  background: transparent;
  color: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

/* ===== Buttons ===== */
.footer-actions {
  margin-top: 20px;
  padding-top: 10px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 78%, rgba(247, 250, 248, 0));
}

.btn-primary {
  width: 100%;
  min-height: 48px;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition-property: background-color, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.btn-primary:hover {
  background: var(--brand-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition-property: background-color, border-color, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.btn-secondary:hover {
  background: var(--surface-soft);
}

.btn-secondary:active {
  transform: scale(0.97);
}

.btn-glass {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition-property: background-color, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.24);
}

.btn-glass:active {
  transform: scale(0.97);
}

.btn-accent {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition-property: background-color, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-accent:active {
  transform: scale(0.97);
}

.link-btn {
  border: none;
  background: transparent;
  color: var(--brand);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}

/* ===== EDITORIAL DASHBOARD HERO ===== */
.dash-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: #fff;
  background: #0F231B;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.dash-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}

.dash-hero-content {
  position: relative;
  z-index: 2;
  background: linear-gradient(105deg, rgba(12, 34, 24, 0.94) 0%, rgba(12, 34, 24, 0.72) 65%, rgba(12, 34, 24, 0.45) 100%);
  padding: 20px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dash-hero .brand-mark {
  color: #fff;
  font-size: 20px;
}

.dash-hero .brand-badge {
  background: rgba(16, 185, 129, 0.22);
  color: #6EE7B7;
  border: 1px solid rgba(110, 231, 183, 0.35);
}

.dash-summary-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 680px) {
  .dash-summary-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* Concentric tab-bar: outer 10px, padding 4px -> inner 6px (6 + 4 = 10px!) */
.tab-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  background: var(--surface-soft);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

@media (min-width: 560px) {
  .tab-bar {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tab-btn {
  min-height: 40px;
  padding: 9px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition-property: background-color, color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.tab-btn:hover {
  color: var(--ink);
}

.tab-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

/* Day switcher */
.day-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.day-pills::-webkit-scrollbar {
  display: none;
}

.day-pill {
  flex: 1;
  min-width: 72px;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  transition-property: background-color, border-color, color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.day-pill:hover {
  border-color: var(--border-strong);
}

.day-pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.day-pill-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.day-pill-meta {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
}

/* ===== Photo Meal Cards ===== */
.meals-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 720px) {
  .meals-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.meal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition-property: border-color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.meal-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.meal-photo-wrap {
  position: relative;
  height: 164px;
  overflow: hidden;
  cursor: pointer;
  background: #E5ECE8;
}

.meal-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition-property: transform;
  transition-duration: 280ms;
  transition-timing-function: ease-out;
}

.meal-card:hover .meal-photo-wrap img {
  transform: scale(1.03);
}

.meal-photo-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.meal-type-glass,
.meal-time-glass {
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

.meal-photo-bottom-tags {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.meal-body {
  padding: 14px 16px 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 12px;
}

.batch-badge {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(217, 119, 6, 0.94);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

.meal-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  cursor: pointer;
  letter-spacing: -0.01em;
}

.meal-name:hover {
  color: var(--brand);
}

.meal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
  font-weight: 600;
  margin-top: 6px;
}

.meal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.meal-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  color: var(--ink);
}

/* ===== Shopping List, Promos & Fridge ===== */
.promo-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
  color: var(--accent-hover);
  margin-left: 6px;
}

.fridge-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: rgba(2, 132, 199, 0.92);
  color: #fff;
}

.fridge-pill-soft {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: #E0F2FE;
  color: #0369A1;
  margin-left: 6px;
}

.old-price {
  font-size: 12px;
  color: var(--ink-muted);
  text-decoration: line-through;
  margin-right: 5px;
  font-weight: 600;
}

.fridge-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.fridge-chip {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition-property: background-color, border-color, color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.fridge-chip.active {
  background: #E0F2FE;
  border-color: #0284C7;
  color: #0369A1;
}

.promo-toggle-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  margin-bottom: 12px;
}

.shop-cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
}

.shop-cat-title {
  background: var(--surface-soft);
  padding: 9px 15px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.shop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  gap: 12px;
  transition-property: background-color, opacity;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.shop-item:hover {
  background: #F9FCFA;
}

.shop-item:last-child {
  border-bottom: none;
}

.shop-item.owned {
  opacity: 0.46;
  text-decoration: line-through;
}

.shop-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-item-right {
  text-align: right;
  white-space: nowrap;
}

.shop-qty {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-muted);
}

.shop-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

/* Store Comparison (concentric inside .panel: outer 10px -> inner 6px) */
.compare-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 8px;
  transition-property: border-color, background-color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.compare-row:hover {
  border-color: var(--border-strong);
}

.compare-row.current {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* Macro Bars */
.bar-row {
  margin-bottom: 14px;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.bar-track {
  height: 8px;
  border-radius: var(--radius-xs);
  background: var(--surface-soft);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-xs);
  background: var(--brand);
  transition-property: width;
  transition-duration: 300ms;
  transition-timing-function: ease-out;
}

.craving-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
}

.craving-chip {
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition-property: border-color, color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.craving-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.select-field {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  outline: none;
}

.share-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius-md);
  background: #E0F2FE;
  border: 1px solid #BAE6FD;
  color: #075985;
  font-size: 13.5px;
}

/* ===== Photo Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

@media (min-width: 600px) {
  .modal-backdrop {
    align-items: center;
  }
}

.modal-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.modal-hero-photo {
  position: relative;
  height: 200px;
  width: 100%;
  background: #0F172A;
  flex-shrink: 0;
}

.modal-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.88) 0%, rgba(15, 23, 42, 0.14) 60%, rgba(15, 23, 42, 0.35) 100%);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
}

.modal-close-float {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
}

.modal-emoji {
  font-size: 30px;
}

.modal-title {
  margin: 0;
  font-size: 18.5px;
  font-weight: 700;
  line-height: 1.25;
}

.modal-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.modal-hero-scrim .modal-subtitle {
  color: rgba(255, 255, 255, 0.86);
}

.modal-body {
  padding: 18px 20px 24px;
  overflow-y: auto;
}

.recipe-ing-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}

.recipe-ing-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14.5px;
}

.recipe-steps {
  padding-left: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14.5px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  z-index: 200;
}

/* ===== Mobile Native Feel (<= 600px) ===== */
@media (max-width: 600px) {
  .app-shell {
    padding: max(18px, env(safe-area-inset-top)) 12px calc(84px + env(safe-area-inset-bottom));
  }

  .step-title {
    font-size: 22px;
  }

  .dash-hero-content {
    padding: 16px;
  }

  .kpi-value {
    font-size: 19px;
  }

  /* Липкая верхняя панель вкладок — не перекрывается нижней плашкой хостинга */
  .tab-bar {
    position: sticky;
    top: 0;
    z-index: 90;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
  }

  .tab-btn {
    padding: 8px 4px;
    font-size: 11.5px;
    line-height: 1.25;
    border-radius: var(--radius-sm);
    flex-direction: column;
    gap: 2px;
  }

  .tab-btn.active {
    background: var(--brand-soft);
    color: var(--brand-hover);
    box-shadow: none;
  }

  /* Отступ снизу у кнопки «Далее» в анкете, чтобы плашка Netlify её не перекрывала */
  .footer-actions {
    padding-bottom: 56px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 0;
  }

  .modal-sheet {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .toast {
    bottom: calc(68px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 32px);
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .tab-bar, .footer-actions, .btn-secondary, .btn-primary, .btn-accent, .btn-glass, .day-pills {
    display: none !important;
  }
  body {
    background: #fff;
  }
}
