/* ═══════════════════════════════════════
   MADPLAN — Nordic Precision Design System
   ═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
  /* ── Primary ── */
  --primary:        #22C55E;
  --primary-dark:   #16A34A;
  --primary-darker: #15803D;
  --primary-bg:     #F0FDF4;
  --primary-border: #BBF7D0;

  /* ── Neutrals ── */
  --slate-900: #0F172A;
  --slate-800: #1E293B;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748B;
  --slate-400: #94A3B8;
  --slate-300: #CBD5E1;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;
  --slate-50:  #F8FAFC;

  /* ── Semantic colours (kept for JS compatibility) ── */
  --moss-50:   #F0FDF4;
  --moss-100:  #DCFCE7;
  --moss-200:  #BBF7D0;
  --moss-700:  #15803D;
  --moss-800:  #166534;
  --moss-900:  #14532D;
  --rye-50:    #FFFBEB;
  --rye-100:   #FEF3C7;
  --rye-800:   #92400E;
  --fjord-50:  #F0FDFA;
  --fjord-100: #CCFBF1;
  --fjord-800: #115E59;
  --stone-100: #F1F5F9;
  --stone-200: #E2E8F0;
  --stone-800: #1E293B;
  --berry-50:  #FEF2F2;
  --berry-100: #FEE2E2;
  --berry-400: #F87171;
  --berry-600: #DC2626;
  --berry-800: #991B1B;
  --amber-50:  #FFFBEB;
  --amber-100: #FEF3C7;
  --amber-600: #D97706;
  --amber-800: #92400E;
  --teal-50:   #F0FDFA;
  --teal-100:  #CCFBF1;
  --teal-600:  #0D9488;
  --teal-800:  #115E59;
  --coral-400: #FB923C;
  --coral-600: #EA580C;

  /* ── App tokens ── */
  --bg:            #EFEFEB;
  --card:          #FFFFFF;
  --border:        rgba(0,0,0,0.07);
  --border-hover:  rgba(0,0,0,0.14);
  --border-strong: rgba(0,0,0,0.18);

  --text:       #0F172A;
  --muted:      #64748B;
  --light:      #94A3B8;
  --faint:      #CBD5E1;

  --accent:       #22C55E;
  --accent-light: #4ADE80;
  --accent-hover: #16A34A;
  --accent-bg:    #F0FDF4;

  /* ── Grønne aliases (bruges i app.js) ── */
  --green-50:  #F0FDF4;
  --green-100: #DCFCE7;

  /* ── Typography ── */
  --font:      'Inter', system-ui, -apple-system, sans-serif;
  --font-head: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* ── Geometry ── */
  --r:      12px;
  --r-sm:   8px;
  --r-xs:   5px;
  --r-lg:   18px;
  --r-full: 100px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);

  /* ── Nav ── */
  --nav-h: 68px;
}

html {
  scroll-behavior: smooth;
  height: 100%;
  /* Ingen bounce/gummi på iOS */
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport height på mobile */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  /* Fjern grå flash ved tap på iOS */
  -webkit-tap-highlight-color: transparent;
}

/* Fjern 300ms tap-delay + double-tap-zoom på alle interaktive elementer */
button, a, [role="button"],
.nav-item, .day-card, .shop-card, .recipe-card,
.auth-tab, .gen-btn, .swap-btn, .action-btn {
  touch-action: manipulation;
}

/* ═══════════════════
   AUTH
   ═══════════════════ */

#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(2rem + env(safe-area-inset-top, 0px)) 1.5rem calc(2rem + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
}

.auth-card {
  background: var(--card);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.auth-emblem {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 24px;
  box-shadow: 0 8px 24px rgba(34,197,94,0.3);
}

.auth-logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.5px;
}

.auth-logo em { color: var(--primary); font-style: normal; }

.auth-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 2rem;
  font-weight: 400;
}

.auth-tabs {
  display: flex;
  gap: 3px;
  background: var(--slate-100);
  border-radius: var(--r-sm);
  padding: 3px;
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: var(--r-xs);
  font-family: var(--font);
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.auth-tab.active {
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.demo-hint { font-size: 12px; color: var(--faint); margin-top: 1rem; }

.auth-link-btn {
  background: none;
  border: none;
  padding: 4px 0;
  font-family: var(--font);
  font-size: 13px;
  color: var(--green-600);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s;
}
.auth-link-btn:hover { text-decoration-color: var(--green-600); }

.auth-error {
  background: var(--berry-50);
  border: 1px solid var(--berry-100);
  color: var(--berry-600);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 1rem;
  text-align: left;
}

/* ═══════════════════
   FORM ELEMENTS
   ═══════════════════ */

.input-group { text-align: left; margin-bottom: 1rem; }

.input-group label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.input-group input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
  padding: 11px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--r-sm);
  background: var(--slate-50);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.input-group input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
  background: white;
}

select {
  padding: 9px 12px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--r-sm);
  background: var(--slate-50);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(34,197,94,0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(34,197,94,0.35);
}

.btn-primary:active { transform: translateY(0); }

/* ═══════════════════
   APP LAYOUT
   ═══════════════════ */

#app-screen { min-height: 100vh; }

.layout {
  max-width: 520px;
  margin: 0 auto;
  /* Undgå at indhold gemmer sig bag bottom nav + home bar */
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 1rem);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Hide old sidebar */
.sidebar { display: none !important; }

.main {
  padding: 0 1rem 0;
  max-width: 100%;
}

.page { display: none; }
.page.active {
  display: block;
  animation: pageIn 0.18s ease;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Press-feedback (native feel) ── */
.btn-primary:active        { transform: scale(0.97); transition: transform 0.08s; }
.nav-item:active           { opacity: 0.55; transform: scale(0.88); transition: transform 0.08s, opacity 0.08s; }
.shop-card:active          { transform: scale(0.95); transition: transform 0.08s; }
.day-card:active           { transform: scale(0.98); transition: transform 0.08s; }
.recipe-card:active        { transform: scale(0.97); transition: transform 0.08s; }
.action-btn:active         { transform: scale(0.92); transition: transform 0.08s; }
.gen-btn:active            { transform: scale(0.97); transition: transform 0.08s; }
.swap-btn:active           { transform: scale(0.93); transition: transform 0.08s; }
.auth-tab:active           { transform: scale(0.95); transition: transform 0.08s; }

/* ── Top bar — udvides ind i status bar (safe area) ── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  /* Skyder indhold ned under status bar (notch/Dynamic Island) */
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-bar-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.top-bar-logo em { color: var(--primary); font-style: normal; }

.top-bar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  cursor: pointer;
}

/* ── Bottom nav — udvides ind i home bar (safe area) ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  /* Højde: nav + home bar på iPhone */
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start; /* items øverst, home bar er luft nedenunder */
  justify-content: space-around;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  padding: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  cursor: pointer;
  flex: 1;
  color: var(--slate-400);
  transition: color 0.15s;
  user-select: none;
  border: none;
  background: none;
  text-decoration: none;
}

.nav-item:hover { color: var(--slate-600); }

.nav-item.active { color: var(--primary); }

.nav-icon { font-size: 22px; line-height: 1; }

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ═══════════════════
   PAGE HEADERS
   ═══════════════════ */

.page-head {
  padding: 0.25rem 0 1.25rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-title em { color: var(--primary); font-style: normal; }

.page-sub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 5px;
  font-weight: 400;
}

/* ═══════════════════
   SECTIONS
   ═══════════════════ */

.section {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 7px;
}

.section-icon { font-size: 14px; }

.field-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ═══════════════════
   GRIDS
   ═══════════════════ */

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

/* ═══════════════════
   COUNTERS
   ═══════════════════ */

.counter { display: flex; align-items: center; gap: 12px; }

.counter-btn {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--slate-200);
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
  user-select: none;
  font-weight: 400;
}

.counter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

.counter-val {
  font-size: 2rem;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
  color: var(--text);
  line-height: 1;
}

.counter-label { font-size: 13px; color: var(--muted); }

/* ═══════════════════
   SHOP CARDS
   ═══════════════════ */

.shop-card {
  border: 2px solid var(--slate-200);
  border-radius: var(--r);
  padding: 12px 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  background: var(--card);
  user-select: none;
  position: relative;
}

.shop-card:hover { border-color: var(--slate-300); }

.shop-card.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.shop-card.selected::after {
  content: '✓';
  position: absolute;
  top: 5px; right: 7px;
  font-size: 10px;
  color: var(--primary);
  font-weight: 800;
}

.shop-logo {
  font-size: 22px;
  margin-bottom: 5px;
  display: block;
}

.shop-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

.shop-badge {
  font-size: 10px;
  color: var(--faint);
  margin-top: 2px;
  font-weight: 400;
}

.shop-card.selected .shop-name { color: var(--primary-darker); }

/* ═══════════════════
   TAGS
   ═══════════════════ */

.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }

.tag {
  padding: 7px 14px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--slate-200);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--card);
  user-select: none;
  font-weight: 500;
}

.tag:hover { border-color: var(--primary); color: var(--primary); }

.tag.active {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary-darker);
  font-weight: 700;
}

/* ═══════════════════
   INGREDIENT ROWS
   ═══════════════════ */

.ingredient-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ingredient-row input[type="text"] { flex: 1; padding: 9px 12px; font-size: 14px; }

.remove-btn {
  width: 30px; height: 30px;
  border: none; background: transparent;
  color: var(--faint); cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
  flex-shrink: 0;
}

.remove-btn:hover { background: var(--berry-50); color: var(--berry-600); }

.add-btn {
  padding: 9px 14px;
  border: 1.5px dashed var(--slate-200);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-top: 4px;
  font-weight: 500;
}

.add-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ═══════════════════
   PREFERENCES
   ═══════════════════ */

.pref-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.pref-row input[type="text"] { flex: 1; font-size: 14px; }
.pref-count { width: 90px !important; text-align: center; font-size: 14px; }

/* ═══════════════════
   OPT BUTTONS
   ═══════════════════ */

.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 1.25rem; }

.opt-btn {
  padding: 14px 12px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--r);
  background: var(--card);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.opt-btn:hover { border-color: var(--slate-300); }

.opt-btn.active {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.opt-btn.active::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.opt-btn-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.opt-btn.active .opt-btn-title { color: var(--primary-darker); }
.opt-btn-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }

/* ═══════════════════
   BUDGET
   ═══════════════════ */

.budget-row { display: flex; align-items: center; gap: 12px; }
.budget-row input[type="number"] { width: 130px !important; font-size: 1.1rem; font-weight: 600; }
.budget-currency { font-size: 1rem; color: var(--muted); }
.budget-hint { font-size: 13px; color: var(--faint); }

/* ═══════════════════════════════════
   KIDS SECTION
   ═══════════════════════════════════ */

.kids-section {
  border-radius: var(--r-lg);
  margin-bottom: 0.75rem;
  overflow: hidden;
  border: 1.5px solid #FED7AA;
  background: var(--card);
}

.kids-header {
  background: #FFF7ED;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.kids-header:hover { background: #FFEDD5; }

.kids-header-left { display: flex; align-items: center; gap: 12px; }

.kids-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: #EA580C;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.kids-title { font-size: 15px; font-weight: 700; color: #7C2D12; }
.kids-sub { font-size: 12px; color: #9A3412; margin-top: 2px; }

.kids-toggle { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.kids-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.kids-toggle-track {
  position: absolute; inset: 0;
  border-radius: 100px;
  background: var(--slate-200);
  transition: background 0.25s;
  cursor: pointer;
}

.kids-toggle input:checked + .kids-toggle-track { background: #EA580C; }

.kids-toggle-thumb {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: white;
  top: 3px; left: 3px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.kids-toggle input:checked ~ .kids-toggle-thumb { transform: translateX(20px); }

.kids-body {
  display: none;
  background: #FFF7ED;
  border-top: 1px solid #FED7AA;
  padding: 1.1rem 1.25rem 1.25rem;
}

.kids-body.open { display: block; }

.kids-field-label {
  font-size: 11px;
  font-weight: 700;
  color: #9A3412;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  margin-top: 1.25rem;
}

.kids-field-label:first-child { margin-top: 0; }

.kids-age-row { display: flex; gap: 8px; flex-wrap: wrap; }

.kids-age-chip {
  padding: 7px 14px;
  border-radius: var(--r-full);
  border: 1.5px solid #FED7AA;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  color: #9A3412;
  user-select: none;
}

.kids-age-chip:hover { border-color: #EA580C; color: #EA580C; }
.kids-age-chip.active { background: #EA580C; border-color: #EA580C; color: white; }

.kids-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }

.kids-option {
  padding: 12px;
  border: 1.5px solid #FED7AA;
  border-radius: var(--r);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.kids-option:hover { border-color: #EA580C; }
.kids-option.active { border-color: #EA580C; background: #FFF7ED; }
.kids-option-icon { font-size: 20px; margin-bottom: 5px; }
.kids-option-title { font-size: 13px; font-weight: 700; color: #7C2D12; }
.kids-option.active .kids-option-title { color: #EA580C; }
.kids-option-desc { font-size: 11px; color: #9A3412; margin-top: 2px; line-height: 1.4; }

.kids-info-box {
  margin-top: 1rem;
  padding: 10px 12px;
  background: rgba(234,88,12,0.07);
  border-radius: var(--r-sm);
  border-left: 3px solid #EA580C;
  font-size: 13px;
  color: #7C2D12;
  line-height: 1.5;
}

/* ═══════════════════
   GENERATE BUTTON
   ═══════════════════ */

.gen-btn {
  width: 100%;
  padding: 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-lg);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(34,197,94,0.35);
  margin-bottom: 0.75rem;
}

.gen-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(34,197,94,0.4);
}

.gen-btn:active { transform: translateY(0); }
.gen-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ═══════════════════
   OFFERS ROW
   ═══════════════════ */

.offers-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.offers-row::-webkit-scrollbar { display: none; }

.offer-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--slate-200);
  font-size: 11px;
  font-weight: 600;
  background: var(--card);
  white-space: nowrap;
}

.offer-chip.netto { border-color: #D4B800; color: #6b5c00; background: #FFFBDC; }
.offer-chip.rema  { border-color: #CC0010; color: #7a000a; background: #FDE8EA; }
.offer-chip.lidl  { border-color: #0050AA; color: #002855; background: #E0EAFB; }
.offer-chip.disc  { border-color: #1976D2; color: #0d3c7a; background: #E3F2FD; }
.offer-chip.spar  { border-color: #E65100; color: #7a2900; background: #FFF3E0; }
.offer-chip.meny  { border-color: #424242; color: #111;    background: #F5F5F5; }
.offer-chip.aldi  { border-color: #1565C0; color: #0a2a5e; background: #E8EAF6; }
.offer-chip.coop  { border-color: #2E7D32; color: #1b4d1e; background: #E8F5E9; }

/* ═══════════════════
   LOADING
   ═══════════════════ */

.loading-state { text-align: center; padding: 4rem 2rem; }

.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--primary-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

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

.loading-text { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.loading-sub { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ═══════════════════
   PLAN OUTPUT
   ═══════════════════ */

.plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.plan-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.4px; }
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.action-btn {
  padding: 8px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}

.action-btn:hover { border-color: var(--primary); color: var(--primary); }

.action-btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(34,197,94,0.25);
}

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

.total-bar {
  background: var(--primary-bg);
  border: 1.5px solid var(--primary-border);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.total-label { font-size: 11px; color: var(--primary-darker); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.total-amount { font-size: 1.5rem; font-weight: 800; color: var(--primary-darker); }

/* ── Day cards with photo ── */
.day-card {
  background: var(--card);
  border-radius: var(--r-lg);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.day-card-photo-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.day-card-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: var(--slate-100);
}

.day-card-photo-credit {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 10px;
  color: rgba(255,255,255,0.75);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.day-card-photo-credit a {
  color: inherit;
  text-decoration: none;
}

.day-card-photo-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--slate-100) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}

.day-card-body { padding: 1rem 1.25rem 1.25rem; }

.day-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--light);
  margin-bottom: 2px;
}

.day-date {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: -0.3px;
}

.meal-row {
  display: flex;
  gap: 0.75rem;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  align-items: flex-start;
}

.meal-type {
  font-size: 10px;
  font-weight: 700;
  color: var(--light);
  width: 80px;
  flex-shrink: 0;
  padding-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meal-info { flex: 1; min-width: 0; }
.meal-name { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }
.meal-detail { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.meal-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

.badge {
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
}

.badge-green  { background: var(--primary-bg);   color: var(--primary-darker); }
.badge-amber  { background: var(--amber-50);      color: var(--amber-800); }
.badge-teal   { background: var(--teal-50);       color: var(--teal-800); }
.badge-gray   { background: var(--slate-100);     color: var(--slate-700); }
.badge-coral  { background: #FFF7ED;              color: #9A3412; }
.badge-veg    { background: var(--primary-bg);    color: var(--primary-darker); }

.meal-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-darker);
  white-space: nowrap;
  padding-top: 2px;
  flex-shrink: 0;
}

/* ═══════════════════
   SWAP BUTTON
   ═══════════════════ */

.swap-btn {
  padding: 5px 10px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  font-weight: 600;
}

.swap-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

/* ═══════════════════
   SHOPPING LIST
   ═══════════════════ */

.shop-list { margin-top: 1.5rem; }

.shop-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.shop-list-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.3px; }

.shop-section {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.shop-section-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.shop-section-badge { padding: 2px 9px; border-radius: var(--r-full); font-size: 10px; font-weight: 700; text-transform: none; letter-spacing: 0; }

.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.2s;
}

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

.shop-cb {
  width: 21px; height: 21px;
  border: 2px solid var(--slate-300);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  user-select: none;
}

.shop-cb:hover { border-color: var(--primary); }
.shop-cb.checked { background: var(--primary); border-color: var(--primary); }
.shop-cb.checked::after { content: '✓'; font-size: 12px; color: #fff; font-weight: 700; }

.shop-item-name { flex: 1; font-size: 14px; color: var(--text); font-weight: 500; }
.shop-item-amount { font-size: 13px; color: var(--muted); }
.shop-item-price { font-size: 13px; color: var(--primary-dark); font-weight: 700; }
.shop-item.done .shop-item-name { text-decoration: line-through; color: var(--faint); }
.shop-item.done { opacity: 0.55; }

/* ═══════════════════
   HISTORY
   ═══════════════════ */

.history-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

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

.history-meta { display: flex; justify-content: space-between; align-items: flex-start; }
.history-date { font-size: 11px; color: var(--light); }
.history-title { font-size: 1rem; font-weight: 700; margin: 5px 0 2px; }
.history-stat { font-size: 13px; color: var(--muted); }
.history-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ═══════════════════
   EMPTY STATE
   ═══════════════════ */

.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.25; }
.empty-text { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.empty-sub { font-size: 13px; margin-top: 8px; color: var(--muted); }

/* ═══════════════════
   PROFILE
   ═══════════════════ */

.profile-section {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.profile-avatar-big {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(34,197,94,0.3);
}

.profile-name { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.3px; }
.profile-email-text { font-size: 14px; color: var(--muted); margin-top: 3px; }
.profile-joined { font-size: 12px; color: var(--light); margin-top: 3px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }

.stat-card {
  background: var(--primary-bg);
  border-radius: var(--r);
  padding: 1rem;
  text-align: center;
  border: 1.5px solid var(--primary-border);
}

.stat-num { font-size: 2rem; font-weight: 800; color: var(--primary-darker); line-height: 1; }
.stat-lbl { font-size: 10px; color: var(--muted); margin-top: 5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

/* ═══════════════════
   MODAL
   ═══════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--card);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
  gap: 1rem;
}

.modal-title { font-size: 1.1rem; font-weight: 800; }
.modal-context { font-size: 12px; color: var(--muted); margin-top: 2px; }

.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--slate-100);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: all 0.15s;
  flex-shrink: 0;
}

.modal-close:hover { background: var(--berry-100); color: var(--berry-600); }
.modal-body { padding: 1rem 1.25rem 1.5rem; }

.alt-card {
  border: 1.5px solid var(--slate-200);
  border-radius: var(--r);
  padding: 1rem 1.1rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--slate-50);
}

.alt-card:last-child { margin-bottom: 0; }

.alt-card:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.alt-card-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.alt-card-desc { font-size: 13px; color: var(--muted); line-height: 1.4; }
.alt-card-meta { display: flex; gap: 7px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.alt-card-price { font-size: 14px; font-weight: 700; color: var(--primary-dark); }

/* ═══════════════════
   RECIPE CATALOG
   ═══════════════════ */

.recipe-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.recipe-card {
  background: var(--card);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.recipe-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--primary-border);
}

.recipe-card-photo {
  width: 72px;
  height: 72px;
  border-radius: var(--r);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--slate-100);
}

.recipe-card-photo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--primary-bg), var(--slate-100));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.recipe-card-body { flex: 1; min-width: 0; }
.recipe-card-name { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }
.recipe-card-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.recipe-card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }

.recipe-card-score {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.recipe-score-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--slate-200);
}

.recipe-score-dot.active { background: var(--primary); }

.category-filter {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
  margin-bottom: 0.75rem;
}

.category-filter::-webkit-scrollbar { display: none; }

.cat-filter-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 1rem;
}

.cat-filter-row::-webkit-scrollbar { display: none; }

.cat-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--slate-200);
  font-size: 12px;
  font-weight: 600;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cat-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ═══════════════════
   RECIPE SEARCH
   ═══════════════════ */

.recipe-search-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}

.recipe-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.recipe-search {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--r-full);
  background: var(--card);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.recipe-search::placeholder { color: var(--light); }

.recipe-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
}

/* clear button (WebKit) */
.recipe-search::-webkit-search-cancel-button { cursor: pointer; }

/* ═══════════════════
   RECIPE CARD ARROW
   ═══════════════════ */

.recipe-card-arrow {
  font-size: 1.4rem;
  color: var(--slate-300);
  flex-shrink: 0;
  line-height: 1;
  margin-left: auto;
  padding-left: 4px;
}

/* ═══════════════════
   SHOPPING CTA
   ═══════════════════ */

.shopping-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-bg);
  border: 1.5px solid var(--primary-border);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.15s, box-shadow 0.15s;
}

.shopping-cta:hover {
  background: #dcfce7;
  box-shadow: 0 2px 12px rgba(34,197,94,0.15);
}

.shopping-cta-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.shopping-cta-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.shopping-cta-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-darker);
}

.shopping-cta-sub {
  font-size: 12px;
  color: var(--primary-dark);
  margin-top: 2px;
}

.shopping-cta-arrow {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 700;
}

/* ═══════════════════
   RECIPE DETAIL MODAL
   ═══════════════════ */

.recipe-detail-sheet {
  padding: 0;
  /* full modal scrolls via .modal overflow-y:auto */
}

.recipe-detail-sheet .modal-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.rd-category {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.rd-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  padding: 1rem 1.25rem 0.5rem;
  letter-spacing: -0.3px;
}

.rd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 1.25rem 1rem;
}

.rd-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--light);
  padding: 0 1.25rem 0.5rem;
}

.rd-ingredients {
  padding: 0 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rd-ingredient {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
}

.rd-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.rd-persons-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 1.25rem 1rem;
  font-size: 14px;
  color: var(--text);
}
.rd-persons-icon { font-size: 15px; }
.rd-persons-unit { color: var(--muted); }
.rd-persons-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  transition: border-color 0.15s;
}
.rd-persons-btn:hover { border-color: var(--primary); color: var(--primary); }
#rd-persons-val { font-weight: 700; min-width: 18px; text-align: center; }
.rd-scale-note {
  margin-left: 4px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.rd-steps-label { margin-top: 0.5rem; }

.rd-steps {
  padding: 0 1.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rd-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.rd-step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.rd-step-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.rd-steps-loading {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  padding: 0.25rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rd-steps-loading::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.rd-steps-error { font-size: 13px; color: var(--muted); padding: 0.25rem 0 1rem; }

/* ═══════════════════
   MEAL ACTIONS & SAVE BUTTON
   ═══════════════════ */

.meal-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
}

.save-meal-btn {
  background: none;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--r-full);
  font-size: 15px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s;
  line-height: 1;
}

.save-meal-btn:hover, .save-meal-btn.saved {
  border-color: #f43f5e;
  color: #f43f5e;
  background: #fff1f2;
}

/* ═══════════════════
   SAVED RECIPES SECTION
   ═══════════════════ */

.saved-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.saved-recipe-card {
  border-color: #fde68a;
  background: #fffbeb;
}

.delete-saved-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--light);
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s;
}

.delete-saved-btn:hover { color: #dc2626; }

/* ═══════════════════
   TOAST NOTIFICATION
   ═══════════════════ */

.mp-toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0F172A;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--r-full);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  white-space: nowrap;
}

.mp-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════
   CUSTOM SHOPPING ITEMS
   ═══════════════════ */

.custom-items-section {
  margin-top: 1.5rem;
  background: var(--card);
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--slate-200);
  padding: 1rem 1.25rem 1.25rem;
}

.custom-items-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.custom-item-add {
  display: flex;
  gap: 8px;
  margin-top: 0.75rem;
}

.custom-item-input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--r-full);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
}

.custom-item-input::placeholder { color: var(--light); }
.custom-item-input:focus { border-color: var(--primary); }

.custom-item-btn {
  padding: 9px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.custom-item-btn:hover { background: var(--primary-dark); }

/* ═══════════════════
   STORE BADGE COLOURS — Bilka, Føtex
   ═══════════════════ */

.badge-bilka  { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.badge-fotex  { background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }
.offer-chip.bilka { background: #EFF6FF; color: #1D4ED8; }
.offer-chip.fotex { background: #F0FDF4; color: #15803D; }

/* ═══════════════════
   MADPAKKER
   ═══════════════════ */

.lunch-day-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.lunch-box {
  margin-top: 0.6rem;
  padding: 0.9rem 1rem;
  background: var(--slate-50);
  border-radius: var(--r);
  border: 1px solid var(--border);
}

.lunch-box + .lunch-box { margin-top: 0.5rem; }

.lunch-box-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--light);
  margin-bottom: 0.5rem;
}

.lunch-items { list-style: none; }

.lunch-item {
  font-size: 13px;
  color: var(--text);
  padding: 2px 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
  line-height: 1.4;
}

.lunch-item::before { content: '·'; color: var(--primary); font-weight: 700; flex-shrink: 0; }
.lunch-price { font-size: 13px; color: var(--primary-dark); margin-top: 7px; font-weight: 700; }
.lunch-tip { font-size: 12px; color: var(--teal-600); margin-top: 5px; font-style: italic; }

/* ═══════════════════
   PRINT
   ═══════════════════ */

@media print {
  .bottom-nav, .plan-actions, .action-btn, .gen-btn, .swap-btn { display: none !important; }
  .layout { padding-bottom: 0; }
  body { background: white; }
}

/* ═══════════════════
   RESPONSIVE — Desktop
   ═══════════════════ */

@media (min-width: 560px) {
  .layout { max-width: 560px; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .modal { border-radius: var(--r-lg); }
  .modal-overlay { align-items: center; padding: 1.5rem; }
}

@media (max-width: 400px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .opt-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .kids-options { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════
   LOGOUT BTN
   ═══════════════════ */

.logout-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

.logout-btn:hover { border-color: var(--berry-400); color: var(--berry-600); }

/* ── user-pill (kept for JS refs) ── */
.user-pill { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 700; color: var(--text); }

/* ═══════════════════
   SKELETON LOADING
   ═══════════════════ */

@keyframes skel-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skel-line, .skel-photo {
  background: linear-gradient(90deg, var(--border) 25%, var(--slate-100) 50%, var(--border) 75%);
  background-size: 800px 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

.skel-photo {
  width: 100%;
  height: 100%;
  min-height: 140px;
  border-radius: 0;
}

.skel-card {
  opacity: 0.85;
}

.skel-line {
  display: block;
  margin-bottom: 0;
}

.stream-loading-bar {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  padding: 0.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stream-loading-bar::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.user-email { font-size: 11px; color: var(--muted); }
