/* ═══════════════════════════════════════════════════════════
   KrisFam Kitchen — Stylesheet
   Warm parchment · Indian spice palette · Senior-friendly
═══════════════════════════════════════════════════════════ */

/* ── 1. Custom Properties ──────────────────────────────── */
:root {
  /* Brand colours */
  --primary:          #7B3F00;   /* Rich saddle brown */
  --primary-dark:     #5A2D00;
  --primary-light:    #A0522D;
  --accent:           #C8941A;   /* Turmeric gold */
  --accent-muted:     rgba(200, 148, 26, 0.6);

  /* Backgrounds */
  --bg-deep:          #FBF3E3;   /* Warm parchment */
  --bg-card:          #FFFDF5;   /* Soft cream */
  --bg-surface:       #FFF8EC;
  --bg-dark:          #2C1408;

  /* Text */
  --text-primary:     #1A0800;
  --text-secondary:   #4A2510;
  --text-muted:       #8B6040;
  --text-on-dark:     #FBF3E3;

  /* Borders */
  --border-subtle:    rgba(123, 63, 0, 0.15);
  --border-active:    rgba(123, 63, 0, 0.4);
  --border-rule:      #7B3F00;

  /* Functional */
  --success:          #2E7D32;
  --warning:          #E65100;
  --error:            #B71C1C;
  --info:             #1565C0;
  --fodmap-warn:      #E65100;
  --fodmap-ok:        #2E7D32;

  /* Typography */
  --font-masthead:    'Copperplate', 'Copperplate Gothic Bold', 'Big Caslon', serif;
  --font-display:     'Optima', 'Segoe UI', 'Candara', sans-serif;
  --font-body:        'Optima', 'Segoe UI', 'Candara', 'Georgia', sans-serif;
  --font-ui:          'Futura', 'Century Gothic', 'Trebuchet MS', sans-serif;

  /* Spacing */
  --top-bar-height:   68px;
  --bottom-nav-height: 70px;
  --safe-top:         env(safe-area-inset-top, 0px);
  --safe-bottom:      env(safe-area-inset-bottom, 0px);
  --page-padding:     20px;

  /* Shadows */
  --shadow-card:      0 2px 12px rgba(123, 63, 0, 0.12);
  --shadow-elevated:  0 6px 24px rgba(123, 63, 0, 0.18);
  --shadow-modal:     0 16px 48px rgba(0, 0, 0, 0.35);

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
}

/* ── 2. Reset & Base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 18px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

button {
  cursor: pointer;
  font-family: var(--font-ui);
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

input, textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  -webkit-appearance: none;
}

ul { list-style: none; }

img { display: block; max-width: 100%; }

/* ── 3. App Shell ──────────────────────────────────────── */
#app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ── 4. Top Bar ────────────────────────────────────────── */
#top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: calc(var(--top-bar-height) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 3px solid var(--accent);
  flex-shrink: 0;
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 640px;
  padding: 0 16px;
  height: var(--top-bar-height);
}

#top-bar-back {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.4rem;
  background: rgba(255,255,255,0.08);
}

#top-bar-back:active { background: rgba(255,255,255,0.15); }

.top-bar-titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

#top-bar-title {
  font-family: var(--font-masthead);
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-align: center;
}

.top-bar-studio {
  font-family: var(--font-ui);
  font-size: 0.55rem;
  color: rgba(200, 148, 26, 0.6);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.top-bar-logo {
  width: 40px;
  height: 40px;
}

/* ── 5. Main Content Area ──────────────────────────────── */
#app-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.screen {
  display: none;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--page-padding);
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 24px);
}

.screen.active {
  display: block;
  animation: screenFadeIn 0.25s ease;
}

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

/* ── 6. Bottom Navigation ──────────────────────────────── */
#bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 100;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--primary-dark);
  border-top: 2px solid rgba(200, 148, 26, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  color: rgba(200, 148, 26, 0.5);
  transition: color 0.2s;
  min-width: 72px;
  height: var(--bottom-nav-height);
  justify-content: center;
}

.nav-btn.active { color: var(--accent); }
.nav-btn:active { opacity: 0.7; }

.nav-icon { font-size: 1.6rem; }
.nav-label {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── 7. Home Screen ────────────────────────────────────── */
.home-hero {
  text-align: center;
  padding: 32px 0 24px;
}

.home-greeting {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.home-title {
  font-family: var(--font-masthead);
  font-size: 2rem;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 8px;
}

.home-tagline {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.home-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--accent-muted);
  font-size: 1rem;
}

.home-divider::before, .home-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 20px;
  background: var(--primary);
  color: #FBF3E3;
  font-family: var(--font-masthead);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-elevated);
  transition: background 0.2s, transform 0.1s;
  border: 2px solid var(--accent-muted);
}

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

.btn-secondary {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--bg-card);
  color: var(--primary);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-card);
  border: 2px solid var(--border-subtle);
  transition: background 0.2s, border-color 0.2s;
  margin-top: 12px;
}

.btn-secondary:active { background: var(--bg-surface); }

.home-stats {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.stat-card {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.stat-number {
  font-family: var(--font-masthead);
  font-size: 2rem;
  color: var(--primary);
}

.stat-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 4px;
}

.home-resume-section {
  margin-top: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.home-resume-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

#home-last-menu-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

#home-resume-btn {
  padding: 14px;
  background: var(--bg-surface);
  color: var(--primary);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: 100%;
  text-align: center;
}

/* ── 8. Pantry Screen ──────────────────────────────────── */
.pantry-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

#pantry-search {
  flex: 1;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-subtle);
  background: var(--bg-card);
  font-size: 1rem;
  color: var(--text-primary);
}

#pantry-search:focus { border-color: var(--primary-light); }

#pantry-add-btn {
  padding: 14px 20px;
  background: var(--primary);
  color: var(--bg-deep);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.pantry-count {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.pantry-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.pantry-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 50px;
  padding: 12px 16px;
  min-height: 52px;
  box-shadow: var(--shadow-card);
}

.pantry-item-name {
  font-size: 1rem;
  color: var(--text-primary);
}

.pantry-remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(183, 28, 28, 0.08);
  color: var(--error);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pantry-empty {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.empty-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

#pantry-clear-btn {
  padding: 12px 20px;
  color: var(--error);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  border: 1px solid rgba(183, 28, 28, 0.3);
  border-radius: var(--radius-md);
  margin-top: 8px;
}

/* ── 9. Planner Screen ─────────────────────────────────── */
.planner-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-subtle);
  transition: all 0.3s;
}

.step-dot.active {
  background: var(--primary);
  transform: scale(1.3);
}

.step-dot.done {
  background: var(--accent);
}

#planner-step-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}

.planner-step-content {
  min-height: 300px;
}

.planner-step-content.step-enter {
  animation: stepFadeIn 0.3s ease;
}

@keyframes stepFadeIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.step-header {
  margin-bottom: 24px;
}

.step-title {
  font-family: var(--font-masthead);
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 6px;
}

.step-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.planner-nav {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.planner-nav button {
  flex: 1;
  padding: 18px;
  border-radius: var(--radius-lg);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

#planner-prev {
  background: var(--bg-card);
  color: var(--primary);
  border: 2px solid var(--border-subtle);
}

#planner-next {
  background: var(--primary);
  color: var(--bg-deep);
  box-shadow: var(--shadow-card);
}

#planner-next:disabled {
  background: var(--border-subtle);
  color: var(--text-muted);
  box-shadow: none;
}

/* ── Ingredient chips ──── */
.ingredient-section {
  margin-bottom: 24px;
}

.section-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.section-hint {
  font-weight: normal;
  opacity: 0.7;
}

.ingredient-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.ingredient-chip {
  padding: 12px 18px;
  border-radius: 50px;
  border: 2px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  min-height: 48px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ingredient-chip.selected {
  background: var(--primary);
  color: var(--bg-deep);
  border-color: var(--primary);
}

.ingredient-chip:active { transform: scale(0.95); }

.chip-remove {
  font-size: 1.1rem;
  opacity: 0.7;
  margin-left: 2px;
}

.chip-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.link-btn {
  color: var(--primary-light);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  text-decoration: underline;
  padding: 4px;
}

.divider-dot { color: var(--text-muted); }

.add-ingredient-inline-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 2px dashed var(--border-active);
  border-radius: var(--radius-md);
  color: var(--primary);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  width: 100%;
}

.add-icon {
  font-size: 1.2rem;
  font-weight: 700;
}

.selected-summary {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border-subtle);
  margin-top: 8px;
}

.summary-placeholder {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.summary-label {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.summary-list {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.empty-pantry-hint {
  padding: 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Cuisine cards ──── */
.cuisine-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cuisine-card {
  background: var(--bg-card);
  border: 2.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: var(--shadow-card);
  min-height: 110px;
}

.cuisine-card.selected {
  border-color: var(--primary);
  background: rgba(123, 63, 0, 0.06);
  box-shadow: 0 0 0 3px rgba(123, 63, 0, 0.15);
}

.cuisine-card:active { transform: scale(0.96); }

.cuisine-icon { font-size: 2rem; }
.cuisine-name {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  line-height: 1.2;
}

.cuisine-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ── Dietary cards ──── */
.dietary-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dietary-card-wrap { position: relative; }

.dietary-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 2.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: all 0.2s;
  min-height: 80px;
}

.dietary-card.selected {
  border-color: var(--primary);
  background: rgba(123, 63, 0, 0.05);
}

.dietary-icon { font-size: 1.5rem; flex-shrink: 0; }

.dietary-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.dietary-name {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dietary-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.dietary-status {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 50px;
  flex-shrink: 0;
}

.dietary-status.defined { background: rgba(46, 125, 50, 0.1); color: var(--success); }
.dietary-status.undefined { background: rgba(230, 81, 0, 0.1); color: var(--warning); }

.define-diet-btn {
  margin-top: 6px;
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--primary-light);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.define-diet-btn.pulse { animation: buttonPulse 0.5s ease; }
@keyframes buttonPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); background: rgba(200, 148, 26, 0.2); }
}

.skip-dietary {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ── Prep style cards ──── */
.prep-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prep-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: var(--bg-card);
  border: 2.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: all 0.2s;
  min-height: 100px;
}

.prep-card.selected {
  border-color: var(--primary);
  background: rgba(123, 63, 0, 0.05);
  box-shadow: 0 0 0 3px rgba(123, 63, 0, 0.12);
}

.prep-icon { font-size: 1.8rem; }
.prep-name {
  font-family: var(--font-masthead);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.prep-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.prep-time {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 4px;
}

.both-hint {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(200, 148, 26, 0.1);
  border: 1px solid var(--accent-muted);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ── 10. Menu Scroll Screen ────────────────────────────── */
#screen-menu {
  background: var(--bg-deep);
  padding: 0;
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 24px);
}

.menu-scroll-wrapper {
  padding: 16px var(--page-padding);
}

/* Parchment scroll container */
.menu-parchment {
  background:
    radial-gradient(ellipse at top, #FBF3E3 0%, #F5E8C8 40%, #EDD99A 100%);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  box-shadow:
    var(--shadow-elevated),
    inset 0 0 80px rgba(139, 100, 20, 0.08);
  border: 2px solid rgba(139, 100, 20, 0.2);
}

/* Scroll rolls — top and bottom */
.menu-parchment::before,
.menu-parchment::after {
  content: '';
  display: block;
  height: 24px;
  background: linear-gradient(to bottom, #7B3F00, #A0602A 40%, #7B3F00);
  border-radius: 4px 4px 0 0;
}

.menu-parchment::after {
  border-radius: 0 0 4px 4px;
}

#menu-scroll-body {
  padding: 28px 24px 24px;
}

.scroll-masthead {
  text-align: center;
  margin-bottom: 32px;
}

.scroll-decorative-top {
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}

.scroll-subtitle {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.scroll-title {
  font-family: var(--font-masthead);
  font-size: 1.6rem;
  color: var(--primary-dark);
  line-height: 1.2;
  margin-bottom: 12px;
}

.scroll-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 0.9rem;
  margin: 10px 0;
}

.scroll-divider::before, .scroll-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--accent-muted);
}

.dietary-badge-menu {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  background: rgba(123, 63, 0, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 50px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ── Dish entries (menu-scroll style — no card boxes) ──── */
.dish-list {
  display: flex;
  flex-direction: column;
}

/* Each dish is a parchment entry, not a card */
.dish-card {
  padding: 20px 4px 20px;
  border-bottom: 1px solid rgba(139, 100, 20, 0.18);
}

.dish-card:last-child { border-bottom: none; }

/* Top row: small thumbnail medallion + name/meta inline */
.dish-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}

.dish-card-header {
  flex: 1;
  min-width: 0;
}

/* Small rounded thumbnail — medallion style */
.dish-thumb-frame {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #3A1A06;
  border: 3px solid rgba(200, 148, 26, 0.5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  position: relative;
}

.dish-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.placeholder-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(200,148,26,0) 0%,
    rgba(200,148,26,0.15) 50%,
    rgba(200,148,26,0) 100%
  );
  animation: shimmer 2s infinite;
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.dish-card-body { padding: 0; }

.dish-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.dish-prep-badge {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dish-prep-badge.quick {
  background: rgba(21, 101, 192, 0.1);
  color: var(--info);
  border: 1px solid rgba(21, 101, 192, 0.2);
}

.dish-prep-badge.elaborate {
  background: rgba(200, 148, 26, 0.12);
  color: #8B6000;
  border: 1px solid rgba(200, 148, 26, 0.25);
}

.dish-time, .dish-serves {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dish-name {
  font-family: var(--font-masthead);
  font-size: 1.25rem;
  color: var(--primary-dark);
  margin-bottom: 4px;
  line-height: 1.2;
}

.dish-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 6px;
  font-style: italic;
}

.dish-highlight {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 10px;
  font-style: italic;
}

.fodmap-flags {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.fodmap-header {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--fodmap-warn);
  font-weight: 700;
}

.fodmap-badge {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  padding: 4px 10px 4px 8px;
  background: rgba(230, 81, 0, 0.07);
  color: var(--fodmap-warn);
  border: 1px solid rgba(230, 81, 0, 0.22);
  border-radius: 8px;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.4;
}

.fodmap-swap {
  font-size: 0.67rem;
  color: #6d4c00;
  font-style: italic;
  opacity: 0.85;
}

.to-source {
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.to-source-label {
  font-family: var(--font-ui);
  font-weight: 700;
  margin-right: 4px;
}

.recipe-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: rgba(123, 63, 0, 0.08);
  color: var(--primary);
  border: 1px solid rgba(123, 63, 0, 0.2);
  border-radius: 50px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-top: 10px;
}

.recipe-link:active { background: rgba(123, 63, 0, 0.15); }

.scroll-footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 20px;
}

.scroll-footer-text {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 4px;
}

.scroll-studio {
  font-family: var(--font-masthead);
  font-size: 0.7rem;
  color: var(--accent-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── 11. Recipe Modal ──────────────────────────────────── */
#modal-recipe {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

#modal-recipe.active { display: flex; }

.recipe-modal-panel {
  background: var(--bg-card);
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: panelSlideUp 0.3s ease;
  padding-bottom: calc(var(--safe-bottom) + 16px);
}

@keyframes panelSlideUp {
  from { transform: translateY(100%); opacity: 0.8; }
  to   { transform: translateY(0); opacity: 1; }
}

#recipe-content { padding: 0 0 24px; position: relative; }

.recipe-close-btn {
  position: sticky;
  top: 0;
  left: 100%;
  display: block;
  margin-left: auto;
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.6);
  color: white;
  border-radius: 50%;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  margin: 12px 12px 0 auto;
}

.recipe-hero-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 200px;
  overflow: hidden;
  margin-bottom: 0;
}

.recipe-painting {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-header {
  padding: 20px 20px 0;
}

.recipe-name {
  font-family: var(--font-masthead);
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.recipe-story {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.recipe-meta-bar {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 4px;
}

.recipe-meta-item {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
  border-right: 1px solid var(--border-subtle);
}

.recipe-meta-item:last-child { border-right: none; }

.recipe-meta-item strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

.recipe-fodmap-note {
  margin: 12px 20px;
  padding: 12px 14px;
  background: rgba(230, 81, 0, 0.07);
  border: 1px solid rgba(230, 81, 0, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--fodmap-warn);
  line-height: 1.5;
}

.recipe-fodmap-title {
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 8px;
  font-family: var(--font-ui);
}

.recipe-fodmap-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 6px;
  padding-left: 4px;
}

.recipe-fodmap-row:last-child {
  margin-bottom: 0;
}

.recipe-fodmap-ingredient {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.78rem;
}

.recipe-fodmap-swap {
  font-family: var(--font-ui);
  font-size: 0.73rem;
  font-style: italic;
  color: #6d4c00;
  padding-left: 16px;
  opacity: 0.9;
}

.recipe-section {
  padding: 20px 20px 0;
}

.recipe-section-title {
  font-family: var(--font-masthead);
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-subtle);
  letter-spacing: 0.03em;
}

.recipe-ingredients { display: flex; flex-direction: column; gap: 10px; }

.recipe-ingredient {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.4;
}

.recipe-ingredient.fodmap-ing {
  background: rgba(230, 81, 0, 0.05);
  border-left: 3px solid var(--fodmap-warn);
}

.ing-amount {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--primary);
  font-size: 0.85rem;
  min-width: 70px;
  flex-shrink: 0;
}

.ing-item { flex: 1; color: var(--text-primary); }
.fodmap-mini { font-size: 0.75rem; }
.ing-note { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }

.recipe-steps { display: flex; flex-direction: column; gap: 14px; }

.recipe-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg-deep);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.6;
  flex: 1;
}

.recipe-tips { background: rgba(200, 148, 26, 0.06); border-radius: var(--radius-md); }

.chef-tip {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.recipe-serving, .recipe-storage {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.recipe-loading, .recipe-error {
  text-align: center;
  padding: 48px 24px;
}

.recipe-loading-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* ── 12. Modals (Common) ───────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active { display: flex; }

.modal-panel {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-modal);
  animation: modalPop 0.2s ease;
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal-title {
  font-family: var(--font-masthead);
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 16px;
}

.modal-input {
  width: 100%;
  padding: 16px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  margin-bottom: 16px;
}

.modal-input:focus { border-color: var(--primary-light); }

.modal-textarea {
  width: 100%;
  padding: 16px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.modal-textarea:focus { border-color: var(--primary-light); }

.modal-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

.modal-context-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.modal-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.modal-btn-confirm {
  flex: 1;
  padding: 16px;
  background: var(--primary);
  color: var(--bg-deep);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
}

.modal-btn-cancel {
  flex: 1;
  padding: 16px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  border: 1px solid var(--border-subtle);
}

/* ── 13. Settings Screen ───────────────────────────────── */
.settings-section {
  margin-bottom: 28px;
}

.settings-section-title {
  font-family: var(--font-masthead);
  font-size: 0.9rem;
  color: var(--primary);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-field {
  margin-bottom: 14px;
}

.settings-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.settings-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-card);
  font-family: 'Courier New', monospace;
}

.settings-input:focus { border-color: var(--primary-light); }

.settings-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.settings-test-btn {
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  background: transparent;
  border: 1.5px solid rgba(139, 100, 20, 0.3);
  border-radius: 20px;
  color: var(--primary-dark);
  cursor: pointer;
  box-shadow: none;
  transition: all 0.2s;
}

.settings-test-btn:active {
  background: rgba(200, 148, 26, 0.12);
  border-color: var(--accent);
}

.settings-test-result {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  line-height: 1.5;
}

.test-info    { background: rgba(200, 148, 26, 0.08); color: var(--primary-dark); border: 1px solid rgba(200,148,26,0.2); }
.test-success { background: rgba(61, 140, 64, 0.1);  color: #2d7a30;             border: 1px solid rgba(61,140,64,0.25); }
.test-error   { background: rgba(192, 57, 43, 0.08); color: #8b1a10;             border: 1px solid rgba(192,57,43,0.25); }

#settings-save-btn {
  width: 100%;
  padding: 18px;
  background: var(--primary);
  color: var(--bg-deep);
  border-radius: var(--radius-lg);
  font-family: var(--font-masthead);
  font-size: 1rem;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.diet-profile-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}

.diet-profile-name {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.diet-preview {
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 10px;
  font-style: italic;
}

.diet-preview.defined { color: var(--text-secondary); }
.diet-preview.undefined { color: var(--text-muted); }

.edit-custom-diet-btn {
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--primary-light);
}

#clear-pantry-settings-btn {
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(183, 28, 28, 0.3);
  color: var(--error);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  margin-top: 8px;
}

.settings-app-info {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.settings-app-name {
  font-family: var(--font-masthead);
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.settings-app-version {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ── 14. Loading Overlay ───────────────────────────────── */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(26, 8, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#loading-overlay.active { display: flex; }

.loading-pot {
  font-size: 3rem;
  animation: potBounce 0.8s ease-in-out infinite alternate;
}

@keyframes potBounce {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(-8px) scale(1.05); }
}

.loading-dots {
  display: flex;
  gap: 8px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotPulse 1.2s ease-in-out infinite;
}

.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%       { opacity: 1;   transform: scale(1.2); }
}

#loading-message {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent);
  text-align: center;
  max-width: 260px;
  font-style: italic;
  animation: msgFade 0.4s ease;
}

@keyframes msgFade {
  from { opacity: 0; } to { opacity: 1; }
}

/* ── 15. Toast Notifications ───────────────────────────── */
#toast-container {
  position: fixed;
  top: calc(var(--top-bar-height) + var(--safe-top) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  text-align: center;
  box-shadow: var(--shadow-elevated);
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s ease;
  width: 100%;
}

.toast.visible { opacity: 1; transform: translateY(0); }

.toast-success { background: #2E7D32; color: white; }
.toast-error   { background: #B71C1C; color: white; }
.toast-warning { background: #E65100; color: white; }
.toast-info    { background: var(--primary-dark); color: var(--accent); }

/* ── 16. Confirm Modal ─────────────────────────────────── */
#modal-confirm .modal-message {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 22px;
}

#confirm-yes {
  flex: 1;
  padding: 16px;
  background: var(--error);
  color: white;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
}

/* ── 17. No-results ────────────────────────────────────── */
.no-results {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* ── 18. Responsive adjustments ───────────────────────── */
@media (min-width: 480px) {
  .cuisine-grid { grid-template-columns: 1fr 1fr; }
  .prep-grid { flex-direction: row; }
  .prep-card { flex: 1; }
}

@media (min-width: 640px) {
  :root { --page-padding: 28px; }
  .home-title { font-size: 2.4rem; }
  .step-title { font-size: 1.7rem; }
  .scroll-title { font-size: 2rem; }
}

/* Standalone (PWA) padding adjustments */
body.standalone #top-bar {
  padding-top: max(var(--safe-top), 12px);
}

body.standalone #bottom-nav {
  padding-bottom: max(var(--safe-bottom), 12px);
}

/* ── 19. Accessibility & touch ─────────────────────────── */
@media (hover: hover) {
  .ingredient-chip:hover { border-color: var(--primary-light); }
  .cuisine-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-elevated); }
  .recipe-link:hover { background: var(--primary-dark); }
  .btn-primary:hover { background: var(--primary-dark); }
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── 20. Multi-select dietary ──────────────────────────── */
.dietary-check {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 8px;
}

/* Multiple dietary badges in menu masthead */
.dietary-badges-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.dietary-badge-menu {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 13px;
  background: rgba(123, 63, 0, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 50px;
  font-family: var(--font-ui);
  font-size: 0.73rem;
  color: var(--text-secondary);
}

/* Menu empty state */
.menu-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.menu-empty-state .empty-icon { font-size: 2rem; margin-bottom: 12px; }
.menu-empty-state .empty-label {
  font-family: var(--font-display);
  font-style: italic;
  line-height: 1.5;
}

/* ── 21. Common ingredients in planner step 1 ──────────── */
.common-ingredients-section {
  margin-top: 4px;
  padding-top: 4px;
}

.common-cat-section {
  margin-bottom: 14px;
}

.common-cat-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.common-chips { flex-wrap: wrap; gap: 8px; }

.common-chip {
  background: var(--bg-surface);
  border: 1.5px dashed var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.common-chip:active {
  background: rgba(123, 63, 0, 0.08);
  border-color: var(--primary-light);
  border-style: solid;
}

/* ── 22. Pantry quick-add section ──────────────────────── */
.quick-add-section {
  margin-top: 24px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.quick-add-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-light);
  box-shadow: var(--shadow-card);
}

.quick-add-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.quick-add-body {
  margin-top: 14px;
}

.quick-add-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-style: italic;
}

.quick-add-cat-section {
  margin-bottom: 16px;
}

.quick-add-cat-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 8px;
}

.quick-add-chips { flex-wrap: wrap; gap: 8px; }

.quick-add-chip {
  background: var(--bg-surface);
  border: 1.5px solid rgba(200, 148, 26, 0.3);
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 8px 12px;
}

.quick-add-chip:active {
  background: rgba(200, 148, 26, 0.15);
  border-color: var(--accent);
  color: var(--primary-dark);
}

/* ── DINER PROFILES — Settings ───────────────────────────── */
.diner-profile-card {
  background: rgba(251, 243, 227, 0.6);
  border: 1.5px solid rgba(139, 100, 20, 0.18);
  border-radius: 12px;
  padding: 4px 0 4px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.diner-profile-card.active {
  border-color: rgba(200, 148, 26, 0.55);
  background: rgba(200, 148, 26, 0.08);
}

.diner-profile-top {
  padding: 0;
}

.diner-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}

.diner-toggle-btn:active {
  background: rgba(200, 148, 26, 0.12);
}

.diner-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.diner-label {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.diner-toggle-state {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(139, 100, 20, 0.1);
  border-radius: 20px;
  padding: 4px 12px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.diner-toggle-btn.on .diner-toggle-state {
  background: rgba(61, 140, 64, 0.18);
  color: #2d7a30;
}

.diner-conditions {
  padding: 8px 16px 14px;
  border-top: 1px solid rgba(139, 100, 20, 0.12);
}

.diner-conditions-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.diner-conditions-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.condition-chip {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 7px 13px;
  border: 1.5px solid rgba(139, 100, 20, 0.25);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: 20px;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.15s;
}

.condition-chip.selected {
  background: rgba(200, 148, 26, 0.18);
  border-color: var(--accent);
  color: var(--primary-dark);
  font-weight: 600;
}

/* ── PROFILE SWITCHER — Menu screen ─────────────────────── */
.profile-switcher {
  padding: 12px 16px 0;
}

.profile-switcher-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.profile-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 7px 14px;
  border: 1.5px solid rgba(139, 100, 20, 0.25);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: 20px;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.2s;
}

.profile-tab.active {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--parchment);
  font-weight: 600;
}

.profile-tab-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ── NUTRITION PANEL — Per-dish ─────────────────────────── */
.nutrition-expand {
  margin-top: 10px;
}

.nutrition-toggle {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid rgba(200, 148, 26, 0.3);
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  box-shadow: none;
  letter-spacing: 0.04em;
  transition: background 0.15s;
}

.nutrition-toggle:active,
.nutrition-toggle.open {
  background: rgba(200, 148, 26, 0.12);
}

.nutrition-panel {
  display: none;
  margin-top: 10px;
  padding: 12px 14px 10px;
  background: rgba(251, 243, 227, 0.5);
  border: 1px solid rgba(139, 100, 20, 0.15);
  border-radius: 10px;
}

.nutrition-panel.open {
  display: block;
}

.nutr-header {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.nutr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.nutr-label {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--primary-dark);
  width: 90px;
  flex-shrink: 0;
}

.nutr-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(139, 100, 20, 0.12);
  border-radius: 4px;
  overflow: hidden;
}

.nutr-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.nutr-bar.green  { background: #3d8c40; }
.nutr-bar.amber  { background: #c8941a; }
.nutr-bar.red    { background: #c0392b; }
.nutr-bar.dim    { background: rgba(139, 100, 20, 0.25); }

.nutr-val {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-secondary);
  width: 42px;
  text-align: right;
  flex-shrink: 0;
}

.nutr-pct {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.nutr-pct.green { color: #3d8c40; }
.nutr-pct.amber { color: #c8941a; }
.nutr-pct.red   { color: #c0392b; }
.nutr-pct.dim   { color: rgba(139, 100, 20, 0.45); }

.nutr-cond-notes {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(200, 148, 26, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--primary-dark);
  line-height: 1.5;
}

.nutr-cond-notes strong {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 4px;
}

.nutr-disclaimer {
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  opacity: 0.8;
}

/* ── FREE-TEXT INSTRUCTION — Planner step 1 ─────────────── */
.free-text-section {
  background: rgba(200, 148, 26, 0.06);
  border: 1.5px dashed rgba(200, 148, 26, 0.4);
  border-radius: 12px;
  padding: 14px 16px 12px;
  margin-bottom: 22px;
}

.free-text-label {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.free-text-hint {
  font-weight: 400;
  font-size: 0.73rem;
  color: var(--text-secondary);
  margin-left: 4px;
}

.free-text-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(251, 243, 227, 0.8);
  border: 1.5px solid rgba(139, 100, 20, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--primary-dark);
  line-height: 1.5;
  resize: vertical;
  min-height: 68px;
  transition: border-color 0.2s;
}

.free-text-input:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
}

.free-text-input::placeholder {
  color: rgba(139, 100, 20, 0.4);
  font-style: italic;
  font-size: 0.8rem;
}

.free-text-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.free-text-generate-btn {
  flex: 1;
  padding: 11px 16px;
  font-size: 0.9rem;
}

.free-text-clear-btn {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── RECIPE SAVE BUTTON ──────────────────────────────────── */
.recipe-save-btn {
  position: absolute;
  top: 14px;
  right: 52px;
  background: rgba(251, 243, 227, 0.92);
  border: 1.5px solid rgba(200, 148, 26, 0.4);
  border-radius: 20px;
  padding: 6px 14px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
  box-shadow: none;
  transition: all 0.2s;
  z-index: 2;
}

.recipe-save-btn:active,
.recipe-save-btn:hover {
  background: rgba(200, 148, 26, 0.15);
  border-color: var(--accent);
}

.recipe-save-btn.saved {
  background: rgba(61, 140, 64, 0.12);
  border-color: #3d8c40;
  color: #2d7a30;
}

/* ── SAVED RECIPES SCREEN ────────────────────────────────── */
.screen-header-bar {
  padding: 16px 20px 8px;
  border-bottom: 1px solid rgba(139, 100, 20, 0.12);
}

.screen-header-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--primary-dark);
  margin: 0;
}

.saved-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.saved-empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  opacity: 0.5;
}

.saved-empty-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin: 0 0 8px;
}

.saved-empty-hint {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.saved-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(139, 100, 20, 0.12);
  background: transparent;
  transition: background 0.15s;
}

.saved-card:active {
  background: rgba(200, 148, 26, 0.06);
}

.saved-thumb {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(200, 148, 26, 0.35);
  flex-shrink: 0;
}

.saved-thumb-placeholder {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(200, 148, 26, 0.1);
  border: 2px solid rgba(200, 148, 26, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.saved-card-body {
  flex: 1;
  min-width: 0;
}

.saved-dish-name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--primary-dark);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.saved-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.saved-cuisine {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}

.saved-date {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.saved-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.saved-view-btn {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 14px;
  background: var(--primary-dark);
  color: var(--parchment);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: none;
}

.saved-view-btn:active {
  opacity: 0.8;
}

.saved-delete-btn {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid rgba(139, 100, 20, 0.2);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  padding: 0;
}

.saved-delete-btn:active {
  background: rgba(192, 57, 43, 0.1);
  border-color: #c0392b;
  color: #c0392b;
}
