* { box-sizing: border-box; }
:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #1f2421;
  --mute: #6c706b;
  --line: #e3e1da;
  --green: #0a7c36;
  --green-bg: #e7f3eb;
  --red: #c14a3b;
  --amber: #b87e1a;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.4;
  font-size: 15px;
  padding-bottom: 64px;
}

header {
  padding: 16px 16px 8px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
}
header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
header .meta {
  color: var(--mute);
  font-size: 13px;
  margin-top: 2px;
}

.tabs {
  display: flex;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 60px;
  z-index: 10;
}
.tab {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-weight: 500;
  color: var(--mute);
  cursor: pointer;
}
.tab.active {
  color: var(--ink);
  border-bottom-color: var(--green);
}
.tab .count {
  display: inline-block;
  background: var(--green);
  color: white;
  border-radius: 10px;
  padding: 0 6px;
  font-size: 11px;
  margin-left: 4px;
  min-width: 18px;
  text-align: center;
}
.tab .count:empty { display: none; }

main {
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.section-head {
  margin-bottom: 12px;
}
.section-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}
.section-head .hint {
  margin: 0;
  color: var(--mute);
  font-size: 13px;
}

.filter-pills {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.pill {
  padding: 4px 12px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  color: var(--mute);
  cursor: pointer;
}
.pill.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

/* DEALS GRID */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.deal-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.deal-card .img-wrap {
  background: #fafafa;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.deal-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.deal-card .discount {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--green);
  color: white;
  font-weight: 700;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
}
.deal-card .body {
  padding: 8px 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.deal-card .name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 4px;
}
.deal-card .price {
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
}
.deal-card .meta {
  color: var(--mute);
  font-size: 11px;
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.deal-card .more-badge {
  background: var(--green-bg);
  color: var(--green);
  font-weight: 600;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  white-space: nowrap;
}
.deal-card { cursor: pointer; }
.deal-card:hover { box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 6px 16px rgba(0,0,0,0.08); }
.deal-card .alternates {
  border-top: 1px solid var(--line);
  margin: 0 10px;
  padding: 6px 0 8px;
}
.deal-card .alt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  padding: 3px 0;
  color: var(--mute);
}
.deal-card .alt-row .alt-merchant {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deal-card .alt-row .alt-price { color: var(--ink); }
.deal-card .alt-row .alt-discount {
  color: var(--green);
  font-weight: 600;
  min-width: 32px;
  text-align: right;
}
.deal-card .add-btn {
  margin-top: 8px;
  width: 100%;
  background: var(--ink);
  color: white;
  border: 0;
  border-radius: 6px;
  padding: 7px 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.deal-card .add-btn:hover { background: #2c322e; }
.deal-card .add-btn.added {
  background: var(--green-bg);
  color: var(--green);
}
.deal-card .add-btn.via-recipe {
  background: transparent;
  color: var(--green);
  border: 1px dashed var(--green);
  cursor: default;
}
.deal-card.in-cart {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

/* RECIPES */
#recipes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recipe-card {
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.1s;
}
.recipe-card:hover { background: #fbfaf5; }
.recipe-card.selected {
  background: var(--green-bg);
  border: 1px solid var(--green);
  padding: 13px;
}
.recipe-card .check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: white;
  cursor: pointer;
}
.recipe-card .check:hover { border-color: var(--green); }
.recipe-card.selected .check {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.recipe-card.selected .check::after {
  content: "✓";
  font-weight: 700;
}
.recipe-card .body {
  flex: 1;
  min-width: 0;
}
.recipe-card .name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}
.recipe-card .stats {
  font-size: 12px;
  color: var(--mute);
}
.recipe-card .stats .matched {
  color: var(--green);
  font-weight: 600;
}
.recipe-card .score {
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
}
.recipe-card .score.zero { color: var(--mute); font-weight: 500; font-size: 14px; }

.alignment-note {
  margin-top: 16px;
  padding: 12px;
  background: #fff8e1;
  border-radius: 8px;
  font-size: 13px;
  color: #5a4700;
  line-height: 1.5;
}

/* SHOPPING LIST */
.list-summary {
  background: var(--card);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.list-summary strong { color: var(--green); }

.list-section { margin-top: 12px; }
.list-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
}

.list-item {
  background: var(--card);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.list-item.expanded {
  flex-direction: column;
}
.list-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 6px;
  background: #fafafa;
  flex-shrink: 0;
}
.list-item .body { flex: 1; min-width: 0; }
.list-item .name {
  font-weight: 600;
  font-size: 14px;
}
.list-item .deal-info {
  color: var(--green);
  font-size: 13px;
  margin-top: 2px;
}
.list-item .full-price {
  color: var(--mute);
  font-size: 13px;
  margin-top: 2px;
}
.list-item .recipe-list {
  font-size: 11px;
  color: var(--mute);
  margin-top: 2px;
}
.list-item.expanded .full-img {
  width: 100%;
  max-width: 360px;
  margin-top: 8px;
  border-radius: 8px;
}
.list-item .remove-btn {
  background: none;
  border: 0;
  color: var(--mute);
  font-size: 22px;
  line-height: 1;
  padding: 0 6px;
  cursor: pointer;
  align-self: flex-start;
  flex-shrink: 0;
}
.list-item .remove-btn:hover { color: var(--red); }

.grabbed-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.1s, border-color 0.1s;
}
.grabbed-check:hover { border-color: var(--green); }
.list-item.grabbed .grabbed-check,
.pantry-item.grabbed .grabbed-check {
  background: var(--green);
  border-color: var(--green);
}
.list-item.grabbed .grabbed-check::after,
.pantry-item.grabbed .grabbed-check::after {
  content: "✓";
  color: white;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}
.list-item.grabbed .name,
.list-item.grabbed .deal-info,
.list-item.grabbed .full-price,
.list-item.grabbed .recipe-list {
  text-decoration: line-through;
}
.list-item.grabbed { opacity: 0.55; }

.pantry-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  padding: 8px 0;
  color: var(--mute);
  border-bottom: 1px solid var(--line);
}
.pantry-item .pantry-text { flex: 1; min-width: 0; }
.pantry-item.grabbed .pantry-text {
  text-decoration: line-through;
  opacity: 0.5;
}

.price-match-note {
  margin-top: 16px;
  background: var(--green-bg);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  font-size: 11px;
  color: var(--mute);
  text-align: center;
}

@media (max-width: 480px) {
  .deals-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* PROOF MODAL */
.proof-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.proof-modal[hidden] { display: none; }
.proof-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.proof-card {
  position: relative;
  background: var(--card);
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 20px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.proof-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: var(--mute);
  cursor: pointer;
  padding: 4px 10px;
}
.proof-close:hover { color: var(--ink); }
.proof-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.proof-content .proof-img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  background: #fafafa;
  border-radius: 10px;
}
.proof-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 4px;
}
.proof-merchant {
  font-size: 14px;
  color: var(--mute);
}
.proof-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.proof-price-row .proof-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--green);
  flex: 1;
}
.proof-price-row .proof-discount {
  background: var(--green);
  color: white;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.proof-meta {
  color: var(--mute);
  font-size: 13px;
}
.proof-tip {
  background: var(--green-bg);
  color: var(--green);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}
.proof-flipp-link {
  display: inline-block;
  margin-top: 4px;
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.proof-flipp-link:hover { text-decoration: underline; }



/* TOAST (bottom-center) */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  z-index: 90;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  max-width: calc(100vw - 32px);
}
.toast button {
  background: none;
  border: 0;
  color: var(--green-bg);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.toast button:hover { color: white; }

/* DEAL DETAIL MODAL — reuses .proof-modal layout */
.detail-content .detail-img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  background: #fafafa;
  border-radius: 10px;
}
.detail-content .detail-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 4px;
}
.detail-content .detail-merchant {
  font-size: 14px;
  color: var(--mute);
}
.detail-content .detail-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.detail-content .detail-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
  flex: 1;
}
.detail-content .detail-discount {
  background: var(--green);
  color: white;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.detail-content .detail-meta {
  color: var(--mute);
  font-size: 13px;
}
.detail-content .detail-add-btn {
  width: 100%;
  margin-top: 4px;
  padding: 10px 0;
  background: var(--ink);
  color: white;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.detail-content .detail-add-btn:hover { background: #2c322e; }
.detail-content .detail-add-btn.added {
  background: var(--green-bg);
  color: var(--green);
}
.detail-content .detail-section {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.detail-content .detail-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.detail-content .alt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  padding: 4px 0;
  color: var(--mute);
}
.detail-content .alt-merchant { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-content .alt-price { color: var(--ink); }
.detail-content .alt-discount { color: var(--green); font-weight: 600; min-width: 32px; text-align: right; }
.detail-content .detail-report-link {
  background: none;
  border: 0;
  color: var(--red);
  font: inherit;
  font-size: 13px;
  padding: 8px 0 0;
  cursor: pointer;
  text-align: left;
  align-self: flex-start;
}
.detail-content .detail-report-link:hover { text-decoration: underline; }

/* REPORT MODAL */
.report-card {
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.report-summary {
  background: #fafafa;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--mute);
}
.report-label {
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}
.report-reason {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 88px;
}
.report-reason:focus {
  outline: 2px solid var(--green);
  outline-offset: -2px;
  border-color: var(--green);
}
.report-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
.report-cancel,
.report-submit {
  padding: 9px 16px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--line);
}
.report-cancel { background: white; color: var(--ink); }
.report-cancel:hover { background: #f5f3ee; }
.report-submit {
  background: var(--red);
  color: white;
  border-color: var(--red);
}
.report-submit:hover { background: #a83e30; }
.report-note {
  font-size: 11px;
  color: var(--mute);
  margin: 4px 0 0;
}

/* FOOTER REPORTS LINK */
footer #reports-link {
  background: none;
  border: 0;
  color: var(--green);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 12px;
  padding: 0;
}
footer #reports-link:hover { text-decoration: underline; }

/* MISS PROMPT (bottom of Deals tab) */
.miss-prompt {
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--mute);
  flex-wrap: wrap;
}
.miss-prompt button {
  background: none;
  border: 0;
  color: var(--green);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.miss-prompt button:hover { text-decoration: underline; }

/* MISS MODAL form inputs (reuses .report-card layout) */
.miss-card .miss-name,
.miss-card .miss-store,
.miss-card .miss-price {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  font-size: 14px;
}
.miss-card .miss-name:focus,
.miss-card .miss-store:focus,
.miss-card .miss-price:focus {
  outline: 2px solid var(--green);
  outline-offset: -2px;
  border-color: var(--green);
}
.miss-card .miss-store {
  background: white;
  cursor: pointer;
}
.miss-card .miss-submit {
  background: var(--green);
  border-color: var(--green);
}
.miss-card .miss-submit:hover { background: #086c2e; }

/* RECIPE DETAIL MODAL */
.recipe-modal-card {
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recipe-modal-name {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
}
.recipe-modal-stats {
  font-size: 13px;
  color: var(--mute);
  margin-bottom: 4px;
}
.recipe-ingredients {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.rec-ing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.rec-ing.on-sale { background: var(--green-bg); border-radius: 8px; padding: 6px 10px; }
.rec-ing-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 6px;
  background: #fafafa;
  flex-shrink: 0;
}
.rec-ing-img.placeholder { background: #f3f1ec; }
.rec-ing-body { flex: 1; min-width: 0; }
.rec-ing-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}
.rec-ing-deal {
  font-size: 12px;
  color: var(--green);
  margin-top: 2px;
}
.rec-ing-deal.muted { color: var(--mute); }
.rec-ing-add {
  background: var(--ink);
  color: white;
  border: 0;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.rec-ing-add:hover { background: #2c322e; }
.rec-ing-add.added {
  background: var(--green);
}
.recipe-pantry {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.recipe-pantry:empty {
  border-top: 0;
  padding-top: 0;
}
.rec-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.rec-pantry-item {
  font-size: 13px;
  color: var(--mute);
  padding: 4px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.rec-pantry-item span { flex: 1; min-width: 0; }
.recipe-select-btn {
  margin-top: 10px;
  padding: 11px;
  background: var(--ink);
  color: white;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.recipe-select-btn:hover { background: #2c322e; }
.recipe-select-btn.selected {
  background: var(--green-bg);
  color: var(--green);
}

/* RECIPE SEARCH */
.recipe-search-wrap { margin-bottom: 12px; }
#recipe-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  background: white;
}
#recipe-search:focus {
  outline: 2px solid var(--green);
  outline-offset: -2px;
  border-color: var(--green);
}

/* SECONDARY FILTER ROW */
.filter-pills.second-row { margin-top: 6px; }
.filter-pills.second-row .organic-pill.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.filter-pills .store-pill {
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236c706b' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
  max-width: 180px;
  text-overflow: ellipsis;
}
.filter-pills .store-pill:focus {
  outline: 2px solid var(--green);
  outline-offset: -2px;
  border-color: var(--green);
}

/* ORGANIC BADGE on deal card */
.deal-card .organic-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--green);
  color: white;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* RECIPE EDIT controls */
.rec-ing-remove {
  background: none;
  border: 0;
  color: var(--mute);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  flex-shrink: 0;
}
.rec-ing-remove:hover { color: var(--red); }
.rec-add-form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  position: relative;
  flex-wrap: wrap;
}
.rec-add-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
}
.rec-add-input:focus {
  outline: 2px solid var(--green);
  outline-offset: -2px;
  border-color: var(--green);
}
.rec-add-btn {
  background: var(--ink);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 7px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.rec-add-btn:hover { background: #2c322e; }

/* INGREDIENT AUTOCOMPLETE */
.rec-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  max-height: 240px;
  overflow-y: auto;
  z-index: 20;
  padding: 4px;
}
.rec-suggestions[hidden] { display: none; }
.sug-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: 0;
  padding: 7px 8px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}
.sug-row:hover { background: #f5f3ee; }
.sug-name { flex: 1; min-width: 0; color: var(--ink); font-weight: 500; }
.sug-sub {
  font-size: 11px;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.sug-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.sug-tag.tracked { background: var(--green-bg); color: var(--green); }
.sug-tag.recipe  { background: #eef0f2; color: #4a5057; }
.sug-tag.seen    { background: #fff8e1; color: #8a6a16; }

/* WATCH LIST */
.watch-list { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.watch-row {
  background: var(--card);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
}
.watch-row-body { flex: 1; min-width: 0; }
.watch-row-name { font-weight: 600; font-size: 14px; }
.watch-row-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.watch-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef0f2;
  color: #4a5057;
}
.watch-status-untested { background: #fff8e1; color: #8a6a16; }
.watch-status-staged   { background: var(--green-bg); color: var(--green); }
.watch-status-active   { background: var(--green); color: white; }
.watch-status-dead     { background: #f3e5e2; color: var(--red); }
.watch-tracked {
  font-size: 11px;
  color: var(--mute);
  font-style: italic;
}
.watch-test-btn {
  background: var(--ink);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.watch-test-btn:hover { background: #2c322e; }
.watch-remove-btn {
  background: none;
  border: 0;
  color: var(--mute);
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.watch-remove-btn:hover { color: var(--red); }

/* WATCH TEST MODAL — iframe preview */
.watch-test-card {
  max-width: 640px;
  width: calc(100vw - 24px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.watch-test-summary {
  font-size: 13px;
  color: var(--mute);
  background: #fafafa;
  border-radius: 8px;
  padding: 8px 10px;
}
.watch-test-frame-wrap {
  width: 100%;
  height: 60vh;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fafafa;
}
.watch-test-frame {
  width: 100%;
  height: 100%;
  border: 0;
}
.watch-test-fallback {
  font-size: 12px;
  color: var(--mute);
  margin: 0;
}
.watch-test-fallback a { color: var(--green); font-weight: 600; }
