/* ═══════════════════════════════════════
   [kich-uhn] — Main Stylesheet
   ═══════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  /* Midnight Kitchen (default) */
  --bg: #161616;
  --bg2: #111111;
  --surface: #242424;
  --surface2: #2E2E2E;
  --surface3: #383838;
  --gold: #E8C547;
  --gold-dim: rgba(232,197,71,0.12);
  --spice: #D4845A;
  --text: #F0EDE8;
  --text-dim: rgba(240,237,232,0.5);
  --text-dimmer: rgba(240,237,232,0.25);
  --border: rgba(240,237,232,0.07);
  --border-strong: rgba(240,237,232,0.14);
  --accent: var(--gold);
  --accent-text: #161616;
  --nav-bg: #1A1A1A;
  --featured-grad: linear-gradient(135deg, #2A2010, #1C1810);
  --featured-border: rgba(232,197,71,0.15);
  --danger: #C0392B;
  --success: #52B788;
}

body.theme-clean {
  --bg: #F5F5F3;
  --bg2: #EBEBEA;
  --surface: #FFFFFF;
  --surface2: #F0F0EE;
  --surface3: #E8E8E6;
  --gold: #1B4332;
  --gold-dim: rgba(27,67,50,0.08);
  --spice: #52B788;
  --text: #1A1A1A;
  --text-dim: rgba(26,26,26,0.5);
  --text-dimmer: rgba(26,26,26,0.25);
  --border: rgba(26,26,26,0.08);
  --border-strong: rgba(26,26,26,0.16);
  --accent: var(--gold);
  --accent-text: #FFFFFF;
  --nav-bg: #FFFFFF;
  --featured-grad: linear-gradient(135deg, #D8EDDF, #EAF4EE);
  --featured-border: rgba(27,67,50,0.2);
  --meta-color: #555550;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
}

button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
input, textarea { font-family: inherit; }

/* ── View System ── */
.view {
  position: fixed;
  inset: 0;
  bottom: 72px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  background: var(--bg);
}

.view.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* Full-screen views (no nav) */
#view-recipe, #view-edit, #view-cook {
  bottom: 0;
  z-index: 100;
}

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 72px;
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-dimmer);
  transition: color 0.15s;
  padding: 8px 0;
}

.nav-btn.active { color: var(--accent); }
.nav-btn .nav-icon { font-size: 20px; line-height: 1; }
.nav-btn .nav-label { font-size: 10px; font-weight: 500; letter-spacing: 0.03em; }

/* ═══════════════════════════════════════
   HOME
   ═══════════════════════════════════════ */

.home-header {
  padding: 56px 20px 0;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.home-greeting {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  line-height: 1;
}

.add-btn {
  width: 36px; height: 36px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: transform 0.1s, opacity 0.1s;
}
.add-btn:active { transform: scale(0.92); opacity: 0.85; }

/* Featured */
.featured-wrap { padding: 0 16px; margin-bottom: 20px; }

.featured-banner {
  background: var(--featured-grad);
  border-radius: 20px;
  padding: 18px 18px 18px 18px;
  border: 1px solid var(--featured-border);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s;
}
.featured-banner:active { transform: scale(0.98); }

.featured-bg-emoji {
  position: absolute;
  right: -10px; bottom: -12px;
  font-size: 90px;
  opacity: 0.12;
  pointer-events: none;
  line-height: 1;
}

.featured-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
  font-weight: 600;
}

.featured-name {
  font-family: 'Playfair Display', serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
  max-width: 220px;
}

.featured-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.featured-actions { display: flex; gap: 8px; }

.featured-btn {
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  transition: opacity 0.1s, transform 0.1s;
}
.featured-btn:active { opacity: 0.8; transform: scale(0.97); }
.featured-btn.primary { background: var(--accent); color: var(--accent-text); }
.featured-btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }

/* Section label */
.section-label {
  padding: 0 20px 8px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dimmer);
}

/* Time filter */
.time-filter-row {
  padding: 0 16px;
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.time-filter-row::-webkit-scrollbar { display: none; }

.time-pill {
  padding: 5px 11px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  background: transparent;
  color: var(--spice);
  border: 1px solid var(--spice);
  opacity: 0.65;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.time-pill.active {
  opacity: 1;
  background: var(--spice);
  color: #fff;
}

/* Lanes */
.lane { margin-bottom: 28px; }

.lane-header {
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.lane-title { font-size: 14px; font-weight: 600; color: var(--text); }
.lane-more { font-size: 11px; color: var(--accent); }

.lane-scroll {
  padding: 0 16px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.lane-scroll::-webkit-scrollbar { display: none; }

.lane-card {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  width: 130px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s;
}
.lane-card:active { transform: scale(0.96); }

.lane-img {
  height: 68px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  position: relative;
}

.lane-fav {
  position: absolute;
  top: 6px; right: 7px;
  font-size: 12px;
  color: var(--accent);
}

.lane-body { padding: 9px 10px 11px; }

.lane-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 4px;
}

.lane-time { font-size: 10px; color: var(--text-dim); }

/* Home footer */
.home-footer {
  text-align: center;
  font-size: 10px;
  color: var(--text-dimmer);
  padding: 10px 20px 28px;
  letter-spacing: 0.03em;
}

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

.search-header { padding: 56px 20px 16px; }
.search-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 14px;
}

.search-input-wrap {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 10px;
}

.search-icon { font-size: 16px; flex-shrink: 0; }

.search-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text);
  min-width: 0;
}

.search-input-wrap input::placeholder { color: var(--text-dimmer); }

.search-clear {
  font-size: 13px;
  color: var(--text-dimmer);
  padding: 2px 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.search-clear.visible { opacity: 1; }

.tag-filter-section { padding: 4px 20px 8px; }

.tag-filter-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  margin: 12px 0 7px;
}

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

.tag-pill {
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tag-pill.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.search-results { padding: 8px 16px 20px; }

.result-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.result-row:active { opacity: 0.7; }

.result-emoji {
  width: 44px; height: 44px;
  background: var(--surface);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.result-body { flex: 1; min-width: 0; }
.result-name { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.result-meta { font-size: 11px; color: var(--text-dim); }

.result-time { font-size: 12px; color: var(--accent); font-weight: 500; white-space: nowrap; }

.no-results {
  text-align: center;
  color: var(--text-dimmer);
  padding: 40px 20px;
  font-size: 14px;
}

/* ═══════════════════════════════════════
   RECIPE VIEW
   ═══════════════════════════════════════ */

.recipe-top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 52px 16px 12px;
}

.back-btn {
  font-size: 16px;
  color: var(--accent);
  font-weight: 500;
  padding: 4px 0;
}

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

.recipe-action-btn {
  font-size: 18px;
  color: var(--text-dim);
  padding: 4px 6px;
  transition: color 0.15s;
}
.recipe-action-btn.fav-active { color: var(--accent); }

.cook-mode-btn {
  background: var(--accent);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 10px;
}

.recipe-content { padding: 20px 20px 40px; }

.recipe-hero-emoji {
  font-size: 56px;
  text-align: center;
  margin-bottom: 16px;
  line-height: 1;
}

.recipe-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 10px;
}

.recipe-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.recipe-tag {
  background: var(--gold-dim);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
}

.recipe-times {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.recipe-time-item { text-align: center; flex: 1; }
.recipe-time-value { font-size: 15px; font-weight: 600; color: var(--text); }
.recipe-time-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }

/* Scaler */
.recipe-scaler {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.scaler-label { font-size: 12px; color: var(--text-dim); flex: 1; }

.scaler-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scaler-btn {
  width: 30px; height: 30px;
  background: var(--surface2);
  border-radius: 8px;
  font-size: 18px;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s;
}
.scaler-btn:active { background: var(--surface3); }

.scaler-input {
  width: 52px;
  text-align: center;
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 5px 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  outline: none;
}

.scaler-unit { font-size: 12px; color: var(--text-dim); }

/* Sections */
.recipe-section { margin-bottom: 24px; }

.recipe-section-heading {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.ingredient-section { margin-bottom: 16px; }
.ingredient-section-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.ingredient-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
}

.ingredient-item .bullet { flex-shrink: 0; font-size: 13px; margin-top: 1px; }
.ingredient-item.sub-item { padding-left: 20px; }
.ingredient-item.sub-item .bullet { font-size: 11px; }

.ingredient-item.flagged .amount { color: var(--spice); }
.flag-note { font-size: 10px; color: var(--spice); margin-left: 4px; }

.method-section { margin-bottom: 16px; }
.method-section-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.method-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.method-step:last-child { border-bottom: none; }

.step-number {
  width: 22px; height: 22px;
  background: var(--gold-dim);
  color: var(--accent);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.method-step.sub-step { padding-left: 20px; }

.step-text { font-size: 14px; color: var(--text); line-height: 1.5; flex: 1; }

/* Notes */
.recipe-notes {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.recipe-notes-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  margin-bottom: 6px;
}
.recipe-notes-text { font-size: 13px; color: var(--text-dim); line-height: 1.55; }

/* Source */
.recipe-source { font-size: 12px; color: var(--text-dimmer); margin-bottom: 20px; }
.recipe-source a { color: var(--accent); text-decoration: none; }

/* Last cooked */
.recipe-last-cooked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.last-cooked-label { font-size: 12px; color: var(--text-dim); }
.last-cooked-value { font-size: 12px; color: var(--text); font-weight: 500; }
.mark-cooked-btn {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  padding: 5px 10px;
  background: var(--gold-dim);
  border-radius: 8px;
}

/* Shopping from recipe */
.recipe-shop-btn {
  width: 100%;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
  transition: background 0.15s;
}
.recipe-shop-btn:active { background: var(--surface2); }

/* ═══════════════════════════════════════
   EDIT / ADD RECIPE
   ═══════════════════════════════════════ */

.edit-top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 52px 16px 12px;
}

.edit-top-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.save-recipe-btn {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 0;
}

.edit-body { padding: 20px 20px 60px; }

.edit-field { margin-bottom: 20px; }

.edit-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  margin-bottom: 7px;
  display: block;
}

.edit-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.edit-input:focus { border-color: var(--accent); }
.edit-input::placeholder { color: var(--text-dimmer); }

textarea.edit-input {
  resize: none;
  min-height: 80px;
  line-height: 1.5;
}

.edit-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.edit-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.yield-toggle {
  display: flex;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  margin-bottom: 10px;
}
.yield-opt {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}
.yield-opt.active {
  background: var(--accent);
  color: var(--accent-text);
}

/* Tag selector in edit */
.edit-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.edit-tag {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.edit-tag.selected {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* Sub-tag reveal */
.sub-tags { margin-top: 10px; padding-left: 10px; border-left: 2px solid var(--border); }

/* Sections editor */
.sections-editor { margin-top: 8px; }

.section-block {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  overflow: hidden;
}

.section-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.section-name-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.section-name-input::placeholder { color: var(--text-dimmer); }

.section-delete-btn {
  font-size: 16px;
  color: var(--text-dimmer);
  padding: 2px 6px;
}

.section-items { padding: 8px 14px; }

.item-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
}

.item-bullet { font-size: 14px; flex-shrink: 0; margin-top: 8px; }

.item-input {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
  font-size: 14px;
  color: var(--text);
  padding: 6px 2px;
  line-height: 1.4;
}
.item-input::placeholder { color: var(--text-dimmer); }
.item-input:focus { border-bottom-color: var(--accent); }

.item-delete-btn { font-size: 14px; color: var(--text-dimmer); padding: 4px; margin-top: 4px; flex-shrink: 0; }

.add-item-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--accent);
  padding: 8px 0;
  font-weight: 500;
}

.add-section-btn {
  width: 100%;
  padding: 13px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 4px;
  transition: border-color 0.15s, color 0.15s;
}
.add-section-btn:active { border-color: var(--accent); color: var(--accent); }

/* ═══════════════════════════════════════
   COOK MODE
   ═══════════════════════════════════════ */

.cook-mode {
  background: var(--bg2);
  bottom: 0 !important;
  z-index: 200;
}

.cook-top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 52px 20px 14px;
}

.cook-top-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
  max-width: 200px;
  text-align: right;
  line-height: 1.3;
}

.back-btn.light { color: var(--accent); }

.cook-content { padding: 20px 20px 60px; }

.cook-step-block {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 14px;
}

.cook-step-block.current {
  border-color: var(--accent);
  background: var(--featured-grad);
}

.cook-step-number {
  width: 28px; height: 28px;
  background: var(--gold-dim);
  color: var(--accent);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.cook-step-block.current .cook-step-number {
  background: var(--accent);
  color: var(--accent-text);
}

.cook-step-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
}

.cook-step-text.cook-text-sm { font-size: 14px; }
.cook-step-text.cook-text-md { font-size: 16px; }
.cook-step-text.cook-text-lg { font-size: 19px; }

.cook-section-heading {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Done button */
.cook-done-btn {
  display: block;
  width: calc(100% - 40px);
  margin: 20px auto 40px;
  padding: 16px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  transition: opacity 0.15s;
}
.cook-done-btn:active { opacity: 0.85; }

/* Timer */
.cook-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: 10px;
}
.timer-display {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  min-width: 60px;
}
.timer-btn {
  padding: 7px 14px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

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

.list-header {
  padding: 56px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.list-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
}

.list-clear-btn {
  font-size: 13px;
  color: var(--danger);
  font-weight: 500;
}

.list-items { padding: 0 20px; }

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.list-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.list-check.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.list-check.checked::after {
  content: '✓';
  font-size: 12px;
  color: var(--accent-text);
  font-weight: 700;
}

.list-item-text {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
  transition: color 0.15s;
}
.list-item-text.done { color: var(--text-dimmer); text-decoration: line-through; }

.list-item-from { font-size: 10px; color: var(--text-dimmer); margin-top: 2px; }

.list-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dimmer);
  font-size: 14px;
  line-height: 1.7;
  display: none;
}
.list-empty.visible { display: block; }
.list-empty-icon { font-size: 40px; margin-bottom: 12px; }

.list-actions {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-action-btn {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.15s;
}
.list-action-btn:active { opacity: 0.8; }
.list-action-btn.primary { background: var(--accent); color: var(--accent-text); }
.list-action-btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }

/* ═══════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════ */

.settings-header { padding: 56px 20px 16px; }
.settings-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
}

.settings-body { padding: 0 20px 80px; }

.settings-section-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  margin: 24px 0 10px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.settings-row-col {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.settings-row-label { font-size: 14px; color: var(--text); }

.settings-input {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  text-align: right;
  min-width: 0;
  max-width: 160px;
  transition: border-color 0.15s;
}
.settings-input:focus { border-color: var(--accent); }
.settings-input::placeholder { color: var(--text-dimmer); }
.settings-input-sm { width: 60px; }
.settings-input-full { width: 100%; max-width: 100%; text-align: left; }

/* Theme toggle */
.theme-toggle, .size-toggle {
  display: flex;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
}
.theme-opt, .size-opt {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.theme-opt.active, .size-opt.active {
  background: var(--accent);
  color: var(--accent-text);
}

.size-opt { padding: 8px 14px; }
.size-opt:nth-child(1) { font-size: 11px; }
.size-opt:nth-child(2) { font-size: 14px; }
.size-opt:nth-child(3) { font-size: 18px; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface3);
  border-radius: 26px;
  transition: background 0.2s;
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Sync status */
.sync-status {
  font-size: 13px;
  color: var(--text-dim);
  padding: 6px 12px;
  background: var(--surface);
  border-radius: 8px;
}
.sync-status.ok { color: var(--success); }
.sync-status.error { color: var(--danger); }

/* Data buttons */
.data-btn {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: block;
  transition: background 0.15s;
}
.data-btn:active { background: var(--surface2); }

.delete-recipe-btn {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1px solid var(--danger);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--danger);
  transition: background 0.15s;
}
.delete-recipe-btn:active { background: rgba(192,57,43,0.1); }

.settings-save-row { margin-top: 28px; }

.save-btn {
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  transition: opacity 0.15s;
}
.save-btn:active { opacity: 0.85; }

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

.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface3);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal {
  width: 100%;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.32,0.72,0,1);
}
.modal-overlay.show .modal { transform: translateY(0); }

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.modal-body {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-actions { display: flex; flex-direction: column; gap: 10px; }

.modal-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  transition: opacity 0.15s;
}
.modal-btn:active { opacity: 0.8; }
.modal-btn.primary { background: var(--accent); color: var(--accent-text); }
.modal-btn.secondary { background: var(--surface2); color: var(--text); }
.modal-btn.danger { background: var(--danger); color: white; }

/* ═══════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════ */

.hidden { display: none !important; }

/* Smooth theme transition */
body, .view, .bottom-nav, .recipe-top-bar, .edit-top-bar, .cook-top-bar, .settings-header, .list-header, .search-header {
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

/* ── Edit form additions ── */
.edit-input-emoji { max-width: 80px; }

.edit-label-sub { margin-bottom: 4px; }

.edit-tag-label {
  margin-top: 12px;
  margin-bottom: 7px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dimmer);
}

.edit-tag-label-sub {
  margin-top: 4px;
}

.edit-delete-row { margin-top: 12px; }

.item-bullet-number {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  margin-top: 8px;
}
