:root {
  color-scheme: light;
  --bg: #faf9f5;
  --header-bg: rgba(250, 249, 245, 0.88);
  --card: #ffffff;
  --surface-subtle: #f3f1ea;
  --surface-pill: #f1efe8;
  --surface-pill-hover: #e6e3d8;
  --text: #1c201e;
  --muted: #616d67;
  --border: #e5e2d9;
  --omnibox-border: #dcd8ce;
  --brand: #256d4f;
  --brand-light: #ebf5f0;
  --brand-dark: #1b523b;
  --safe: #188647;
  --safe-bg: #e7f6ed;
  --caution: #b87108;
  --caution-bg: #fef4e3;
  --toss: #c52828;
  --toss-bg: #fdecec;
  --info-bg: #eef4ff;
  --info-border: #2b6cb0;
  --rescue-bg: #f6fbf8;
  --rescue-border: #cde2d7;
  --radius: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(24, 39, 32, 0.08);
  --shadow-lg: 0 10px 32px rgba(24, 39, 32, 0.12);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111513;
  --header-bg: rgba(17, 21, 19, 0.88);
  --card: #1a201d;
  --surface-subtle: #232b27;
  --surface-pill: #212825;
  --surface-pill-hover: #2c3531;
  --text: #eef2ef;
  --muted: #9aa7a0;
  --border: #2d3732;
  --omnibox-border: #35413b;
  --brand: #3tb882;
  --brand: #38b27d;
  --brand-light: rgba(56, 178, 125, 0.15);
  --brand-dark: #68d3a1;
  --safe: #42c878;
  --safe-bg: rgba(34, 150, 83, 0.16);
  --caution: #f0a83c;
  --caution-bg: rgba(217, 138, 22, 0.16);
  --toss: #f26464;
  --toss-bg: rgba(214, 52, 52, 0.16);
  --info-bg: rgba(59, 130, 246, 0.14);
  --info-border: #60a5fa;
  --rescue-bg: rgba(56, 178, 125, 0.09);
  --rescue-border: rgba(56, 178, 125, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 22px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}
main { flex: 1; }
.container { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ───────── Top Navigation ───────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -0.02em;
}
.logo-q { color: var(--brand); }
.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
}
.nav-link:hover { color: var(--text); background: var(--surface-subtle); }

.nav-btn, .high-risk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}
.nav-btn:hover, .high-risk-pill:hover {
  border-color: var(--brand);
}
.high-risk-pill input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.nav-badge {
  background: var(--brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

/* Segmented Theme Switcher (Light / System / Dark) */
.theme-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.theme-btn {
  border: none;
  background: transparent;
  width: 30px;
  height: 28px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
  transition: all 0.15s ease;
}
.theme-btn:hover { opacity: 1; }
.theme-btn.active {
  background: var(--card);
  opacity: 1;
  box-shadow: var(--shadow-sm);
}

/* ───────── Google-Style Search Stage ───────── */
.search-stage {
  padding: 11vh 20px 36px;
  transition: padding 0.25s ease, background-color 0.2s ease;
}
body.has-selection .search-stage {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.search-container {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
body.has-selection .search-container {
  max-width: 840px;
}

.brand-hero {
  margin-bottom: 26px;
  transition: all 0.2s ease;
}
body.has-selection .brand-hero {
  display: none;
}
.brand-title {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-emoji { font-size: 0.9em; }
.accent-q { color: var(--brand); }
.brand-tagline {
  color: var(--muted);
  font-size: 1.06rem;
  margin: 0;
}

/* Unified Pill Search Bar (Omnibox) */
.search-box-wrap {
  position: relative;
  text-align: left;
}
.omnibox {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1.5px solid var(--omnibox-border);
  border-radius: 999px;
  padding: 6px 10px 6px 18px;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.omnibox:focus-within {
  border-color: var(--brand);
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(56, 178, 125, 0.18);
}
.search-icon {
  color: var(--muted);
  flex-shrink: 0;
}
#food-search {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1.08rem;
  padding: 10px 6px;
  width: 100%;
  color: var(--text);
}
#food-search:focus { outline: none; }
#food-search::placeholder { color: var(--muted); opacity: 0.75; }

.omnibox-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 2px;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover {
  background: var(--brand-light);
  color: var(--brand);
}
.btn-inline-ai {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 7px 13px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-inline-ai:hover { opacity: 0.92; }

/* Autocomplete Dropdown */
.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  list-style: none;
  margin: 0;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  max-height: 350px;
  overflow-y: auto;
}
.suggestions li {
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.98rem;
  color: var(--text);
}
.suggestions li small { color: var(--muted); margin-left: auto; font-size: 0.82rem; }
.suggestions li.active, .suggestions li:hover { background: var(--brand-light); }
.suggestions .ai-option {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 12px;
  color: var(--brand);
  font-weight: 600;
}

/* Under-Search Action Buttons (Google-style secondary row) */
.under-search-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
body.has-selection .under-search-actions {
  margin-top: 10px;
}
.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-pill);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 15px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.action-pill:hover {
  background: var(--surface-pill-hover);
  border-color: var(--brand);
}

/* Popular Quick Picks */
.quick-picks {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}
body.has-selection .quick-picks {
  display: none;
}
.quick-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-right: 4px;
}
.quick-chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.quick-chip:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

/* Drawers (Categories, Lot Decoder, Camera) */
.drawer-panel {
  margin-top: 16px;
  padding: 18px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.drawer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.drawer-sub {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--muted);
}
.btn-close-light {
  background: var(--surface-subtle);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
}
.btn-close-light:hover { color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
#directory-filter label { display: block; font-weight: 600; margin-bottom: 6px; }
#guide-search {
  width: min(100%, 30rem);
  padding: 10px 14px;
  border: 1px solid var(--omnibox-border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
}
#guide-count { margin: 8px 0 20px; color: var(--muted); }
[data-guide-category][hidden], [data-aliases][hidden] { display: none; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
}
.chip:hover { border-color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.food-chips { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.food-chips:empty { display: none; }

.lot-row { display: flex; gap: 8px; }
.lot-row input {
  flex: 1;
  font: inherit;
  padding: 10px 14px;
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 10px;
}
.lot-output {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--brand-light);
  font-size: 0.9rem;
}

/* Camera Scanner Drawer */
.scanner-drawer {
  margin-top: 16px;
  background: #141917;
  color: #fff;
  border-radius: 16px;
  padding: 16px;
  text-align: left;
}
.scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}
.btn-close {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
}
.viewport {
  position: relative;
  width: 100%;
  max-height: 280px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewport video { width: 100%; max-height: 280px; object-fit: cover; }
.reticle {
  position: absolute;
  width: 66%;
  height: 110px;
  border: 2px solid rgba(47, 212, 135, 0.85);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.scanner-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.manual-upc { display: flex; gap: 8px; }
.manual-upc input {
  flex: 1;
  background: #222926;
  border: 1px solid #36403c;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font: inherit;
}
.photo-ai-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { opacity: 0.92; }
.btn-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ───────── Results Workspace & Compact Context Bar ───────── */
.workspace {
  padding-top: 18px;
  padding-bottom: 28px;
}

.context-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.context-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.context-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Segmented Pills for Storage & Quick Age Presets */
.seg-pills {
  display: inline-flex;
  background: var(--surface-subtle);
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
}
.seg-btn {
  border: none;
  background: transparent;
  padding: 6px 11px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.12s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: var(--card);
  color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
}

.age-Quick-Row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.custom-date-inputs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#days-past {
  width: 68px;
  padding: 6px 8px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
}
#exp-date {
  width: 136px;
  padding: 5px 8px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.84rem;
}
.muted-sep { font-size: 0.8rem; color: var(--muted); }

/* Context Chip Toggles (Opened / Counter time) */
.context-toggles { position: relative; }
.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-subtle);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.chip-toggle input { margin: 0; accent-color: var(--brand); }
.inline-opened {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.84rem;
}
.inline-opened input {
  width: 54px;
  padding: 5px 7px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.more-Menu { position: relative; }
.more-Menu summary { list-style: none; }
.more-Menu summary::-webkit-details-marker { display: none; }
.popover-card {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 25;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  width: 250px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}
.popover-card select {
  font: inherit;
  padding: 8px;
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Status banner */
.status-banner {
  margin-bottom: 14px;
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--brand-light);
  border: 1px solid var(--rescue-border);
  color: var(--brand-dark);
  font-weight: 500;
}
.status-banner.error { background: var(--toss-bg); border-color: var(--toss); color: var(--toss); }

/* ───────── Verdict & Detail Cards ───────── */
.result { margin-top: 16px; animation: fadeUp 0.2s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.verdict {
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  border: 2px solid;
}
.verdict.safe { background: var(--safe-bg); border-color: var(--safe); }
.verdict.caution { background: var(--caution-bg); border-color: var(--caution); }
.verdict.toss { background: var(--toss-bg); border-color: var(--toss); }
.verdict-icon { font-size: 2.6rem; line-height: 1; }
.product-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 4px;
}
.verdict-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.verdict h2 { margin: 0 0 4px; font-size: 1.5rem; letter-spacing: -0.01em; }
.verdict.safe h2 { color: var(--safe); }
.verdict.caution h2 { color: var(--caution); }
.verdict.toss h2 { color: var(--toss); }
.verdict p { margin: 4px 0; font-size: 1.02rem; }
.verdict .meta {
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}
.source-pill {
  display: inline-block;
  background: var(--surface-subtle);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}
.verdict-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-action-sm {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-action-sm:hover { border-color: var(--brand); color: var(--brand-dark); }

.timeline { margin: 16px 0 0; }
.timeline-bar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: var(--toss); position: relative; }
.timeline-bar .seg-safe { background: var(--safe); }
.timeline-bar .seg-caution { background: var(--caution); }
.timeline-marker { position: absolute; top: -5px; width: 4px; height: 19px; background: var(--text); border-radius: 2px; transform: translateX(-2px); }
.timeline-legend { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: 5px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.detail-grid .card h3 { margin: 0 0 10px; font-size: 1.04rem; }
.detail-grid ul { margin: 0; padding-left: 20px; }
.detail-grid li { margin: 7px 0; font-size: 0.95rem; }
.card.ok h3 { color: var(--safe); }
.card.no h3 { color: var(--toss); }
.card.rescue-card { border-color: var(--rescue-border); background: var(--rescue-bg); }
.card.rescue-card h3 { color: var(--brand-dark); }
.card.full { grid-column: 1 / -1; }

.risk-note { background: var(--toss-bg); border-left: 4px solid var(--toss); padding: 13px 16px; border-radius: 10px; margin-top: 14px; font-size: 0.94rem; }
.storage-note { background: var(--brand-light); border-left: 4px solid var(--brand); padding: 13px 16px; border-radius: 10px; margin-top: 14px; font-size: 0.94rem; }
.visual-ai-note { background: var(--info-bg); border-left: 4px solid var(--info-border); padding: 13px 16px; border-radius: 10px; margin-top: 14px; font-size: 0.94rem; }

/* Interactive Sensory Checkboxes */
.sensory-list { list-style: none !important; padding-left: 0 !important; }
.sensory-list li { margin: 8px 0; }
.sensory-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 0.94rem; }
.sensory-check input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--toss); cursor: pointer; flex-shrink: 0; }
.sensory-check input:checked + span { color: var(--toss); font-weight: 600; text-decoration: underline; }
.sensory-hint { font-size: 0.82rem; color: var(--muted); margin: 0 0 8px; }

/* ───────── My Fridge Modal Sheet ───────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 14, 12, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none !important; }
.modal-sheet {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.modal-header h2 { margin: 0; font-size: 1.35rem; }
.modal-sub { margin: 4px 0 0; font-size: 0.9rem; color: var(--muted); }

#watch-controls:not([hidden]) { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
#watch-controls label { display: grid; gap: 4px; font-size: 0.9rem; }
#watch-controls select { font: inherit; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px; }
.watchlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.watch-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.watch-card.safe { border-left: 5px solid var(--safe); }
.watch-card.caution { border-left: 5px solid var(--caution); }
.watch-card.toss { border-left: 5px solid var(--toss); background: var(--toss-bg); }
.watch-top { display: flex; align-items: center; gap: 10px; }
.watch-top .emoji { font-size: 1.5rem; }
.watch-top .title { font-weight: 700; font-size: 0.96rem; flex: 1; }
.watch-status { font-size: 0.8rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; width: fit-content; }
.watch-status.safe { background: var(--safe-bg); color: var(--safe); }
.watch-status.caution { background: var(--caution-bg); color: var(--caution); }
.watch-status.toss { background: var(--toss-bg); color: var(--toss); }
.watch-meta { font-size: 0.82rem; color: var(--muted); }
.watch-actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.watch-empty {
  grid-column: 1 / -1;
  background: var(--card);
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

/* ───────── Clean Collapsible Reference Accordions ───────── */
.reference-section {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.guide-accordion {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
}
.guide-accordion summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.96rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.guide-accordion summary::-webkit-details-marker { display: none; }
.guide-accordion[open] summary { margin-bottom: 14px; color: var(--brand-dark); }
.chev { color: var(--muted); transition: transform 0.15s; }
.guide-accordion[open] .chev { transform: rotate(180deg); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.flag { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.flag .icon { font-size: 1.4rem; }
.flag h3 { margin: 6px 0 4px; font-size: 0.95rem; }
.flag p { margin: 0; color: var(--muted); font-size: 0.88rem; }

.site-footer {
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

/* ───────── Monetization: Savings Pill, Affiliate Cards & Pro Modal ───────── */
.savings-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--safe-bg);
  color: var(--safe);
  border: 1px solid var(--safe);
  padding: 5px 11px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.savings-pill:hover { transform: scale(1.03); }
.savings-pill.bump { animation: popBump 0.35s ease; }
@keyframes popBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.pro-pill {
  background: linear-gradient(135deg, #256d4f, #188647);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.pro-pill:hover { opacity: 0.92; }

/* Replace / Delivery Affiliate Strip (shown on Toss verdicts) */
.replace-strip {
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--card);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.replace-strip-title {
  font-weight: 700;
  font-size: 0.94rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.replace-links { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-delivery {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  transition: all 0.15s;
}
.btn-delivery:hover {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand-dark);
}

/* Recommended Storage & Safety Gear Card */
.gear-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.gear-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.gear-item:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}
.gear-icon { font-size: 1.55rem; line-height: 1; margin-top: 2px; }
.gear-body { flex: 1; }
.gear-title { font-weight: 700; font-size: 0.9rem; color: var(--brand-dark); }
.gear-pitch { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.gear-cta { font-size: 0.76rem; font-weight: 700; color: var(--brand); margin-top: 5px; display: inline-block; }

/* Pro Modal Styles */
.pro-sheet { max-width: 760px; }
.pro-eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brand);
}
.pro-tiers {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 14px;
  margin-top: 14px;
}
.pro-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  position: relative;
}
.pro-card.featured {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}
.pro-popular-tag {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--brand);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}
.pro-card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.pro-price { font-size: 1.8rem; font-weight: 800; margin-bottom: 12px; }
.pro-price span { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.pro-card ul { padding-left: 18px; margin: 0 0 16px; font-size: 0.9rem; }
.pro-card li { margin: 7px 0; }
.pro-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.b2b-banner {
  margin-top: 16px;
  padding: 15px 18px;
  border-radius: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.88rem;
}
.b2b-banner p { margin: 3px 0 0; color: var(--muted); }

@media (max-width: 680px) {
  .search-stage { padding-top: 6vh; }
  .detail-grid, .pro-tiers { grid-template-columns: 1fr; }
  .verdict { flex-direction: column; }
  .context-bar { flex-direction: column; align-items: stretch; }
  .nav-link { display: none; }
  .high-risk-pill span { display: none; }
  .high-risk-pill::after { content: "🛡️"; }
}
