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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f8f9fa;
  color: #212529;
  line-height: 1.5;
  font-size: 15px;
}

a { color: #0066cc; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.site-header {
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: 0 2rem;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo { font-weight: 800; font-size: 1.4rem; color: #212529; }
.logo:hover { text-decoration: none; }

.site-header nav { display: flex; gap: 1.5rem; flex: 1; }
.site-header nav a { color: #6c757d; font-size: 0.95rem; }
.site-header nav a:hover { color: #212529; text-decoration: none; }

.header-user { display: flex; align-items: center; gap: .65rem; margin-left: auto; flex-shrink: 0; }
.user-email { font-size: .82rem; color: #6c757d; white-space: nowrap; }
.header-account-btn { display: inline-flex; align-items: center; color: #495057; padding: 4px; border-radius: 4px; text-decoration: none; }
.header-account-btn:hover { color: #0066cc; background: #f0f4ff; text-decoration: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ── Page header ── */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.6rem; font-weight: 700; }
.subtitle { color: #6c757d; margin-top: 0.3rem; font-size: 0.95rem; }

.hint { color: #6c757d; font-size: 0.85rem; }
.hint.center { text-align: center; margin-top: 1rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #0066cc; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #0052a3; }
.btn-ghost { background: transparent; color: #6c757d; border: 1px solid #dee2e6; }
.btn-ghost:hover:not(:disabled) { background: #f1f3f5; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.82rem; }

.btn-action {
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: #fff;
  color: #495057;
  cursor: pointer;
}
.btn-action:hover { background: #f1f3f5; }
.btn-muted { color: #adb5bd; }
.btn-muted:hover { color: #6c757d; }

.page-actions { margin-top: 2rem; display: flex; gap: 0.75rem; align-items: center; }

/* ── Alerts ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: #fff3f3; border: 1px solid #f5c2c2; color: #842029; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.hidden { display: none !important; }

/* ── Upload / Dropzone ── */
.dropzone {
  border: 2px dashed #dee2e6;
  border-radius: 10px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 1.2rem;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: #0066cc;
  background: #f0f6ff;
}
.dropzone-inner svg { color: #adb5bd; margin-bottom: 0.8rem; }
.dropzone p { color: #6c757d; margin: 0.2rem 0; }
.file-label { color: #0066cc; cursor: pointer; }
.file-label:hover { text-decoration: underline; }
input[type="file"].hidden { display: none; }

.file-list { border: 1px solid #dee2e6; border-radius: 6px; overflow: hidden; margin-bottom: 1.2rem; }
.file-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #f1f3f5;
  font-size: 0.88rem;
}
.file-item:last-child { border-bottom: none; }
.file-size { color: #adb5bd; }

/* ── Progress card ── */
.progress-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}
.step-indicator { font-size: 0.85rem; color: #6c757d; margin-bottom: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }

.progress-bar-wrap {
  background: #e9ecef;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.progress-bar {
  height: 100%;
  background: #0066cc;
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-text { font-size: 0.9rem; color: #495057; }

/* ── Review layout ── */
.review-search-bar {
  margin-bottom: 1rem;
}
.review-search-bar .text-input {
  width: 100%;
  max-width: 28rem;
}

.review-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 768px) {
  .review-layout { grid-template-columns: 1fr; }
}

.review-section h2 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c757d;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #dee2e6;
}

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

.ingredient-group {
  position: relative;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: border-color 0.15s;
}

.group-remove-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: #adb5bd;
  opacity: 0;
  transition: opacity 0.1s, color 0.1s;
  padding: 0.1rem 0.2rem;
}
.ingredient-group:hover .group-remove-btn { opacity: 1; }
.group-remove-btn:hover { color: #dc2626; }
.ingredient-group.pending { border-color: #f59e0b; background: #fffbeb; }

.group-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}
.canonical-name { font-weight: 600; font-size: 0.95rem; }

.badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-sku { background: #dbeafe; color: #1e40af; }
.badge-search { background: #ede9fe; color: #5b21b6; }
.badge-inhouse { background: #dcfce7; color: #166534; }
.badge-unknown { background: #f3f4f6; color: #6b7280; }

.dish-pills { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.dish-pill {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  background: #f1f3f5;
  border-radius: 4px;
  color: #6c757d;
}
.dish-pill-removable { position: relative; padding-right: 1.2rem; }
.dish-pill-remove-btn {
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.68rem;
  color: #adb5bd;
  padding: 0;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
}
.dish-pill-removable:hover .dish-pill-remove-btn { opacity: 0.7; }
.dish-pill-remove-btn:hover { opacity: 1 !important; color: #dc3545; }

.raw-variants { font-size: 0.78rem; color: #adb5bd; margin-bottom: 0.4rem; font-style: italic; }

.group-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }

.empty { color: #adb5bd; font-size: 0.9rem; padding: 0.5rem 0; }

/* ── Pending bar ── */
.pending-bar {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.pending-bar--scrolled {
  position: sticky;
  top: 52px;
  z-index: 90;
}
.pending-bar--scrolled #pending-list { display: none; }
.pending-bar-top { display: flex; align-items: center; gap: 0.75rem; }
#pending-count { flex: 1; font-weight: 500; }
#pending-list { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.1rem; }
.pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #78350f;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
}
.pending-item:hover { background: rgba(0,0,0,0.04); }
.pending-item-label { flex: 1; }
.pending-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #92400e;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
  opacity: 0.5;
}
.pending-remove-btn:hover { opacity: 1; }

/* Badge × removal */
.badge-removable { position: relative; }
.badge-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0 0 0 0.3rem;
  color: inherit;
  opacity: 0;
  transition: opacity 0.1s;
  vertical-align: middle;
}
.badge-removable:hover .badge-remove-btn { opacity: 0.7; }
.badge-remove-btn:hover { opacity: 1 !important; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  width: min(420px, 92vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
#modal-body {
  overflow-y: auto;
  flex: 1;
}
.modal h3 { font-size: 1rem; margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.6rem; margin-top: 1.2rem; justify-content: flex-end; }

.text-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 0.95rem;
  margin-top: 0.3rem;
}
.text-input:focus { outline: 2px solid #0066cc; border-color: transparent; }

/* ── Resolve log ── */
.resolve-status { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 0.5rem; }
.eta { font-size: 0.85rem; color: #6c757d; }

.resolve-log {
  margin-top: 0.8rem;
  max-height: 240px;
  overflow-y: auto;
  font-size: 0.82rem;
  font-family: ui-monospace, monospace;
  color: #495057;
}
.log-ok { color: #166534; }
.log-err { color: #842029; }

/* ── Save page ── */
.save-ids {
  margin: 0.5rem 0 1.5rem;
  font-size: 0.9rem;
  color: #495057;
}

/* ── Menu page: recipe cards + ingredient chips ── */
.recipe-card-block {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
}
.recipe-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.ing-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.ing-chip {
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: default;
  border: 1px solid transparent;
  transition: filter 0.1s;
  user-select: none;
}
.ing-chip:hover { filter: brightness(0.93); }
.ing-list-text {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: #6c757d;
  line-height: 1.55;
  border-top: 1px solid #f1f3f5;
  padding-top: 0.5rem;
}
.ing-chip-provider-matched { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; cursor: pointer; }
.ing-chip-provider         { background: #f3f4f6; color: #374151; border-color: #e5e7eb; cursor: pointer; }
.ing-chip-inhouse          { background: #dcfce7; color: #166534; border-color: #bbf7d0; cursor: pointer; }
.ing-chip-unknown          { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }

/* ── Invoice drop zone ── */
.invoice-drop-zone {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 1.4rem 1rem;
  text-align: center;
  cursor: pointer;
  color: #6c757d;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}
.invoice-drop-zone:hover,
.invoice-drop-zone.drag-over {
  border-color: #4361ee;
  background: #f0f3ff;
  color: #4361ee;
}
.invoice-drop-zone.scanning {
  opacity: 0.55;
  pointer-events: none;
}
.invoice-drop-zone p { margin: 0; font-size: 0.88rem; }
.invoice-drop-zone .drop-hint { font-size: 0.76rem; margin-top: 0.25rem; color: inherit; }
@keyframes invoice-spin { to { transform: rotate(360deg); } }
.invoice-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #e2e8f0;
  border-top-color: #4361ee;
  border-radius: 50%;
  animation: invoice-spin 0.75s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* ── Ingredient tooltip ── */
.ing-tooltip {
  position: fixed;
  z-index: 300;
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.8rem;
  max-width: 290px;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.28);
  line-height: 1.45;
}
.ing-tooltip.interactive {
  pointer-events: auto;
}
.tt-header {
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.45rem;
}
.tt-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.22rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.tt-label {
  color: #94a3b8;
  font-size: 0.72rem;
  min-width: 54px;
  flex-shrink: 0;
}
.tt-allergens  { color: #fca5a5; }
.tt-dim        { color: #94a3b8; }
.tt-click-hint { color: #64748b; font-size: 0.68rem; font-style: italic; margin-bottom: 0.4rem; }
.tt-dish-list { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.tt-dish {
  display: inline-block;
  background: #334155;
  border-radius: 3px;
  padding: 0.08rem 0.32rem;
  font-size: 0.72rem;
}

/* Sub-ingredient allergenic underline — all products with allergens */
.sub-ing-allergenic {
  color: #dc2626;
  cursor: pointer;
}

/* Unverified ingredient-knowledge products — amber highlight on top of red text */
.sub-ing-llm {
  background: #fef3c7;
  border-radius: 2px;
  padding: 0 2px;
}

/* LLM-inferred allergen chip highlight — kept for reference, no longer applied */
.ing-chip-llm {
  outline: 1.5px solid #f59e0b;
  outline-offset: 1px;
}

/* Allergen action buttons inside product-page tooltip */
.tt-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.tt-allergen-name {
  flex: 1;
}
.tt-actions {
  display: flex;
  gap: 0.25rem;
}
.tt-action-confirm, .tt-action-remove {
  border: none;
  border-radius: 3px;
  padding: 0 5px;
  font-size: 0.8rem;
  line-height: 1.4;
  cursor: pointer;
  font-weight: 700;
}
.tt-action-confirm {
  background: #22c55e;
  color: #fff;
}
.tt-action-remove {
  background: #ef4444;
  color: #fff;
}

/* Per-recipe allergen summary */
.recipe-allergen-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin: 0.2rem 0 0.5rem;
  font-size: 0.8rem;
}
.ra-label { color: #6c757d; font-weight: 500; }
.ra-sep { margin-left: 0.4rem; }
.badge-llm { background: #fef3c7; color: #92400e; }
.badge-sm { font-size: 0.65rem; padding: 0.1rem 0.35rem; white-space: nowrap; }

/* ── Recipe card action bar ── */
.recipe-card-name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.1rem;
}
.recipe-card-actions {
  display: none;
  gap: 0.3rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin-bottom: 0.4rem;
}
.recipe-card-block.editing .recipe-card-actions { display: flex; }
.recipe-edit-toggle {
  margin-left: auto;
  flex-shrink: 0;
  color: #adb5bd;
  border-color: transparent;
}
.recipe-edit-toggle:hover { color: #374151; border-color: #dee2e6; }
.recipe-card-block.editing .recipe-edit-toggle { color: #16a34a; border-color: #86efac; }
.recipe-card-block.editing .recipe-edit-toggle:hover { background: #f0fdf4; border-color: #4ade80; }
.btn-action {
  background: none;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  cursor: pointer;
  color: #374151;
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
  transition: background 0.1s, border-color 0.1s;
}
.btn-action:hover { background: #f3f4f6; border-color: #adb5bd; }
.btn-xs { font-size: 0.72rem; padding: 0.15rem 0.45rem; }
.btn-danger-soft { border-color: #fca5a5; color: #dc2626; }
.btn-danger-soft:hover { background: #fef2f2; border-color: #ef4444; }
.btn-action.active { background: #e7f0ff; border-color: #93c5fd; color: #1d4ed8; }

/* ── Ingredient chip remove button (edit mode) ── */
.ing-chip { position: relative; }
.ing-chip-remove-btn {
  display: none;
  position: absolute;
  top: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1;
}
.ing-chip-list.editing .ing-chip { margin-right: 6px; }
.ing-chip-list.editing .ing-chip-remove-btn { display: flex; }

/* ── Alert inline (re-resolve error) ── */
.alert-inline {
  border: 1px solid #fca5a5;
  background: #fef2f2;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  color: #7f1d1d;
  font-size: 0.88rem;
  margin-top: 0.75rem;
}

/* ── Manage ingredients list ── */
.manage-ing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
  font-size: 0.88rem;
}
.manage-ing-row:hover { background: #f8f9fa; }
.manage-ing-name { flex: 1; }

/* ── Categories page ── */
.cat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 700px) {
  .cat-layout { grid-template-columns: 1fr; }
}
.cat-sidebar {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}
.cat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cat-sidebar-header h2 { margin: 0; font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #374151; }
.cat-section { margin-bottom: 0.75rem; }
.cat-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.4rem;
  background: #e9ecef;
  border-radius: 5px;
  margin-bottom: 0.3rem;
}
.cat-section-name { font-size: 0.85rem; font-weight: 600; color: #374151; }
.cat-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}
.cat-delete-btn:hover { color: #ef4444; }
.cat-dishes { padding-left: 0.5rem; display: flex; flex-direction: column; gap: 0.2rem; }
.cat-dish-chip {
  font-size: 0.78rem;
  color: #4b5563;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #dee2e6;
}
.cat-sidebar-footer { border-top: 1px solid #dee2e6; padding-top: 0.75rem; }
.cat-scan-hint { font-size: 0.8rem; color: #6c757d; margin: 0 0 0.5rem; }
.cat-main { display: flex; flex-direction: column; gap: 0; }
.cat-main-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.cat-main-header h2 { margin: 0; font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6c757d; }
.cat-unassigned-label { font-size: 0.82rem; font-weight: 500; }
.dish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  margin-bottom: 0.35rem;
  background: #fff;
}
.dish-row:hover { border-color: #adb5bd; }
.dish-row-name { font-size: 0.9rem; flex: 1; }
.dish-cat-select {
  font-size: 0.82rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  max-width: 160px;
}
.dish-cat-select:focus { outline: 2px solid #0066cc; border-color: transparent; }

/* ── Autocomplete widget ── */
.ac-wrap { position: relative; }
.ac-dropdown {
  position: absolute;
  background: #fff; border: 1px solid #dee2e6; border-top: none;
  border-radius: 0 0 6px 6px; max-height: 200px; overflow-y: auto;
  z-index: 9999; box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.ac-option { padding: 0.38rem 0.65rem; font-size: 0.88rem; cursor: pointer; }
.ac-option:hover, .ac-option.ac-active { background: #f1f3f5; }

/* ── Menu page category dividers ── */
.menu-category-divider {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6c757d;
  margin: 1.4rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #dee2e6;
}
.menu-category-divider:first-child { margin-top: 0; }
.menu-category-divider--uncategorized { color: #adb5bd; }

/* ── Home page ── */
.home-cta { display: flex; gap: .75rem; justify-content: center; }

.home-hero-full {
  margin-top: -2rem;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  background: linear-gradient(135deg, #0d1b2a 0%, #132440 100%);
  padding: 80px 2rem;
}

.home-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4rem;
}

.home-hero-left {
  flex: 0 0 42%;
  max-width: 420px;
}

.home-hero-subtitle {
  font-size: 1.65rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 2rem;
}

.home-hero-full .home-cta { justify-content: flex-start; }

.home-hero-right {
  flex: 1;
  display: flex;
  justify-content: center;
}

.monitor-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.monitor-screen {
  width: 100%;
  border: 12px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.08);
  position: relative;
}

.monitor-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 40%);
  pointer-events: none;
  z-index: 1;
}

.browser-chrome {
  background: #1e293b;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.browser-dots { display: flex; gap: 5px; flex-shrink: 0; }

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #22c55e; }

.browser-url-bar {
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-content img { width: 100%; display: block; }

.monitor-stand { width: 4px; height: 32px; background: #1e293b; }
.monitor-base { width: 120px; height: 10px; background: #1e293b; border-radius: 5px; }

@media (max-width: 768px) {
  .home-hero-inner { flex-direction: column; gap: 2.5rem; }
  .home-hero-left { max-width: 100%; }
  .home-hero-subtitle { font-size: 1.35rem; }
}

/* ── Home stats section ── */
.home-stats-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #dee2e6; }
.home-stats-section > h2 { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6c757d; margin-bottom: 1.75rem; }
.home-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat-card { background: #fff; border: 1px solid #dee2e6; border-top: 2px solid #0066cc; border-radius: 6px; padding: 1.25rem 1.25rem 1rem; }
.stat-number { font-size: 2.4rem; font-weight: 800; color: #0066cc; line-height: 1; margin-bottom: .5rem; }
.stat-caption { font-size: .875rem; color: #495057; line-height: 1.45; margin-bottom: .4rem; }
.stat-source { font-size: .78rem; color: #adb5bd; font-style: italic; margin: 0; }
.stat-source a { color: inherit; text-decoration: none; }
.stat-source a:hover { text-decoration: underline; }
@media (max-width: 640px) { .home-stats-grid { grid-template-columns: repeat(2, 1fr); } }

.menu-list { display: flex; flex-direction: column; gap: .6rem; margin-top: .5rem; }
.menu-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: .75rem 1rem;
  flex-wrap: wrap;
}
.menu-list-info { flex: 1; min-width: 0; }
.menu-list-name { font-weight: 600; font-size: .95rem; }
.menu-list-meta { font-size: .8rem; color: #adb5bd; margin-top: .1rem; }
.menu-list-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Auth forms ── */
.auth-card {
  max-width: 380px;
  margin: 4rem auto;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 2rem;
}
.auth-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.25rem; }
.auth-footer { margin-top: 1.25rem; font-size: .875rem; color: #6c757d; text-align: center; }
.field-label { display: block; font-size: .88rem; font-weight: 500; margin-top: .5rem; }
.auth-card-wide { max-width: 560px; }

.tos-scroll-box {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 1rem 1.1rem;
  height: 280px;
  overflow-y: auto;
  font-size: .78rem;
  line-height: 1.55;
  color: #495057;
  background: #f8f9fa;
}
.tos-scroll-box h2 { font-size: .85rem; font-weight: 700; margin-bottom: .5rem; }
.tos-scroll-box h3 { font-size: .8rem; font-weight: 600; margin: .9rem 0 .25rem; }
.tos-scroll-box p  { margin-bottom: .35rem; }

.tos-check-row { display: flex; align-items: flex-start; gap: .55rem; }
.tos-check-row input[type="checkbox"] { margin-top: .2rem; flex-shrink: 0; }
.tos-check-row label { font-size: .83rem; color: #495057; line-height: 1.45; cursor: pointer; }

/* ── Terms of Service standalone page ── */
.terms-page h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; }
.terms-page h3 { font-size: 1rem; font-weight: 600; margin: 1.4rem 0 .4rem; }
.terms-page p  { margin-bottom: .6rem; color: #495057; line-height: 1.6; }

/* ── Site footer ── */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .8rem;
  color: #adb5bd;
  border-top: 1px solid #dee2e6;
  margin-top: 2rem;
}
.site-footer a { color: #6c757d; }
.site-footer a:hover { color: #212529; }
.site-footer-sep { color: #dee2e6; margin: 0 .4rem; }

/* ── Review page recipe mode ── */
/* Chip remove buttons appear when the recipe card itself is in edit mode */
.recipe-card-block.editing .ing-chip { margin-right: 6px; }
.recipe-card-block.editing .ing-chip-remove-btn { display: flex; }

/* Badge for manually-entered ingredient list */
.badge-manual { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }

/* "Make in-house recipe" button when active */
.btn-inhouse-active { color: #166534; border-color: #86efac; background: #f0fdf4; }
.btn-inhouse-active:hover { background: #dcfce7; border-color: #4ade80; }

/* Textarea inside modals */
.text-input[rows] { display: block; min-height: 5rem; }

/* Manual product "Enter ingredients" button success state */
.btn-action--manual-done { color: #16a34a; border-color: #86efac; }
