* { box-sizing: border-box; }

/* ── Base ── */
body { background: #fff; margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; min-height: 100vh; display: flex; font-size: 18px; }

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  height: 100vh;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
}
.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  background: #f0f0f0;
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.sidebar-btn:hover { background: #e8e8e8; }
.sidebar-btn.active {
  background: #e8e8e8;
  border-color: #d0d0d0;
  font-weight: 600;
}
.sidebar-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  color: #333;
  transition: background 0.15s;
}
.sidebar-plus:hover { background: #d8d8d8; }

/* ── Main ── */
.main { flex: 1; padding: 36px 52px 0; display: flex; flex-direction: column; overflow: hidden; height: 100vh; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-title {
  font-size: 2.8rem;
  font-weight: 700;
  margin: 0;
  color: #111;
}
.add-btn {
  padding: 12px 28px;
  border-radius: 12px;
  border: 1px solid #d0d0d0;
  background: #f0f0f0;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: #333;
}
.add-btn:hover { background: #e4e4e4; }

.btn-reset {
  padding: 12px 28px;
  border-radius: 12px;
  border: 1px solid #d0d0d0;
  background: #f0f0f0;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  color: #333;
  transition: background 0.15s;
}
.btn-reset:hover { background: #e4e4e4; }

/* ── Search + Filters ── */
.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.search-field {
  flex: 1;
  max-width: 460px;
  flex-basis: 460px;
  padding: 12px 18px;
  border: 1px solid #d0d0d0;
  border-radius: 12px;
  font-size: 1.05rem;
  background: #f2f2f2;
  outline: none;
}
.search-field::placeholder { color: #999; }
.search-field:focus { background: #fff; border-color: #aaa; }
.filter-label {
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid #d0d0d0;
  background: #f0f0f0;
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
}
.filter-label:hover { background: #e8e8e8; }

/* ── Filter Dropdown ── */
.filter-dropdown {
  background: #f5f5f5;
  border: 1px solid #d0d0d0;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  padding: 16px;
  min-width: 280px;
  max-width: 320px;
  max-height: 400px;
  overflow-y: auto;
}
.filter-dropdown-section { margin-bottom: 12px; }
.filter-dropdown-section-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #111;
  margin-bottom: 8px;
}
.filter-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.filter-dropdown-item input.filter-check {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid #999;
  border-radius: 4px;
  background: #e8e8e8;
  cursor: pointer;
  display: grid;
  place-content: center;
  margin: 0;
  flex-shrink: 0;
  box-sizing: border-box;
}
.filter-dropdown-item input.filter-check::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: 0.1s transform ease-in-out;
  background-color: #333;
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.filter-dropdown-item input.filter-check:checked::before { transform: scale(1); }
.filter-dropdown-item input.filter-check:checked {
  background: #e0e0e0;
  border-color: #999;
}
.filter-dropdown-item label { cursor: pointer; font-size: 1rem; }
.filter-dropdown-divider {
  margin: 16px 0 12px;
  padding-top: 12px;
  border-top: 1px solid #d0d0d0;
}
.filter-dropdown-actions { display: flex; gap: 12px; }
.filter-dropdown-reset {
  background: none;
  border: none;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}
.filter-dropdown-apply {
  background: #e0e0e0;
  color: #333;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  margin-left: auto;
  transition: background 0.15s;
}
.filter-dropdown-apply:hover { background: #d0d0d0; }

/* ── Recipe Card Grid ── */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
  padding-bottom: 64px;
  align-content: start;
}

/* ── Scrollable recipe area ── */
.recipe-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin-right: -52px;
  padding-right: 52px;
  padding-top: 80px;
  padding-bottom: 24px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 80px);
  mask-image: linear-gradient(to bottom, transparent 0%, black 80px);
}
.recipe-card {
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.recipe-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.recipe-card .card-img-wrap {
  height: 220px;
  overflow: hidden;
  position: relative;
}
.recipe-card .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recipe-card .card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8e8e8, #d0d0d0);
}
.recipe-card .card-img-placeholder i { font-size: 3rem; color: #999; opacity: 0.8; }
.recipe-card .card-info {
  padding: 14px 16px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.recipe-card .card-name {
  font-size: 1rem;
  font-weight: 500;
  color: #222;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.recipe-card .card-time {
  font-size: 0.9rem;
  color: #666;
  white-space: nowrap;
  margin-left: 8px;
}

/* ── Empty / Loading ── */
.empty-state { overflow-y: auto; flex: 1; padding-bottom: 64px; 
  text-align: center;
  padding: 80px 20px;
  color: #aaa;
}
.empty-state i { font-size: 4rem; }

/* ── Card Actions ── */
.card-actions {
  display: flex;
  gap: 4px;
  padding: 0 14px 10px;
}
.card-actions .btn {
  padding: 3px 8px;
  font-size: 0.75rem;
  border-radius: 8px;
}

/* ── Label Pills ── */
.label-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin: 0 2px;
  border: none;
}
.label-filter-btn {
  border-radius: 20px;
  font-size: 0.82rem;
  padding: 4px 14px;
  height: auto;
  margin-top: 4px;
}

/* ── Meal Type Badge ── */
.meal-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ── Page Section Label ── */
.page-section-label {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: #111;
}
.page-section-label:first-child { margin-top: 0; }

/* ── Modal Form Styles ── */
.modal-content { border-radius: 16px; border: none; }
.modal-header { border-bottom: 1px solid #e8e8e8; padding: 18px 24px; }
.modal-title { font-size: 1.3rem; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid #e8e8e8; padding: 12px 20px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; color: #555; margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  font-size: 1rem;
  background: #f8f8f8;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.form-input:focus { background: #fff; border-color: #aaa; }
.form-input::placeholder { color: #bbb; }
textarea.form-input { resize: vertical; min-height: 80px; }

.image-upload-area {
  border: 2px dashed #d0d0d0;
  border-radius: 12px;
  padding: 36px;
  text-align: center;
  cursor: pointer;
  background: #fafafa;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}
.image-upload-area:hover { background: #f0f0f0; border-color: #bbb; }
.image-upload-area i { font-size: 2.2rem; color: #bbb; }
.image-upload-area p { margin: 8px 0 0; font-size: 0.9rem; color: #999; }
.image-preview { max-width: 100%; max-height: 200px; border-radius: 10px; margin-top: 12px; object-fit: cover; }

/* ── AI Generate Button ── */
.btn-ai-generate {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  background: #f0f0f0;
  color: #555;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1;
}
.btn-ai-generate i { font-size: 0.8rem; }
.btn-ai-generate:hover:not(:disabled) {
  background: #e4e4e4;
}
.btn-ai-generate:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ai-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #d0d0d0;
  border-top-color: #888;
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 500px) { .info-row { grid-template-columns: 1fr 1fr; } }

.ingredient-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 36px;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}
.ingredient-row .form-input { font-size: 0.9rem; padding: 10px 12px; }

.btn-remove-row {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid #d0d0d0;
  background: #f0f0f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #999;
  transition: background 0.15s;
}
.btn-remove-row:hover { background: #e8e8e8; color: #666; }

.btn-add-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #d0d0d0;
  background: #f0f0f0;
  font-size: 0.9rem;
  cursor: pointer;
  color: #555;
  transition: background 0.15s;
}
.btn-add-row:hover { background: #e4e4e4; }

.btn-save {
  padding: 12px 32px;
  border-radius: 12px;
  border: 1px solid #d0d0d0;
  background: #e0e0e0;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  color: #333;
  transition: background 0.15s;
}
.btn-save:hover { background: #d0d0d0; }

.btn-cancel {
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  color: #888;
}
.btn-cancel:hover { color: #555; }

.label-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.label-checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid #d0d0d0;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.label-checkbox-item:hover { background: #eee; }
.label-checkbox-item input[type="checkbox"] { display: none; }
.label-checkbox-item.selected { box-shadow: inset 0 1px 3px rgba(0,0,0,0.12); }

.meal-type-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.meal-type-chip {
  padding: 10px 18px;
  border-radius: 20px;
  border: 1px solid #d0d0d0;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.15s;
}
.meal-type-chip:hover { background: #eee; }
.meal-type-chip.selected { font-weight: 600; }
.meal-type-chip.selected[data-value="breakfast"] { background: #ffe082; border-color: #f9a825; }
.meal-type-chip.selected[data-value="lunch"] { background: #90caf9; border-color: #1e88e5; }
.meal-type-chip.selected[data-value="dinner"] { background: #b39ddb; border-color: #7b1fa2; }
.meal-type-chip.selected[data-value="dessert"] { background: #f48fb1; border-color: #d81b60; }
.meal-type-chip.selected[data-value="sides"] { background: #80cbc4; border-color: #00897b; }

.image-gallery { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.image-gallery-item { position: relative; width: 160px; height: 160px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; cursor: pointer; }
.image-gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.image-gallery-item.cover { border-color: #333; }
.image-gallery-item .cover-badge { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.7); color: #fff; font-size: 0.65rem; text-align: center; padding: 2px 0; }
.image-gallery-item .remove-img { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; border: none; font-size: 0.65rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ── Recipe View Modal ── */
.recipe-view-modal .modal-content { border-radius: 16px; max-height: 90vh; overflow-y: auto; }
.recipe-view-hero {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}
.recipe-view-hero-carousel {
  height: 280px;
  overflow: visible;
  border-radius: 16px 16px 0 0;
}
.recipe-view-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recipe-view-hero-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8e8e8, #d0d0d0);
}
.recipe-view-hero-placeholder i { font-size: 4rem; color: #999; }
.recipe-view-hero-btn {
  position: absolute;
  top: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: #555;
  transition: background 0.15s;
}
.recipe-view-hero-btn:hover { background: #fff; }
.recipe-view-hero-btn.btn-edit { right: 56px; }
.recipe-view-hero-btn.btn-close-view { right: 12px; }

/* ── Image Carousel ── */
.rv-carousel {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}
.rv-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.35s ease;
}
.rv-carousel-slide {
  flex: 0 0 100%;
  height: 100%;
}
.rv-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rv-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.15);
  font-size: 1.4rem;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 2;
}
.rv-carousel-arrow:hover { background: #fff; }
.rv-carousel-prev { left: 12px; }
.rv-carousel-next { right: 12px; }
.rv-carousel-thumbs {
  display: flex;
  gap: 8px;
  padding: 12px 20px 0;
  justify-content: center;
}
.rv-carousel-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: opacity 0.15s, border-color 0.15s;
}
.rv-carousel-thumb.active {
  border-color: #555;
  opacity: 1;
}
.rv-carousel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recipe-view-body { padding: 28px 32px 36px; }
.recipe-view-title {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 8px;
  color: #111;
}
.recipe-view-meal-types {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.recipe-view-meal-types .meal-type-chip {
  cursor: default;
}
.recipe-view-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
}
.recipe-view-label-row .label-badge {
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: 14px;
}
.recipe-view-two-col {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 600px) {
  .recipe-view-two-col { grid-template-columns: 1fr; }
}
.recipe-view-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
label.recipe-view-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 400;
  color: #333;
}
.recipe-view-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  place-content: center;
}
.recipe-view-check::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: scale(0);
  transition: 0.12s transform ease-in-out;
  background: #666;
}
.recipe-view-check:checked::before { transform: scale(1); }
.recipe-view-check:checked { border-color: #888; }
.recipe-view-info-card {
  background: #f2f2f2;
  border-radius: 14px;
  padding: 18px;
  font-size: 0.95rem;
  color: #444;
  line-height: 1.7;
}
.recipe-view-info-card strong { color: #222; }
.recipe-view-instructions {
  font-size: 1rem;
  color: #444;
  line-height: 1.7;
}
.recipe-view-instructions p { margin-bottom: 8px; }
.recipe-view-instructions ul, .recipe-view-instructions ol { padding-left: 20px; margin-bottom: 8px; }
.recipe-view-instructions li { margin-bottom: 4px; }
.recipe-view-instructions h1, .recipe-view-instructions h2, .recipe-view-instructions h3 { margin-top: 16px; margin-bottom: 8px; }
.recipe-view-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ── Markdown Editor Tabs ── */
.md-editor { border: 1px solid #d0d0d0; border-radius: 10px; overflow: hidden; }
.md-editor-tabs {
  display: flex;
  border-bottom: 1px solid #d0d0d0;
  background: #f5f5f5;
}
.md-editor-tab {
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: #888;
  border: none;
  background: transparent;
  transition: color 0.15s, background 0.15s;
}
.md-editor-tab:hover { color: #555; }
.md-editor-tab.active {
  color: #333;
  background: #fff;
  border-bottom: 2px solid #333;
  margin-bottom: -1px;
}
.md-editor-code {
  width: 100%;
  min-height: 400px;
  padding: 14px 16px;
  border: none;
  font-size: 0.95rem;
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
  background: #fff;
  resize: vertical;
  outline: none;
  line-height: 1.6;
}
.md-editor-preview {
  display: none;
  min-height: 200px;
  padding: 14px 16px;
  background: #fff;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #333;
}
.md-editor-preview.active { display: block; }
.md-editor-code.hidden { display: none; }
.md-editor-preview h1, .md-editor-preview h2, .md-editor-preview h3 { margin-top: 12px; margin-bottom: 6px; }
.md-editor-preview ul, .md-editor-preview ol { padding-left: 20px; }
.md-editor-preview li { margin-bottom: 4px; }
.md-editor-preview code { background: #f0f0f0; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.md-editor-preview pre { background: #f5f5f5; padding: 12px; border-radius: 8px; overflow-x: auto; }
.md-editor-preview pre code { background: none; padding: 0; }

/* ── Label Manager ── */
.label-mgr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: #f8f8f8;
  border: 1px solid #e8e8e8;
}
.label-mgr-item .label-mgr-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}
.label-mgr-item .label-mgr-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}
.label-mgr-item .label-mgr-count {
  font-size: 0.8rem;
  color: #999;
  white-space: nowrap;
}
.label-mgr-item .btn-remove-row {
  width: 28px; height: 28px;
  font-size: 0.85rem;
}

/* ── Grocery List ── */
.cat-section { margin-bottom: 32px; }
.cat-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eee;
}
.grocery-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  transition: opacity 0.15s;
}
.grocery-item.checked { opacity: 0.45; }
.grocery-item.checked .item-text { text-decoration: line-through; }
.grocery-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  place-content: center;
}
.grocery-check::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: scale(0);
  transition: 0.12s transform ease-in-out;
  background: #666;
}
.grocery-check:checked::before { transform: scale(1); }
.grocery-check:checked { border-color: #888; }
.item-text { flex: 1; font-size: 1rem; color: #222; }
.btn-edit-item {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #bbb;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.btn-edit-item:hover { color: #555; background: #f0f0f0; }
.item-edit-input {
  flex: 1;
  font-size: 1rem;
  padding: 4px 8px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  outline: none;
  background: #fff;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { width: 72px; padding: 16px 8px; }
  .sidebar-btn span, .sidebar-btn::after { display: none; }
  .main { padding: 24px 20px 48px; }
  .recipe-scroll-area { margin-right: -20px; padding-right: 20px; }
  .page-title { font-size: 2rem; }
  .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
}
