:root {
  --bg: #FFF8F0;
  --card: #FFFFFF;
  --primary: #7B3F00;
  --primary-hover: #5C2E00;
  --primary-light: #A0522D;
  --accent: #E8A45A;
  --accent-light: #FDF0E0;
  --text: #2C1500;
  --text-muted: #7A5C3A;
  --border: #E5C9A8;
  --success: #2D6A4F;
  --success-bg: #D8F3DC;
  --danger: #C0392B;
  --danger-bg: #FDECEA;
  --warning-bg: #FFF3CD;
  --warning-text: #856404;
  --shadow: rgba(90, 40, 0, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.page-center {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px var(--shadow);
  padding: 2rem;
}

/* ── Topbar ── */
.topbar {
  background: var(--primary);
  color: white;
  padding: 0.75rem 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.topbar-brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1.2rem; font-weight: 700; color: white; text-decoration: none;
}
.topbar-brand .logo-emoji { font-size: 1.5rem; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.topbar-user { color: rgba(255,255,255,0.85); font-size: 0.9rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem; padding: 0.6rem 1.2rem; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none; transition: all 0.15s ease;
  line-height: 1;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover:not(:disabled) { background: #c8863a; }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--accent-light); }
.btn-ghost { background: rgba(255,255,255,0.15); color: white; }
.btn-ghost:hover { background: rgba(255,255,255,0.25); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #962d22; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-weight: 600; color: var(--primary);
  margin-bottom: 0.4rem; font-size: 0.9rem;
}
.form-control {
  width: 100%; padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.95rem; color: var(--text); background: white;
  transition: border-color 0.15s;
}
.form-control:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 164, 90, 0.2);
}
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 99px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-einfach { background: var(--success-bg); color: var(--success); }
.badge-mittel { background: var(--warning-bg); color: var(--warning-text); }
.badge-anspruchsvoll { background: var(--danger-bg); color: var(--danger); }

/* ── Alert ── */
.alert {
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  margin-bottom: 1rem; font-size: 0.9rem;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f5c6cb; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #b7e4c7; }

/* ── Tag input ── */
.tag-input-wrapper {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.5rem; min-height: 48px; background: white;
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  cursor: text; transition: border-color 0.15s;
}
.tag-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 164, 90, 0.2);
}
.tag {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--accent-light); border: 1px solid var(--border);
  border-radius: 99px; padding: 0.2rem 0.6rem 0.2rem 0.75rem;
  font-size: 0.85rem; color: var(--primary); font-weight: 500;
}
.tag-remove {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1rem; line-height: 1;
  padding: 0; display: flex; align-items: center;
}
.tag-remove:hover { color: var(--danger); }
.tag-real-input {
  border: none; outline: none; flex: 1; min-width: 120px;
  font-size: 0.9rem; color: var(--text); background: transparent;
  padding: 0.1rem 0.25rem;
}

/* ── Category buttons ── */
.category-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
}
.cat-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  padding: 0.75rem 0.5rem; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: white; cursor: pointer;
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
  transition: all 0.15s ease; text-align: center;
}
.cat-btn .cat-emoji { font-size: 1.6rem; }
.cat-btn:hover { border-color: var(--accent); color: var(--primary); background: var(--accent-light); }
.cat-btn.active { border-color: var(--primary); color: var(--primary); background: var(--accent-light); }

/* ── Multiplier ── */
.mult-row { display: flex; align-items: center; gap: 0.35rem; }
.mult-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.mult-btn {
  padding: 0.18rem 0.5rem; border-radius: 99px; font-size: 0.78rem; font-weight: 700;
  border: 1.5px solid var(--border); background: white; cursor: pointer;
  color: var(--text-muted); transition: all 0.15s; line-height: 1.4;
}
.mult-btn:hover { border-color: var(--accent); color: var(--primary); }
.mult-btn.active { border-color: var(--primary); background: var(--primary); color: white; }

/* ── Portions row ── */
.portions-row { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.portions-row .mult-btn { min-width: 2.2rem; text-align: center; }

/* ── Recipe expand/collapse button ── */
.recipe-expand-btn {
  display: block; width: 100%; text-align: left;
  margin-top: 0.75rem; padding: 0.45rem 0.75rem;
  background: var(--accent-light); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600;
  color: var(--primary); cursor: pointer; transition: all 0.15s;
}
.recipe-expand-btn:hover { border-color: var(--accent); background: var(--bg); }

/* ── Chapter chip (per recipe card) ── */
.chapter-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  background: var(--accent-light); border: 1.5px solid var(--border);
  border-radius: 99px; padding: 0.15rem 0.6rem;
  cursor: pointer; transition: all 0.15s;
}
.chapter-chip:hover { border-color: var(--accent); color: var(--primary); }
.chapter-chip.readonly { cursor: default; }
.chapter-chip.readonly:hover { border-color: var(--border); color: var(--text-muted); }

/* ── Chapter headers ── */
.chapter-header {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0; margin: 1.5rem 0 0.75rem;
  border-bottom: 2px solid var(--border); cursor: pointer; user-select: none;
}
.chapter-title {
  font-size: 0.8rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--primary); flex: 1;
}
.chapter-count {
  font-size: 0.75rem; color: var(--text-muted); font-weight: 600;
  background: var(--accent-light); border-radius: 99px; padding: 0.1rem 0.5rem;
}
.chapter-chevron { font-size: 0.75rem; color: var(--text-muted); transition: transform 0.2s; }
.chapter-chevron.open { transform: rotate(180deg); }
.chapter-edit-btn {
  font-size: 0.75rem; color: var(--text-muted); background: none; border: none;
  cursor: pointer; padding: 0.1rem 0.35rem; border-radius: var(--radius-sm);
  opacity: 0; transition: opacity 0.15s;
}
.chapter-header:hover .chapter-edit-btn { opacity: 1; }

/* ── Star rating ── */
.rating-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 0; border-top: 1px solid var(--bg);
}
.stars-display { display: flex; gap: 0.1rem; }
.star {
  font-size: 1.2rem; cursor: pointer; transition: transform 0.1s;
  line-height: 1; color: var(--border);
}
.star:hover, .star.filled { color: #f5a623; }
.star:hover { transform: scale(1.2); }
.rating-info { font-size: 0.82rem; color: var(--text-muted); }
.rating-info strong { color: var(--primary); }

/* ── Comments ── */
/* ── Drafts section ── */
.drafts-section {
  background: var(--warning-bg); border: 1.5px solid var(--accent);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.drafts-header {
  font-size: 0.8rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--warning-text);
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem;
}
.draft-count {
  background: var(--accent); color: white;
  border-radius: 99px; font-size: 0.7rem; padding: 0.1rem 0.5rem;
}
.draft-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 0; border-top: 1px solid rgba(0,0,0,0.07);
}
.draft-row:first-of-type { border-top: none; }
.draft-info { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.draft-emoji { font-size: 1.6rem; flex-shrink: 0; }
.draft-title { font-weight: 700; font-size: 0.95rem; color: var(--primary); }
.draft-date { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.1rem; }
.draft-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.comments-section { border-top: 1px solid var(--bg); padding-top: 0.75rem; margin-top: 0.5rem; }
.comments-toggle {
  background: none; border: none; cursor: pointer; font-size: 0.85rem;
  color: var(--text-muted); font-weight: 600; padding: 0; display: flex; align-items: center; gap: 0.4rem;
}
.comments-toggle:hover { color: var(--primary); }
.comments-list { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.comment-item {
  background: var(--bg); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem;
  font-size: 0.88rem;
}
.comment-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.2rem; }
.comment-author { font-weight: 700; color: var(--primary); font-size: 0.8rem; }
.comment-date { font-size: 0.75rem; color: var(--text-muted); }
.comment-del { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 0.8rem; padding: 0; }
.comment-del:hover { color: var(--danger); }
.comment-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.comment-form textarea {
  flex: 1; resize: none; min-height: 40px; max-height: 120px;
  padding: 0.4rem 0.6rem; font-size: 14px; font-family: inherit;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  line-height: 1.4; color: var(--text);
}
.comment-form textarea:focus { outline: none; border-color: var(--accent); }

/* ── Loading ── */
.loading-box {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1.25rem; padding: 4rem 2rem;
  color: var(--text-muted); text-align: center;
}
.progress-bar-wrap {
  width: 240px; height: 6px; background: var(--border);
  border-radius: 99px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; width: 0%; background: var(--primary);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ── Recipe cards ── */
.recipes-grid { display: flex; flex-direction: column; gap: 2rem; margin-top: 1.5rem; }
.recipe-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 2px 16px var(--shadow);
  overflow: hidden; animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.recipe-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white; padding: 1.5rem 2rem;
}
.recipe-title-row {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem;
}
.recipe-emoji { font-size: 2.5rem; }
.recipe-title { font-size: 1.5rem; font-weight: 700; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.meta-chip {
  background: rgba(255,255,255,0.2); border-radius: 99px;
  padding: 0.2rem 0.65rem; font-size: 0.8rem; font-weight: 500;
}
/* ── Recipe image gallery ── */
.recipe-gallery {
  display: flex; gap: 6px; overflow-x: auto; padding: 6px;
  background: #111; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent;
  scroll-snap-type: x mandatory;
}
.recipe-gallery::-webkit-scrollbar { height: 4px; }
.recipe-gallery::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 99px; }
.gallery-item {
  position: relative; flex-shrink: 0; scroll-snap-align: start;
  border-radius: 6px; overflow: hidden;
}
.gallery-img {
  height: 200px; width: auto; min-width: 140px; max-width: 320px;
  object-fit: cover; display: block; cursor: zoom-in;
  transition: transform 0.25s ease;
}
.gallery-item:hover .gallery-img { transform: scale(1.03); }
.gallery-del-btn {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.6); color: white; border: none;
  border-radius: 50%; width: 26px; height: 26px;
  cursor: pointer; font-size: 0.8rem; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.gallery-item:hover .gallery-del-btn { opacity: 1; }
.gallery-add {
  flex-shrink: 0; height: 200px; min-width: 90px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem;
  background: rgba(255,255,255,0.08); border: 2px dashed rgba(255,255,255,0.25);
  border-radius: 6px; color: rgba(255,255,255,0.6); font-size: 1.5rem;
  cursor: pointer; transition: all 0.15s; scroll-snap-align: start;
}
.gallery-add:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.5); color: white; }

/* Leerer Zustand — kein schwarzer Balken */
.gallery-empty-add {
  padding: 0.4rem 0.9rem; font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer; display: inline-flex;
  align-items: center; gap: 0.35rem; border-bottom: 1px dashed var(--border);
  transition: color 0.15s; background: var(--accent-light);
  width: 100%;
}
.gallery-empty-add:hover { color: var(--primary); background: var(--bg); }

/* ── Feed cards ── */
.feed-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem; padding-bottom: 3rem;
}
.feed-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 2px 12px var(--shadow);
  overflow: hidden; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
}
.feed-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px var(--shadow); border-color: var(--accent); }
.feed-card-img { width: 100%; height: 180px; object-fit: cover; background: var(--accent-light); }
.feed-card-img-placeholder {
  width: 100%; height: 180px; display: flex; align-items: center; justify-content: center;
  font-size: 4rem; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}
.feed-card-body { padding: 1rem 1.1rem; flex: 1; display: flex; flex-direction: column; gap: 0.35rem; }
.feed-card-title { font-size: 1rem; font-weight: 700; color: var(--primary); }
.feed-card-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-card-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: auto; padding-top: 0.5rem; }
.feed-card-user { font-size: 0.78rem; font-weight: 600; color: var(--primary); }
.feed-card-date { font-size: 0.75rem; color: var(--text-muted); }
.feed-card-chapter { font-size: 0.72rem; background: var(--accent-light); color: var(--primary);
  border-radius: 99px; padding: 0.1rem 0.5rem; font-weight: 600; }

.recipe-body { padding: 1.75rem 2rem; }
.recipe-description { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; }
.recipe-two-col {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.5rem; margin-bottom: 1.5rem;
}
@media (max-width: 600px) { .recipe-two-col { grid-template-columns: 1fr; } }
.recipe-section h3 {
  font-size: 0.9rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--primary); margin-bottom: 0.6rem;
  padding-bottom: 0.4rem; border-bottom: 2px solid var(--border);
}
.ingredient-list { list-style: none; }
.ingredient-list li {
  padding: 0.3rem 0; border-bottom: 1px solid var(--bg);
  font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem;
}
.ingredient-list li::before { content: "·"; color: var(--accent); font-weight: 900; }
.missing-list { list-style: none; }
.missing-list li {
  padding: 0.3rem 0; font-size: 0.9rem;
  color: var(--danger); display: flex; align-items: center; gap: 0.5rem;
}
.missing-list li::before { content: "✗"; font-weight: 700; }
.all-good-box {
  background: var(--success-bg); border-radius: var(--radius-sm);
  padding: 1rem; text-align: center; color: var(--success);
}
.all-good-box .check-icon { font-size: 2rem; margin-bottom: 0.25rem; }
.all-good-box p { font-weight: 600; font-size: 0.9rem; }
.steps-section { margin-bottom: 1.5rem; }
.steps-section h3 {
  font-size: 0.9rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--primary); margin-bottom: 0.75rem;
  padding-bottom: 0.4rem; border-bottom: 2px solid var(--border);
}
.steps-list { list-style: none; counter-reset: step-counter; }
.steps-list li {
  counter-increment: step-counter;
  display: flex; gap: 1rem; padding: 0.6rem 0;
  border-bottom: 1px solid var(--bg); font-size: 0.9rem;
}
.steps-list li::before {
  content: counter(step-counter);
  min-width: 1.8rem; height: 1.8rem;
  background: var(--primary); color: white;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 0.75rem; font-weight: 700;
  flex-shrink: 0; margin-top: 0.1rem;
}
.tip-box {
  background: var(--accent-light); border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 1rem 1.25rem;
  display: flex; gap: 0.75rem; align-items: flex-start;
}
.tip-icon { font-size: 1.25rem; flex-shrink: 0; }
.tip-box p { font-size: 0.9rem; color: var(--text-muted); }

/* ── Admin table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
  text-align: left; padding: 0.6rem 0.75rem;
  background: var(--accent-light); color: var(--primary);
  font-weight: 700; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.04em; border-bottom: 2px solid var(--border);
}
.data-table td {
  padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--bg); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
}
.modal-box {
  background: white; border-radius: var(--radius); padding: 2rem;
  max-width: 400px; width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; color: var(--primary); }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.hidden { display: none !important; }

/* ── Misc ── */
.greeting-box {
  background: var(--accent-light); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.9rem 1.25rem;
  font-style: italic; color: var(--primary); margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.section-title {
  font-size: 1.3rem; font-weight: 700; color: var(--primary); margin-bottom: 0.25rem;
}
.section-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.25rem; }

/* ── Cook Mode ── */
#cookmode-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: #1a0a00;
  display: flex; flex-direction: column;
}
#cookmode-overlay.hidden { display: none; }
.cm-container {
  display: flex; flex-direction: column; height: 100%;
  max-width: 680px; margin: 0 auto; width: 100%; padding: 0;
}
.cm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.cm-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1rem; font-weight: 700; color: rgba(255,255,255,0.9);
  overflow: hidden;
}
.cm-title span:last-child {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.cm-emoji { font-size: 1.4rem; flex-shrink: 0; }
.cm-header-actions { display: flex; gap: 0.5rem; }
.cm-btn-icon {
  background: rgba(255,255,255,0.1); border: none; border-radius: 8px;
  width: 38px; height: 38px; font-size: 1.1rem; cursor: pointer;
  color: white; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.cm-btn-icon:hover { background: rgba(255,255,255,0.2); }
.cm-progress-wrap {
  height: 4px; background: rgba(255,255,255,0.15); flex-shrink: 0;
}
.cm-progress-bar {
  height: 100%; background: var(--accent);
  transition: width 0.3s ease;
}
.cm-step-count {
  text-align: center; font-size: 0.8rem; font-weight: 600;
  color: rgba(255,255,255,0.5); padding: 0.6rem 1rem 0;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.cm-ingredients {
  margin: 0.75rem 1.25rem; background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm); padding: 1rem 1.25rem;
  max-height: 200px; overflow-y: auto;
}
.cm-ingredients h3 {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent); margin-bottom: 0.5rem;
}
.cm-ingredients ul { list-style: none; }
.cm-ingredients li {
  font-size: 0.9rem; color: rgba(255,255,255,0.8);
  padding: 0.2rem 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cm-step-area {
  flex: 1; display: flex; flex-direction: column;
  justify-content: center; padding: 2rem 1.75rem;
  overflow-y: auto;
}
.cm-step-text {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  color: white; line-height: 1.7; text-align: center;
  font-weight: 400;
}
.cm-tip {
  margin-top: 1.5rem; background: rgba(232,164,90,0.15);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem; font-size: 0.9rem;
  color: rgba(255,255,255,0.75); text-align: left;
}
.cm-nav {
  display: flex; gap: 1rem; padding: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
}
.cm-nav-btn {
  flex: 1; padding: 1rem; border-radius: var(--radius-sm);
  font-size: 1.1rem; font-weight: 700; cursor: pointer; border: none;
  background: rgba(255,255,255,0.12); color: white;
  transition: background 0.15s;
}
.cm-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.2); }
.cm-nav-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.cm-nav-next { background: var(--primary); }
.cm-nav-next:hover { background: var(--primary-hover); }
.cm-nav-done { background: var(--success); }
.cm-nav-done:hover { background: #236040; }

/* Timer start buttons */
.cm-timer-start-wrap {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  justify-content: center; margin-top: 1.5rem;
}
.cm-timer-start-btn {
  background: rgba(232,164,90,0.2); border: 1.5px solid var(--accent);
  color: var(--accent); border-radius: 99px; padding: 0.55rem 1.2rem;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.cm-timer-start-btn:hover { background: rgba(232,164,90,0.35); }

/* Timer box (running) */
.cm-timer-box {
  margin-top: 1.5rem; display: flex; flex-direction: column;
  align-items: center; gap: 0.75rem;
}
.cm-timer-label {
  font-size: 0.9rem; color: rgba(255,255,255,0.6);
  font-weight: 600; letter-spacing: 0.03em;
}
.cm-timer-ring-wrap {
  position: relative; width: 140px; height: 140px;
  display: flex; align-items: center; justify-content: center;
}
.cm-timer-ring { width: 140px; height: 140px; }
.cm-timer-countdown {
  position: absolute; font-size: 2rem; font-weight: 800;
  color: white; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.cm-timer-urgent { color: #ef4444; animation: pulse 0.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
.cm-timer-actions { display: flex; gap: 0.6rem; }
.cm-timer-btn {
  padding: 0.5rem 1.1rem; border-radius: 99px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; border: 1.5px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1); color: white; transition: background 0.15s;
}
.cm-timer-btn:hover { background: rgba(255,255,255,0.2); }
.cm-timer-btn-cancel { border-color: rgba(239,68,68,0.5); color: #fca5a5; }
.cm-timer-btn-cancel:hover { background: rgba(239,68,68,0.2); }

/* Timer done */
.cm-timer-done { gap: 0.5rem; }
.cm-timer-done-icon { font-size: 3rem; animation: popIn 0.4s ease; }
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
.cm-timer-done-text { font-size: 1.4rem; font-weight: 800; color: white; }
.cm-timer-done-sub { font-size: 0.85rem; color: rgba(255,255,255,0.5); }
.cm-timer-btn-close {
  margin-top: 0.25rem; padding: 0.6rem 2rem; border-radius: 99px;
  background: var(--success); color: white; border: none;
  font-size: 1rem; font-weight: 700; cursor: pointer;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .card { padding: 1.25rem; }
  .recipe-header { padding: 1.25rem; }
  .recipe-body { padding: 1.25rem; }
  .recipe-title { font-size: 1.2rem; }
}

@media (max-width: 600px) {
  /* Topbar: swipeable nav */
  .topbar-right {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 1;
    min-width: 0;
    gap: 0.4rem;
    padding-right: 0.5rem;
  }
  .topbar-right::-webkit-scrollbar { display: none; }
  .topbar-right .btn { white-space: nowrap; flex-shrink: 0; font-size: 0.78rem; padding: 0.45rem 0.7rem; }
  .topbar-brand { flex-shrink: 0; }
  .topbar-brand .logo-emoji { font-size: 1.4rem; }
  .topbar-brand span:not(.logo-emoji) { display: none; }

  /* iOS zoom fix: inputs must be >= 16px */
  .form-control,
  .tag-real-input,
  .edit-input,
  input[type="text"],
  input[type="password"],
  textarea { font-size: 16px !important; }

  /* Touch targets */
  .item-checkbox { width: 24px !important; height: 24px !important; min-width: 24px; }
  .item-delete { padding: 0.6rem !important; font-size: 1.2rem !important; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .cat-btn { padding: 0.6rem 0.4rem; font-size: 0.78rem; }
  .cat-btn .cat-emoji { font-size: 1.35rem; }
  .btn { min-height: 40px; }

  /* Tool cards: full width on small screens */
  .tool-card { width: 100% !important; max-width: 340px; flex-direction: row; text-align: left; gap: 1rem; padding: 1rem 1.25rem; }
  .tool-emoji { font-size: 2rem; flex-shrink: 0; }
  .tool-badge { align-self: flex-start; }

  /* Dashboard hero */
  .dashboard-hero h1 { font-size: 1.5rem; }
  .tools-grid { padding: 0 0 2rem; }

  /* Recipe meta chips: smaller */
  .meta-chip { font-size: 0.73rem; padding: 0.15rem 0.5rem; }

  /* Recipe card actions: wrap nicely */
  .recipe-card-actions { flex-wrap: wrap; }

  /* Einkaufsliste: manual add stacks vertically */
  .manual-add { flex-direction: column; }
  .manual-add input { max-width: 100% !important; width: 100%; }

  /* Shopping modal: full-width on mobile */
  .modal-box { padding: 1.25rem; }

  /* Kochbuch header */
  .kochbuch-header { flex-direction: column; align-items: flex-start; }

  /* Cook mode: larger nav buttons */
  .cm-nav-btn { font-size: 1rem; padding: 0.85rem; }
  .cm-step-text { font-size: clamp(1.1rem, 5vw, 1.5rem); }
}

/* Admin table: horizontal scroll on mobile */
.table-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}
.table-scroll-wrap .data-table { min-width: 500px; }

/* Admin create form: single column on mobile */
@media (max-width: 560px) {
  .admin-create-grid { grid-template-columns: 1fr !important; }
}
