/* ============================================================
   DESIGN SYSTEM — Mein Rezeptbuch
   Style:   Electric Pop Editorial / Neo-Brutalist Zine
   Font:    Manrope + Material Symbols
   Shadows: Hard offset (neo-shadow), no soft blur
   ============================================================ */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('fonts/material-symbols-outlined.woff2') format('woff2');
}
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

:root {
  --header-h:     60px;
  --footer-h:     57px;

  /* Electric Pop palette */
  --primary-pink:      #FF8ACD;
  --hero-purple:       #D1C4FF;
  --section-pink:      #FFC6E7;
  --section-cyan:      #B3F6FF;
  --accent-green:      #76F7AE;
  --accent-yellow:     #FFE959;
  --accent-orange:     #FFB347;
  --accent-purple:     #C69EFF;
  --accent-blue:       #8AF1FF;
  --card-subtle-red:   #FFEBEE;
  --card-subtle-blue:  #E3F2FD;
  --card-subtle-green: #F1F8E9;

  --black: #000000;
  --white: #FFFFFF;
  --fg:    #000000;
  --fg-muted: rgba(0,0,0,0.5);

  /* Neo-shadows (hard offset, no blur) */
  --neo-shadow:    6px 6px 0px 0px #000;
  --neo-shadow-sm: 4px 4px 0px 0px #000;

  /* Borders */
  --border:    3px solid #000;
  --border-sm: 2px solid #000;

  /* Radii */
  --radius-card: 40px;
  --radius-img:  30px;
  --radius-pill: 9999px;
  --radius-md:   24px;
  --radius-sm:    8px;

  /* Transitions */
  --t: 100ms ease;
}

/* ===== LOADING OVERLAY ===== */
.app-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--hero-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}
.app-loading-hidden { opacity: 0; pointer-events: none; }

.app-loading-burger {
  width: 96px;
  height: 96px;
  object-fit: contain;
  animation: burger-spin 1s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  filter: drop-shadow(4px 4px 0 rgba(0,0,0,0.2));
}

@keyframes burger-spin {
  0%   { transform: rotate(0deg) scale(1); }
  25%  { transform: rotate(90deg) scale(1.08); }
  50%  { transform: rotate(180deg) scale(1); }
  75%  { transform: rotate(270deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Inline burger spinner — used inside buttons during async actions */
.btn-burger-spinner {
  width: 20px;
  height: 20px;
  object-fit: contain;
  animation: burger-spin 0.9s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ===== DECORATIVE FOOD ASSETS ===== */
.deco-img {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
@media (max-width: 767px) {
  .deco-img { display: none; }
}

/* ── Milkshake — parallax via JS ── */
.deco-milkshake {
  width: 80px;
  /* Default: right of search bar / filter area in the lower half of the hero */
  bottom: 32px;
  right: 72px;
  transform: rotate(10deg);
  will-change: transform;
  filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.12));
  z-index: 0;
}
/* On detail hero: behind content, right of action buttons, at rating height */
.detail-hero-section .deco-milkshake {
  bottom: auto;
  right: auto;
  top: 205px;
  left: 40%;
  z-index: 0;
  opacity: 0.85;
}

/* ── Spaghetti — gentle floating bob ── */
.deco-spaghetti {
  width: 120px;
  bottom: 16px;
  left: 10%;
  animation: deco-bob 3.8s ease-in-out infinite;
  filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.12));
}
@keyframes deco-bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}

/* ── Burger — starts tilted, rotates upright when parent section is hovered ── */
.deco-burger {
  width: 100px;
  bottom: -32px; /* lower third bleeds below the section border */
  right: 18%;
  transform: rotate(-15deg);
  transition: transform 0.6s ease;
  filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.12));
}
/* Detail page burger: bottom-right of content section */
.detail-content-section .deco-burger {
  top: auto;
  bottom: 56px;
  right: 56px;
}

/* Trigger on section hover, not the image itself */
.section-recipes:hover .deco-burger,
.detail-content-section:hover .deco-burger,
.settings-hero:hover .deco-burger {
  transform: rotate(12deg);
}

/* ── Collections grid: burger at dividing line, milkshake lower-right ── */
.section-collections-grid .deco-burger {
  bottom: auto;
  top: -48px;
  right: 26%;
  transform: rotate(-18deg);
  width: 90px;
}
.section-collections-grid:hover .deco-burger { transform: rotate(12deg); }
.section-collections-grid .deco-milkshake {
  top: auto;
  bottom: 48px;
  right: auto;
  left: 56px;
  transform: rotate(8deg);
  width: 80px;
}

/* ── Collection detail recipes: spaghetti lower-right ── */
.section-collection-detail-recipes .deco-spaghetti {
  left: auto;
  right: 56px;
  top: auto;
  bottom: 48px;
  width: 100px;
  animation: deco-bob 3.8s ease-in-out infinite;
}

/* ── Form main: milkshake lower-right ── */
.form-main .deco-milkshake {
  top: auto;
  bottom: 48px;
  right: 56px;
  transform: rotate(-8deg);
  width: 90px;
}

/* ── Settings hero ── */
.settings-hero .deco-burger {
  bottom: auto;
  right: 64px;
  top: 50%;
  transform: translateY(-50%) rotate(-18deg);
  width: 88px;
}

/* ── Shopping content: spaghetti lower-left above footer ── */
.shopping-content .deco-spaghetti {
  left: 48px;
  right: auto;
  bottom: 40px;
  top: auto;
  width: 100px;
  animation: deco-bob 3.8s ease-in-out infinite;
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
}
body {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  background: #F7F7EE;
  color: var(--fg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}


.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 0, 'opsz' 24;
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
}

/* ===== HEADER ===== */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  background: var(--primary-pink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top) 16px 0;
  z-index: 100;
  border-bottom: var(--border);
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 32px;
  min-width: 0;
}

.header-brand {
  font-size: 1rem;
  font-weight: 800;
  color: var(--black);
  cursor: pointer;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity var(--t);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-brand:hover { opacity: 0.7; }
.header-brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Header buttons — icon circles on mobile, pill with text on desktop */
.header-btn {
  height: 44px;
  border: var(--border);
  border-radius: var(--radius-pill);
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
  white-space: nowrap;
  /* Mobile: icon-only circle */
  width: 44px;
  padding: 0;
}
.header-btn:hover { transform: translate(-2px, -2px); box-shadow: var(--neo-shadow-sm); }
.header-btn .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }
.header-btn .header-btn-label { display: none; }

.header-btn-cart { background: var(--white); color: var(--black); }
.header-btn-dark { background: var(--white); color: var(--black); }

/* Desktop: expand to pill with text */
@media (min-width: 768px) {
  header { padding: env(safe-area-inset-top) 24px 0; }
  .header-btn { width: auto; padding: 0 18px; gap: 6px; }
  .header-btn .header-btn-label { display: inline; }
}

.btn-icon {
  width: 36px;
  height: 36px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-pill);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
  flex-shrink: 0;
}
.btn-icon:hover { transform: translate(-2px, -2px); box-shadow: var(--neo-shadow-sm); }
.btn-icon .material-symbols-outlined { font-size: 18px; }

.header-desktop-nav,
.header-nav {
  display: none;
  gap: 24px;
}
@media (min-width: 1200px) {
  .header-desktop-nav,
  .header-nav { display: flex; }
}

.header-nav-link {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--black);
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: opacity var(--t);
  padding-bottom: 2px;
  white-space: nowrap;
}
.header-nav-link:hover { border-bottom: 2px solid rgba(0,0,0,0.35); }
.header-nav-link.active { border-bottom: var(--border); color: var(--black); }

/* ===== SIDEBAR — hidden in new design ===== */
.sidebar { display: none !important; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: 0;
  padding-top: calc(var(--header-h) + env(safe-area-inset-top));
  min-height: 100vh;
}

.view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 32px;
}

/* List, collections, detail, form and settings views are full-bleed section-based layouts */
#view-list,
#view-collections,
#view-collection-detail,
#view-detail,
#view-form,
#view-profile,
#view-meal-plan,
#view-settings,
#view-shopping,
#view-impressum,
#view-datenschutz,
#view-agb {
  max-width: none;
  padding: 0;
}

#view-collections,
#view-collection-detail,
#view-detail,
#view-profile,
#view-meal-plan,
#view-settings,
#view-shopping,
#view-impressum,
#view-datenschutz,
#view-agb {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h) - env(safe-area-inset-top) - var(--footer-h));
}
#view-collections .section-collections-grid,
#view-detail .detail-content-section,
#view-profile .section-profile-recipes,
#view-meal-plan .section-meal-plan-days,
#view-settings .settings-content,
#view-shopping .shopping-content,
#view-impressum .impressum-content,
#view-datenschutz .impressum-content,
#view-agb .impressum-content {
  flex: 1;
}

/* ===== HERO SECTION (list view) ===== */
.view-hero {
  background: var(--hero-purple);
  border-bottom: var(--border);
  padding: 64px 32px 40px;
  position: relative;
  overflow: visible;
  text-align: center;
}
.view-hero > *:not(.view-hero-grid-pattern):not(.deco-img) {
  position: relative;
  z-index: 1;
}

.view-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.20) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.20) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  opacity: 0.5;
}

.view-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.display-heading {
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--black);
  margin-bottom: 32px;
  white-space: nowrap;
}

.display-heading .accent { color: var(--primary-pink); }

/* ===== SECTION WRAPPER (own recipes) ===== */
.section-recipes {
  background: var(--section-pink);
  border-bottom: var(--border);
  padding: 32px;
  position: relative;
  overflow: visible;
  z-index: 1; /* lets the burger bleed over the community section below */
}

.section-recipes::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.20) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.20) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.section-recipes-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ===== SECTION WRAPPER (community recipes) ===== */
.section-community {
  background: var(--section-cyan);
  border-top: var(--border);
  padding: 32px;
  position: relative;
  overflow: visible;
}

.section-community::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.20) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.20) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.section-community-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.community-count-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(0,0,0,0.45);
  display: block;
  margin-top: 2px;
}

.community-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* btn-load-more: ghost tier with larger padding */
.btn-load-more { padding: 14px 48px; font-size: 1rem; }

/* Cook mode grid pattern override */
.cook-grid-pattern {
  position: fixed !important;
}

/* Reusable grid pattern overlay div */
.view-hero-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.20) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.20) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Collections hero section */
.collections-hero {
  background: var(--hero-purple);
  border-bottom: var(--border);
  padding: 48px 32px 36px;
  position: relative;
  overflow: hidden;
}
.collections-hero > *:not(.view-hero-grid-pattern):not(.deco-img) {
  position: relative;
  z-index: 1;
}
.collections-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.collections-hero-title-block {
  display: flex;
  align-items: flex-end;
  gap: 24px;
}
.collections-hero-title-block .display-heading,
.settings-hero-inner .display-heading,
.shopping-hero-inner .display-heading {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 4vw, 3rem);
  white-space: normal;
}
.collections-hero-count {
  padding-bottom: 6px;
}
.collections-count-num {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  display: block;
}
.collections-count-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(0,0,0,0.45);
  display: block;
}
.collections-hero-btn {
  flex-shrink: 0;
  margin-bottom: 4px;
}

/* Collections grid section */
.section-collections-grid {
  background: var(--section-pink);
  padding: 36px 32px;
  position: relative;
  overflow: visible;
}
.section-collections-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.20) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.20) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Section recipes header */
.section-recipes-header {
  max-width: 1200px;
  margin: 0 auto 24px;
  position: relative;
  z-index: 1;
  padding-bottom: 12px;
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.section-recipes-title {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.section-heading-sub {
  font-size: 0.82rem;
  font-weight: 400;
  color: rgba(0,0,0,0.55);
  margin: 0;
  letter-spacing: 0;
  text-transform: none;
}
.section-recipes-actions {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 767px) {
  .section-recipes-title { flex: 1 1 100%; }
  .section-recipes-actions { flex: 1 1 100%; justify-content: flex-start; }
}

/* Search icon in search bar */
.search-icon {
  position: absolute;
  left: 16px;
  color: rgba(0,0,0,0.4);
  font-size: 18px;
  pointer-events: none;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: var(--border);
}

.section-heading {
  font-size: 1.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--black);
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-pink);
  color: var(--black);
  border: var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
}
.btn-primary:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: var(--neo-shadow-sm); }
.btn-primary .material-symbols-outlined { font-size: 18px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  color: var(--black);
  border: var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
}
.btn-secondary:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: var(--neo-shadow-sm); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-subtle-red);
  color: var(--black);
  border: var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
}
.btn-danger:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: var(--neo-shadow-sm); }

/* Global disabled state for all button tiers — muted, no hover, clear cursor.
   Styleguide reference: opacity 0.38–0.5 + cursor + semantic attribute. */
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* btn-black is deprecated — use btn-danger */
.btn-black { background: var(--card-subtle-red); color: var(--black); border: var(--border); }
.btn-black:hover { transform: translate(-2px,-2px); box-shadow: var(--neo-shadow-sm); }

/* btn-back is deprecated — use btn-secondary */
.btn-back { margin-bottom: 24px; }

.btn-sm { padding: 7px 14px; font-size: 0.75rem; }
.btn-sm .material-symbols-outlined { font-size: 16px; }

/* ===== GHOST BUTTON ===== */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: rgba(0,0,0,0.45);
  border: 2px solid rgba(0,0,0,0.2);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t), color var(--t), border-color var(--t);
}
.btn-ghost:hover {
  color: var(--black);
  border-color: rgba(0,0,0,0.5);
  transform: translate(-2px,-2px);
  box-shadow: 2px 2px 0 0 rgba(0,0,0,0.25);
}
.btn-ghost .material-symbols-outlined { font-size: 18px; }
/* "Auswählen" button — enters multi-select mode for bulk delete /
   shopping list. Compact ghost variant with smaller padding to fit
   alongside the other section-header controls. */
.btn-enter-selection {
  padding: 8px 14px;
  font-size: 0.72rem;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 28px;
  background: var(--white);
  border: var(--border);
  border-radius: 9999px;
  box-shadow: 2px 2px 0 0 #000;
  overflow: hidden;
  transition: box-shadow var(--t);
}

.search-bar:focus-within { box-shadow: 4px 4px 0 0 var(--primary-pink); }
@media (min-width: 1024px) {
  .search-bar { max-width: 720px; }
}
@media (min-width: 1440px) {
  .search-bar { max-width: 880px; }
}

.search-bar input::placeholder { color: rgba(0,0,0,0.35); font-weight: 600; }

.search-icon-right {
  padding-right: 20px;
  color: var(--black);
  font-size: 26px;
  pointer-events: none;
  flex-shrink: 0;
}

/* Category filters inside hero: centered, wrapping */
.view-hero .category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
}

/* ===== SORT SELECT ===== */
/* ── Own filter toggle (Alle / Eigene) ── */
.own-filter-toggle {
  display: flex;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.own-filter-btn {
  padding: 6px 14px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: none;
  background: var(--white);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.own-filter-btn + .own-filter-btn { border-left: var(--border-sm); }
.own-filter-btn.own-filter-active {
  background: var(--primary-pink);
  color: var(--black);
}

.cat-chip-clear {
  background: var(--card-subtle-red) !important;
  border-color: #DC2626 !important;
  color: #DC2626 !important;
}
.cat-chip-clear:hover {
  background: #DC2626 !important;
  color: var(--white) !important;
}

.settings-cookidoo-section {
  border-top: var(--border-sm);
  padding-top: 16px;
  width: 100%;
}
#cookidoo-disconnected,
#cookidoo-connected {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
#cookidoo-disconnected p {
  margin-bottom: 8px;
}
#cookidoo-disconnected input {
  width: 100%;
}
.settings-cookidoo-section .form-card-label {
  margin-bottom: 2px !important;
  margin-top: 10px !important;
}
.settings-cookidoo-section .form-card-label:first-of-type {
  margin-top: 0 !important;
}
.settings-cookidoo-section input {
  margin-top: 0;
}
.btn-cookidoo-export {
  white-space: nowrap;
}

.sort-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.sort-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--white);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  padding: 7px 32px 7px 16px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--black);
  cursor: pointer;
  box-shadow: none;
  outline: none;
}
.sort-select:focus { box-shadow: 4px 4px 0 0 var(--primary-pink); }
.sort-select-arrow {
  position: absolute;
  right: 8px;
  font-size: 16px;
  pointer-events: none;
  color: var(--black);
}

.btn-cart {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  border: var(--border);
  background: var(--white);
  box-shadow: none;
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
}
.btn-cart:hover { transform: translate(-2px,-2px); box-shadow: var(--neo-shadow-sm); }

/* ===== CATEGORY FILTER CHIPS ===== */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
}

/* Chip color rotation — palette colors only (no orange) */
.chip-color-0 { background: #76F7AE; } /* Decorative Green  Tone 50 */
.chip-color-1 { background: #FFE959; } /* Decorative Yellow Tone 50 */
.chip-color-2 { background: #FF8ACD; } /* Primary Pink      Tone 50 */
.chip-color-3 { background: #B37DFF; } /* Decorative Purple Tone 50 */
.chip-color-4 { background: #8AF1FF; } /* Decorative Blue   Tone 50 */
.chip-color-5 { background: #FFD6E7; } /* Decorative Pink   Tone 70 */

/* Container card palette — same subtle tones as recipe cards */
.card-bg-0 { background: var(--card-subtle-blue)  !important; }
.card-bg-1 { background: var(--card-subtle-red)   !important; }
.card-bg-2 { background: var(--card-subtle-green) !important; }
.card-bg-3 { background: var(--card-subtle-blue)  !important; }
.card-bg-4 { background: var(--card-subtle-red)   !important; }
.card-bg-5 { background: var(--card-subtle-green) !important; }

/* ================================================================
   CHIP SYSTEM
   Three roles × two sizes — always combine role + size as needed.

   Filter chip  (cat-chip, star-chip)         — toggle, white bg at rest
   Label chip   (card-thumb-tag, card-cat-chip) — display only, permanent shadow
   Action chip  (detail-cat-tag, detail-collection-tag) — clickable, lifts on hover

   Default size: padding 6px 14px / font 0.72rem
   Small size:   padding 4px 10px / font 0.65rem  (–sm modifier)
   ================================================================ */

/* ── Filter chips ── */
.cat-chip,
.star-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: var(--border-sm);
  background: var(--white);
  color: var(--black);
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
  white-space: nowrap;
}
.cat-chip:hover,
.star-chip:hover { transform: translate(-2px,-2px); box-shadow: 2px 2px 0 0 #000; }
.cat-chip.active,
.star-chip.active { background: var(--black) !important; color: var(--white); box-shadow: 2px 2px 0 0 #000; }
.star-chip.active .material-symbols-outlined { color: var(--white); }
.star-chip .material-symbols-outlined { font-size: 14px; font-variation-settings: 'FILL' 1; }

.filter-separator {
  display: inline-block;
  width: 3px;
  height: 20px;
  background: rgba(0,0,0,0.2);
  margin: 0 4px;
  align-self: center;
  flex-shrink: 0;
}

/* ── "Mehr" filter button ── */
.cat-mehr-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--white);
}
.cat-mehr-btn-active {
  background: var(--accent-yellow) !important;
}

/* ── "Mehr" category filter popover ── */
.cat-mehr-popover {
  position: absolute;
  z-index: 300;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 14px;
  width: min(380px, calc(100vw - 24px));
  max-height: min(60vh, 560px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cat-mehr-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.cat-mehr-group-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0,0,0,0.35);
}
.cat-mehr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Form category picker ── */
.category-picker {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}
.category-picker-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.category-picker-group-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0,0,0,0.4);
}
.picker-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  user-select: none;
}
.picker-chevron {
  font-size: 16px;
  transition: transform 0.2s ease;
}
.picker-collapsed .picker-chevron {
  transform: rotate(-90deg);
}
.category-picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
@media (min-width: 768px) {
  .picker-chevron { display: none; }
  .picker-toggle { cursor: default; }
}
@media (max-width: 767px) {
  .picker-collapsed .category-picker-chips {
    display: none;
  }
}
/* Selectable form chip — same shape as filter chips but slightly smaller */
.cat-chip-select {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  border: var(--border-sm);
  color: var(--black);
  font-family: 'Manrope', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t);
}
.cat-chip-select:hover {
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0 0 #000;
}
.cat-chip-select.selected {
  background: var(--black) !important;
  color: var(--white);
  border-color: var(--black);
  box-shadow: 2px 2px 0 0 #000;
}
.cat-chip-select.selected:hover {
  transform: translate(-2px, -2px);
}

/* ===== RECIPE GRID ===== */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
@media (min-width: 900px) {
  .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
}

/* ===== RECIPE CARD — desktop: vertical card with inner image ===== */
.recipe-card {
  border-radius: var(--radius-card);
  cursor: pointer;
  border: var(--border);
  box-shadow: var(--neo-shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--t), box-shadow var(--t);
  overflow: visible;
  padding: 24px;
  background: var(--card-subtle-blue);
}
.recipe-card:hover { transform: translate(-3px, -3px); box-shadow: var(--neo-shadow); }

/* Cycling backgrounds */
.recipe-card:nth-child(3n+1) { background: var(--card-subtle-blue); }
.recipe-card:nth-child(3n+2) { background: var(--card-subtle-red); }
.recipe-card:nth-child(3n)   { background: var(--card-subtle-green); }

/* Inner image container — bordered rounded box inside card padding */
.card-img-wrap {
  border: var(--border-sm);
  border-radius: 30px;
  overflow: hidden;
  height: 200px;
  position: relative;
  margin-bottom: 20px;
  background: rgba(0,0,0,0.04);
  flex-shrink: 0;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Category tag: top-left of image (desktop) — color set by chip-color-N class */
/* Chip overlay container — top-left of image, wraps to next line if needed */
.card-thumb-tags {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

/* ── Label chips (display only) ── */
.card-thumb-tag {
  display: inline-flex;
  align-items: center;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--black);
  white-space: nowrap;
  box-shadow: 1px 1px 0 0 #000;
}

/* Card body — below image */
.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.recipe-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--black);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}

/* Category chips row inside card body */
.card-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.card-cat-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  box-shadow: 1px 1px 0 0 #000;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 800;
  color: rgba(0,0,0,0.55);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

/* Footer: stars + bookmark */
.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-icon-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== CARD RATING ===== */
.card-rating {
  display: flex;
  gap: 1px;
  align-items: center;
}
.card-star {
  font-size: 14px;
  color: rgba(0,0,0,0.18);
}
.card-star.card-star-filled { color: var(--black); }
.card-rating-count {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(0,0,0,0.4);
  margin-left: 3px;
}
.detail-rating-info {
  font-size: 0.82rem;
  font-weight: 800;
  color: rgba(0,0,0,0.5);
  margin-left: 8px;
}
.detail-rating-count {
  font-weight: 700;
  font-size: 0.72rem;
}

/* ===== PRIVATE BADGE (card) ===== */
.card-private-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-yellow);
  border: var(--border-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 1px 1px 0 0 #000;
}
.card-private-badge .material-symbols-outlined {
  font-size: 14px;
  color: var(--black);
}
.card-tm-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: var(--border-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 1px 1px 0 0 #000;
}
.card-tm-badge .material-symbols-outlined {
  font-size: 14px;
  color: var(--black);
}
.card-private-badge::after {
  content: 'Nur für dich sichtbar';
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--accent-yellow);
  color: var(--black);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 10px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: 2px 2px 0 0 #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1000;
}
.card-private-badge:hover::after {
  opacity: 1;
}

.card-tm-badge::after {
  content: 'Thermomix-Version verfügbar';
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--accent-yellow);
  color: var(--black);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 10px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: 2px 2px 0 0 #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1000;
}
.card-tm-badge:hover::after {
  opacity: 1;
}

/* ===== COLLECTION BADGE (card — community recipe from collection) ===== */
.card-collection-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-purple);
  border: var(--border-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 1px 1px 0 0 #000;
}
.card-collection-badge .material-symbols-outlined {
  font-size: 14px;
  color: var(--black);
}
.card-collection-badge::after {
  content: 'Aus Sammlung';
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--accent-yellow);
  color: var(--black);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 10px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: 2px 2px 0 0 #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1000;
}
.card-collection-badge:hover::after {
  opacity: 1;
}
@media (max-width: 767px) {
  .card-collection-badge::after { display: none; }
  .card-collection-badge {
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
  }
  .card-collection-badge .material-symbols-outlined { font-size: 14px; }
  /* Prevent chip overlap with collection badge on mobile */
  .card-img-wrap:has(.card-collection-badge) .card-thumb-tags {
    right: 36px;
  }
}

/* ===== CARD COLLECTION BUTTON ===== */
/* ===== FAVORITE BUTTON (card) ===== */
.card-favorite-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: var(--border-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
  padding: 0;
  flex-shrink: 0;
  position: relative;
}
.card-favorite-btn:hover { transform: translate(-1px,-1px); box-shadow: 2px 2px 0 0 #000; }
.card-favorite-btn .material-symbols-outlined { font-size: 16px; color: var(--black); }
.card-favorite-btn.card-favorite-active { background: var(--primary-pink); }
.card-favorite-btn.card-favorite-active .material-symbols-outlined { color: var(--white); }
.card-favorite-btn::after {
  content: 'Als Favorit markieren';
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  transform: translateY(-50%);
  background: var(--accent-yellow);
  color: var(--black);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 10px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: 2px 2px 0 0 #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1000;
}
.card-favorite-btn.card-favorite-active::after { content: 'Favorit entfernen'; }
.card-favorite-btn:hover::after { opacity: 1; }

.card-collection-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: var(--border-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
  padding: 0;
  flex-shrink: 0;
}
.card-collection-btn { position: relative; }
.card-collection-btn:hover { transform: translate(-1px,-1px); box-shadow: 2px 2px 0 0 #000; }
.card-collection-btn .material-symbols-outlined { font-size: 16px; color: var(--black); }
.card-collection-btn.card-collection-btn-active { background: var(--accent-purple); }
.card-collection-btn.card-collection-btn-active .material-symbols-outlined { color: var(--white); }
.card-collection-btn.card-collection-btn-active::after { content: 'Sammlungen bearbeiten'; }
.card-collection-btn::after {
  content: 'Zur Sammlung hinzufügen';
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  transform: translateY(-50%);
  background: var(--accent-yellow);
  color: var(--black);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 10px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: 2px 2px 0 0 #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1000;
}
.card-collection-btn:hover::after {
  opacity: 1;
}

.card-shopping-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: var(--border-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
  padding: 0;
  flex-shrink: 0;
  position: relative;
}
.card-shopping-btn:hover { transform: translate(-1px,-1px); box-shadow: 2px 2px 0 0 #000; }
.card-shopping-btn .material-symbols-outlined { font-size: 16px; color: var(--black); }
.card-shopping-btn::after {
  content: 'Zur Einkaufsliste';
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  transform: translateY(-50%);
  background: var(--accent-yellow);
  color: var(--black);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 10px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: 2px 2px 0 0 #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1000;
}
.card-shopping-btn:hover::after { opacity: 1; }

@media (max-width: 767px) {
  /* Mobile card is horizontal with a 110px image — 44px buttons would overflow.
     36px on mobile is below iOS HIG ideal (44), but the card itself is a large
     tap target (tap anywhere opens recipe) and these are secondary actions. */
  .card-favorite-btn,
  .card-collection-btn,
  .card-shopping-btn { width: 36px; height: 36px; }
  .card-shopping-btn .material-symbols-outlined { font-size: 16px; }
}

/* ===== SELECTION MODE ===== */
.recipe-card.card-selected { outline: none; }

.card-select-check {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: var(--border-sm);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 2px 2px 0 0 #000;
  opacity: 0;
  transition: opacity var(--t), background var(--t);
}
.card-selectable .card-select-check { opacity: 1; }
.card-select-visible { opacity: 1 !important; background: var(--black) !important; }
.card-select-check .material-symbols-outlined {
  font-size: 14px;
  color: var(--white);
  font-variation-settings: 'FILL' 1, 'wght' 700;
}

/* ===== MOBILE CARD — horizontal layout ===== */
@media (max-width: 767px) {
  .recipe-card {
    flex-direction: row;
    padding: 16px;
    gap: 14px;
    border-radius: 32px;
    align-items: flex-start;
    overflow: hidden;
  }
  .card-img-wrap {
    width: 110px;
    height: 110px;
    flex-shrink: 0;
    border-radius: 18px;
    margin-bottom: 0;
  }
  .card-thumb-tags {
    top: 6px;
    left: 6px;
    right: 6px;
    gap: 3px 4px;
  }
  .card-thumb-tag:nth-child(n+3) {
    display: none;
  }
  .card-thumb-tag {
    font-size: 0.58rem;
    padding: 2px 7px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .recipe-card h3 {
    font-size: 0.85rem;
    margin-bottom: 4px;
    padding-right: 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .card-meta { flex-direction: column; gap: 2px; margin-bottom: 8px; }
}

/* ===== EXTRA-SMALL VIEWPORTS (≤360px) — prevent card button overflow ===== */
@media (max-width: 360px) {
  .view { padding: 16px 10px; }
  .recipe-card { padding: 12px; gap: 10px; }
  .card-img-wrap { width: 92px; height: 92px; }
  .card-favorite-btn,
  .card-collection-btn { width: 32px; height: 32px; }
  .card-shopping-btn { width: 32px; height: 32px; }
  .card-icon-btns { gap: 2px; }
  .card-star { font-size: 12px; }
  .card-footer { flex-wrap: wrap; row-gap: 6px; }
  .card-private-badge { bottom: 8px; right: 8px; width: 26px; height: 26px; }
  .card-private-badge .material-symbols-outlined { font-size: 12px; }
  .card-select-check { top: 16px; left: 130px; width: 36px; height: 36px; }
  .card-select-check .material-symbols-outlined { font-size: 14px; }
  .card-star { font-size: 12px; }
}

/* Push float bar above selection bar when both are visible */
.selection-bar-open .detail-float-bar {
  bottom: calc(56px + env(safe-area-inset-bottom));
}
@media (max-width: 767px) {
  .selection-bar-open .detail-float-bar {
    bottom: calc(64px + env(safe-area-inset-bottom) + 56px);
  }
}

/* Selection bar */
.selection-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--black);
  color: var(--white);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  border-top: var(--border);
}
.selection-bar-count {
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.selection-bar-actions { display: flex; gap: 8px; }
.selection-bar .btn-secondary {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
  color: var(--white);
}
.selection-bar .btn-secondary:hover { background: rgba(255,255,255,0.25); }
.selection-bar .btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.selection-bar .btn-danger {
  background: rgba(211, 47, 47, 0.25);
  border-color: rgba(211, 47, 47, 0.6);
  color: #ff8a80;
}
.selection-bar .btn-danger:hover { background: rgba(211, 47, 47, 0.4); transform: none; box-shadow: none; }
.selection-bar .btn-danger:disabled { opacity: 0.35; cursor: not-allowed; }

@media (max-width: 767px) {
  .selection-bar {
    bottom: calc(64px + env(safe-area-inset-bottom));
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .selection-bar-actions {
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
  }
  .selection-bar .btn-secondary,
  .selection-bar .btn-primary,
  .selection-bar .btn-danger {
    padding: 8px 10px;
    font-size: 0.72rem;
    white-space: nowrap;
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
  }
  /* On very narrow viewports (< 380px), drop button text and keep icons only */
}
/* Tablet-Range: Bottom-Nav sichtbar — Selection-Bar darueber anheben */
@media (min-width: 768px) and (max-width: 1199px) {
  .selection-bar {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 380px) {
  .selection-bar .btn-secondary,
  .selection-bar .btn-primary,
  .selection-bar .btn-danger {
    font-size: 0;
    gap: 0;
    padding: 8px;
  }
  .selection-bar .btn-secondary .material-symbols-outlined,
  .selection-bar .btn-primary .material-symbols-outlined,
  .selection-bar .btn-danger .material-symbols-outlined {
    font-size: 18px;
  }
}

/* Hide the import FAB while the selection bar is up — they collide on mobile
 * and the FAB is irrelevant during multi-select anyway. */
.selection-bar-open .fab-import { display: none !important; }

/* ===== SETTINGS VIEW ===== */
.settings-hero {
  background: var(--hero-purple);
  padding: 48px 32px 36px;
  position: relative;
  overflow: hidden;
  border-bottom: var(--border);
}
.settings-hero > *:not(.view-hero-grid-pattern):not(.deco-img) { position: relative; z-index: 1; }
.settings-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.settings-content {
  background: var(--section-pink);
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.settings-content-inner {
  max-width: 1200px;
  margin: 0 auto;
  columns: 2;
  column-gap: 20px;
  position: relative;
  z-index: 1;
}
.settings-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.20) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.20) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.settings-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--neo-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
  break-inside: avoid;
  margin-bottom: 20px;
}
.settings-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-card-header .material-symbols-outlined { font-size: 22px; }
.settings-card-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0;
}
.settings-card-desc {
  font-size: 0.82rem;
  color: rgba(0,0,0,0.55);
  margin: 0;
  line-height: 1.5;
}

/* ── Profile editor (settings) ── */
#settings-profile-card .settings-card-header {
  flex-wrap: wrap;
}
.settings-profile-edit-btn {
  margin-left: auto;
}
.settings-profile-bio-row {
  width: 100%;
}
.settings-profile-bio-row textarea {
  width: 100%;
}
/* ── Private info section ── */
.settings-profile-private {
  width: 100%;
  border-top: var(--border-sm);
  padding-top: 16px;
}
.settings-private-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
}
.settings-private-heading .material-symbols-outlined { font-size: 16px; }
.settings-private-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.settings-private-grid .form-card-label {
  margin-bottom: 2px !important;
  margin-top: 0 !important;
}
.settings-private-grid input,
.settings-private-grid select {
  width: 100%;
  margin-top: 0;
}
.settings-private-diet {
  margin-top: 12px;
}
.settings-private-diet .form-card-label {
  margin-bottom: 6px !important;
  margin-top: 0 !important;
}
.settings-diet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.diet-chip {
  padding: 6px 14px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: none;
}
.diet-chip:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 0 #000;
}
.diet-chip.diet-active {
  background: var(--black);
  color: var(--white);
  box-shadow: 2px 2px 0 0 #000;
  transform: translate(-1px, -1px);
}
.diet-chip:disabled {
  cursor: default;
}
.diet-chip:disabled:not(.diet-active) {
  opacity: 0.5;
}
.diet-chip:disabled.diet-active {
  background: var(--black);
  color: var(--white);
  box-shadow: 2px 2px 0 0 #000;
  transform: translate(-1px, -1px);
  opacity: 1;
}
.settings-gender-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings-profile-actions {
  display: flex;
  gap: 8px;
  align-self: flex-start;
}
/* Disabled inputs in view mode — greyed out to signal read-only state. */
#settings-profile-card input:disabled,
#settings-profile-card textarea:disabled {
  cursor: default;
  color: rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.25);
  opacity: 1;
}
#settings-profile-card input:disabled::placeholder,
#settings-profile-card textarea:disabled::placeholder {
  color: rgba(0, 0, 0, 0.3);
}
/* Editable state — explicit reset so entering edit mode restores full
   contrast regardless of any other selector trying to style the bio field. */
#settings-profile-card input:not(:disabled),
#settings-profile-card textarea:not(:disabled) {
  background: var(--white);
  color: var(--black);
  border-color: #000;
  cursor: text;
}
.settings-profile-editor {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-top: 12px;
}
.settings-avatar-wrap {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  width: 80px;
  height: 80px;
  border: var(--border-sm);
}
.settings-avatar-preview { width: 80px; height: 80px; }
.settings-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.35;
  transition: opacity 0.15s;
}
.settings-avatar-overlay .material-symbols-outlined { color: #fff; font-size: 28px; }
.settings-avatar-wrap:hover .settings-avatar-overlay,
.settings-avatar-wrap:focus-within .settings-avatar-overlay { opacity: 1; }
.settings-avatar-wrap:focus-visible,
.settings-avatar-wrap:focus-within {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}
.settings-profile-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.settings-profile-fields .form-card-label {
  margin-bottom: 2px !important;
  margin-top: 12px !important;
}
.settings-profile-fields .form-card-label:first-child {
  margin-top: 0 !important;
}
.settings-profile-fields input,
.settings-profile-fields textarea {
  margin-top: 0;
}

/* ── Avatar (shared) ── */
.avatar-img {
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--black);
  flex-shrink: 0;
}

/* ── Card author ── */
.card-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(0,0,0,0.75);
  margin-bottom: 6px;
  min-width: 0;
}
.card-author > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.card-author .avatar-img,
.card-author .avatar-initials {
  width: 20px;
  height: 20px;
  font-size: 9px;
}

/* ── Detail author ── */
.detail-author {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(0,0,0,0.65);
  margin-top: 8px;
}
.detail-author .avatar-img,
.detail-author .avatar-initials {
  width: 36px;
  height: 36px;
  font-size: 16px;
  border: var(--border-sm);
}

/* TM model selector */
.tm-model-selector {
  display: flex;
  gap: 0;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  overflow: hidden;
  align-self: flex-start;
  max-width: 100%;
}
.tm-model-btn {
  padding: 8px 20px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  background: var(--white);
  color: var(--black);
  transition: background var(--t), color var(--t);
  box-shadow: none;
  flex: 1;
  white-space: nowrap;
  min-width: 0;
}
.tm-model-btn + .tm-model-btn { border-left: var(--border-sm); }
.tm-model-btn:hover { background: rgba(0,0,0,0.05); transform: none; box-shadow: none; }
.tm-model-active {
  background: var(--primary-pink) !important;
  color: var(--black) !important;
}
.settings-account-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ms-connected-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(118, 247, 174, 0.3);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  padding: 5px 12px 5px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  align-self: flex-start;
}
.ms-connected-badge .material-symbols-outlined {
  font-size: 16px;
  color: #16a34a;
  font-variation-settings: 'FILL' 1;
}
.settings-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.settings-input {
  flex: 1;
  font-size: 0.85rem;
  padding: 8px 14px;
}
@media (max-width: 767px) {
  .settings-hero { padding: 28px 16px 24px; }
  .settings-content { padding: 20px 16px; }
  .settings-content-inner { columns: 1; }
  .tm-model-selector { align-self: stretch; width: 100%; }
  .tm-model-btn { padding: 8px 6px; font-size: 0.75rem; min-width: 0; }
  .settings-input-row { flex-direction: column; align-items: stretch; }
  .settings-input-row .btn-primary { align-self: flex-start; }
  .settings-profile-editor { gap: 12px; }
  .settings-profile-fields { flex: 1; min-width: 0; }
}

/* ===== FOOTER ===== */
.app-footer {
  background: var(--black);
  color: var(--white);
  border-top: var(--border);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.app-footer-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.app-footer-link {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.app-footer-link:hover { color: var(--white); }
@media (max-width: 767px) {
  .app-footer { padding: 16px 20px; }
}

/* ===== LOGIN LEGAL BAR ===== */
.login-legal-bar {
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding-top: 24px;
}
.login-legal-link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0,0,0,0.35);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.login-legal-link:hover { color: rgba(0,0,0,0.7); }
.login-legal-sep {
  color: rgba(0,0,0,0.25);
  font-size: 0.75rem;
  margin: 0 8px;
}

/* ===== IMPRESSUM VIEW ===== */
.impressum-hero {
  background: var(--hero-purple);
  border-bottom: var(--border);
  padding: 48px 32px 36px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.impressum-hero > *:not(.view-hero-grid-pattern):not(.deco-img) { position: relative; z-index: 1; }
.impressum-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.impressum-hero-inner .display-heading {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 4vw, 3rem);
  white-space: normal;
}
.impressum-content {
  background: var(--section-pink);
  padding: 32px 32px 120px;
  position: relative;
}
.impressum-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.20) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.20) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.impressum-content-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.impressum-block {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-card);
  padding: 28px 32px;
  box-shadow: var(--neo-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.impressum-block p {
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 0;
  color: rgba(0,0,0,0.75);
}
.impressum-block p strong { color: var(--black); }
.impressum-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.impressum-list li {
  font-size: 0.9rem;
  line-height: 1.65;
  color: rgba(0,0,0,0.75);
}
.impressum-meta {
  font-size: 0.75rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0,0,0,0.4) !important;
}
.impressum-section-title {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0;
}
.impressum-float-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 96;
  display: flex;
}

@media (max-width: 767px) {
  .impressum-float-bar {
    bottom: calc(64px + env(safe-area-inset-bottom) + 16px);
    left: 20px;
    right: auto;
  }
  .impressum-float-bar .detail-float-back {
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    font-size: 0;
    gap: 0;
    cursor: pointer;
    border: var(--border);
    border-radius: 50%;
    background: var(--white);
    color: var(--black);
    box-shadow: none;
    transition: transform var(--t), box-shadow var(--t);
  }
  .impressum-float-bar .detail-float-back:active { opacity: 0.7; }
  .impressum-float-bar .detail-float-back .material-symbols-outlined { font-size: 28px; }
}

@media (min-width: 768px) {
  .impressum-float-bar {
    bottom: 32px;
    padding: 0 40px;
  }
  .impressum-float-bar .detail-float-back {
    pointer-events: all;
  }
}
@media (max-width: 767px) {
  .impressum-hero { padding: 28px 16px 24px; }
  .impressum-content { padding: 20px 16px 100px; }
  .impressum-block { padding: 20px; border-radius: var(--radius-md); }
}

/* ===== EMPTY MESSAGE ===== */
.empty-message {
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 80px;
  line-height: 2;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

/* ===== FORM ===== */

/* ── Form hero (sticky) ── */
.form-hero {
  background: var(--hero-purple);
  border-bottom: var(--border);
  padding: 16px 32px;
  position: sticky;
  top: calc(var(--header-h) + env(safe-area-inset-top));
  z-index: 99;
  overflow: visible;
}
.form-hero > *:not(.view-hero-grid-pattern):not(.deco-img) { position: relative; z-index: 1; }
.form-hero-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.form-hero-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0;
}
.form-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Private lock toggle in hero ── */
.form-private-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding: 10px;
  background: var(--white);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: none;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), background var(--t);
  flex-shrink: 0;
  margin: 0; /* override global label margin */
}
.form-private-toggle:hover { transform: translate(-2px,-2px); box-shadow: var(--neo-shadow-sm); }
.form-private-toggle .private-checkbox { display: none; }
.form-private-icon {
  font-size: 20px;
  font-variation-settings: 'FILL' 0, 'wght' 700;
  color: rgba(0,0,0,0.45);
  transition: color var(--t);
  pointer-events: none;
  line-height: 1;
}
/* Default: show open lock, hide closed */
.form-private-toggle .form-lock-closed { display: none !important; }
.form-private-toggle .form-lock-open   { display: inline-block !important; }
/* When checked: pink bg, show closed lock, hide open */
.form-private-toggle:has(.private-checkbox:checked) { background: var(--primary-pink); }
.form-private-toggle:has(.private-checkbox:checked) .form-lock-open   { display: none !important; }
.form-private-toggle:has(.private-checkbox:checked) .form-lock-closed {
  display: inline-block !important;
  color: var(--black);
  font-variation-settings: 'FILL' 1, 'wght' 700;
}
/* Tooltip base */
.form-private-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--accent-yellow);
  color: var(--black);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 10px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: 2px 2px 0 0 #000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 200;
}
.form-private-tooltip::after { display: none; }
/* Show "öffentlich" tooltip on hover when unchecked */
.form-private-toggle:hover .form-private-tooltip-open { opacity: 1; transform: translateY(0); }
/* Show "privat" tooltip on hover when checked */
.form-private-toggle:has(.private-checkbox:checked):hover .form-private-tooltip-open  { opacity: 0; transform: translateY(-4px); }
.form-private-toggle:has(.private-checkbox:checked):hover .form-private-tooltip-closed { opacity: 1; transform: translateY(0); }

/* ── Inline private toggle (inside Details card) ── */
.form-private-toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin-top: -4px;
  padding: 8px 14px;
  background: var(--white);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  transition: background var(--t);
}
.form-private-toggle-inline:hover { transform: translate(-2px,-2px); box-shadow: var(--neo-shadow-sm); }
.form-private-toggle-inline .private-checkbox { display: none; }
.form-private-inline-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(0,0,0,0.6);
}
/* Default: show open lock + label, hide closed */
.form-private-toggle-inline .form-lock-closed { display: none !important; }
.form-private-toggle-inline .form-lock-open   { display: inline-block !important; }
.form-private-toggle-inline .form-private-label-closed { display: none; }
.form-private-toggle-inline .form-private-label-open   { display: inline; }
/* When checked: pink bg, swap labels and lock icons */
.form-private-toggle-inline:has(.private-checkbox:checked) { background: var(--primary-pink); }
.form-private-toggle-inline:has(.private-checkbox:checked) .form-private-label-open   { display: none; }
.form-private-toggle-inline:has(.private-checkbox:checked) .form-private-label-closed { display: inline; }
.form-private-toggle-inline:has(.private-checkbox:checked) .form-lock-open   { display: none !important; }
.form-private-toggle-inline:has(.private-checkbox:checked) .form-lock-closed {
  display: inline-block !important;
  color: var(--black);
  font-variation-settings: 'FILL' 1, 'wght' 700;
}
/* Locked state — applied when the user is duplicating a community recipe.
   The toggle is forced to private and cannot be clicked. */
.form-private-toggle-inline.toggle-locked {
  cursor: not-allowed;
  opacity: 0.85;
}
.form-private-toggle-inline.toggle-locked:hover {
  transform: none;
  box-shadow: none;
}
.form-private-toggle-inline.toggle-locked .private-checkbox {
  pointer-events: none;
}
/* Lineage hint shown below the private toggle when a recipe was duplicated
   from someone else's recipe. Yellow neo-brutalist info banner. */
.form-private-lineage-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--accent-yellow);
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--black);
}
.form-private-lineage-hint .material-symbols-outlined {
  font-size: 1.05rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Form floating action buttons ── */
.form-float-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 96;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.form-float-bar .detail-float-back,
.form-float-save {
  pointer-events: all;
}
.form-float-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  border: var(--border);
  background: var(--primary-pink);
  color: var(--black);
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
}
.form-float-save:hover { transform: translate(-2px,-2px); box-shadow: var(--neo-shadow-sm); }
.form-float-save:disabled { opacity: 0.6; cursor: not-allowed; }

@media (max-width: 767px) {
  .form-float-bar {
    bottom: calc(64px + env(safe-area-inset-bottom) + 16px);
    left: 20px;
    right: 20px;
  }
  .form-float-save {
    width: 56px;
    height: 56px;
    padding: 0;
    font-size: 0;
    gap: 0;
    border-radius: 50%;
    justify-content: center;
    box-shadow: none;
  }
  .form-float-save .material-symbols-outlined { font-size: 28px; }
}
@media (min-width: 768px) {
  .form-float-bar {
    bottom: 32px;
    padding: 0 40px;
  }
  .form-float-save {
    height: 48px;
    padding: 0 24px 0 16px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    box-shadow: none;
  }
  .form-float-save .material-symbols-outlined { font-size: 20px; }
}

/* ── Import card ── */
.form-card-import { background: var(--card-subtle-blue); }
.btn-scan { margin-top: 4px; }

/* ── Form main (cyan bg) ── */
.form-main {
  background: var(--section-cyan);
  padding: 40px 32px calc(40px + 80px);
  position: relative;
  overflow: visible;
}
@media (max-width: 767px) {
  .form-main { padding: 24px 16px calc(24px + 80px); }
}
.form-main > *:not(.view-hero-grid-pattern):not(.deco-img) { position: relative; z-index: 1; }

/* ── Form grid: 7/5 columns ── */
.form-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  position: relative;
  z-index: 1;
}
@media (min-width: 768px) {
  .form-grid { grid-template-columns: 7fr 5fr; gap: 28px; }
}
@media (min-width: 1200px) {
  .form-grid { gap: 32px; }
}

.form-fields-col,
.form-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (max-width: 767px) {
  .form-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .form-sidebar-col { order: -1; }
  .form-card-tips { display: none; }
}

/* Make the form itself a flex column so gap applies between cards */
#recipe-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Form card ── */
.form-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-card);
  padding: 24px 28px;
  box-shadow: 2px 2px 0 0 #000;
}
.form-card-tips { background: var(--section-pink); }
.form-card-scan { background: var(--accent-purple); }

.form-card-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0,0,0,0.5);
  margin-bottom: 10px;
  margin-top: 0;
}
/* Stacked labels inside combined cards get top spacing */
.form-card .form-card-label + * + .form-card-label,
.form-card p + .form-card-label,
.form-card input + .form-card-label,
.form-card textarea + .form-card-label,
.form-card .form-time-grid + .form-card-label,
.form-card .form-rating + .form-card-label {
  margin-top: 20px;
}
.form-hint {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(0,0,0,0.35);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 8px;
}

/* ── Form card heading (tips/scan) ── */
.form-card-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
.form-card-heading .material-symbols-outlined { font-size: 20px; }

/* ── Tips list ── */
.form-tips-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.form-tip-dot {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border: var(--border-sm);
  margin-top: 2px;
}
.form-tips-list p {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(0,0,0,0.65);
  line-height: 1.45;
  margin: 0;
}

/* ── Scan card desc ── */
.form-scan-desc {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(0,0,0,0.65);
  line-height: 1.45;
  margin: 0 0 16px;
}

/* ── Textarea inside form cards: slightly tighter radius ── */
.form-input-textarea {
  border-radius: 16px;
}

/* ── Time grid: 3 columns, 2 on narrow phones, 1 on extra-small ── */
.form-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
@media (max-width: 500px) {
  .form-time-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
@media (max-width: 360px) {
  .form-time-grid { grid-template-columns: 1fr; }
}
.form-time-grid .form-card-label { margin-bottom: 8px; margin-top: 0; }

/* ── Form rating stars ── */
.form-rating {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.form-star {
  font-size: 28px;
  color: rgba(0,0,0,0.15);
  cursor: pointer;
  transition: color 0.1s, transform 0.1s;
  user-select: none;
}
.form-star.form-star-filled { color: var(--primary-pink); }
.form-star:hover { transform: scale(1.15); }

/* ── Nutrition form fields ── */
.form-nutrition-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}
@media (max-width: 600px) {
  .form-nutrition-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
.form-nutrition-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0,0,0,0.7);
  margin-bottom: 4px;
}
.form-nutrition-grid input {
  width: 100%;
  min-height: 44px;
  text-align: center;
}
.form-nutrition-grid input:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}
.form-nutrition-grid input.input-error,
.form-nutrition-grid input:invalid:not(:placeholder-shown) {
  border-color: #DC2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}
.form-card-hint {
  font-size: 0.62rem;
  font-weight: 700;
  color: rgba(0,0,0,0.4);
  text-transform: none;
  letter-spacing: 0;
}

/* ── Difficulty selector (form) ── */
.difficulty-selector {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.difficulty-btn {
  flex: 1;
  min-height: 44px;
  padding: 10px 12px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  background: #fff;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: none;
}
.difficulty-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--neo-shadow-sm);
}
.difficulty-btn:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}
.difficulty-btn.difficulty-active {
  background: var(--accent-yellow);
  box-shadow: var(--neo-shadow-sm);
  transform: translate(-2px, -2px);
}

/* ── Difficulty chip (card) ── */
/* "Mit dir geteilt"-Hinweis auf Cards, die ueber recipe_shares reinkamen */
.card-shared-by {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--black);
  background: var(--accent-purple);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  margin-bottom: 8px;
  box-shadow: 1px 1px 0 0 #000;
  align-self: flex-start;
}
.card-shared-by .material-symbols-outlined {
  font-size: 11px;
  color: var(--white);
}
.card-shared-by { color: var(--white); }

.card-difficulty {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  background: var(--accent-yellow);
  box-shadow: 1px 1px 0 0 #000;
  white-space: nowrap;
  margin-bottom: 8px;
}
.card-difficulty .material-symbols-outlined {
  font-size: 11px;
}

/* ── Save button (bottom of fields col) ── */
.form-save-btn {
  width: 100%;
  justify-content: center;
  height: 56px;
  font-size: 0.9rem;
}
.form-delete-btn {
  width: 100%;
  justify-content: center;
  height: 56px;
  font-size: 0.9rem;
  margin-top: 24px;
}

label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  color: rgba(0,0,0,0.5);
  margin-bottom: 6px;
  margin-top: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea {
  width: 100%;
  padding: 12px 16px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  font-family: 'Manrope', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  background: var(--white);
  color: var(--black);
  box-shadow: none;
  transition: box-shadow var(--t);
  line-height: 1.5;
  outline: none;
}
textarea {
  border-radius: var(--radius-md);
  resize: vertical;
}
input:focus, textarea:focus { box-shadow: 2px 2px 0 0 var(--primary-pink); }
input::placeholder, textarea::placeholder { color: rgba(0,0,0,0.3); font-weight: 600; }

/* Search input: transparent inside the pill wrapper — must come after global input rule */
.search-bar input[type="text"] {
  flex: 1;
  width: auto;
  padding: 16px 8px 16px 28px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 1rem;
}
.search-bar input[type="text"]:focus { box-shadow: none; }


/* Image upload */
.image-upload-area {
  width: 100%;
  border: 3px dashed rgba(0,0,0,0.35);
  border-radius: var(--radius-md);
  background: var(--card-subtle-green);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--t), background var(--t);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-upload-area:hover { border-color: var(--primary-pink); background: rgba(255,138,205,0.12); }
.image-upload-area.has-image { border-style: solid; border-color: var(--black); min-height: unset; background: var(--white); }

#upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 32px 28px;
  color: rgba(0,0,0,0.55);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  pointer-events: none;
  text-align: center;
}
.upload-icon { font-size: 48px; color: rgba(0,0,0,0.3); margin-bottom: 4px; font-variation-settings: 'FILL' 1; }
.upload-hint { font-size: 0.68rem; color: rgba(0,0,0,0.35); font-weight: 600; text-transform: none; letter-spacing: 0; }
.upload-format-badges {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.upload-badge {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border: var(--border-sm);
  box-shadow: 2px 2px 0 0 #000;
}
.badge-green  { background: var(--accent-green); }
.badge-yellow { background: var(--accent-yellow); }
.badge-blue   { background: var(--accent-blue); }

#image-preview {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

/* btn-remove-image: ghost tier, layout only */
.btn-remove-image { margin-top: 8px; }

/* Form steps (add recipe form) */
.step-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.step-number {
  flex-shrink: 0;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background: var(--primary-pink);
  color: var(--black);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  letter-spacing: 0.02em;
}
.step-textarea { flex: 1; }
.step-remove {
  flex-shrink: 0;
  background: none;
  border: var(--border);
  border-radius: var(--radius-pill);
  color: rgba(0,0,0,0.45);
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  padding: 5px;
  margin-top: 8px;
  transition: transform var(--t), box-shadow var(--t), color var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}
.step-remove .material-symbols-outlined { font-size: 16px; }
.step-remove:hover { transform: translate(-1px,-1px); box-shadow: 2px 2px 0 0 #000; color: var(--black); }

/* btn-add-step: secondary tier, layout only */
.btn-add-step { margin-top: 4px; }

.form-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 20px;
  border-top: var(--border);
}

.label-hint {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(0,0,0,0.4);
  text-transform: none;
  letter-spacing: 0;
}

/* ===== URL IMPORT ===== */
.import-row { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.import-row input[type="url"] {
  flex: 1;
  background: var(--white);
  margin-top: 0;
  box-shadow: 2px 2px 0 0 #000;
  border-radius: var(--radius-pill);
}

.btn-import {
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-import:disabled { opacity: 0.5; cursor: not-allowed; }


.btn-scan { width: 100%; justify-content: center; }
.btn-scan:disabled { opacity: 0.5; cursor: not-allowed; }

.import-text-area {
  width: 100%;
  margin-top: 12px;
  background: var(--white);
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 0 #000;
  padding: 12px;
  font-family: var(--font);
  font-size: 0.82rem;
  resize: vertical;
  min-height: 80px;
}
.btn-import-text {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}
.btn-import-text:disabled { opacity: 0.5; cursor: not-allowed; }

.import-status {
  font-size: 0.775rem;
  margin-top: 8px;
  min-height: 18px;
  font-weight: 700;
  text-transform: uppercase;
  color: transparent;
}
.import-status.loading { color: rgba(0,0,0,0.6); }
.import-status.success { color: #16A34A; }
.import-status.error   { color: #DC2626; }


/* ===== PRIVATE TOGGLE (form) ===== */
/* TM auto-convert toggle in Mein Thermomix settings card (Bundle F / #59) */
.tm-auto-convert-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(0,0,0,0.2);
}
.tm-auto-convert-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.tm-auto-convert-label > span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--black);
  line-height: 1.4;
}
.tm-auto-convert-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(0,0,0,0.55);
}

.private-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
}
.private-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--black);
  cursor: pointer;
  margin: 0;
}
.private-toggle-label .material-symbols-outlined {
  font-size: 18px;
  color: rgba(0,0,0,0.5);
  font-variation-settings: 'FILL' 1, 'wght' 700;
}
.private-toggle-hint {
  font-size: 0.7rem;
  color: rgba(0,0,0,0.4);
  font-weight: 600;
}
.private-checkbox {
  width: 18px !important;
  height: 18px !important;
  accent-color: var(--primary-pink);
  cursor: pointer;
  flex-shrink: 0;
}

/* ===== DETAIL VIEW ===== */
/* =====================================================
   DETAIL VIEW — Electric Pop Editorial layout
   ===================================================== */

/* ── Hero section ── */
.detail-hero-section {
  display: flex;
  flex-direction: column;
  background: var(--hero-purple);
  border-bottom: var(--border);
  overflow: visible;
  position: relative;
}
@media (min-width: 768px) {
  .detail-hero-section { flex-direction: row; }
}

.detail-hero-left {
  flex: 1;
  padding: 32px 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}
@media (min-width: 768px) {
  .detail-hero-left { width: 50%; flex: none; padding: 48px 56px 40px; gap: 20px; }
}

.detail-hero-right {
  min-height: 220px;
  max-height: 240px;
  position: relative;
  overflow: hidden;
  border-top: var(--border);
}
@media (min-width: 768px) {
  .detail-hero-right {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 50%;
    min-height: unset;
    max-height: unset;
    border-top: none;
    border-left: var(--border);
  }
}
.detail-hero-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Floating action bar ── */
.detail-float-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 96;
  display: flex;
  pointer-events: none; /* children re-enable */
}

/* Mobile: FAB buttons instead of full-width bar */
@media (max-width: 767px) {
  .detail-float-bar {
    bottom: calc(64px + env(safe-area-inset-bottom) + 16px);
    left: 20px;
    right: 20px;
    justify-content: space-between;
  }
  .detail-float-right {
    display: flex;
  }
  .detail-float-back,
  .detail-float-cook {
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    font-size: 0;
    gap: 0;
    cursor: pointer;
    border: var(--border);
    border-radius: 50%;
    box-shadow: none;
    transition: transform var(--t), box-shadow var(--t);
  }
  .detail-float-back:active,
  .detail-float-cook:active { opacity: 0.7; }
  .detail-float-back {
    background: var(--white);
    color: var(--black);
  }
  .detail-float-cook {
    background: var(--primary-pink);
    color: var(--black);
  }
  .detail-float-back .material-symbols-outlined,
  .detail-float-cook .material-symbols-outlined { font-size: 28px; }
}

/* Desktop: two floating pill buttons in opposite corners */
@media (min-width: 768px) {
  .detail-float-bar {
    bottom: 32px;
    justify-content: space-between;
    padding: 0 40px;
  }
}
/* Tablet-Range: Bottom-Nav sichtbar — Detail-Float-Bar darueber anheben */
@media (min-width: 768px) and (max-width: 1199px) {
  .detail-float-bar {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}
@media (min-width: 768px) {
  .detail-float-right {
    display: flex;
    gap: 12px;
  }
  .detail-float-back,
  .detail-float-cook {
    pointer-events: all;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px 0 16px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    border: var(--border);
    border-radius: var(--radius-pill);
    box-shadow: none;
    transition: transform var(--t), box-shadow var(--t);
  }
  .detail-float-back:hover,
  .detail-float-cook:hover { transform: translate(-2px,-2px); box-shadow: var(--neo-shadow-sm); }
  .detail-float-back {
    background: var(--white);
    color: var(--black);
    padding: 0 20px 0 14px;
  }
  .detail-float-cook {
    background: var(--primary-pink);
    color: var(--black);
  }
  .detail-float-back .material-symbols-outlined,
  .detail-float-cook .material-symbols-outlined { font-size: 18px; }
}

/* ── Category chips + private badge ── */
.detail-cats-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.detail-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* ── Action chips (default size) ── */
.detail-cat-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--black);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: none;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
}
.detail-cat-tag:hover { transform: translate(-2px, -2px); box-shadow: 2px 2px 0 0 #000; }

.detail-private-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-yellow);
  color: var(--black);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  box-shadow: 2px 2px 0 0 #000;
}
.detail-private-badge .material-symbols-outlined {
  font-size: 12px;
  font-variation-settings: 'FILL' 1, 'wght' 700;
}

/* ── Title ── */
.detail-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.92;
  color: var(--black);
}

/* ── Meta row: time pills + servings ── */
.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.detail-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.detail-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 9px 16px;
  box-shadow: 2px 2px 0 0 #000;
  white-space: nowrap;
}
.detail-meta-pill .material-symbols-outlined { font-size: 16px; }
.detail-meta-pill-blue   { background: var(--card-subtle-blue); }
.detail-meta-pill-green  { background: var(--card-subtle-green); }
.detail-meta-pill-yellow { background: var(--accent-yellow); }

/* Servings adjuster */
.servings-adjuster {
  display: flex;
  align-items: stretch;
  background: var(--section-pink);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: none;
  overflow: hidden;
  height: 40px;
}
.servings-adjuster button {
  background: var(--primary-pink);
  border: none;
  width: 40px;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--black);
  transition: background var(--t);
  font-family: 'Manrope', sans-serif;
}
.servings-adjuster button:hover { background: #ff6db8; }
.servings-adjuster button:first-child { border-right: var(--border-sm); }
.servings-adjuster button:last-child  { border-left: var(--border-sm); }
.servings-adjuster-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.servings-adjuster-inner .material-symbols-outlined { font-size: 16px; }

/* ── Rating row ── */
.detail-rating-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.detail-rating-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0,0,0,0.45);
  white-space: nowrap;
}

/* ── Action buttons ── */
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* detail-btn: layout-only size class, combine with btn-secondary/danger/primary */
.detail-btn { height: 44px; padding: 0 18px; font-size: 0.75rem; }
/* TM-Version button — same shape/size as Bearbeiten but uses accent-blue
   so it visually reads as a paired-but-distinct primary action. (Bundle G
   request 4.) Owner-only — JS hides it for non-owners. */
.detail-btn-tm {
  background: var(--accent-blue) !important;
  color: var(--black) !important;
}

/* ── Collections in hero ── */
.detail-collections-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.detail-collection-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* ── Action chips (sm size) ── */
.detail-collection-tag {
  display: inline-flex;
  align-items: center;
  color: var(--black);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: none;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
}
.detail-collection-tag:hover { transform: translate(-2px, -2px); box-shadow: 2px 2px 0 0 #000; }
.detail-manage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--white);
  border: var(--border-sm);
  border-radius: 50%;
  color: var(--black);
  cursor: pointer;
  box-shadow: none;
  flex-shrink: 0;
  transition: transform var(--t), box-shadow var(--t);
}
.detail-manage-btn:hover { transform: translate(-2px,-2px); box-shadow: 2px 2px 0 0 #000; }
.detail-manage-btn .material-symbols-outlined { font-size: 16px; }

/* ── TM model select popover ── */
.tm-model-select-popover {
  position: absolute;
  z-index: 300;
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
  padding: 6px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}
.tm-model-select-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(0,0,0,0.45);
  white-space: nowrap;
  padding: 0 6px;
}
.tm-model-select-btn {
  padding: 5px 14px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.95);
  color: var(--black);
  box-shadow: none;
  transition: background var(--t), border-color var(--t), transform var(--t);
}
.tm-model-select-btn:hover { background: rgba(0,0,0,0.07); border-color: rgba(0,0,0,0.25); transform: scale(1.05); box-shadow: none; }

/* ── Collection tag popover ── */
.collection-tag-popover {
  position: absolute;
  z-index: 200;
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
  padding: 6px;
  display: flex;
  flex-direction: row;
  gap: 4px;
}
.collection-tag-popover-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.95);
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), transform var(--t);
  color: var(--black);
}
.collection-tag-popover-btn:hover {
  background: rgba(0,0,0,0.07);
  border-color: rgba(0,0,0,0.25);
  transform: scale(1.08);
}
.collection-tag-popover-btn .material-symbols-outlined { font-size: 16px; }
.collection-tag-popover-btn-danger { color: #c0392b; }
.collection-tag-popover-btn-danger:hover { background: rgba(192,57,43,0.08); border-color: rgba(192,57,43,0.3); }

/* Popover button tooltips */
.collection-tag-popover-btn::after {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-yellow);
  color: var(--black);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 10px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: 2px 2px 0 0 #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 300;
}
#btn-popover-goto::after    { content: 'Zur Sammlung'; }
#btn-popover-remove::after  { content: 'Entfernen'; }
#btn-cat-popover-filter::after { content: 'Nach Kategorie filtern'; }
#btn-cat-popover-remove::after { content: 'Kategorie entfernen'; }
#collection-edit-popover { position: fixed; z-index: 400; }
#btn-col-edit-select::after { content: 'Auswählen'; }
#btn-col-edit-rename::after { content: 'Umbenennen'; }
#btn-col-edit-delete::after { content: 'Löschen'; }
.collection-tag-popover-btn:hover::after { opacity: 1; }

/* ── Source ── */
.detail-source {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(0,0,0,0.45);
  word-break: break-word;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.detail-source a { color: var(--black); text-decoration: underline; }

/* Lineage credit — shown on a recipe that was duplicated from someone else's
   community recipe. Inline pill below the source/author row. */
.detail-lineage {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 14px;
  background: var(--accent-yellow);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--black);
  width: fit-content;
  max-width: 100%;
}
.detail-lineage .material-symbols-outlined {
  font-size: 1.05rem;
  flex-shrink: 0;
}
.detail-lineage a {
  color: var(--black);
  text-decoration: underline;
}

/* "Zuletzt gekocht: vor X Tagen" line — Bundle G / BACKLOG #12.
   Subtle inline pill below the source/author/lineage block. Uses the
   green accent to feel positive (vs the yellow lineage warning).
   When the latest cook event has a note, the pill gets .has-note +
   data-tooltip="..." and a sticky_note icon, with a yellow tooltip
   on hover (matching the existing card-private-badge tooltip pattern). */
.detail-last-cooked {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 14px;
  background: var(--accent-green);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--black);
  width: fit-content;
  max-width: 100%;
  position: relative;
}
.detail-last-cooked .material-symbols-outlined {
  font-size: 1.05rem;
  flex-shrink: 0;
}
.detail-last-cooked.has-note {
  cursor: help;
}
.detail-last-cooked-note-icon {
  opacity: 0.8;
}
/* Tooltip — appears above the pill on hover/tap. Uses attr(data-tooltip)
   so the note text comes from the JS-set attribute. Wraps long notes
   instead of forcing nowrap (notes can be a sentence or two). */
.detail-last-cooked.has-note::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--accent-yellow);
  color: var(--black);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  padding: 8px 12px;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 0 #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1000;
  width: max-content;
  max-width: 280px;
  white-space: normal;
}
.detail-last-cooked.has-note:hover::after,
.detail-last-cooked.has-note:focus::after {
  opacity: 1;
}
/* Mobile: tap to toggle via .tooltip-tapped class (added by JS click handler) */
@media (max-width: 767px) {
  .detail-last-cooked.has-note:hover::after { opacity: 0; }
  .detail-last-cooked.has-note.tooltip-tapped::after { opacity: 1; }
}

/* Cooking log modal textarea */
.cooking-log-textarea {
  width: 100%;
  min-height: 100px;
  margin-top: 12px;
  padding: 12px 14px;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: 'Manrope', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--black);
  resize: vertical;
  outline: none;
}
.cooking-log-textarea:focus {
  box-shadow: 4px 4px 0 0 var(--primary-pink);
}

/* ============================================================
   IMPORT FAB + POPOVER (Bundle G — home view)
   ============================================================ */
/* Round FAB on the home view, fixed bottom-right. Above the bottom nav
   on mobile (handled via z-index + safe-area inset). Pink primary look. */
.fab-import {
  position: fixed;
  right: 24px;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-pink);
  color: var(--black);
  border: var(--border);
  box-shadow: var(--neo-shadow);
  cursor: pointer;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t), box-shadow var(--t);
}
.fab-import:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 0 #000;
}
.fab-import .material-symbols-outlined {
  font-size: 32px;
  font-variation-settings: 'FILL' 1, 'wght' 700;
}
/* Hide on non-list views (set via JS, but defensive default) */
.fab-import.fab-import-hidden { display: none; }

/* Desktop position: align to the right margin a bit further out */
@media (min-width: 768px) {
  .fab-import {
    right: 32px;
    bottom: 32px;
  }
}
/* Tablet-Range: Bottom-Nav ist sichtbar (768-1199), FAB darueber platzieren */
@media (min-width: 768px) and (max-width: 1199px) {
  .fab-import {
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}

/* Popover above the FAB — matches the established frosted-glass pattern
   used by .detail-more-popover and .cat-mehr-popover (backdrop blur,
   white-translucent bg, soft drop shadow). Animates in via modalCardIn. */
.fab-import-popover {
  position: fixed;
  right: 24px;
  bottom: calc(176px + env(safe-area-inset-bottom, 0px));
  width: 280px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 8px;
  z-index: 91;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: modalCardIn 220ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@media (min-width: 768px) {
  .fab-import-popover {
    right: 32px;
    bottom: 112px;
  }
}
.fab-import-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  text-align: left;
  font-family: 'Manrope', sans-serif;
  transition: background var(--t), border-color var(--t), transform var(--t);
  -webkit-tap-highlight-color: transparent;
}
.fab-import-item:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.2);
  transform: scale(1.02);
}
.fab-import-item .material-symbols-outlined {
  font-size: 20px;
  flex-shrink: 0;
  color: var(--black);
}
.fab-import-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.fab-import-item strong {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--black);
}
.fab-import-item small {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.55);
  text-transform: none;
  letter-spacing: 0;
}

/* Import modal inputs (URL, textarea, scan button) */
.import-modal-input {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: 'Manrope', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--black);
  outline: none;
}
.import-modal-input:focus {
  box-shadow: 4px 4px 0 0 var(--primary-pink);
}
.import-modal-textarea {
  width: 100%;
  min-height: 180px;
  margin-top: 12px;
  padding: 12px 14px;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: 'Manrope', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--black);
  resize: vertical;
  outline: none;
}
.import-modal-textarea:focus {
  box-shadow: 4px 4px 0 0 var(--primary-pink);
}
.import-modal-scan-btn {
  width: 100%;
  margin-top: 12px;
  justify-content: center;
}

/* Yellow tip badge under the description in the image import modal —
   makes the multi-page support more discoverable than the prose text. */
.image-tip-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--accent-yellow);
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--black);
  line-height: 1.3;
}
.image-tip-badge .material-symbols-outlined {
  font-size: 1.05rem;
  flex-shrink: 0;
}

/* Staging area thumbnails for picked images. Each thumb shows the
   compressed JPG, a page-number badge bottom-left, and a small remove
   button top-right. */
.image-thumbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.image-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
}
.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-thumb-pdf {
  width: 100%;
  height: 100%;
  background: var(--card-subtle-red);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  text-align: center;
}
.image-thumb-pdf .material-symbols-outlined {
  font-size: 32px;
  color: var(--black);
}
.image-thumb-pdf-name {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--black);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 100%;
  word-break: break-word;
}
.image-thumb-num {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: var(--white);
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--black);
  line-height: 1.4;
}
.image-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  border: var(--border-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--t);
}
.image-thumb-remove:hover {
  background: var(--accent-yellow);
}
.image-thumb-remove .material-symbols-outlined {
  font-size: 14px;
  color: var(--black);
  font-variation-settings: 'FILL' 1, 'wght' 700;
}

/* ── Content section: cyan bg, 2-col grid ── */
.detail-content-section {
  background: var(--section-cyan);
  border-top: var(--border);
  padding: 32px 20px calc(32px + 52px + 64px + env(safe-area-inset-bottom));
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
}
@media (min-width: 768px) {
  .detail-content-section { padding: 48px 40px calc(48px + 80px); }
}

.detail-content-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  position: relative;
  z-index: 1;
}
@media (min-width: 768px) {
  .detail-content-grid { grid-template-columns: 3fr 9fr; gap: 36px; }
}
@media (min-width: 1200px) {
  .detail-content-grid { grid-template-columns: 4fr 8fr; gap: 48px; }
}

.detail-content-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Section headings */
.detail-section-heading {
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--black);
  border-bottom: var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
@media (min-width: 500px) {
  .detail-section-heading { font-size: 1.5rem; }
}
@media (min-width: 1024px) {
  .detail-section-heading { font-size: 1.75rem; }
}
@media (min-width: 1440px) {
  .detail-section-heading { font-size: 2rem; }
}

/* ── Steps heading row (heading + TM tab toggle) ── */
.steps-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  border-bottom: var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.steps-heading-row .detail-section-heading {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* ── TM tab row (toggle + ⋮ button grouped right) ── */
.tm-tab-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── TM actions ⋮ trigger button ── */
.btn-tm-actions {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.btn-tm-actions .material-symbols-outlined { font-size: 18px; }

/* ── TM popover tooltip labels ── */
#btn-tm-popover-edit::after   { content: 'Bearbeiten'; }
#btn-tm-popover-delete::after { content: 'Löschen'; }

/* ── Edit TM steps modal ── */
.modal-card-tm-edit {
  width: min(780px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-body-tm-edit {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px 8px;
}

/* ── Structured TM step card ── */
.tm-edit-step-card {
  border: var(--border-sm);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--t), background var(--t);
}
.tm-edit-step-card[data-type="manual"] {
  border-color: rgba(255, 233, 89, 0.7);
  background: rgba(255, 233, 89, 0.07);
}

/* Card header: step number + type toggle + delete */
.tm-step-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tm-edit-step-num {
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* Type toggle */
.tm-step-type-toggle {
  flex: 1;
  display: flex;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  overflow: hidden;
  height: 38px;
}
.tm-type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  background: transparent;
  color: rgba(0,0,0,0.38);
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}
.tm-type-btn .material-symbols-outlined { font-size: 14px; }
.tm-type-btn + .tm-type-btn { border-left: var(--border-sm); }
.tm-type-btn:hover { background: rgba(0,0,0,0.04); color: var(--black); transform: none; box-shadow: none; }
/* Active: machine = black, manual = yellow */
.tm-edit-step-card[data-type="machine"] .tm-type-active {
  background: var(--black) !important;
  color: #fff !important;
}
.tm-edit-step-card[data-type="manual"] .tm-type-active {
  background: var(--accent-yellow) !important;
  color: var(--black) !important;
}

/* Delete button */
.tm-edit-remove-btn {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity var(--t), transform var(--t), box-shadow var(--t);
}
.tm-edit-remove-btn:hover { opacity: 1; }
.tm-edit-remove-btn .material-symbols-outlined { font-size: 16px; }

/* Description textarea */
.tm-edit-textarea {
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.55;
  padding: 10px 12px;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  background: var(--white);
  resize: vertical;
  min-height: 64px;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  width: 100%;
  box-sizing: border-box;
}
.tm-edit-textarea:focus {
  border-color: var(--primary-pink);
  box-shadow: 2px 2px 0 0 var(--primary-pink);
}

/* Machine params section */
.tm-step-machine-section {
  background: rgba(179, 246, 255, 0.3);
  border: 1.5px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 3-column params grid: Dauer | Temperatur | Linkslauf */
.tm-params-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: start;
}
.tm-param-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tm-param-block-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(0,0,0,0.4);
}

/* Dauer row — two number inputs (Min + Sek) side by side with unit labels */
.tm-dauer-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* Use input.classname (specificity 0,1,1) so we beat the global
   input[type="number"] rule which would otherwise force width:100% +
   pill border-radius onto these compact number inputs. */
input.tm-dauer-min-input,
input.tm-dauer-sek-input,
input.tm-dauer-input,
input.tm-temp-input {
  width: 56px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 8px;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  text-align: center;
  background: #fff;
  outline: none;
  transition: box-shadow var(--t);
}
input.tm-dauer-min-input:focus,
input.tm-dauer-sek-input:focus,
input.tm-dauer-input:focus,
input.tm-temp-input:focus { box-shadow: 2px 2px 0 0 var(--primary-pink); }
.tm-dauer-unit-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

/* Temp row */
.tm-temp-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tm-temp-unit { font-size: 0.78rem; font-weight: 800; }
.tm-varoma-btn {
  padding: 5px 11px;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  background: #fff;
  transition: background var(--t), box-shadow var(--t), transform var(--t);
  box-shadow: none;
}
.tm-varoma-btn:hover { transform: translate(-1px,-1px); box-shadow: 2px 2px 0 0 #000; }
.tm-varoma-active { background: var(--accent-blue) !important; box-shadow: 2px 2px 0 0 #000 !important; }

/* Linkslauf */
.tm-linkslauf-row { align-items: start; }
.tm-linkslauf-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding-top: 2px;
}
.tm-linkslauf-check { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary-pink); flex-shrink: 0; }

/* Stufe section */
.tm-stufe-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tm-stufe-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tm-stufe-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--black);
  transition: transform var(--t), box-shadow var(--t), background var(--t);
  text-align: center;
  box-shadow: none;
}
.tm-stufe-btn:hover { transform: translate(-1px,-1px); box-shadow: 2px 2px 0 0 #000; }
.tm-stufe-active { background: var(--primary-pink) !important; box-shadow: 2px 2px 0 0 #000 !important; }

/* ── TM edit mode-specific rows (Bundle D Phase 3) ──
   Shared styling for all the conditional rows that show/hide based on the
   currently-selected stufe (Turbo, Anbraten, Dampfgaren, Pürieren, Erwärmen,
   Reis kochen). Each row uses a column layout with a label on top and the
   input controls below. A dashed top border visually separates mode-specific
   rows from the always-visible manual params above. */
.tm-turbo-row,
.tm-mode-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0,0,0,0.25);
}
.tm-turbo-row:first-of-type,
.tm-mode-row + .tm-mode-row {
  /* When multiple mode rows are visible back-to-back, the separator line is
     still visible via each row's own border-top — no need to collapse. */
}
.tm-mode-row-hint {
  font-size: 0.72rem;
  opacity: 0.7;
  font-weight: 600;
}
/* Pulse count row uses the default .tm-mode-row column layout (label on
   top, full-width dashed divider). The input + hint sit side-by-side in
   an inner flex row below the label. */
.tm-pulse-count-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
/* input.classname (specificity 0,1,1) — beats the global
   input[type="number"] rule which would otherwise force width:100% +
   pill border-radius. */
input.tm-pulse-count-input {
  width: 52px;
  height: 34px;
  padding: 0 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  background: var(--white);
}
input.tm-warmup-temp-input {
  width: 100px;
  height: 40px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  background: var(--white);
}

/* Hard-disabled stufe button — used only for TM7-only modes (Anbraten,
   Dampfgaren) when editing a TM5/TM6 version. These modes literally don't
   exist on the target device, so clicks are blocked entirely. */
.tm-stufe-btn.tm-stufe-disabled,
.tm-stufe-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--white) !important;
  box-shadow: none !important;
  transform: none !important;
}
.tm-stufe-btn.tm-stufe-disabled:hover,
.tm-stufe-btn:disabled:hover {
  background: var(--white) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Dimmed stufe button — used for speed buttons 6.5-10 when a temperature is
   set (speed-temperature coupling rule). UNLIKE tm-stufe-disabled, these
   remain clickable. When clicked, setTmStufe auto-clears the temperature so
   the user can freely switch to the high speed without manually deselecting
   temp first. Same visual treatment as disabled but with cursor/pointer
   events intact. */
.tm-stufe-btn.tm-stufe-dimmed {
  opacity: 0.5;
  background: var(--white);
}

/* TM temp dropdown (replaces the old free-entry number input).
   Styled to match the neo-brutalist input aesthetic — pill-ish shape, 2px
   border, Manrope bold. Uses the browser's native <select> appearance with
   just enough custom styling to look consistent. */
.tm-temp-select,
.tm-warmup-temp-select {
  min-width: 108px;
  height: 40px;
  padding: 0 28px 0 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--black);
  background: var(--white);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'><path fill='%23000' d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.tm-temp-select:focus,
.tm-warmup-temp-select:focus {
  outline: none;
  box-shadow: 2px 2px 0 0 var(--primary-pink);
}
.tm-temp-select:disabled,
.tm-warmup-temp-select:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background-color: var(--white);
}

/* Dimmed parameter block (used when speed > 6 dims the whole temp block).
   The block stays visible but grayed. Kept clickable so users can still
   override by clicking a temp value — that will reset the speed per the
   coupling rule. */
.tm-param-block.tm-block-disabled {
  opacity: 0.55;
}

/* Add step button */
.tm-edit-add-btn {
  width: 100%;
  justify-content: center;
  border: var(--border-sm);
  border-style: dashed;
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.78rem;
}
.tm-edit-add-btn:hover {
  background: rgba(0,0,0,0.04);
  transform: none;
  box-shadow: none;
}
.tm-edit-step-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Mobile: collapse 3-col grid to 2-col */
@media (max-width: 520px) {
  .tm-params-grid { grid-template-columns: 1fr 1fr; }
  .tm-linkslauf-row { grid-column: 1 / -1; }
}

/* ── Thermomix tab toggle ── */
.tm-tab-toggle {
  display: flex;
  gap: 0;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  overflow: hidden;
  flex-shrink: 0;
}
.tm-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  background: var(--white);
  color: var(--black);
  transition: background var(--t), color var(--t);
}
.tm-tab-btn + .tm-tab-btn {
  border-left: var(--border-sm);
}
.tm-tab-active {
  background: var(--primary-pink);
  color: var(--black);
}

/* ── Multi-model TM version tabs (Bundle D) ── */
/* Shown below the Original/Thermomix toggle when Thermomix tab is active.
   Three buttons TM5/TM6/TM7 — one is highlighted (current version), others
   are either available (has a conversion) or empty (dashed style). The edit
   actions button (⋮) sits at the far right of the same row. */
.tm-version-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  flex-wrap: wrap;
}
.tm-version-tab-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tm-version-tabs .btn-tm-actions {
  flex-shrink: 0;
}
.tm-version-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--black);
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t), background var(--t);
}
.tm-version-tab:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--neo-shadow-sm);
}
.tm-version-tab.tm-version-tab-active {
  background: var(--primary-pink);
  transform: translate(-2px, -2px);
  box-shadow: var(--neo-shadow-sm);
}
.tm-version-tab.tm-version-tab-empty {
  background: var(--white);
  border-style: dashed;
  opacity: 0.75;
}
.tm-version-tab.tm-version-tab-empty::after {
  content: '+';
  margin-left: 6px;
  font-size: 1rem;
  opacity: 0.6;
}
.tm-version-tab.tm-version-tab-empty.tm-version-tab-active {
  background: var(--accent-yellow);
  opacity: 1;
  border-style: dashed;
}

/* Empty state shown when the selected TM version has no steps yet.
   Offers a "Convert for [model]" button that triggers a fresh conversion
   of the original recipe into the active model's slot. */
.tm-version-empty {
  display: flex;
  justify-content: center;
  padding: 32px 16px;
  border: var(--border-sm);
  border-style: dashed;
  border-radius: var(--radius-card);
  background: var(--white);
  margin-bottom: 20px;
}
.tm-version-empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  text-align: center;
}
.tm-version-empty-icon {
  font-size: 48px !important;
  opacity: 0.5;
}
.tm-version-empty-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--black);
}
.tm-version-empty-text strong {
  font-weight: 800;
  text-transform: uppercase;
}
.tm-version-empty-btn {
  margin-top: 4px;
}

/* ── Thermomix step params line ── */
/* ── TM step param chips ── */
.tm-params-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.tm-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--black);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: 1px 1px 0 0 #000;
  white-space: nowrap;
}
.tm-chip .material-symbols-outlined {
  font-size: 14px;
}
.tm-chip-time  { background: var(--accent-blue); }
.tm-chip-temp  { background: #FFAD8A; }
.tm-chip-speed { background: var(--accent-yellow); }
.tm-chip-mode  { background: var(--accent-purple); color: var(--black); }

/* Legacy single-line fallback */
.step-tm-params {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--black);
  background: var(--accent-yellow);
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  letter-spacing: 0.02em;
}

/* ── Manual step (⚠️) ── */
.step-entry-manual .step-card {
  background: #fff9e6;
  border-color: #e6c700;
}


/* ── Ingredient reset button ── */
.ingredients-reset-btn {
  display: none;
  align-items: center;
  gap: 5px;
  background: none;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  font-family: 'Manrope', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0,0,0,0.45);
  cursor: pointer;
  padding: 4px 10px 4px 8px;
  transition: color var(--t), border-color var(--t);
}
.ingredients-reset-btn:hover { color: var(--black); border-color: var(--black); }
.ingredients-reset-btn .material-symbols-outlined { font-size: 14px; }

/* ── Ingredients card controls (scaler + reset, inside card at top) ── */
.ingredients-card-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: var(--border-sm);
}
.ingredients-card-controls:empty { display: none; }

/* ── Ingredients card ── */
.ingredients-card {
  position: relative;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: 2px 2px 0 0 #000;
}
#detail-ingredients { list-style: none; padding: 0; margin: 0; }

.ingredient-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 2px solid rgba(0,0,0,0.07);
  cursor: pointer;
}
.ingredient-item:last-child { border-bottom: none; }

.ingredient-check {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t);
}
.ingredient-item:hover .ingredient-check { background: rgba(255,138,205,0.2); }
.ingredient-item.ingredient-checked .ingredient-check { background: var(--primary-pink); }
.ingredient-check .check-icon {
  font-size: 16px;
  font-variation-settings: 'FILL' 1, 'wght' 700;
  color: var(--black);
  opacity: 0;
  transition: opacity var(--t);
}
.ingredient-item.ingredient-checked .ingredient-check .check-icon { opacity: 1; }

.ingredient-text {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.4;
  transition: opacity var(--t), text-decoration var(--t);
}
.ingredient-item.ingredient-checked .ingredient-text {
  text-decoration: line-through;
  opacity: 0.35;
}

.ingredients-section-header {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(0,0,0,0.4);
  padding-top: 16px;
  padding-bottom: 6px;
  list-style: none;
  border-bottom: none !important;
  cursor: default;
}
.ingredients-section-header:first-child { padding-top: 0; }

/* ── Notes card ── */
.detail-notes-card {
  background: var(--section-pink);
  border: var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: 2px 2px 0 0 #000;
}
.notes-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.notes-title .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 1, 'wght' 700;
}
.detail-notes-card p {
  font-size: 0.875rem;
  line-height: 1.7;
  font-weight: 700;
  color: rgba(0,0,0,0.75);
  font-style: italic;
}

/* ── Comments section ── */
.detail-comments-section {
  width: 100%;
  margin-top: 32px;
  padding-top: 24px;
  border-top: var(--border);
}
.detail-comments-inner {
  max-width: 720px;
}
.comments-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--card-subtle-blue);
  border: 1.5px solid #000;
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  vertical-align: middle;
  margin-left: 6px;
}
/* Comment input */
.comment-input-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.comment-input-avatar { flex-shrink: 0; }
.comment-input-fields { flex: 1; }
.comment-textarea {
  width: 100%;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 0 #000;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 0.92rem;
  resize: vertical;
  min-height: 48px;
}
.comment-textarea:focus {
  outline: none;
  box-shadow: 4px 4px 0 0 var(--primary-pink);
}
.comment-send-btn {
  margin-top: 8px;
  float: right;
}
/* Comment list */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.comment-item:last-child { border-bottom: none; }
.comment-item-avatar { flex-shrink: 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.comment-author {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.comment-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(0,0,0,0.4);
}
.comment-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(0,0,0,0.8);
  word-break: break-word;
}
.comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.comment-action-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0,0,0,0.4);
  cursor: pointer;
  transition: color 0.15s;
}
.comment-action-btn:hover { color: var(--black); }
.comment-action-btn-danger:hover { color: #DC2626; }
/* Reply indent — only 1 visual level */
.comment-item.comment-reply {
  margin-left: 38px;
  padding-left: 14px;
  border-left: 3px solid rgba(0,0,0,0.1);
  border-bottom: none;
}
/* Reply input inline */
.comment-reply-input {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 8px;
  margin-left: 38px;
  padding-left: 14px;
  border-left: 3px solid rgba(0,0,0,0.1);
  padding-bottom: 14px;
}
.comment-reply-input textarea {
  flex: 1;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  box-shadow: 1px 1px 0 0 #000;
  padding: 8px 10px;
  font-family: var(--font);
  font-size: 0.78rem;
  resize: none;
  min-height: 36px;
}

/* ── Notification bell + panel ── */
.header-btn-notifications {
  position: relative;
}
.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--primary-pink);
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary-pink);
  pointer-events: none;
}
.notification-panel {
  position: fixed;
  top: 68px;
  right: 16px;
  width: 360px;
  max-height: 420px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px) saturate(1.6);
  border: var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.notification-panel-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.notification-list {
  overflow-y: auto;
  flex: 1;
}
.notification-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.notification-item:hover {
  background: rgba(0,0,0,0.04);
}
.notification-item.notification-unread {
  background: rgba(255, 138, 205, 0.08);
}
.notification-item-avatar { flex-shrink: 0; }
.notification-item-body { flex: 1; min-width: 0; }
.notification-item-text {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--black);
}
.notification-item-text strong {
  font-weight: 800;
}
.notification-item-time {
  font-size: 0.65rem;
  color: rgba(0,0,0,0.4);
  margin-top: 2px;
}
.notification-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-pink);
  flex-shrink: 0;
  margin-top: 6px;
}
.notification-release-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-yellow, #ffd84a);
  border: 1.5px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notification-release-icon .material-symbols-outlined {
  font-size: 16px;
  color: #000;
}
.release-note-date {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.55;
  margin: 0 0 6px 0;
}
.notification-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(0,0,0,0.4);
  font-style: italic;
}
@media (max-width: 767px) {
  .notification-panel {
    right: 8px;
    left: 8px;
    width: auto;
    top: 60px;
  }
  .notification-badge {
    top: 2px;
    right: 2px;
  }
}

.comment-empty {
  font-size: 0.82rem;
  color: rgba(0,0,0,0.4);
  font-style: italic;
  padding: 12px 0;
}
@media (max-width: 767px) {
  .comment-item.comment-reply { margin-left: 24px; }
  .comment-reply-input { margin-left: 24px; }
}

/* ── Nutrition section ── */
.detail-nutrition-section {
  margin-bottom: 24px;
}
.nutrition-heading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.nutrition-heading-row .detail-section-heading { margin-bottom: 0; }
.nutrition-source-badge {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--card-subtle-green);
  border: 1.5px solid #000;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  white-space: nowrap;
  position: relative;
  cursor: default;
}
.nutrition-source-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-yellow);
  color: var(--black);
  font-family: inherit;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 10px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: 2px 2px 0 0 #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1000;
}
.nutrition-source-badge:hover::after {
  opacity: 1;
}
@media (max-width: 767px) {
  .nutrition-source-badge::after { display: none; }
}
.nutrition-per-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(0,0,0,0.5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nutrition-disclaimer {
  font-size: 0.7rem;
  color: rgba(0,0,0,0.45);
  margin: 0 0 10px 0;
  line-height: 1.3;
}
.nutrition-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.nutrition-pill {
  display: inline-flex;
  align-items: center;
  flex-direction: column;
  gap: 2px;
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: 2px 2px 0 0 #000;
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}
.nutrition-pill-value {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.nutrition-pill-label {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
  max-width: 100%;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.nutrition-pill-kcal    { background: var(--accent-yellow); }
.nutrition-pill-protein { background: var(--accent-green); }
.nutrition-pill-carbs   { background: #BBDEFB; }
.nutrition-pill-fat     { background: var(--section-pink); }

/* ── Global header search popover ── */
.header-search-popover {
  position: fixed;
  top: calc(64px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 10px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: modalCardIn 220ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@media (min-width: 768px) {
  .header-search-popover {
    top: 72px;
    left: auto;
    right: 24px;
    width: 420px;
    max-width: 420px;
  }
}
.header-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.header-search-input-icon {
  position: absolute;
  left: 12px;
  font-size: 18px;
  opacity: 0.5;
  pointer-events: none;
}
.header-search-popover input.header-search-input {
  width: 100%;
  padding: 11px 40px 11px 42px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--black);
  font-family: 'Manrope', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  outline: none;
  transition: box-shadow var(--t);
  box-sizing: border-box;
  margin: 0;
  box-shadow: none;
  line-height: 1.5;
}
.header-search-popover input.header-search-input:focus {
  box-shadow: 2px 2px 0 0 var(--primary-pink);
}
.header-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity var(--t), background var(--t);
}
.header-search-clear:hover { opacity: 1; background: rgba(0,0,0,0.06); }
.header-search-clear .material-symbols-outlined { font-size: 18px; }
.header-search-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 60vh;
  overflow-y: auto;
}
.header-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  text-align: left;
  font-family: 'Manrope', sans-serif;
  transition: background var(--t), border-color var(--t), transform var(--t);
}
.header-search-result:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.2);
  transform: scale(1.01);
}
.header-search-result-thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.06) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.3);
}
.header-search-result-thumb .material-symbols-outlined { font-size: 22px; }
.header-search-result-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.header-search-result-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-search-result-meta {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.65;
  display: flex;
  gap: 6px;
  align-items: center;
}
.header-search-result-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.7);
}
.header-search-result-badge.community {
  background: var(--card-subtle-blue, #d6e9ff);
}
.header-search-empty {
  padding: 18px 8px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.6;
}

/* ── Kitchen-Search CTA + Modal (BACKLOG #75) ── */
/* Hero row: search bar (flex) + kitchen CTA side by side, centered + bounded
 * so they don't collide with the milkshake decoration on the right. */
.hero-search-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 28px;
}
@media (min-width: 1024px) {
  .hero-search-row { max-width: 720px; }
}
@media (min-width: 1440px) {
  .hero-search-row { max-width: 880px; }
}
.hero-search-row .search-bar {
  flex: 1;
  min-width: 0;
  max-width: none; /* override the standalone .search-bar's own cap */
  margin: 0;       /* centering is handled by the row */
}
/* CTA: matches search-bar height; on mobile becomes icon-only */
.btn-kitchen-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--accent-yellow);
  color: var(--black);
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: var(--neo-shadow-sm);
  transition: transform var(--t), box-shadow var(--t);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-kitchen-search:hover { transform: translate(-3px, -3px); box-shadow: var(--neo-shadow); }
.btn-kitchen-search .material-symbols-outlined { font-size: 20px; }
@media (max-width: 767px) {
  .btn-kitchen-search { padding: 0 14px; }
  .btn-kitchen-search-label { display: none; }
}

.kitchen-search-card {
  width: min(640px, 100%);
  max-height: 90vh;
}
.kitchen-search-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.kitchen-search-intro {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(0,0,0,0.65);
  margin: 0;
  line-height: 1.5;
}
.kitchen-search-input-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kitchen-search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* Chip per Styleguide: pill, border-sm, font 800 uppercase, letter-spacing */
.kitchen-search-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px 4px 12px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  background: var(--accent-yellow);
  color: var(--black);
  font-weight: 800;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 2px 2px 0 0 #000;
}
.kitchen-search-tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: var(--black);
  transition: background var(--t);
}
.kitchen-search-tag-remove:hover { background: rgba(0,0,0,0.15); }
.kitchen-search-tag-remove .material-symbols-outlined { font-size: 14px; }
.kitchen-search-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
/* Mirror the global input style explicitly so the form input rule doesn't override */
.kitchen-search-input-wrap input.kitchen-search-input {
  flex: 1;
  padding: 12px 16px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--black);
  font-family: 'Manrope', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  outline: none;
  transition: box-shadow var(--t);
  margin: 0;
  box-sizing: border-box;
  line-height: 1.5;
  box-shadow: none;
}
.kitchen-search-input-wrap input.kitchen-search-input:focus {
  box-shadow: 2px 2px 0 0 var(--primary-pink);
}
.kitchen-search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 52px; /* leave space for the + button so dropdown sits over input only */
  z-index: 5;
  margin-top: 6px;
  background: var(--white);
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  box-shadow: var(--neo-shadow-sm);
  max-height: 220px;
  overflow-y: auto;
}
.kitchen-search-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--black);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.kitchen-search-suggestion:last-child { border-bottom: none; }
.kitchen-search-suggestion:hover, .kitchen-search-suggestion.active { background: var(--accent-yellow); }

.kitchen-search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.kitchen-search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: var(--border-sm);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  text-align: left;
  font-family: 'Manrope', sans-serif;
  transition: transform var(--t), box-shadow var(--t);
  box-shadow: 2px 2px 0 0 #000;
}
.kitchen-search-result:hover { transform: translate(-2px, -2px); box-shadow: var(--neo-shadow-sm); }
.kitchen-search-result-thumb {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: var(--border-sm);
  background: rgba(0,0,0,0.06) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,0.4);
}
.kitchen-search-result-thumb .material-symbols-outlined { font-size: 24px; }
.kitchen-search-result-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kitchen-search-result-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kitchen-search-result-meta {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.55;
}
/* Score chip — follows the chip system */
.kitchen-search-result-score {
  font-weight: 800;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  border: var(--border-sm);
  background: var(--accent-green);
  color: var(--black);
  white-space: nowrap;
  box-shadow: 1px 1px 0 0 #000;
}
.kitchen-search-empty {
  padding: 24px 8px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(0,0,0,0.55);
}
.kitchen-search-count {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.55;
  padding: 0 2px;
}

.nutrition-pill-label .label-short { display: none; }
@media (max-width: 767px) {
  .nutrition-pill-label .label-full  { display: none; }
  .nutrition-pill-label .label-short { display: inline; }
}

.nutrition-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-nutrition-estimate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-purple);
  border: var(--border);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-family: var(--font);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-nutrition-estimate:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--neo-shadow-sm);
}
.btn-nutrition-estimate .material-symbols-outlined { font-size: 18px; }
.btn-nutrition-refresh {
  width: 36px;
  height: 36px;
}
.btn-nutrition-refresh .material-symbols-outlined { font-size: 18px; }

/* ── Steps timeline ── */
.detail-content-right { display: flex; flex-direction: column; min-width: 0; }

.detail-steps-list {
  display: flex;
  flex-direction: column;
}

.step-entry {
  position: relative;
  padding-left: 52px;
  padding-bottom: 32px;
  border-left: var(--border);
  margin-left: 20px;
}
.step-entry:last-child {
  padding-bottom: 4px;
  border-left-color: transparent;
}

.step-num {
  position: absolute;
  left: -22px;
  top: 0;
  width: 40px;
  height: 40px;
  border: var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: 2px 2px 0 0 #000;
  z-index: 1;
  flex-shrink: 0;
}

.step-card {
  background: var(--white);
  border: var(--border);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 2px 2px 0 0 #000;
  margin-left: 8px;
}

.step-headline {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--black);
  line-height: 1.5;
  margin: 0 0 4px;
}

.step-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(0,0,0,0.65);
  line-height: 1.7;
  margin: 0;
}

/* ===== STAR RATING (interactive) ===== */
.star-rating-interactive {
  display: flex;
  gap: 2px;
  align-items: center;
}
.star-icon {
  font-size: 28px;
  font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 0, 'opsz' 24;
  color: rgba(0,0,0,0.18);
  cursor: pointer;
  transition: color 80ms ease, transform 80ms ease;
  user-select: none;
}
.star-icon:hover, .star-icon.star-hover { transform: scale(1.15); }
.star-icon.star-filled { color: var(--primary-pink); }

/* ===== COOK MODE OVERLAY ===== */
/* ============================================================
   COOK MODE — redesigned
   ============================================================ */

#view-cook {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--hero-purple);
  color: var(--black);
  flex-direction: column;
}
#view-cook::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.20) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.20) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ---- Header ---- */
.cook-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  padding-top: calc(14px + env(safe-area-inset-top));
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  border-bottom: var(--border);
  background: var(--hero-purple);
}

.cook-exit-btn {
  flex-shrink: 0;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-pill);
  color: var(--black);
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
}
.cook-exit-btn:hover { transform: translate(-2px,-2px); box-shadow: var(--neo-shadow-sm); }
.cook-exit-btn .material-symbols-outlined { font-size: 16px; }

.cook-counter {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0,0,0,0.5);
}

.cook-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Ingredients toggle — mobile only (hidden on desktop) */
.cook-ing-toggle-btn {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-pill);
  color: var(--black);
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
}
.cook-ing-toggle-btn:hover { transform: translate(-2px,-2px); box-shadow: var(--neo-shadow-sm); }
.cook-ing-toggle-btn .material-symbols-outlined { font-size: 16px; }

/* Servings adjuster */
.cook-servings-adjuster {
  display: flex;
  align-items: center;
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--white);
  box-shadow: none;
  overflow: hidden;
  flex-shrink: 0;
}
.cook-servings-adjuster button {
  width: 34px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t);
}
.cook-servings-adjuster button:first-child { border-right: var(--border); }
.cook-servings-adjuster button:last-child  { border-left: var(--border); }
.cook-servings-adjuster button:hover { background: rgba(0,0,0,0.06); }
.cook-servings-val {
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 800;
}
.cook-servings-val .material-symbols-outlined { font-size: 15px; }

/* ---- Main layout: sidebar + content ---- */
.cook-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* ---- Ingredients sidebar ---- */
.cook-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--white);
  border-right: var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cook-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: var(--border-sm);
  flex-shrink: 0;
}

.cook-sidebar-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(0,0,0,0.45);
}

.cook-sidebar-reset {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--t), background var(--t);
}
.cook-sidebar-reset:hover { color: var(--black); background: rgba(0,0,0,0.06); }
.cook-sidebar-reset .material-symbols-outlined { font-size: 18px; }

#cook-ing-list {
  list-style: none;
  padding: 12px 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}
#cook-ing-list li {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--black);
  padding: 9px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background var(--t), opacity var(--t);
  user-select: none;
}
#cook-ing-list li:hover { background: rgba(0,0,0,0.04); }
#cook-ing-list li::before {
  content: '';
  width: 9px;
  height: 9px;
  min-width: 9px;
  background: var(--primary-pink);
  border: var(--border-sm);
  border-radius: 50%;
  transition: background var(--t), border-color var(--t);
}
#cook-ing-list li.ing-checked {
  opacity: 0.38;
  text-decoration: line-through;
}
#cook-ing-list li.ing-checked::before {
  background: rgba(0,0,0,0.2);
  border-color: rgba(0,0,0,0.2);
}
#cook-ing-list li.cook-section-header {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(0,0,0,0.38);
  padding-top: 16px;
  padding-bottom: 4px;
  cursor: default;
}
#cook-ing-list li.cook-section-header::before { display: none; }
#cook-ing-list li.cook-section-header:first-child { padding-top: 6px; }
#cook-ing-list li.cook-section-header:hover { background: none; }

/* ---- Step content column ---- */
.cook-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Recipe name pill */
.cook-recipe-pill {
  display: flex;
  justify-content: center;
  padding: 16px 24px 0;
  flex-shrink: 0;
}
.cook-recipe-pill span {
  background: var(--black);
  color: var(--white);
  border: var(--border);
  padding: 5px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: var(--neo-shadow-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Step body */
.cook-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px 32px 20px;
  overflow-y: auto;
  gap: 18px;
}

/* Step card */
.cook-step-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-card);
  padding: 36px;
  box-shadow: var(--neo-shadow);
  width: 100%;
  max-width: 580px;
}

.cook-step-num {
  font-size: clamp(64px, 14vw, 96px);
  font-weight: 800;
  line-height: 0.85;
  margin-bottom: 18px;
  letter-spacing: -0.04em;
  transition: color 250ms ease;
}

.cook-step-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--black);
  margin: 0 0 8px;
  padding: 4px 12px;
  background: var(--accent-yellow);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  display: inline-block;
}
.cook-step-text {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--black);
  font-weight: 700;
}
.cook-step-card .tm-params-row {
  margin-top: 16px;
  gap: 8px;
}
.cook-step-card .tm-chip {
  font-size: 0.78rem;
  padding: 6px 14px;
  gap: 6px;
}
.cook-step-card .tm-chip .material-symbols-outlined {
  font-size: 16px;
}

/* Tip card */
.cook-tip-card {
  background: var(--primary-pink);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--neo-shadow-sm);
  width: 100%;
  max-width: 580px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.cook-tip-icon { font-size: 1.25rem; flex-shrink: 0; }
.cook-tip-text {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--black);
}

/* Progress */
.cook-progress-section {
  padding: 0 32px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.cook-progress-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
}
.cook-progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--black);
  background: rgba(255,255,255,0.5);
  transition: background 200ms;
}
.cook-progress-dot.done    { background: var(--primary-pink); }
.cook-progress-dot.current { background: var(--black); }
.cook-progress-track {
  height: 14px;
  background: rgba(255,255,255,0.5);
  border: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.cook-progress-fill {
  height: 100%;
  background: var(--primary-pink);
  border-radius: var(--radius-pill);
  transition: width 300ms ease;
}

/* Navigation */
.cook-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: var(--border);
  flex-shrink: 0;
}
.cook-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  border: none;
  font-family: 'Manrope', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  min-height: 60px;
  transition: background var(--t), opacity var(--t);
}
.cook-btn .material-symbols-outlined { font-size: 20px; }
.cook-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.cook-btn-prev {
  background: var(--white);
  color: var(--black);
  border-right: var(--border);
}
.cook-btn-prev:hover:not(:disabled) { background: rgba(0,0,0,0.05); }
.cook-btn-next {
  background: var(--primary-pink);
  color: var(--black);
}
.cook-btn-next:hover:not(:disabled) { background: #ff9ed5; }

/* ---- Mobile: bottom sheet for ingredients ---- */
.cook-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 19;
}
#view-cook.cook-ing-open .cook-sheet-overlay {
  display: block;
}
/* On mobile, sidebar transforms into a bottom sheet */

/* Cook mode: start cooking button */
.btn-cook {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-pink);
  color: var(--black);
  border: var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: var(--neo-shadow-sm);
  transition: transform var(--t), box-shadow var(--t);
}
.btn-cook:hover { transform: translate(2px, 2px); box-shadow: none; }
.btn-cook .material-symbols-outlined { font-size: 18px; }

/* ===== LOGIN OVERLAY ===== */
#view-login {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--hero-purple);
  overflow-x: hidden;
  animation: loginFadeIn 280ms ease-out both;
}
@keyframes loginFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { #view-login { animation: none; } }

/* Split layout */
.login-split {
  display: flex;
  height: 100%;
  width: 100%;
}

/* Brand panel (left) */
.login-brand {
  flex: 1;
  background: var(--hero-purple);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px 48px 56px;
}
.login-brand > *:not(.view-hero-grid-pattern):not(.login-deco) {
  position: relative;
  z-index: 1;
}
.login-brand-inner { position: relative; z-index: 1; }

.login-brand-title {
  font-size: clamp(4rem, 9vw, 7rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  line-height: 0.88;
  color: var(--black);
  margin-bottom: 20px;
}
.login-brand-tagline {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(0,0,0,0.4);
}

/* Decorative milkshake in brand panel */
.login-deco {
  position: absolute;
  width: 200px;
  top: 48px;
  right: 32px;
  transform: rotate(10deg);
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

/* Form panel (right) */
.login-form-panel {
  width: 400px;
  max-width: 100%;
  flex-shrink: 0;
  background: var(--white);
  border-left: var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 48px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  min-width: 0;
  animation: loginFormSlide 350ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 80ms;
}
.login-form-inner,
.login-form-panel form,
.login-form-panel input,
.login-form-panel button {
  max-width: 100%;
  box-sizing: border-box;
}
@keyframes loginFormSlide {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.login-form-inner {
  width: 100%;
}

.login-form-heading {
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--black);
  margin-bottom: 6px;
}
.login-form-sub {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(0,0,0,0.38);
  margin-bottom: 32px;
}

/* Form fields */
#view-login label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0,0,0,0.5);
  margin-bottom: 6px;
  margin-top: 20px;
}
#view-login label:first-of-type { margin-top: 0; }

.password-field { position: relative; display: flex; align-items: center; }
.password-field input { width: 100%; padding-right: 44px; }
.password-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: rgba(0,0,0,0.4);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  min-width: 32px;
  min-height: 32px;
}
.password-toggle .material-symbols-outlined { font-size: 18px; }

.login-error {
  display: none;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  color: #DC2626;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--card-subtle-red);
  border: var(--border);
}
.login-error.visible { display: flex; }
.login-error .material-symbols-outlined { font-size: 16px; flex-shrink: 0; }

#view-login input[type="email"],
#view-login input[type="password"],
#view-login input[type="text"] { min-height: 48px; font-size: 1rem; }

.login-submit {
  width: 100%;
  justify-content: center;
  padding: 14px;
  margin-top: 28px;
  font-size: 0.875rem;
  min-height: 52px;
}

/* Social sign-in button */
.btn-social-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border: var(--border);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
  margin-top: 4px;
}
.btn-social-google:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--neo-shadow-sm);
}

/* "oder" divider */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 4px;
  color: rgba(0,0,0,0.35);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: rgba(0,0,0,0.1);
}

/* Mode toggle link */
.login-mode-toggle {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(0,0,0,0.45);
  margin-top: 20px;
}
.login-mode-toggle button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 800;
  color: #000;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.login-mode-toggle button:hover { opacity: 0.6; }

/* Email confirmation panel */
.login-confirm-icon {
  margin-bottom: 20px;
}
.login-confirm-icon .material-symbols-outlined {
  font-size: 52px;
  font-variation-settings: 'FILL' 1;
  color: var(--primary-pink);
}
.login-confirm-text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(0,0,0,0.6);
  margin-bottom: 28px;
}

/* ===== BOTTOM NAV (mobile + tablet) ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(64px + env(safe-area-inset-bottom));
  background: var(--white);
  border-top: var(--border);
  z-index: 95;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom);
}
/* Tablet (768–1199): top nav is hidden to avoid header overflow; show bottom nav instead */
@media (min-width: 768px) and (max-width: 1199px) {
  .bottom-nav { display: flex; }
  .main-content { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

.bottom-nav-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: rgba(0,0,0,0.35);
  text-decoration: none;
  cursor: pointer;
  border-right: 2px solid rgba(0,0,0,0.08);
  -webkit-tap-highlight-color: transparent;
  transition: color var(--t);
  padding: 0 2px;
  text-align: center;
  line-height: 1.15;
}
.bottom-nav-item:last-child { border-right: none; }
.bottom-nav-item .material-symbols-outlined { font-size: 22px; }
.bottom-nav-item > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
@media (max-width: 380px) {
  .bottom-nav-item { font-size: 0.56rem; gap: 2px; }
  .bottom-nav-item .material-symbols-outlined { font-size: 20px; }
}
.bottom-nav-item.active { color: var(--primary-pink); }
.bottom-nav-item.active .material-symbols-outlined { font-variation-settings: 'FILL' 1, 'wght' 700; }

/* ===== COLLECTIONS VIEW ===== */
.collections-grid {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.collections-empty-msg {
  max-width: 1200px;
  margin: 16px auto 0;
  position: relative;
  z-index: 1;
}

/* Collection card — vertical layout with colored top */
.collection-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  overflow: visible;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  box-shadow: var(--neo-shadow-sm);
  transition: transform var(--t), box-shadow var(--t);
}
.collection-card:hover { transform: translate(-3px,-3px); box-shadow: var(--neo-shadow); }

.collection-card-top {
  padding: 28px 20px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: var(--border);
  border-radius: calc(var(--radius-md) - 3px) calc(var(--radius-md) - 3px) 0 0;
  position: relative;
}
.collection-card-shared-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--black);
  background: var(--accent-yellow);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  box-shadow: 1px 1px 0 0 #000;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collection-card-shared-badge-owner {
  background: var(--accent-purple);
  color: var(--white);
}
.collection-card-top .material-symbols-outlined {
  font-size: 44px;
  color: var(--black);
  font-variation-settings: 'FILL' 1;
}

.collection-card-bottom {
  padding: 14px 16px 12px;
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.collection-card-bottom-text {
  flex: 1;
  min-width: 0;
}
.collection-card-bottom h3 {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--black);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collection-card-bottom p {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(0,0,0,0.45);
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 120px;
}
.collection-card-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--white);
  border: var(--border-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
  padding: 0;
  flex-shrink: 0;
}
.collection-card-action-btn:hover { transform: translate(-1px,-1px); box-shadow: 2px 2px 0 0 #000; }
.collection-card-action-btn .material-symbols-outlined { font-size: 16px; color: var(--black); }
.collection-card-action-btn.collection-card-delete:hover .material-symbols-outlined { color: #DC2626; }


/* ===== COLLECTION DETAIL VIEW ===== */
.collection-detail-hero {
  background: var(--hero-purple);
  border-bottom: var(--border);
  padding: 20px 48px 22px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.collection-detail-hero > *:not(.view-hero-grid-pattern):not(.deco-img) {
  position: relative;
  z-index: 1;
}
.collection-detail-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}


.collection-detail-hero-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.collection-detail-hero-main .display-heading {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 4vw, 3rem);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collection-detail-hero-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.collection-detail-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(0,0,0,0.45);
  margin: 0;
}

.section-collection-detail-recipes {
  background: var(--section-cyan);
  padding: 36px 32px calc(36px + 80px);
  flex: 1;
  position: relative;
  overflow: visible;
}
.section-collection-detail-recipes::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.20) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.20) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}
/* Floating back bar for collection detail */
.collection-detail-float-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 96;
  display: flex;
  pointer-events: none;
}

@media (max-width: 767px) {
  .collection-detail-float-bar {
    bottom: calc(64px + env(safe-area-inset-bottom) + 16px);
    left: 20px;
    right: auto;
    pointer-events: none;
  }
  .collection-detail-float-bar .detail-float-back {
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    font-size: 0;
    gap: 0;
    cursor: pointer;
    border: var(--border);
    border-radius: 50%;
    background: var(--white);
    color: var(--black);
    box-shadow: none;
    transition: transform var(--t), box-shadow var(--t);
  }
  .collection-detail-float-bar .detail-float-back:active { opacity: 0.7; }
  .collection-detail-float-bar .detail-float-back .material-symbols-outlined { font-size: 28px; }
  .section-collection-detail-recipes { padding: 24px 20px; }
}

@media (min-width: 768px) {
  .collection-detail-float-bar {
    bottom: 32px;
    padding: 0 40px;
    gap: 12px;
  }
}
/* Tablet-Range: Bottom-Nav sichtbar — Zurueck-Bar darueber anheben */
@media (min-width: 768px) and (max-width: 1199px) {
  .collection-detail-float-bar {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}
@media (min-width: 768px) {
  .collection-detail-float-bar .detail-float-back {
    pointer-events: all;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px 0 14px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    background: var(--white);
    color: var(--black);
    border: var(--border);
    border-radius: var(--radius-pill);
    box-shadow: none;
    transition: transform var(--t), box-shadow var(--t);
  }
  .collection-detail-float-bar .detail-float-back:hover { transform: translate(-2px,-2px); box-shadow: var(--neo-shadow-sm); }
  .collection-detail-float-bar .detail-float-back .material-symbols-outlined { font-size: 18px; }
}

@media (max-width: 767px) {
  .collection-detail-hero { padding: 28px 16px 24px; }
  .collection-detail-hero-actions { gap: 6px; }
}

/* ===== PROFILE VIEW (BACKLOG #78) ===== */
.profile-hero {
  background: var(--hero-purple);
  border-bottom: var(--border);
  padding: 32px 48px 28px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.profile-hero > *:not(.view-hero-grid-pattern):not(.deco-img) {
  position: relative;
  z-index: 1;
}
.profile-hero .deco-burger {
  bottom: auto;
  right: 48px;
  top: 50%;
  transform: translateY(-50%) rotate(-18deg);
  width: 88px;
}
.profile-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.profile-hero-top {
  display: flex;
  align-items: center;
  gap: 18px;
}
.profile-avatar {
  flex-shrink: 0;
}
.profile-avatar .avatar-img,
.profile-avatar .avatar-initials {
  border: var(--border-sm);
  box-shadow: var(--neo-shadow-sm);
  border-radius: 50%;
  box-sizing: border-box;
}
.profile-hero-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-hero-meta .display-heading {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(0,0,0,0.55);
  margin: 0;
}
.profile-edit-btn {
  flex-shrink: 0;
}
.profile-bio {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(0,0,0,0.75);
  max-width: 640px;
}

.section-profile-recipes {
  background: var(--section-cyan);
  padding: 36px 32px calc(36px + 80px);
  flex: 1;
  position: relative;
  overflow: visible;
}
.section-profile-recipes .deco-spaghetti {
  left: 48px;
  right: auto;
  bottom: 40px;
  top: auto;
  width: 100px;
}

/* Clickable author affordance on cards + detail.
   Hit-area-Padding erweitert das Touch-Target auf ≥44px ohne Layout-Shift. */
.card-author-clickable {
  cursor: pointer;
  border-radius: 6px;
  padding: 6px 8px;
  margin: 0 -8px;
  transition: background 0.12s ease;
  min-height: 36px;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
}
.card-author-clickable:hover {
  background: rgba(0,0,0,0.06);
}
.card-author-clickable:active {
  background: rgba(0,0,0,0.12);
}
.card-author-clickable:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}
.detail-author-clickable {
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: var(--radius-pill);
  transition: background 0.12s ease, opacity 0.12s ease;
}
.detail-author-clickable:hover {
  background: rgba(0,0,0,0.06);
  opacity: 1;
}
.detail-author-clickable:active {
  background: rgba(0,0,0,0.12);
}
.detail-author-clickable:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}

/* Clickable comment author (avatar + name) */
.comment-profile-link {
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease, opacity 0.12s ease;
}
.comment-profile-link:hover { opacity: 0.7; }
.comment-profile-link:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}
.comment-author.comment-profile-link {
  padding: 2px 6px;
  margin: -2px -6px;
}
.comment-author.comment-profile-link:hover {
  background: rgba(0,0,0,0.06);
  opacity: 1;
}

/* Programmatically-restored focus ring (popstate) — matches :focus-visible
   styling. Removed on blur in _restoreViewPosition. */
[data-focus-key].focus-restored {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .profile-hero { padding: 24px 16px 20px; }
  .profile-hero .deco-burger { right: 12px; width: 64px; }
  .profile-hero-top { gap: 12px; }
  .profile-edit-btn { padding: 6px 10px; font-size: 0.72rem; }
  .profile-edit-btn .material-symbols-outlined { font-size: 16px; }
  .section-profile-recipes { padding: 24px 16px calc(24px + 80px); }
}

/* ===== SHOPPING LIST MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  animation: modalBgIn 180ms ease-out both;
}
@keyframes modalBgIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--neo-shadow);
  overflow: hidden;
  animation: modalCardIn 240ms cubic-bezier(0.34, 1.2, 0.64, 1) both;
  animation-delay: 30ms;
}
.modal-card-sm { max-width: 400px; }
.modal-card-bulk-import { max-width: 560px; }
.modal-card-share { max-width: 460px; }

/* ===== SHARE RECIPE MODAL ===== */
.modal-share-body {
  padding: 20px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.modal-share-hint {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(0,0,0,0.7);
  line-height: 1.45;
  margin: 0;
}
.modal-share-warning {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--black);
  background: var(--accent-yellow);
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  box-shadow: 1px 1px 0 0 #000;
}
.modal-share-warning::before {
  content: 'warning';
  font-family: 'Material Symbols Outlined';
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}
.share-search-wrap { display: flex; flex-direction: column; gap: 8px; }
.share-search-input {
  width: 100%;
  padding: 12px 16px;
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-family: 'Manrope', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--black);
  box-shadow: var(--neo-shadow-sm);
  outline: none;
  min-height: 44px;
}
.share-search-input:focus-visible { box-shadow: 4px 4px 0 0 var(--primary-pink); }
/* Results inline im Body — modal waechst natuerlich mit dem Inhalt statt
   absolutes Dropdown, das Anzeige abschneidet */
.share-search-results {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--neo-shadow-sm);
}
.share-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(0,0,0,0.08);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  min-height: 44px;
}
.share-search-result:last-child { border-bottom: none; }
.share-search-result:hover { background: rgba(0,0,0,0.04); }
.share-search-result:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: -2px;
  background: rgba(0,0,0,0.04);
}
.share-search-result .avatar-img,
.share-search-result .avatar-initials { width: 28px; height: 28px; font-size: 11px; flex-shrink: 0; }
.share-search-result-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}
.share-search-result-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-search-result-sub {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(0,0,0,0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-search-result-added {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0,0,0,0.5);
  flex-shrink: 0;
}
.share-search-empty {
  padding: 14px;
  font-size: 0.82rem;
  color: rgba(0,0,0,0.55);
  text-align: center;
  font-weight: 700;
}

.share-current-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.share-current-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0,0,0,0.55);
  margin: 0 0 4px 0;
}
.share-current-empty {
  font-size: 0.82rem;
  color: rgba(0,0,0,0.5);
  font-weight: 600;
  font-style: italic;
}
.share-current-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  background: var(--card-subtle-blue);
}
.share-current-row .avatar-img,
.share-current-row .avatar-initials { width: 24px; height: 24px; font-size: 10px; flex-shrink: 0; }
.share-current-row-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.share-current-row-remove {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  min-width: 32px;
  min-height: 32px;
  flex-shrink: 0;
}
.share-current-row-remove:hover { color: #DC2626; background: rgba(220,38,38,0.1); }
.share-current-row-remove:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}
.share-current-row-remove .material-symbols-outlined { font-size: 18px; }
.modal-confirm-body { padding: 20px 24px; }
.modal-confirm-text { font-size: 0.88rem; font-weight: 700; color: var(--black); line-height: 1.5; }
.modal-confirm-detail { font-size: 0.78rem; font-weight: 600; color: rgba(0,0,0,0.6); line-height: 1.5; margin-top: 8px; }
/* Bulk import modal */
.modal-bulk-import-body {
  padding: 20px 24px;
  max-height: 65vh;
  overflow-y: auto;
}
.bulk-import-textarea {
  width: 100%;
  min-height: 220px;
  margin-top: 14px;
  padding: 12px 14px;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: 'Manrope', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--black);
  resize: vertical;
  outline: none;
}
.bulk-import-textarea:focus {
  box-shadow: 4px 4px 0 0 var(--primary-pink);
}
.bulk-import-progress-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bulk-import-progress-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--white);
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--black);
}
.bulk-import-progress-list .bulk-import-status-icon {
  flex-shrink: 0;
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
}
.bulk-import-progress-list .bulk-import-url {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: rgba(0,0,0,0.7);
}
.bulk-import-progress-list .bulk-import-status-label {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bulk-import-progress-list li[data-status="queued"]   { opacity: 0.6; }
.bulk-import-progress-list li[data-status="running"]  { background: var(--accent-blue); }
.bulk-import-progress-list li[data-status="success"]  { background: var(--accent-green); }
.bulk-import-progress-list li[data-status="error"]    { background: rgba(231, 76, 60, 0.18); }
.modal-field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.modal-field-group:last-child { margin-bottom: 0; }
.modal-field-label { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.modal-inline-error { font-size: 0.78rem; font-weight: 700; color: #c0392b; margin: 4px 0 0; }

/* ======== Complete-profile modal — first-run welcome ======== */

/* Card container — wider, taller, sticky-footer layout */
.complete-profile-card {
  max-width: 560px;
  width: 100%;
  max-height: min(92vh, 800px);
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #fff;
  border: var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--neo-shadow);
  overflow: hidden;
}

/* Hero header — purple, grid pattern, decorative */
.complete-profile-hero {
  position: relative;
  background: var(--hero-purple);
  border-bottom: var(--border);
  padding: 32px 32px 28px;
  overflow: hidden;
  flex-shrink: 0;
}
.complete-profile-hero > *:not(.view-hero-grid-pattern):not(.complete-profile-deco) {
  position: relative;
  z-index: 1;
}
.complete-profile-hero-inner {
  max-width: 78%;
}
.complete-profile-eyebrow {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(0,0,0,0.55);
  margin-bottom: 10px;
}
.complete-profile-title {
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.92;
  color: var(--black);
  margin: 0 0 14px;
}
.complete-profile-sub {
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(0,0,0,0.7);
  margin: 0;
  max-width: 36ch;
}
.complete-profile-deco {
  position: absolute;
  width: 130px;
  top: -10px;
  right: -22px;
  transform: rotate(18deg);
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.15));
  transition: transform 280ms cubic-bezier(0.34, 1.2, 0.64, 1);
}
.complete-profile-card:hover .complete-profile-deco {
  transform: rotate(24deg) translate(-4px, 2px);
}

/* Body — scrollable */
.complete-profile-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 12px;
  background: var(--section-cyan);
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.20) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.20) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Sections */
.complete-profile-section {
  background: #fff;
  border: var(--border-sm);
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
  margin-bottom: 18px;
  box-shadow: var(--neo-shadow-sm);
}
.complete-profile-section:last-child { margin-bottom: 18px; }

.complete-profile-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 2px dashed rgba(0,0,0,0.12);
}
.complete-profile-section-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-yellow);
  border: var(--border-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--black);
}
.complete-profile-private .complete-profile-section-num {
  background: var(--accent-blue);
}
.complete-profile-section-title {
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 6px;
}
.complete-profile-section-title .material-symbols-outlined {
  font-size: 18px;
}
.complete-profile-section-sub {
  font-size: 0.76rem;
  font-weight: 500;
  color: rgba(0,0,0,0.55);
  margin-top: 2px;
}

/* Avatar row */
.complete-profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.complete-profile-avatar-preview {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: var(--border);
  background: var(--section-pink);
  box-shadow: var(--neo-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.complete-profile-avatar-preview:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--neo-shadow);
}
.complete-profile-avatar-preview:active {
  transform: translate(0, 0) scale(0.97);
  box-shadow: var(--neo-shadow-sm);
}
.complete-profile-avatar-icon {
  font-size: 44px;
  color: rgba(0,0,0,0.5);
}
.complete-profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.complete-profile-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.35;
  transition: opacity 180ms ease;
  pointer-events: none;
}
.complete-profile-avatar-preview:hover .complete-profile-avatar-overlay,
.complete-profile-avatar-preview:focus-visible .complete-profile-avatar-overlay { opacity: 1; }
.complete-profile-avatar-preview:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}
.complete-profile-avatar-overlay .material-symbols-outlined {
  font-size: 28px;
  color: #fff;
}
.complete-profile-avatar-meta {
  flex: 1;
  min-width: 0;
}
.complete-profile-avatar-meta-label {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--black);
  margin-bottom: 2px;
}
.complete-profile-avatar-meta-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(0,0,0,0.55);
  margin-bottom: 8px;
}

/* Field groups */
.complete-profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.complete-profile-field:last-child { margin-bottom: 0; }
.complete-profile-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 6px;
}
.complete-profile-required {
  color: var(--primary-pink);
  font-weight: 800;
}
.complete-profile-optional-pill {
  display: inline-block;
  padding: 2px 8px;
  background: var(--accent-blue);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--black);
  line-height: 1.4;
}

/* Inputs */
#modal-complete-profile input[type="text"],
#modal-complete-profile input[type="number"],
#modal-complete-profile textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  background: #fff;
  color: var(--black);
  box-sizing: border-box;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
#modal-complete-profile textarea {
  resize: vertical;
  min-height: 80px;
  font-size: 15px;
  line-height: 1.5;
}
#modal-complete-profile input[type="text"]:focus,
#modal-complete-profile input[type="number"]:focus,
#modal-complete-profile textarea:focus {
  outline: none;
  border-color: var(--primary-pink);
  box-shadow: var(--neo-shadow-sm);
  transform: translate(-2px, -2px);
}
#modal-complete-profile input::placeholder,
#modal-complete-profile textarea::placeholder {
  color: rgba(0,0,0,0.35);
}

/* Bio character counter */
.complete-profile-counter {
  font-size: 0.7rem;
  font-weight: 700;
  text-align: right;
  color: rgba(0,0,0,0.45);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.complete-profile-counter.warning { color: var(--accent-yellow); color: #B8860B; }
.complete-profile-counter.danger  { color: #c0392b; }

/* Private grid: 2 columns desktop, 1 column mobile */
.complete-profile-private-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.complete-profile-private-grid .complete-profile-field { margin-bottom: 0; }

/* Reuse settings chip styles inside the modal */
#modal-complete-profile .settings-gender-chips,
#modal-complete-profile .settings-diet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Error message */
.complete-profile-error {
  margin-top: 4px;
  padding: 10px 14px;
  background: #FEE7E7;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  color: #c0392b;
  font-size: 0.82rem;
}

/* Sticky footer */
.complete-profile-footer {
  padding: 16px 28px 20px;
  background: #fff;
  border-top: var(--border);
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
}
.complete-profile-submit {
  min-width: 180px;
  min-height: 50px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Staggered reveal animation */
@keyframes completeProfileItemIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.complete-profile-anim {
  animation: completeProfileItemIn 380ms cubic-bezier(0.22, 0.9, 0.4, 1.05) both;
  animation-delay: var(--cp-delay, 0ms);
}

/* Visually hidden helper for screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .modal-card,
  .modal-overlay,
  .complete-profile-anim,
  .complete-profile-deco {
    animation: none !important;
    transition: none !important;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .complete-profile-card {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  .complete-profile-hero {
    padding: 28px 22px 24px;
  }
  .complete-profile-hero-inner { max-width: 70%; }
  .complete-profile-title { font-size: 1.7rem; }
  .complete-profile-sub { font-size: 0.82rem; }
  .complete-profile-deco {
    width: 100px;
    top: -8px;
    right: -16px;
  }
  .complete-profile-body {
    padding: 20px 18px 8px;
  }
  .complete-profile-section {
    padding: 16px 14px 14px;
    margin-bottom: 14px;
  }
  .complete-profile-private-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .complete-profile-footer {
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0));
  }
  .complete-profile-submit {
    width: 100%;
    min-height: 52px;
  }
  /* Mobile: modal overlay should fill the screen, no padding */
  #modal-complete-profile.modal-overlay {
    padding: 0;
  }
}
@keyframes modalCardIn {
  from { opacity: 0; transform: scale(0.93) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 14px;
  border-bottom: var(--border);
  background: var(--hero-purple);
  flex-shrink: 0;
}
.modal-header h3 {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-body { flex: 1; overflow-y: auto; }

.modal-footer {
  padding: 14px 24px 16px;
  border-top: var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.todo-list-row { display: flex; align-items: center; gap: 10px; }
.todo-list-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(0,0,0,0.5);
  white-space: nowrap;
  flex-shrink: 0;
}
.todo-list-input {
  flex: 1;
  padding: 9px 12px;
  font-size: 0.875rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  color: var(--black);
  outline: none;
  box-shadow: var(--neo-shadow-sm);
}
.todo-list-input:focus { box-shadow: 4px 4px 0 0 var(--primary-pink); }
.modal-footer-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal-footer-actions > * { min-width: 0; }
@media (max-width: 360px) {
  .modal-overlay { padding: 12px; }
  .modal-footer { padding: 12px 14px 14px; }
  .modal-confirm-body { padding: 16px 14px; }
  .modal-footer-actions { gap: 6px; }
  .modal-footer-actions .btn-primary,
  .modal-footer-actions .btn-secondary { padding-left: 14px; padding-right: 14px; font-size: 0.78rem; }
}

/* Shopping modal recipe rows */
.shopping-recipes { padding: 8px 24px 4px; }
.shopping-recipe-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 2px solid rgba(0,0,0,0.08);
  gap: 12px;
}
.shopping-recipe-row:last-child { border-bottom: none; }
.shopping-recipe-name {
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopping-servings {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.shopping-servings button {
  width: 28px;
  height: 28px;
  border: var(--border);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 0 #000;
  transition: transform var(--t), box-shadow var(--t);
}
.shopping-servings button:hover { transform: translate(1px,1px); box-shadow: none; }
.shopping-servings button .material-symbols-outlined { font-size: 15px; }
.shopping-servings > span {
  font-size: 0.78rem;
  font-weight: 800;
  color: rgba(0,0,0,0.6);
  min-width: 60px;
  text-align: center;
  text-transform: uppercase;
}

.shopping-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0,0,0,0.4);
  padding: 14px 24px 8px;
  border-top: 2px solid rgba(0,0,0,0.08);
}
.shopping-section-label .material-symbols-outlined { font-size: 15px; }

.shopping-ing-list {
  list-style: none;
  padding: 0 24px 16px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shopping-ing-list li {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--black);
  padding: 7px 12px;
  background: var(--hero-purple);
  border: var(--border-sm);
  line-height: 1.4;
}
.shopping-ing-empty {
  color: rgba(0,0,0,0.4);
  background: transparent !important;
  border: none !important;
}

/* ===== SHOPPING LIST VIEW ===== */

/* Hero — mirrors .settings-hero exactly */
.shopping-hero {
  background: var(--hero-purple);
  padding: 48px 32px 36px;
  position: relative;
  overflow: hidden;
  border-bottom: var(--border);
}
.shopping-hero > *:not(.view-hero-grid-pattern):not(.deco-img) { position: relative; z-index: 1; }
.shopping-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* Content section — mirrors .settings-content but uses accent-green background */
.shopping-content {
  background: var(--section-pink);
  padding: 32px;
  position: relative;
  overflow: visible;
}
.shopping-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.20) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.20) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Sidebar + main grid */
.shopping-content-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
  position: relative;
  z-index: 1;
}

/* LEFT SIDEBAR */
.shopping-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.shopping-sidebar-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--neo-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shopping-sidebar-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.shopping-sidebar-card-header .material-symbols-outlined { font-size: 20px; }
.shopping-sidebar-card-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.shopping-sidebar-card .btn-primary,
.shopping-sidebar-card .btn-secondary,
.shopping-sidebar-card .btn-ghost { width: 100%; justify-content: center; }

/* Inline add row at the top of the list */
.shopping-inline-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.shopping-inline-add input { flex: 1; min-width: 0; }
.shopping-inline-add-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
}

/* MAIN LIST AREA */
.shopping-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.shopping-main-header {
  padding-bottom: 12px;
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px; /* stable height prevents layout jump between modes */
}

.shopping-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.shopping-view-toggle .material-symbols-outlined { font-size: 18px; }
.shopping-view-toggle-active {
  background: var(--primary-pink);
  border-color: var(--primary-pink);
  color: var(--white);
}
.shopping-view-toggle-active .material-symbols-outlined { color: var(--white); }
.shopping-view-toggle-active:hover { background: var(--primary-pink); }

/* ── By-Recipe view sections (BACKLOG #74) ── */
.shopping-recipe-section {
  margin-top: 14px;
}
.shopping-recipe-section:first-child {
  margin-top: 8px;
}
.shopping-recipe-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  background: var(--accent-yellow);
  box-shadow: 2px 2px 0 0 #000;
  margin-bottom: 8px;
}
.shopping-recipe-section-checked .shopping-recipe-section-header {
  background: var(--card-subtle-blue, #d6e9ff);
}
.shopping-recipe-thumb {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1.5px solid #000;
  background: rgba(0, 0, 0, 0.06) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shopping-recipe-thumb-fallback .material-symbols-outlined {
  font-size: 20px;
  color: rgba(0, 0, 0, 0.5);
}
.shopping-recipe-section-title {
  flex: 1;
  font-weight: 800;
  font-size: 0.92rem;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shopping-recipe-section-count {
  font-weight: 800;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1.5px solid #000;
  background: var(--white);
}
/* Mirrors .card-favorite-btn / .card-shopping-btn — round, 36px, white,
 * subtle hover with translate + 2px shadow. Icon is red for destructive intent. */
.shopping-recipe-section-delete {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--white);
  border: var(--border-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
  padding: 0;
  flex-shrink: 0;
}
.shopping-recipe-section-delete:hover { transform: translate(-1px,-1px); box-shadow: 2px 2px 0 0 #000; }
.shopping-recipe-section-delete .material-symbols-outlined { font-size: 16px; color: #c0392b; }
.shopping-recipe-section-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shopping-select-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

/* Selection mode items */
.shopping-item-selectable {
  cursor: pointer;
  user-select: none;
}
.shopping-item-selectable:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--neo-shadow);
}
.shopping-item-bulk-selected {
  background: var(--card-subtle-blue);
}
.shopping-item-select-check {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.1s;
}
.shopping-item-select-check-on {
  background: var(--black);
  color: var(--white);
}
.shopping-item-select-check .material-symbols-outlined {
  font-size: 14px;
  font-variation-settings: 'FILL' 1;
}

.shopping-count {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(0,0,0,0.45);
}

/* LIST ITEMS */
.shopping-items-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-pill);
  padding: 10px 14px 10px 12px;
  box-shadow: var(--neo-shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.2s;
}
.shopping-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--neo-shadow);
}
.shopping-item-checked {
  opacity: 0.42;
}
.shopping-item-checked .shopping-item-title {
  text-decoration: line-through;
  color: rgba(0,0,0,0.5);
}

.shopping-item-checkbox {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background 0.12s, transform 0.1s;
  padding: 0;
}
.shopping-item-checkbox:hover {
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 0 #000;
}
.shopping-item-checked .shopping-item-checkbox {
  background: var(--accent-green);
}
.shopping-item-checkbox .material-symbols-outlined {
  font-size: 14px;
  font-variation-settings: 'FILL' 1;
}

.shopping-item-title {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
}

.shopping-item-delete {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,0.28);
  border-radius: 50%;
  transition: color 0.12s, background 0.12s;
  padding: 0;
}
.shopping-item-delete:hover {
  color: #c0392b;
  background: rgba(192, 57, 43, 0.08);
}
.shopping-item-delete .material-symbols-outlined { font-size: 16px; }

/* EMPTY STATE */
.shopping-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 24px;
  gap: 10px;
}
.shopping-empty-icon {
  font-size: 48px;
  opacity: 0.22;
}
.shopping-empty-text {
  font-weight: 800;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0;
}
.shopping-empty-sub {
  font-size: 0.82rem;
  color: rgba(0,0,0,0.48);
  max-width: 280px;
  line-height: 1.55;
  margin: 0;
}

/* Mobile: stack sidebar above list */
@media (max-width: 767px) {
  .shopping-hero { padding: 28px 16px 24px; }
  .shopping-content { padding: 20px 16px; }
  .shopping-content-grid {
    grid-template-columns: 1fr;
  }
  .shopping-sidebar {
    position: static;
  }
}

/* ===== COLLECTION MANAGER MODAL ===== */
.collection-check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--black);
  border-bottom: 2px solid rgba(0,0,0,0.08);
  transition: background var(--t);
}
.collection-check-row:last-child { border-bottom: none; }
.collection-check-row:hover { background: rgba(209,196,255,0.3); }
.collection-check-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary-pink); flex-shrink: 0; }
.collection-check-row .material-symbols-outlined {
  font-size: 18px;
  color: var(--primary-pink);
  font-variation-settings: 'FILL' 1, 'wght' 700;
}
.collection-manager-empty { padding: 24px; text-align: center; color: rgba(0,0,0,0.4); font-size: 0.875rem; font-weight: 700; }

/* ===== iOS INSTALL BANNER ===== */
.ios-install-banner {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 12px;
  right: 12px;
  background: var(--black);
  color: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 150;
  box-shadow: var(--neo-shadow);
  animation: bannerSlideUp 300ms ease-out both;
}
@keyframes bannerSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ios-banner-icon {
  font-size: 24px;
  color: var(--primary-pink);
  flex-shrink: 0;
  font-variation-settings: 'FILL' 1, 'wght' 700;
}
.ios-install-banner p {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.45;
  color: rgba(255,255,255,0.85);
  margin: 0;
}
.ios-install-banner strong { color: var(--white); }
.ios-banner-dismiss {
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.6);
}
.ios-banner-dismiss .material-symbols-outlined { font-size: 16px; }

/* ===== MOBILE BREAKPOINT ===== */
@media (max-width: 767px) {
  /* Prevent iOS auto-zoom on input focus — requires font-size >= 16px */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  textarea,
  select { font-size: 1rem !important; }

  /* Suppress all ::after tooltips — no hover on touch */
  .card-private-badge::after,
  .card-tm-badge::after,
  .card-collection-btn::after,
  .card-shopping-btn::after,
  .collection-tag-popover-btn::after,
  #btn-popover-goto::after,
  #btn-popover-remove::after,
  #btn-cat-popover-filter::after,
  #btn-cat-popover-remove::after,
  #btn-tm-popover-edit::after,
  #btn-tm-popover-delete::after { display: none; }

  /* Hide desktop nav on mobile */
  .header-desktop-nav,
  .header-nav { display: none; }

  /* Add bottom nav padding */
  .main-content { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

  /* Tighter view padding */
  .view { padding: 20px 16px; }

  /* Show bottom nav */
  .bottom-nav { display: flex; }

  /* Recipe grid: single column — minmax(0,1fr) prevents grid items from overflowing their track */
  .recipe-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  /* Hero tighter on mobile */
  .view-hero { padding: 28px 16px 20px; text-align: left; }
  .display-heading { font-size: clamp(1.9rem, 9vw, 2.8rem); white-space: normal; }
  .search-bar { margin-bottom: 20px; }
  .search-bar input[type="text"] { padding: 14px 8px 14px 18px; font-size: 1rem; }
  .search-icon-right { font-size: 20px; padding-right: 14px; }
  /* Chips: horizontally scrollable on mobile */
  .view-hero .category-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: none;
    padding-bottom: 4px;
  }
  .view-hero .category-filters::-webkit-scrollbar { display: none; }
  .cat-chip { flex-shrink: 0; }

  /* Detail view */
  .detail-title-block { flex-direction: column; align-items: flex-start; gap: 12px; }
  .detail-title-block h2 { margin-bottom: 10px; }
  .detail-actions { flex-wrap: wrap; }
  .detail-sections { grid-template-columns: 1fr; }

  /* Form */
  .form-card { padding: 18px 20px; border-radius: var(--radius-md); }
  .form-hero { padding: 12px 16px; }
  .form-hero-title { font-size: 1.25rem; }
  .form-hero-actions .btn-secondary { display: inline-flex; }
  .import-row { flex-direction: column; }
  .btn-import { width: 100%; justify-content: center; }

  /* Cook mode — mobile: compact header, icon-only buttons */
  .cook-header { padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); gap: 8px; }
  .cook-exit-btn { padding: 8px; font-size: 0; gap: 0; }
  .cook-exit-btn .material-symbols-outlined { font-size: 18px; }
  .cook-ing-toggle-btn { display: inline-flex; padding: 8px; font-size: 0; gap: 0; }
  .cook-ing-toggle-btn .material-symbols-outlined { font-size: 18px; }
  .cook-sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 55vh;
    border-right: none;
    border-top: var(--border);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    box-shadow: 0 -4px 0 0 #000;
    z-index: 20;
    transform: translateY(100%);
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  #view-cook.cook-ing-open .cook-sidebar {
    transform: translateY(0);
  }
  .cook-body { padding: 20px 20px 16px; }
  .cook-step-card { padding: 24px; }
  .cook-step-card { border-radius: var(--radius-md); }
  .cook-progress-section { padding: 0 20px 8px; }
  .cook-recipe-pill { padding: 12px 20px 0; }

  /* Collections */
  .collections-hero { padding: 28px 16px 24px; }
  .collections-hero-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .collections-hero-title-block { flex-direction: column; align-items: flex-start; gap: 8px; }
  .collections-hero-btn { align-self: flex-start; }
  .section-collections-grid { padding: 24px 20px; overflow-x: hidden; }
  .collections-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }

  /* Login — stacked layout on mobile */
  .login-split { flex-direction: column; }
  .login-brand {
    flex: 0 0 auto;
    min-height: 200px;
    padding: 32px 24px 28px;
    justify-content: flex-end;
  }
  .login-brand-title { font-size: clamp(2.8rem, 14vw, 4.5rem); margin-bottom: 12px; }
  .login-deco { width: 110px; top: 16px; right: 16px; }
  .login-form-panel {
    width: 100%;
    flex: 1;
    border-left: none;
    border-top: var(--border);
    padding: 32px 24px 40px;
    animation: none;
    align-items: flex-start;
  }
  .login-form-heading { font-size: 1.5rem; }
  .login-form-sub { margin-bottom: 24px; }

  /* Display heading smaller on mobile */
  .display-heading { font-size: clamp(2rem, 12vw, 3rem); }

  /* Hero section */
  .view-hero { padding: 32px 20px 24px; }
  .section-recipes { padding: 24px 20px; }
  .section-community { padding: 24px 20px; }
}

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 96px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 500;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px 12px 16px;
  border-radius: var(--radius-md);
  border: var(--border);
  box-shadow: var(--neo-shadow-sm);
  width: 320px;
  pointer-events: all;
  animation: toastInRight 280ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.toast.toast-out {
  animation: toastOutRight 280ms ease-in both;
}

.toast-success { background: var(--accent-green); }
.toast-error   { background: #FFB3B3; }
.toast-warning { background: var(--accent-yellow); }
.toast-info    { background: var(--accent-blue); }

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  font-variation-settings: 'FILL' 1;
}

.toast-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.toast-message {
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1.3;
}

.toast-detail {
  font-size: 0.72rem;
  opacity: 0.65;
  line-height: 1.3;
  word-break: break-word;
}

.toast-action {
  margin-top: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  background: #fff;
  color: #000;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: none;
}
.toast-action:hover {
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 0 rgba(0,0,0,0.4);
}

.toast-close {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity var(--t);
}
.toast-close:hover { opacity: 1; }
.toast-close .material-symbols-outlined { font-size: 18px; }

@keyframes toastInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toastOutRight {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}
@keyframes toastInUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes toastOutDown {
  from { transform: translateY(0);    opacity: 1; }
  to   { transform: translateY(40px); opacity: 0; }
}

@media (max-width: 767px) {
  .toast-container {
    bottom: calc(64px + env(safe-area-inset-bottom) + 80px);
    right: 12px;
    left: 12px;
  }
  .toast {
    width: 100%;
    animation: toastInUp 280ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
  .toast.toast-out {
    animation: toastOutDown 280ms ease-in both;
  }
}

/* ═══════════════════════════════════════════
   PRINT / PDF EXPORT
   ═══════════════════════════════════════════ */
@media print {
  /* Hide everything except the active detail view */
  .app-sidebar,
  .bottom-nav,
  .app-header,
  .app-footer,
  .detail-float-bar,
  .form-float-bar,
  .detail-actions,
  .detail-manage-btn,
  .detail-collections-row,
  .servings-adjuster,
  #ingredients-reset-btn,
  .deco-img,
  .view-hero-grid-pattern,
  .ios-install-banner,
  #loading-overlay,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }

  /* Show only the detail view, reset layout */
  body, html { margin: 0; padding: 0; background: #fff; }
  .app-shell { display: block; }
  .main-content { margin-left: 0 !important; }

  #view-detail {
    display: block !important;
  }

  /* Hero section: plain white, no grid, no big padding */
  .detail-hero-section {
    background: #fff !important;
    display: flex;
    flex-direction: row;
    gap: 24px;
    padding: 24px 0 16px;
    border-bottom: 2px solid #000;
    page-break-inside: avoid;
  }

  .detail-hero-left { flex: 1; }

  /* Image: fixed size, right side */
  .detail-hero-right {
    display: block !important;
    flex-shrink: 0;
    width: 180px;
  }
  .detail-hero-right img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border: 2px solid #000;
    border-radius: 12px;
  }

  /* Title */
  .detail-title {
    font-size: 22pt;
    margin: 4px 0 8px;
    text-transform: uppercase;
    letter-spacing: -0.02em;
  }

  /* Category chips: strip color, keep shape */
  .chip {
    background: #eee !important;
    box-shadow: none !important;
    border: 1px solid #000 !important;
  }

  /* Info pills */
  .info-pill {
    background: #eee !important;
    box-shadow: none !important;
    border: 1px solid #000 !important;
  }

  /* Stars */
  .star-rating-interactive { pointer-events: none; }

  /* Content section: no background colour, no shadows */
  .detail-content-section {
    background: #fff !important;
    padding: 16px 0 0;
  }

  .detail-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  /* Cards: simple bordered boxes */
  .ingredients-card,
  .detail-notes-card {
    background: #fff !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
  }

  /* Section headings */
  .detail-section-heading {
    font-size: 13pt;
    margin-bottom: 8px;
  }

  /* Steps */
  .step-item {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    background: #fff !important;
    page-break-inside: avoid;
  }

  /* Private badge */
  .detail-private-badge {
    background: #eee !important;
    box-shadow: none !important;
  }

  /* Source link */
  .detail-source { font-size: 8pt; color: #666; }

  /* Ensure page doesn't cut steps awkwardly */
  .detail-steps-list { page-break-inside: auto; }
  .step-item { page-break-inside: avoid; }
}

/* ═══════════════════════════════════════════
   MOBILE UX REWORK — NEW COMPONENTS
   ═══════════════════════════════════════════ */

/* Suppress FAB transitions during view switches so they appear/disappear instantly */
.fab-no-transition { transition: none !important; }

/* (Bundle G removed .fab-add and .header-btn-add — replaced by the
   discoverable #fab-import on the home view with its 4-option popover.) */

/* ── Floating pill — Neue Sammlung ── */
.fab-new-collection {
  /* Desktop: fixed pill matching Koch-Modus style */
  position: fixed;
  bottom: 32px;
  right: 40px;
  z-index: 94;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px 0 16px;
  background: var(--primary-pink);
  color: var(--black);
  border: var(--border);
  border-radius: var(--radius-pill);
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t), opacity var(--t);
}
.fab-new-collection:hover { transform: translate(-2px,-2px); box-shadow: var(--neo-shadow-sm); }
.fab-new-collection .material-symbols-outlined { font-size: 20px; font-variation-settings: 'FILL' 1, 'wght' 900, 'GRAD' 0, 'opsz' 24; }
.fab-new-collection.fab-hidden { opacity: 0; pointer-events: none; }

@media (max-width: 767px) {
  .fab-new-collection {
    /* Mobile: circle FAB above bottom nav, same as fab-add */
    bottom: calc(64px + env(safe-area-inset-bottom) + 16px);
    right: 20px;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    box-shadow: none;
    font-size: 0;        /* hide text */
    gap: 0;
  }
  .fab-new-collection .material-symbols-outlined { font-size: 28px; font-variation-settings: 'FILL' 1, 'wght' 900, 'GRAD' 0, 'opsz' 24; }
  .fab-new-collection:hover { transform: translate(-2px,-2px); box-shadow: var(--neo-shadow-sm); }
  .fab-new-collection.fab-hidden { transform: scale(0.85) translateY(8px); }
}
/* Tablet-Range: Bottom-Nav sichtbar — Pill-FAB darueber anheben */
@media (min-width: 768px) and (max-width: 1199px) {
  .fab-new-collection {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

/* ── Floating Bearbeiten button (collection-detail view) ── */
.fab-collection-edit {
  /* Desktop: fixed pill matching Koch-Modus / Neue Sammlung style */
  position: fixed;
  bottom: 32px;
  right: 40px;
  z-index: 94;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px 0 16px;
  background: var(--primary-pink);
  color: var(--black);
  border: var(--border);
  border-radius: var(--radius-pill);
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t), opacity var(--t);
}
.fab-collection-edit:hover { transform: translate(-2px,-2px); box-shadow: var(--neo-shadow-sm); }
.fab-collection-edit .material-symbols-outlined { font-size: 20px; }
.fab-collection-edit.fab-hidden { opacity: 0; pointer-events: none; }

@media (max-width: 767px) {
  .fab-collection-edit {
    bottom: calc(64px + env(safe-area-inset-bottom) + 16px);
    right: 20px;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    box-shadow: none;
    font-size: 0;
    gap: 0;
  }
  .fab-collection-edit .material-symbols-outlined { font-size: 28px; }
  .fab-collection-edit:hover { transform: translate(-2px,-2px); box-shadow: var(--neo-shadow-sm); }
  .fab-collection-edit.fab-hidden { transform: scale(0.85) translateY(8px); }
}
/* Tablet-Range: Bottom-Nav sichtbar — Pill-FAB darueber anheben */
@media (min-width: 768px) and (max-width: 1199px) {
  .fab-collection-edit {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

/* ── View transition animations (mobile only) ── */
@media (max-width: 767px) {
  .view-enter-forward { animation: mobileSlideInRight 220ms cubic-bezier(0.4, 0, 0.2, 1) both; }
  .view-enter-back    { animation: mobileSlideInLeft  220ms cubic-bezier(0.4, 0, 0.2, 1) both; }
}
@keyframes mobileSlideInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes mobileSlideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .view-enter-forward,
  .view-enter-back { animation: none; }
}

/* ── Detail view: overflow menu ── */
.detail-more-btn {
  display: flex;
  width: 44px;
  height: 44px;
}
.detail-favorite-btn {
  display: flex;
  width: 44px;
  height: 44px;
}
.detail-favorite-btn .material-symbols-outlined { font-size: 22px; }
.detail-favorite-btn.detail-favorite-active { background: var(--primary-pink); border-color: var(--primary-pink); }
.detail-favorite-btn.detail-favorite-active .material-symbols-outlined { color: var(--white); }
.detail-shopping-btn {
  display: flex;
  width: 44px;
  height: 44px;
}
.detail-shopping-btn .material-symbols-outlined { font-size: 22px; }
@media (max-width: 767px) {
  .detail-btn {
    height: 40px;
    padding: 0 12px;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .detail-more-btn,
  .detail-favorite-btn,
  .detail-shopping-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
}

/* Detail more popover */
.detail-more-popover {
  position: fixed;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 8px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}
.detail-more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.95);
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), transform var(--t);
  -webkit-tap-highlight-color: transparent;
}
.detail-more-item:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.2);
  transform: scale(1.02);
}
.detail-more-item .material-symbols-outlined { font-size: 18px; }
.detail-more-item-danger { color: #c0392b; }
.detail-more-item-danger:hover { background: rgba(192, 57, 43, 0.08); border-color: rgba(192, 57, 43, 0.3); }

/* ── Cook mode: swipe hint ── */
.cook-swipe-hint {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: var(--white);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 5;
  /* Hidden by default — JS sets display:flex and adds .hint-visible */
  display: none;
}
.cook-swipe-hint.hint-visible { opacity: 1; }
.cook-swipe-hint .material-symbols-outlined { font-size: 16px; }
@media (min-width: 768px) {
  .cook-swipe-hint { display: none !important; }
}

/* ── Cook mode: drag handle on ingredient sheet ── */
.cook-drag-handle {
  display: none;
  width: 36px;
  height: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}
@media (max-width: 767px) {
  .cook-drag-handle { display: block; }
  .cook-sidebar-header { padding-top: 8px; }
}

/* ===== MEAL PLAN VIEW (BACKLOG #13) ===== */
.meal-plan-hero {
  background: var(--hero-purple);
  border-bottom: var(--border);
  padding: 24px 48px 22px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.meal-plan-hero > *:not(.view-hero-grid-pattern):not(.deco-img) {
  position: relative;
  z-index: 1;
}
.meal-plan-hero .deco-burger {
  bottom: auto;
  right: 48px;
  top: 50%;
  transform: translateY(-50%) rotate(-18deg);
  width: 80px;
}
.meal-plan-hero-inner {
  max-width: 1400px;
  margin: 0 auto;
}
.meal-plan-week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.meal-plan-week-arrow {
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-pill);
  color: var(--black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t);
  font-family: inherit;
}
.meal-plan-week-arrow:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--neo-shadow-sm);
}
.meal-plan-week-arrow .material-symbols-outlined { font-size: 22px; }
.meal-plan-week-label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.meal-plan-week-label .display-heading {
  margin-bottom: 0;
  font-size: clamp(1.2rem, 3.2vw, 2.25rem);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.meal-plan-today-btn {
  background: var(--accent-yellow);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  padding: 4px 14px;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--black);
  cursor: pointer;
  box-shadow: 2px 2px 0 0 #000;
  transition: transform var(--t), box-shadow var(--t);
}
.meal-plan-today-btn:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 0 #000; }

.section-meal-plan-days {
  background: var(--section-cyan);
  padding: 28px 32px calc(28px + 80px);
  position: relative;
  overflow: visible;
}
.section-meal-plan-days .deco-spaghetti {
  left: 48px;
  right: auto;
  bottom: 40px;
  top: auto;
  width: 100px;
}

.meal-plan-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  position: relative;
  z-index: 1;
}
@media (min-width: 640px) {
  .meal-plan-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (min-width: 900px) {
  .meal-plan-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
@media (min-width: 1200px) {
  .meal-plan-grid { grid-template-columns: repeat(7, 1fr); gap: 14px; }
}

.meal-plan-day {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--neo-shadow-sm);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.meal-plan-day:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--neo-shadow);
}
.meal-plan-day-today {
  background: #FFF8C5;
  border-width: 3px;
}
@media (max-width: 1199px) {
  .meal-plan-day { padding: 18px 16px; gap: 16px; }
  .meal-plan-day:hover { transform: none; box-shadow: var(--neo-shadow-sm); }
}
.meal-plan-day-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: var(--border-sm);
  padding-bottom: 10px;
  position: relative;
}
.meal-plan-day-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meal-plan-day-header:has(.meal-plan-today-badge) .meal-plan-day-title {
  padding-right: 58px;
}
.meal-plan-today-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent-yellow);
  border: 1.5px solid #000;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-size: 0.56rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 1px 1px 0 0 #000;
}


.meal-plan-empty-day {
  padding: 16px;
  text-align: center;
  color: rgba(0,0,0,0.35);
  font-size: 0.8rem;
  font-weight: 600;
}
.meal-plan-recipes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meal-plan-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 8px;
  background: var(--white);
  border: var(--border-sm);
  border-radius: 10px;
  box-shadow: 2px 2px 0 0 #000;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  position: relative;
}
.meal-plan-card:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 0 #000; }
.meal-plan-card-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1.5px solid #000;
  object-fit: cover;
  flex-shrink: 0;
}
.meal-plan-card-thumb-empty {
  background: var(--section-pink);
}
.meal-plan-card-title {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}
.meal-plan-card-remove {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #000;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.12s;
}
.meal-plan-card-remove:hover { background: var(--card-subtle-red); }
.meal-plan-card-remove .material-symbols-outlined { font-size: 14px; }
.meal-plan-card-missing {
  background: var(--card-subtle-red);
  cursor: default;
}

.meal-plan-add-slot-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: transparent;
  border: 2px solid rgba(0,0,0,0.2);
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0,0,0,0.55);
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--t), color var(--t), transform var(--t), box-shadow var(--t);
}
.meal-plan-add-slot-btn:hover {
  border-color: var(--black);
  color: var(--black);
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 0 #000;
}
.meal-plan-add-slot-btn .material-symbols-outlined { font-size: 15px; }

.meal-plan-nutrition {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 8px;
  border-top: 1.5px dashed rgba(0,0,0,0.15);
}
.meal-plan-nutrition-empty {
  padding-top: 8px;
  border-top: 1.5px dashed rgba(0,0,0,0.15);
  font-size: 0.62rem;
  font-weight: 700;
  color: rgba(0,0,0,0.35);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.meal-plan-nutri-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 3px 10px;
  background: var(--card-subtle-blue);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  box-shadow: 2px 2px 0 0 #000;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--black);
}
.meal-plan-nutri-pill strong { font-weight: 800; }
.meal-plan-nutri-pill small { font-size: 0.55rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.65; }

/* Meal plan recipe picker */
.meal-plan-picker-search {
  width: 100%;
  margin-bottom: 12px;
}
.meal-plan-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.meal-plan-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: var(--white);
  border: var(--border-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.12s;
}
.meal-plan-picker-item:hover { background: rgba(0,0,0,0.04); }
.meal-plan-picker-item img,
.meal-plan-picker-thumb-empty {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1.5px solid #000;
  object-fit: cover;
  flex-shrink: 0;
}
.meal-plan-picker-thumb-empty { background: var(--section-pink); }
.meal-plan-picker-item span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.meal-plan-picker-empty {
  text-align: center;
  padding: 24px 0;
  color: rgba(0,0,0,0.5);
  font-weight: 700;
}

@media (max-width: 767px) {
  .meal-plan-hero { padding: 18px 16px 16px; }
  .meal-plan-hero .deco-burger { right: 10px; width: 56px; }
  .meal-plan-week-label .display-heading { font-size: 1.05rem; }
  .section-meal-plan-days { padding: 20px 16px calc(20px + 80px); }
  .meal-plan-day { padding: 12px; }
}

/* Meal-plan actions row (Auto-Fill button under week nav) */
.meal-plan-actions-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
.meal-plan-actions-row .btn-primary {
  padding: 8px 18px;
}

/* Auto-Fill modal sections */
.auto-fill-section {
  margin-bottom: 14px;
}
.auto-fill-section:last-child { margin-bottom: 0; }
.auto-fill-section .form-card-label {
  display: block;
  margin-bottom: 4px !important;
  margin-top: 0 !important;
}
.auto-fill-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.auto-fill-radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--white);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--black);
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t);
}
.auto-fill-radio:hover { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 0 #000; }
.auto-fill-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.auto-fill-radio:has(input:checked) {
  background: var(--black);
  color: var(--white);
  box-shadow: 2px 2px 0 0 #000;
  transform: translate(-1px, -1px);
}
.auto-fill-hint {
  margin: 14px 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(0,0,0,0.55);
  font-style: italic;
}

/* Favorite-category picker (Settings + Auto-Fill modal share this) */
.settings-fav-cats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fav-cat-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fav-cat-group-label {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(0,0,0,0.45);
}
.fav-cat-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.fav-cat-chip {
  padding: 4px 11px;
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--black);
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t);
  box-shadow: none;
}
.fav-cat-chip:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 0 #000;
  opacity: 1;
}
.fav-cat-chip.cat-chip-active {
  background: var(--black);
  color: var(--white);
  box-shadow: 2px 2px 0 0 #000;
  transform: translate(-1px, -1px);
  opacity: 1;
}
.fav-cat-chip:disabled {
  cursor: default;
  opacity: 0.5;
}
.fav-cat-chip.cat-chip-active:disabled { opacity: 1; }

/* Nutrition goals — settings grid (2 columns on desktop, same visual as
   private-grid but limited to the 4 goal inputs). */
.settings-goals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}
@media (max-width: 520px) {
  .settings-goals-grid { grid-template-columns: 1fr; }
}

/* Soll/Ist color variants for the nutrition rollup pills.
   Thresholds: ±15% green, ±35% yellow, outside red. */
.meal-plan-nutri-ok   { background: var(--accent-green); }
.meal-plan-nutri-warn { background: var(--accent-yellow); }
.meal-plan-nutri-off  { background: var(--card-subtle-red); }

.meal-plan-nutri-goal {
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(0,0,0,0.55);
  margin-left: 2px;
}

/* Auto-nutrition-estimate loading placeholder (fires on first detail open). */
.nutrition-auto-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(0,0,0,0.55);
}

/* Auto-Fill mode: disabled Optimal state when no goals set */
.auto-fill-radio-disabled {
  opacity: 0.4;
  pointer-events: none;
}
/* Brutal Stepper (Neo-Brutalist number stepper) */
.brutal-stepper {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brutal-stepper-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: var(--border-sm);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 2px 2px 0 0 #000;
}
.brutal-stepper-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 0 #000;
}
.brutal-stepper-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 0 #000;
}
.brutal-stepper-btn .material-symbols-outlined {
  font-size: 18px;
}
.brutal-stepper-value {
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 1.3rem;
  min-width: 28px;
  text-align: center;
  color: var(--black);
}

.auto-fill-mode-hint {
  margin: 6px 0 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(0,0,0,0.55);
  font-style: italic;
}

/* Day-Actions-Row: "Weiteren Slot" + (optional) "Optimieren" side by side */
.meal-plan-day-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.meal-plan-optimize-btn {
  border-color: rgba(0,0,0,0.3);
  color: rgba(0,0,0,0.7);
}

/* ===== OPTIMIZE-DAY MODAL (Stufe C) ===== */
.optimize-day-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--section-cyan);
  border: var(--border-sm);
  border-radius: var(--radius-md);
}
.optimize-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.optimize-summary-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(0,0,0,0.55);
  min-width: 68px;
}
.optimize-day-hint {
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(0,0,0,0.55);
  line-height: 1.4;
}

.optimize-day-slots {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.optimize-slot-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--white);
  border: var(--border-sm);
  border-radius: 12px;
  box-shadow: var(--neo-shadow-sm);
}
.optimize-slot-row-locked { background: var(--card-subtle-blue); }
.optimize-slot-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.optimize-slot-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0,0,0,0.65);
}

/* Lock-chip: styleguide filter-chip pattern (white default → black active) */
.optimize-lock-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: var(--white);
  border: var(--border-sm);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--black);
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t);
}
.optimize-lock-chip:hover {
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 0 #000;
}
.optimize-lock-chip .material-symbols-outlined { font-size: 14px; }
.optimize-lock-chip-locked {
  background: var(--black);
  color: var(--white);
  box-shadow: 2px 2px 0 0 #000;
  transform: translate(-1px, -1px);
}

.optimize-slot-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.optimize-slot-side { min-width: 0; }
.optimize-slot-arrow {
  font-size: 20px;
  color: rgba(0,0,0,0.4);
}

.optimize-slot-recipe {
  /* Used on locked rows — reuse card styling from meal plan for consistency */
}
.optimize-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 8px;
  background: var(--white);
  border: 1.5px solid #000;
  border-radius: 10px;
}
.optimize-slot-row-locked .optimize-chip {
  background: transparent;
  border: none;
  padding: 0;
}
.optimize-chip-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid #000;
  object-fit: cover;
  flex-shrink: 0;
}
.optimize-chip-thumb-empty { background: var(--section-pink); }
.optimize-chip-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}
.optimize-chip-empty {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(0,0,0,0.3);
  padding: 6px 8px;
}

.optimize-slot-alt-row {
  display: flex;
  justify-content: flex-end;
}
.optimize-alt-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: transparent;
  border: 2px solid rgba(0,0,0,0.25);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0,0,0,0.65);
  cursor: pointer;
  transition: border-color var(--t), color var(--t), transform var(--t), box-shadow var(--t);
}
.optimize-alt-btn:hover {
  border-color: var(--black);
  color: var(--black);
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 0 #000;
}
.optimize-alt-btn .material-symbols-outlined { font-size: 14px; }
.optimize-alt-count {
  margin-left: 2px;
  font-size: 0.6rem;
  opacity: 0.55;
}

/* Alternatives popover — frosted-glass style matching cat-mehr-popover */
.optimize-alt-popover {
  position: fixed;
  width: 280px;
  max-height: 340px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 6px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.optimize-alt-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background var(--t), border-color var(--t), transform var(--t);
}
.optimize-alt-popover-item:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.3);
  transform: scale(1.02);
}
.optimize-alt-popover-item-active {
  background: var(--primary-pink) !important;
  border-color: #000 !important;
  box-shadow: 2px 2px 0 0 #000;
}
.optimize-alt-popover-item img,
.optimize-alt-popover-thumb-empty {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1.5px solid #000;
  object-fit: cover;
  flex-shrink: 0;
}
.optimize-alt-popover-thumb-empty { background: var(--section-pink); }
.optimize-alt-popover-item-title {
  flex: 1;
  min-width: 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}
.optimize-alt-popover-check {
  font-size: 16px;
  flex-shrink: 0;
}

@media (max-width: 540px) {
  .optimize-slot-pair { grid-template-columns: 1fr 18px 1fr; gap: 6px; }
  .optimize-chip-thumb { width: 32px; height: 32px; }
  .optimize-alt-popover { width: calc(100vw - 32px); max-width: 320px; }
}
