/* Kitchen Table design system — single light theme, olive used only as a small accent. */

:root {
  --cream: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f4ee;
  --ink: #2b2e1f;
  --ink-muted: #7a7a6c;
  --line: #e8e7dd;
  --olive: #596a25;
  --olive-deep: #45521c;
  --tag-bg: #f5f4ee;
  --surface-snack: #eef0e1;
  --shadow: 0 1px 2px rgba(43,46,31,0.05), 0 8px 24px -12px rgba(43,46,31,0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Jost', 'Avenir Next', 'Century Gothic', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration-color: var(--line); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px 80px; }

.site-header {
  padding: 32px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}
.site-header .wrap { padding-bottom: 0; display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-header .brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.8rem;
}
.site-header .brand a { text-decoration: none; color: var(--ink); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
}

h1, h2, h3 { text-wrap: balance; font-weight: 600; margin: 0; }

/* Browse grid */
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.recipe-card {
  position: relative;
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: block;
}
.recipe-card .photo {
  aspect-ratio: 4/3;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}
.recipe-card .photo.no-photo,
.recipe-page .hero-photo.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--ink-muted);
}
.no-photo .no-photo-icon { opacity: 0.55; }
.no-photo .no-photo-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.recipe-page .hero-photo.no-photo { aspect-ratio: 16/6; }
.recipe-card .body { padding: 18px 20px 22px; }
.recipe-card .rtitle {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.3rem;
  margin: 4px 0 10px;
}
.recipe-card .rmeta { display: flex; gap: 14px; color: var(--ink-muted); font-size: 0.82rem; margin-bottom: 12px; flex-wrap: wrap; }

/* Tags */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--olive-deep);
  letter-spacing: 0.02em;
}

/* Stat bar */
.stat-bar {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 30px;
}
.stat { flex: 1; padding: 16px 12px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat .num { font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stat .lbl { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.66rem; color: var(--ink-muted); margin-top: 2px; }

/* Ingredient list */
.ingredient-list { list-style: none; margin: 0; padding: 0; }
.ingredient-list li { padding: 10px 4px; font-size: 0.96rem; border-bottom: 1px solid var(--line); }
.ingredient-list li:last-child { border-bottom: none; }

/* Recipe page */
.recipe-page { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.recipe-page .hero-photo { width: 100%; aspect-ratio: 16/8; background-size: cover; background-position: center; background-color: var(--surface-2); }
.recipe-page .content { padding: 36px 40px 44px; }
.recipe-page h1.recipe-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 2.4rem;
  margin-bottom: 18px;
}
.recipe-page .cols { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px; margin-top: 8px; }
.recipe-page .col-h {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 14px;
  color: var(--olive-deep);
}
.recipe-page .method { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.recipe-page .method li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.98rem;
}
.recipe-page .method li::before { content: counter(step); font-weight: 700; color: var(--olive); font-variant-numeric: tabular-nums; }
.recipe-page .tags-and-source {
  margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.source-ref { font-size: 0.82rem; color: var(--ink-muted); }
.source-ref a { text-decoration: none; border-bottom: 1px dotted var(--ink-muted); }

@media (max-width: 720px) {
  .recipe-page .cols { grid-template-columns: 1fr; }
  .recipe-page .content { padding: 26px 22px 32px; }
  .stat-bar { flex-wrap: wrap; }
  .stat { flex: 1 1 33%; border-bottom: 1px solid var(--line); }
}

.empty-state { padding: 80px 24px; text-align: center; color: var(--ink-muted); }

/* Search + filter bar */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.search-input {
  flex: 1 1 240px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
}
.search-select {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--surface);
}
.search-submit {
  padding: 11px 22px;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.search-clear {
  align-self: center;
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-muted);
}
.result-count {
  color: var(--ink-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin: 0 0 22px;
}

@media (max-width: 560px) {
  .search-bar { flex-direction: column; align-items: stretch; }
  .search-submit { width: 100%; }
}

/* Site nav (header) */
.site-nav {
  display: flex;
  gap: 22px;
  flex: 1;
  margin-left: 36px;
}
.site-nav a {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.site-nav a:hover { color: var(--ink); }

/* Recipe detail: prep/cook/serves meta row + "per serve" caption */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.meta-pill {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-muted);
}
.stat-bar-caption {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

/* Back-to-top floating button */
#back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 40;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover { background: var(--olive-deep); }

/* "Saved" toast after an auto-saved calendar edit */
.cal-save-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1100;
}
.cal-save-toast[hidden] { display: block; } /* keep transitions working; visibility is opacity-driven */
.cal-save-toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* Generic page heading (Calendar / Education) */
.page-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 2.1rem;
  margin-bottom: 6px;
}
.page-subtitle {
  color: var(--ink-muted);
  font-size: 0.92rem;
  margin: 0 0 28px;
  max-width: 640px;
}

/* Calendar: toolbar (save/load/delete saved calendars) */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.cal-toolbar-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-plan-select, .cal-plan-name-input {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--surface);
}
.cal-plan-name-input { width: 200px; }
.cal-toolbar-btn {
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.cal-toolbar-btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.cal-toolbar-btn-danger:hover { color: #a5432b; }
.cal-toolbar-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Calendar grid — fluid 7-day layout, no horizontal scrollbar down to
   iPad-5th-gen portrait width (~768px CSS / ~720px usable inside .wrap). A
   narrow vertical-text label column replaces the old fixed-width label
   column so all 7 day columns can shrink to fit. */
.cal-sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--cream);
  padding-top: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.cal-search-bar { margin: 14px 0 0; }
.calendar-grid {
  display: grid;
  grid-template-columns: 26px repeat(7, 1fr);
  gap: 6px;
}
.cal-cell { min-height: 0; }
.cal-corner { background: transparent; }
.cal-day-head {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--olive-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  text-align: center;
}
.cal-slot-label {
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-slot-label span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--ink-muted);
  white-space: nowrap;
}
.cal-slot-label-snack span { color: var(--olive); }
.cal-slot {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}
/* Snack slots are the same height as the core-meal slots -- differentiated
   by a slightly different background tone (and an olive-tinted ring on a
   filled photo tile) instead. */
.cal-slot.cal-slot-snack { background: var(--surface-snack); }
.cal-slot-snack .cal-empty { border-color: rgba(89,106,37,0.35); }
.cal-slot-snack .cal-filled { box-shadow: inset 0 0 0 2px rgba(89,106,37,0.3); }
.cal-slot.cal-drop-hover { outline: 2px solid var(--olive); outline-offset: -2px; }
.cal-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
}
.cal-plus { font-size: 1.3rem; font-weight: 300; color: var(--ink-muted); line-height: 1; }
.cal-filled {
  position: relative;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
  cursor: grab;
}
.cal-draggable { touch-action: none; }
.cal-dragging-source { opacity: 0.35; }
.cal-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 8px 6px;
  background: linear-gradient(to top, rgba(43,46,31,0.75), rgba(43,46,31,0) 100%);
}
.cal-overlay-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
}
.cal-clear-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(43,46,31,0.55);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.cal-clear-btn:hover { background: #a5432b; }

/* Drag ghost that follows the pointer during a drag (mouse or touch). */
.cal-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 96px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: none;
}
.cal-drag-ghost-photo {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}
.cal-drag-ghost-title {
  font-size: 0.66rem;
  font-weight: 600;
  padding: 4px 6px;
  background: var(--surface);
  line-height: 1.25;
}


/* Recipe picker below the calendar — reuses the browse page's search bar,
   plus a thumbnail grid whose tiles are draggable onto calendar slots. */
.search-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 60px;
}
.search-thumb {
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: grab;
}
.search-thumb-photo {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--line);
}
.search-thumb-title {
  padding: 8px 10px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Recipe summary modal (calendar thumbnails/slots open this on a tap) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43,46,31,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.modal-backdrop[hidden] { display: none; }
.modal-box {
  background: var(--surface);
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.modal-hero { width: 100%; aspect-ratio: 16 / 8; background-size: cover; background-position: center; background-color: var(--surface-2); }
.modal-body { padding: 28px 30px 32px; }
/* Quick-add picker's content isn't wrapped in a .modal-body -- it's
   appended straight into this div -- so it needs the same inset itself. */
#qa-modal-content { padding: 26px 28px 28px; }
.modal-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.7rem;
  margin: 6px 0 14px;
}
.modal-view-link {
  display: inline-block;
  margin-top: 22px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}
.modal-view-link:hover { background: var(--olive-deep); }
.modal-loading { color: var(--ink-muted); padding: 40px; text-align: center; }

@media (max-width: 720px) {
  .calendar-grid { grid-template-columns: 20px repeat(7, 1fr); gap: 4px; }
  .cal-day-head { font-size: 0.6rem; }
  .cal-slot-label span { font-size: 0.52rem; }
  .cal-overlay-title { font-size: 0.64rem; }
}

@media (max-width: 720px) {
  .site-nav { margin-left: 0; order: 3; flex-basis: 100%; }
}

/* Education page */
.edu-section { margin-bottom: 44px; }
.edu-section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--olive-deep);
  margin-bottom: 6px;
}
.edu-section-intro { color: var(--ink-muted); font-size: 0.92rem; margin: 0 0 18px; max-width: 720px; }
.edu-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.edu-table th, .edu-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.edu-table th { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.7rem; color: var(--ink-muted); background: var(--surface-2); }
.edu-table tr:last-child td { border-bottom: none; }
.edu-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.edu-card { background: var(--surface); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.edu-card h3 { font-size: 0.98rem; margin: 0 0 8px; color: var(--olive-deep); }
.edu-card p { margin: 0; font-size: 0.88rem; color: var(--ink); line-height: 1.55; }
.edu-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.edu-steps li {
  /* Explicit flex children (a span + a div) rather than a grid column
     paired with bare inline content -- some browsers won't group a
     ::before counter and mixed <strong>/text content into one grid
     item, which pushed the paragraph into the narrow number column. */
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
}
.edu-step-num {
  flex: 0 0 auto;
  min-width: 24px;
  font-weight: 700;
  color: var(--olive);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  line-height: 1.4;
}
.edu-step-body { flex: 1 1 auto; min-width: 0; }
.edu-step-body strong { display: block; margin-bottom: 4px; }
.edu-step-body p { margin: 0; line-height: 1.55; }
.edu-source-note { font-size: 0.78rem; color: var(--ink-muted); margin-top: 8px; }

/* "Add to calendar" quick-add: the small "+" on browse cards, the bigger
   button on a recipe's detail page, and the picker modal they open. */
.qa-add-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(43,46,31,0.55);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.qa-add-btn:hover { background: var(--olive-deep); }
.recipe-actions { margin: -6px 0 20px; }
.qa-add-btn-full {
  position: static;
  width: auto;
  height: auto;
  border-radius: 999px;
  padding: 10px 20px;
  background: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
}

.qa-caption { font-size: 0.92rem; font-weight: 600; margin: 0 0 16px; padding-right: 16px; }
.qa-empty-note { color: var(--ink-muted); font-size: 0.85rem; margin: 0 0 4px; }
.qa-plan-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.qa-plan-btn {
  text-align: left;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.qa-plan-btn:hover { border-color: var(--olive); }
.qa-new-plan-form { display: flex; gap: 8px; }
.qa-new-plan-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--ink);
}

.qa-back-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.qa-back-btn {
  border: none;
  background: none;
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.qa-back-btn:hover { color: var(--ink); }

/* Highly condensed calendar grid used inside the quick-add picker --
   images and a sliver of text only, one tap to place. */
.qa-grid {
  display: grid;
  grid-template-columns: 18px repeat(7, 1fr);
  gap: 4px;
}
.qa-cell { min-height: 0; }
.qa-corner { background: transparent; }
.qa-day-head {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.56rem;
  font-weight: 700;
  color: var(--olive-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}
.qa-slot-label { display: flex; align-items: center; justify-content: center; }
.qa-slot-label span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.44rem;
  font-weight: 700;
  color: var(--ink-muted);
  white-space: nowrap;
}
.qa-slot-label-snack span { color: var(--olive); }
.qa-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
}
.qa-slot.qa-slot-snack { background: var(--surface-snack); }
.qa-slot:hover { outline: 2px solid var(--olive); outline-offset: -2px; }
.qa-filled { width: 100%; height: 100%; background-size: cover; background-position: center; background-color: var(--surface-2); }
.qa-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 3px 2px;
  background: linear-gradient(to top, rgba(43,46,31,0.78), rgba(43,46,31,0) 100%);
}
.qa-overlay-title {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #fff;
  font-size: 0.48rem;
  font-weight: 600;
  line-height: 1.2;
}
.qa-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
}
.qa-slot-snack .qa-empty { border-color: rgba(89,106,37,0.35); }
.qa-plus { font-size: 0.85rem; font-weight: 300; color: var(--ink-muted); line-height: 1; }
.qa-slot-pending { outline: 2px solid var(--olive); outline-offset: -2px; }
.qa-slot-pending::after {
  content: "\2713";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(89,106,37,0.55);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}
.qa-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.qa-action-hint { font-size: 0.78rem; color: var(--ink-muted); }


/* Favourite / heart toggle -- browse-card circle button (top-left, mirrors
   the qa-add-btn "+" circle which sits top-right) and the recipe detail
   page's pill button alongside "+ Add to calendar". */
.fav-toggle-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  background: rgba(43,46,31,0.55);
}
.fav-toggle-btn:hover { background: var(--olive-deep); }
.fav-toggle-btn-card {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.fav-toggle-btn-card.fav-active,
.fav-toggle-btn-full.fav-active { background: #a5432b; }
.fav-toggle-btn-full {
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fav-heart { font-size: 1rem; line-height: 1; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Favourites filter pill in the browse search bar */
.fav-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  background: var(--surface);
}
.fav-filter-pill input { margin: 0; }
.fav-filter-pill .fav-heart { color: var(--ink-muted); }
.fav-filter-pill-active { border-color: #a5432b; color: #a5432b; }
.fav-filter-pill-active .fav-heart { color: #a5432b; }

/* Tag editor on the recipe detail page -- toggleable chips grouped by
   category, plus a small form to add a brand-new tag value. */
.tag-editor { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.tag-editor-group { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.tag-editor-label {
  flex: 0 0 84px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-muted);
}
.tag-chip-row { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; }
.tag-chip {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--tag-bg);
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  cursor: pointer;
}
.tag-chip:hover { border-color: var(--olive); }
.tag-chip.tag-chip-active { background: var(--olive); color: #fff; border-color: var(--olive); }
.tag-add-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tag-add-input {
  flex: 1 1 200px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--surface);
}
.tag-add-select {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--surface);
}

/* My Notes -- free-text notes textarea at the bottom of a recipe page */
.my-notes-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.my-notes-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--surface);
  resize: vertical;
  margin-bottom: 12px;
}


/* Shopping list modal -- generated from whichever calendar is currently
   loaded (selecting any saved calendar switches to it immediately, so
   "any saved calendar" just means: select it, then open this). */
#shopping-modal-content { padding: 26px 28px 28px; }
.shopping-modal-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.6rem;
  margin: 6px 30px 18px 0;
}
.shopping-group-heading {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--olive-deep);
  margin: 18px 0 8px;
}
.shopping-group-heading:first-of-type { margin-top: 0; }
.shopping-item-list { list-style: none; margin: 0; padding: 0; }
.shopping-item-list li {
  padding: 7px 2px;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--line);
}
.shopping-item-list li:last-child { border-bottom: none; }
.shopping-list-textarea {
  width: 100%;
  min-height: 160px;
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--surface-2);
  resize: vertical;
}
.shopping-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.shopping-copy-hint { font-size: 0.78rem; color: var(--ink-muted); }
