/* =========================================================================
   Topfgeflüster Design System
   Warm, colorful, editorial cookbook re-skin
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700;9..144,800&family=Nunito:wght@400;500;600;700;800&family=Caveat:wght@500;700&display=swap');

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

:root {
  /* Brand / pantry hues */
  --tomato-50:  #fff4f0;
  --tomato-100: #ffe0d4;
  --tomato-200: #ffb89e;
  --tomato-300: #ff8a66;
  --tomato-400: #f0623a;
  --tomato-500: #d84a22;
  --tomato-600: #b13917;

  --basil-50:   #f1faf0;
  --basil-100:  #d9f0d4;
  --basil-200:  #a8dd9c;
  --basil-300:  #6fc360;
  --basil-400:  #3ea230;
  --basil-500:  #2b7d20;

  --saffron-50:  #fff8e6;
  --saffron-100: #ffeab8;
  --saffron-200: #ffd46a;
  --saffron-300: #f6b93b;
  --saffron-400: #e49914;
  --saffron-500: #b6760a;

  --berry-50:   #fdeef4;
  --berry-100:  #fbd1e1;
  --berry-200:  #f18cb6;
  --berry-300:  #d95c8e;
  --berry-400:  #b83769;
  --berry-500:  #8c254d;

  --aubergine-50:  #f3eef5;
  --aubergine-100: #dfd1e6;
  --aubergine-200: #b599c3;
  --aubergine-300: #84609a;
  --aubergine-400: #5a3a74;
  --aubergine-500: #3d2552;

  --ocean-50:  #e9f6f7;
  --ocean-100: #c4e6e9;
  --ocean-200: #7bc6cd;
  --ocean-300: #3fa3ac;
  --ocean-400: #20808a;
  --ocean-500: #155a62;

  /* Neutrals — warm paper */
  --cream-50:  #fdfaf4;
  --cream-100: #f8f1e4;
  --cream-200: #efe4cf;
  --cream-300: #e0d1b5;
  --cream-400: #c6b599;
  --ink-300:   #8a7a68;
  --ink-400:   #6b5b4a;
  --ink-500:   #4a3d32;
  --ink-600:   #2d241c;

  /* Semantic tokens */
  --bg:         var(--cream-50);
  --bg-card:    #ffffff;
  --bg-input:   #ffffff;
  --text:       var(--ink-500);
  --text-muted: var(--ink-300);
  --text-heading: var(--ink-600);
  --border:     var(--cream-300);
  --accent:     var(--tomato-400);
  --accent-hover: var(--tomato-500);
  --danger:     #c63838;
  --danger-hover: #a32a2a;
  --success:    var(--basil-400);

  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --radius-wonky: 14px 18px 12px 20px;

  --shadow-xs: 0 1px 2px rgba(74, 48, 24, 0.06);
  --shadow-sm: 0 2px 6px rgba(74, 48, 24, 0.07);
  --shadow-md: 0 6px 18px rgba(74, 48, 24, 0.10);
  --shadow-lg: 0 14px 40px rgba(74, 48, 24, 0.14);
  --shadow-brand: 0 8px 24px rgba(240, 98, 58, 0.28);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-hand: 'Caveat', cursive;

  --dur: 220ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);

  --paper-speck:
    radial-gradient(circle at 20% 30%, rgba(109, 78, 42, 0.035) 0, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(109, 78, 42, 0.03) 0, transparent 2px),
    radial-gradient(circle at 45% 85%, rgba(109, 78, 42, 0.025) 0, transparent 1.5px);
}

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  background-image: var(--paper-speck);
  background-size: 180px 180px, 240px 240px, 320px 320px;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.header-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--tomato-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.header-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.01em;
  line-height: 1;
}

.header-tagline {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--tomato-500);
  margin-top: 3px;
}

.header-nav {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dur) var(--ease-out);
  font-family: var(--font-body);
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand);
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: #fff;
  color: var(--text-heading);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--tomato-300);
  color: var(--tomato-500);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem;
}

.btn-ghost:hover {
  color: var(--text-heading);
  background: var(--cream-100);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

.sidebar {
  width: 280px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 22px 20px;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar h2 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tomato-400);
  margin-bottom: 12px;
}

.main-content {
  flex: 1;
  padding: 32px 36px;
  overflow-y: auto;
}

/* Search */
.search-bar {
  position: relative;
  margin-bottom: 22px;
}

.search-bar input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-heading);
  font-size: 0.9rem;
  font-family: var(--font-body);
  transition: all var(--dur) var(--ease-out);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--tomato-300);
  box-shadow: 0 0 0 3px var(--tomato-100);
}

.search-bar .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Category List */
.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 12px 12px 4px;
  margin-top: 4px;
  list-style: none;
}

.category-group-label:first-child {
  margin-top: 0;
}

.chip-group-label {
  width: 100%;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 8px 0 2px;
  margin-top: 4px;
}

.chip-group-label:first-child {
  margin-top: 0;
  padding-top: 0;
}

.chip-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 120ms var(--ease-out);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-heading);
}

.category-item:hover {
  background: var(--cream-100);
}

.category-item.active {
  background: var(--tomato-50);
  font-weight: 700;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-item .category-count {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--cream-100);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.category-actions {
  display: none;
  gap: 0.25rem;
  margin-left: auto;
}

.category-item:hover .category-actions {
  display: flex;
}

.category-item:hover .category-count {
  display: none;
}

.add-category-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--dur) var(--ease-out);
  margin-top: 14px;
  border: 1.5px dashed var(--border);
  background: transparent;
  width: 100%;
  font-family: var(--font-body);
}

.add-category-btn:hover {
  color: var(--tomato-500);
  border-color: var(--tomato-300);
  background: var(--tomato-50);
}

/* Category Page Header */
.category-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.category-page-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-page-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.category-page-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Recipe Grid */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.recipe-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--dur) var(--ease-out);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
}

.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--tomato-200);
}

.recipe-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.recipe-card-header {
  padding: 14px 16px 10px;
  flex: 1;
}

.recipe-card-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.recipe-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.recipe-card-desc {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card-footer {
  padding: 10px 16px;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: auto;
  background: var(--cream-50);
}

.recipe-card-footer span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 6px;
  color: var(--text-heading);
}

.empty-state p {
  margin-bottom: 20px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 36, 28, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 28px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--dur) var(--ease-out);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--dur) var(--ease-out);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--cream-50);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 120ms;
  line-height: 1;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-heading);
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Form */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-heading);
  font-size: 0.9rem;
  font-family: var(--font-body);
  transition: all var(--dur) var(--ease-out);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--tomato-300);
  box-shadow: 0 0 0 3px var(--tomato-100);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.color-picker-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.color-picker-wrapper input[type="color"] {
  width: 40px;
  height: 40px;
  padding: 2px;
  border-radius: 8px;
  cursor: pointer;
}

.color-presets {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.color-preset {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 120ms;
}

.color-preset:hover,
.color-preset.active {
  border-color: var(--ink-600);
  transform: scale(1.15);
}

/* Category Chip Picker (multi-select) */
.category-chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms var(--ease-out);
  border: 2px solid transparent;
  user-select: none;
}

.category-chip:hover {
  transform: scale(1.05);
}

.category-chip.selected {
  border-color: currentColor;
  opacity: 1;
}

.category-chip:not(.selected) {
  opacity: 0.75;
  border-color: rgba(0, 0, 0, 0.08);
}

.recipe-card-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

/* Image Upload */
.image-upload-area {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--dur) var(--ease-out);
  overflow: hidden;
}

.image-upload-area:hover,
.image-upload-area.dragover {
  border-color: var(--tomato-300);
  background: rgba(240, 98, 58, 0.04);
}

.image-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.image-upload-icon {
  font-size: 1.8rem;
  opacity: 0.7;
}

.image-upload-hint {
  font-size: 0.72rem;
  opacity: 0.6;
}

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

.image-remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.image-upload-progress {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--cream-200);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Recipe Detail View */
.recipe-detail {
  max-width: 820px;
  margin: 0 auto;
}

.recipe-detail-header {
  margin-bottom: 22px;
}

.recipe-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
  margin-bottom: 14px;
  transition: color 120ms;
}

.recipe-detail-back:hover {
  color: var(--text-heading);
}

.recipe-detail-title {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.1;
}

.recipe-detail-meta {
  display: flex;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.recipe-detail-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.recipe-detail-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.recipe-detail-image {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.recipe-detail-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px;
  margin-bottom: 18px;
}

.recipe-detail-section h3 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tomato-400);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.recipe-detail-section p,
.recipe-detail-section ul {
  white-space: pre-line;
  line-height: 1.8;
}

.recipe-detail-columns {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 18px;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.attachment-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 140px;
}

.attachment-thumb {
  display: block;
  width: 140px;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 150ms;
}

.attachment-thumb:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.attachment-info a {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-info a:hover {
  color: var(--accent);
}

.attachment-upload-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.attachment-modal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.attachment-modal-item img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.attachment-modal-name {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Steps list */
.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: none;
}

.step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--cream-200);
}

.step-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.step-number {
  width: 30px;
  height: 30px;
  min-width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--basil-400);
  color: white;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

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

.step-section {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--tomato-400);
  padding-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Time Pills */
.time-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  margin-bottom: 8px;
}

.time-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  min-width: 120px;
}

.time-pill-icon {
  font-size: 1.15rem;
}

.time-pill-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.time-pill-value {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-heading);
}

.time-pill-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-top: 2px;
}

/* Time pill hue variants */
.time-pill-saffron  { background: var(--saffron-50);  border: 1px solid var(--saffron-100); }
.time-pill-tomato   { background: var(--tomato-50);   border: 1px solid var(--tomato-100); }
.time-pill-aubergine{ background: var(--aubergine-50); border: 1px solid var(--aubergine-100); }
.time-pill-basil    { background: var(--basil-50);    border: 1px solid var(--basil-100); }

/* Servings Control */
.servings-control {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.servings-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-heading);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms;
  font-family: var(--font-body);
  line-height: 1;
}

.servings-btn:hover {
  background: var(--cream-100);
}

.servings-btn:active {
  background: var(--tomato-100);
}

.servings-value {
  min-width: 46px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-heading);
  padding: 0 0.25rem;
  user-select: none;
}

.servings-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

/* Ingredients list */
.ingredients-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ingredient-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--cream-200);
  line-height: 1.5;
}

.ingredient-row:last-child {
  border-bottom: none;
}

.ingredient-qty {
  font-weight: 700;
  min-width: 70px;
  color: var(--text-heading);
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  transition: color var(--dur);
}

.ingredient-qty.scaled {
  color: var(--tomato-500);
}

.ingredient-rest {
  flex: 1;
}

/* Dashboard */
.dashboard {
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-welcome {
  background: var(--tomato-50);
  border: 1px solid var(--tomato-100);
  border-radius: var(--radius-wonky);
  padding: 32px 36px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}

.dashboard-welcome-text {
  position: relative;
  z-index: 1;
}

.dashboard-welcome .eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tomato-400);
}

.dashboard-welcome h2 {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 6px 0 4px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.dashboard-welcome p {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--tomato-500);
  margin: 0;
}

.dashboard-welcome-emoji {
  font-size: 140px;
  line-height: 1;
  transform: rotate(-8deg);
  opacity: 0.9;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--dur) var(--ease-out);
}

.stat-card:hover {
  border-color: var(--tomato-200);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.stat-value {
  font-family: var(--font-body);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-heading);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-top: 4px;
}

.dashboard-section {
  margin-bottom: 32px;
}

.dashboard-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dashboard-section-header h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-heading);
}

.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.category-group-heading {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tomato-400);
  padding: 8px 0 0;
  margin: 0;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--dur) var(--ease-out);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.category-card-dot {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.category-card-info {
  flex: 1;
  min-width: 0;
}

.category-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-card-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Import */
.import-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
}

.import-tab {
  flex: 1;
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 150ms;
}

.import-tab:hover {
  color: var(--text-heading);
}

.import-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.import-photo-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 150ms;
}

.import-photo-area:hover {
  border-color: var(--tomato-300);
  background: var(--tomato-50);
}

.import-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.import-photo-preview {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.import-url-row {
  display: flex;
  gap: 10px;
}

.import-url-input {
  flex: 1;
  padding: 10px 14px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-heading);
  font-size: 0.9rem;
  font-family: var(--font-body);
  transition: all var(--dur) var(--ease-out);
  outline: none;
}

.import-url-input:focus {
  border-color: var(--tomato-300);
  box-shadow: 0 0 0 3px var(--tomato-100);
}

.import-ai-badge {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--aubergine-50);
  border: 1px solid var(--aubergine-100);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-badge {
  background: var(--aubergine-400);
  color: white;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.import-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px;
  color: var(--text-muted);
}

.import-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid var(--cream-200);
  border-top-color: var(--tomato-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.import-success-banner {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.import-success-banner.structured {
  background: var(--basil-50);
  border: 1px solid var(--basil-100);
  color: var(--basil-500);
}

.import-success-banner.ai {
  background: var(--aubergine-50);
  border: 1px solid var(--aubergine-100);
  color: var(--aubergine-400);
}

.import-preview-card {
  background: var(--cream-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.import-compare-layout {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.import-original-photo {
  flex: 0 0 40%;
  max-width: 40%;
  position: sticky;
  top: 0;
}

.import-original-photo label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
}

.import-original-photo img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  cursor: zoom-in;
}

.import-original-photo img.zoomed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  object-fit: contain;
  background: rgba(0,0,0,0.85);
  border-radius: 0;
  box-shadow: none;
  z-index: 9999;
  cursor: zoom-out;
}

.import-edit-form {
  flex: 1;
  min-width: 0;
}

@media (max-width: 700px) {
  .import-compare-layout {
    flex-direction: column;
  }
  .import-original-photo {
    flex: none;
    max-width: 100%;
    position: static;
    max-height: 40vh;
    overflow: hidden;
  }
  .import-original-photo img {
    max-height: 40vh;
    object-fit: contain;
  }
}

.import-edit-form .form-group {
  margin-bottom: 0.75rem;
}

.import-edit-form .form-group label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}

.import-edit-form textarea {
  font-size: 0.88rem;
  line-height: 1.5;
}

.import-edit-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.import-preview-image {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  margin-bottom: 14px;
}

.import-preview-meta {
  display: flex;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.import-preview-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.import-error {
  padding: 14px;
  background: rgba(198, 56, 56, 0.08);
  border: 1px solid rgba(198, 56, 56, 0.2);
  border-radius: 10px;
  color: var(--danger);
  font-size: 0.9rem;
}

/* Backup */
.backup-section {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
}

.backup-section-icon {
  font-size: 2rem;
  flex-shrink: 0;
  opacity: 0.7;
  margin-top: 0.1rem;
}

.backup-section-content {
  flex: 1;
}

.backup-section-content h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-heading);
}

.backup-section-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.backup-divider {
  border-top: 1px solid var(--border);
  margin: 0.25rem 0;
}

.backup-upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--dur) var(--ease-out);
  margin-bottom: 1rem;
}

.backup-upload-area:hover {
  border-color: var(--tomato-300);
  background: rgba(240, 98, 58, 0.04);
}

.backup-upload-placeholder {
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.backup-upload-selected {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--tomato-50);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tomato-500);
}

.backup-result {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
}

.backup-result.success {
  background: var(--basil-50);
  border: 1px solid var(--basil-100);
  color: var(--basil-500);
}

.backup-result.error {
  background: rgba(198, 56, 56, 0.08);
  border: 1px solid rgba(198, 56, 56, 0.2);
  color: var(--danger);
}

/* Notification */
.notification {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 300;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s var(--ease-out);
  box-shadow: var(--shadow-md);
}

.notification.show {
  transform: translateY(0);
  opacity: 1;
}

.notification.success {
  background: var(--success);
  color: white;
}

.notification.error {
  background: var(--danger);
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }

  .category-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .category-item {
    padding: 0.4rem 0.75rem;
  }

  .main-content {
    padding: 1rem;
  }

  .recipe-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .recipe-detail-title {
    font-size: 1.75rem;
  }

  .recipe-detail-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .recipe-detail-actions {
    margin-left: 0;
  }

  .recipe-detail-columns {
    grid-template-columns: 1fr;
  }

  .header {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-brand-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .header h1 {
    font-size: 1.2rem;
  }

  .header-tagline {
    font-size: 12px;
  }

  .header-user {
    margin-left: auto;
    border-left: none;
    padding-left: 0;
  }

  .header-user-name {
    display: none;
  }

  .header-nav {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    order: 3;
    margin-left: 0;
  }

  .header-nav .btn {
    padding: 7px 12px;
    font-size: 0.78rem;
    white-space: nowrap;
    justify-content: center;
  }

  .dashboard-welcome {
    padding: 20px 24px;
  }

  .dashboard-welcome h2 {
    font-size: 1.75rem;
  }

  .dashboard-welcome-emoji {
    font-size: 80px;
  }

  .dashboard-stats {
    grid-template-columns: 1fr 1fr;
  }
}

/* =========================================================================
   Login Overlay
   ========================================================================= */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 380px;
  margin: 1rem;
}

.login-brand-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
}

.login-card h1 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 1.8rem;
  margin-bottom: 0.15rem;
}

.login-tagline {
  font-family: var(--font-hand);
  color: var(--text-muted);
  font-size: 1.15rem;
  margin-bottom: 2rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-form input[type="password"] {
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  text-align: center;
  transition: border-color 0.15s;
}

.login-form input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--tomato-100);
}

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 1.2em;
}

.login-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.login-form input[type="text"] {
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  text-align: center;
  transition: border-color 0.15s;
}

.login-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--tomato-100);
}

/* =========================================================================
   Header User Area
   ========================================================================= */

.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 0.25rem;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}

.header-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* =========================================================================
   User Management
   ========================================================================= */

.user-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.15s;
}

.user-card:hover {
  box-shadow: var(--shadow);
}

.user-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.user-card-info {
  flex: 1;
  min-width: 0;
}

.user-card-name {
  font-weight: 600;
  color: var(--ink);
}

.user-card-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.user-card-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.role-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.role-admin {
  background: var(--tomato-100);
  color: var(--tomato-500);
}

.role-user {
  background: var(--basil-50);
  color: var(--basil-400);
}

.role-viewer {
  background: var(--saffron-50);
  color: var(--saffron-400);
}

.badge-2fa {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--saffron-100);
  color: var(--saffron-500);
  margin-left: 4px;
}

.my-account-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* =========================================================================
   Category Group Management
   ========================================================================= */

.group-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.15s, opacity 0.15s;
}

.group-card:hover {
  box-shadow: var(--shadow);
}

.group-card.dragging {
  opacity: 0.4;
}

.group-card-drag {
  cursor: grab;
  color: var(--text-muted);
  font-size: 1.1rem;
  user-select: none;
}

.group-card-drag:active {
  cursor: grabbing;
}

.group-card-name {
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}

.group-card-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.group-card-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* =========================================================================
   2FA Modal
   ========================================================================= */

.twofa-qr {
  text-align: center;
  padding: 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: inline-block;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.twofa-qr img {
  image-rendering: pixelated;
}

.twofa-secret {
  display: block;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--cream);
  border-radius: var(--radius);
  font-size: 0.85rem;
  word-break: break-all;
  text-align: center;
}

/* Form select styling */
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-body);
  background: white;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s;
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--tomato-100);
}

/* =========================================================================
   Meal Plan
   ========================================================================= */

.mealplan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.mealplan-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.mealplan-arrow {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  transition: all 150ms;
  user-select: none;
}

.mealplan-arrow:hover {
  border-color: var(--tomato-300);
  color: var(--tomato-500);
  background: var(--tomato-50);
}

.mealplan-arrow:active {
  transform: scale(0.95);
}

.mealplan-today-btn {
  font-size: 0.8rem !important;
}

.mealplan-week-label {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-heading);
  min-width: 130px;
  text-align: center;
}

.mealplan-date-picker {
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 150ms;
  position: relative;
  line-height: 1;
}

.mealplan-date-picker:hover {
  background: var(--cream);
}

.mealplan-date-picker input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.mealplan-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.mealplan-day {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 200px;
}

.mealplan-day.today {
  border-color: var(--tomato-300);
  box-shadow: 0 0 0 2px var(--tomato-100);
}

.mealplan-day-header {
  padding: 10px 12px;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.mealplan-day-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-heading);
}

.mealplan-day-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.mealplan-slot {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light, #f0ede8);
  cursor: pointer;
  transition: background 150ms;
  min-height: 70px;
}

.mealplan-slot:last-child {
  border-bottom: none;
}

.mealplan-slot:hover {
  background: var(--tomato-50);
}

.mealplan-slot-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.mealplan-slot-content {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.3;
}

.mealplan-slot-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.mealplan-slot-custom {
  color: var(--text-heading);
  font-style: italic;
}

.mealplan-custom-icon {
  font-style: normal;
  opacity: 0.5;
}

.mealplan-slot-servings {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

.mealplan-slot-image {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  float: right;
  margin-left: 6px;
}

/* Meal Slot Modal */

.meal-recipe-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

.meal-recipe-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 100ms;
  border-bottom: 1px solid var(--border-light, #f0ede8);
}

.meal-recipe-item:last-child {
  border-bottom: none;
}

.meal-recipe-item:hover,
.meal-recipe-item.selected {
  background: var(--tomato-50);
}

.meal-recipe-item.selected {
  font-weight: 700;
  color: var(--accent);
}

.meal-recipe-item img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.meal-recipe-item span {
  font-size: 0.88rem;
}

.meal-divider-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 1rem 0;
  position: relative;
}

.meal-divider-text::before,
.meal-divider-text::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}

.meal-divider-text::before { left: 0; }
.meal-divider-text::after { right: 0; }

.meal-servings-row {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 0.75rem;
}

.meal-servings-row label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  display: block;
}

.meal-servings-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meal-servings-control button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: white;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms;
  padding: 0;
}

.meal-servings-control button:hover {
  border-color: var(--tomato-300);
  color: var(--tomato-500);
}

#mealServingsValue {
  font-size: 1.3rem;
  font-weight: 800;
  min-width: 24px;
  text-align: center;
}

.meal-servings-orig {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Shopping List */

.shopping-list {
  list-style: none;
}

.shopping-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light, #f0ede8);
  font-size: 0.9rem;
}

.shopping-item:last-child {
  border-bottom: none;
}

.shopping-item input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent);
}

.shopping-item.checked {
  text-decoration: line-through;
  opacity: 0.5;
}

.shopping-recipe-group {
  margin-bottom: 1rem;
}

.shopping-recipe-group h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.shopping-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

@media (max-width: 768px) {
  .mealplan-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mealplan-day {
    min-height: auto;
  }

  .mealplan-day-header {
    text-align: left;
    display: flex;
    gap: 8px;
    align-items: baseline;
  }

  .mealplan-slot {
    min-height: auto;
    display: flex;
    gap: 8px;
    align-items: baseline;
  }

  .mealplan-slot-label {
    margin-bottom: 0;
    min-width: 50px;
  }
}
