*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg: #F3F4F1;
  --surface: #ffffff;
  --border: #e5e7eb;
  --primary: #22c55e;
  --primary-hover: #16a34a;
  --primary-light: #dcfce7;
  --primary-text: #15803d;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --green: #16a34a;
  --red: #dc2626;
  --blue-walmart: #0071ce;
  --blue-kroger: #005eb8;
  --red-aldi: #cc0000;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --shadow-md: 0 4px 24px rgba(0,0,0,.1);
  --sidebar-w: 210px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  background: #F7F6F3;
  border-right: 1px solid #E2E3DF;
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
}
/* Tree artwork temporarily removed from the page (file kept at static/tree.png).
   To re-add, uncomment this rule.
.sidebar::after {
  content: '';
  position: absolute;
  bottom: 40px; left: 0; right: 0;
  height: 560px;
  background: url('/tree.png') no-repeat -3px bottom;
  background-size: auto 560px;
  opacity: 0.95;
  pointer-events: none;
}
*/
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid #E2E3DF;
}
.sidebar-logo-icon { font-size: 22px; }
.sidebar-logo-text { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }

.nav-list { list-style: none; padding: 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: #6B7280;
  cursor: pointer;
  transition: background .12s, color .12s;
  position: relative;
}
.nav-item:hover { background: rgba(0,0,0,.05); color: #2F6F4F; }
.nav-item.active { background: rgba(47, 111, 79, .12); color: #2F6F4F; font-weight: 600; }
.nav-item--dim { opacity: .45; cursor: default; }
.nav-item--dim:hover { background: none; color: #6B7280; }
.nav-icon { display: flex; align-items: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 0 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: background .12s;
}
.sidebar-profile:hover { background: rgba(0,0,0,.05); }
.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #c8d8c0;
  color: #2F6F4F;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-profile-info { flex: 1; min-width: 0; }
.sidebar-profile-name { font-size: 13px; font-weight: 600; color: #3a3a3a; }

/* ══════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════ */
.app-shell {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ══════════════════════════════════════════
   HEADERS
══════════════════════════════════════════ */
.app-header {
  background: #FAFAF8;
  border-bottom: none;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 14px;
}
.app-header-title { font-size: 15px; font-weight: 600; }

/* Results header */
.results-header { gap: 12px; }
.back-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: background .12s;
}
.back-btn:hover { background: var(--bg); }
.header-search-wrap {
  flex: 1;
  max-width: 500px;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 10px 0 14px;
  transition: border-color .15s, box-shadow .15s;
}
.header-search-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,.14);
  background: #fff;
}
.header-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--text);
  outline: none;
  height: 38px;
}
.header-search-input::placeholder { color: var(--muted); }
.header-clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color .12s, background .12s;
}
.header-clear-btn:hover { color: var(--text); background: var(--border); }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.list-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: background .12s, border-color .12s;
}
.list-btn:hover { background: #e9eaec; }

.badge {
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

/* ══════════════════════════════════════════
   HOME VIEW
══════════════════════════════════════════ */
.app-main {
  padding: 32px 36px 60px;
  max-width: 1000px;
}
.home-heading { font-size: 22px; font-weight: 700; margin-bottom: 18px; }

.search-form { margin-bottom: 32px; display: flex; flex-direction: column; gap: 10px; }
.search-address-row input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-address-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,.14);
}
.search-address-row input::placeholder { color: var(--muted); }

.search-address-row {
  display: flex;
  gap: 8px;
}
.find-stores-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.find-stores-btn:hover { border-color: var(--primary); color: var(--primary-text); }
.find-stores-btn:disabled { opacity: .6; cursor: default; }

/* ── Store picker (map + list) ── */
.store-picker {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}
.store-map {
  flex: 1 1 55%;
  min-height: 260px;
  border-radius: 9px;
  z-index: 0; /* keep Leaflet panes under dialogs/overlays */
}
.store-picker-side {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.store-picker-hint {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.store-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 240px;
}
.store-list-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.store-list-item:hover { border-color: var(--primary); }
.store-list-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.sli-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.sli-addr { font-size: 12px; color: var(--text-2); }
.sli-dist { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* ── Walmart store verification status ── */
.store-status {
  margin: 0 0 14px;
  padding: 9px 13px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.45;
}
.store-status--ok {
  background: var(--primary-light);
  color: var(--primary-text);
  border: 1px solid #bbf7d0;
}
.store-status--warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.store-status-fineprint {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  opacity: .75;
}

/* ── Nearest-store strip ── */
.store-strip {
  display: flex;
  gap: 10px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}
.store-strip-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1 1 220px;
  min-width: 0;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .12s;
}
a.store-strip-card:hover { border-color: var(--primary); }
.ssc-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.ssc-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ssc-name { font-size: 13px; font-weight: 700; }
.ssc-addr {
  font-size: 11.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ssc-addr--none { color: var(--muted); font-style: italic; }
.ssc-dist { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ── Drill-down (type → style) chooser ── */
.drill-heading { font-size: 19px; font-weight: 800; margin: 6px 0 2px; }
.drill-sub { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.drill-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .12s, box-shadow .15s;
}
.drill-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.drill-card-img,
.drill-card-img-placeholder {
  width: 76px; height: 76px;
  object-fit: contain;
  border-radius: 10px;
  background: #f8f9fc;
  flex-shrink: 0;
}
.drill-card-img--right { margin-left: auto; }
.drill-card-body { min-width: 0; }
.drill-card--style .drill-card-body { flex: 1; }
.drill-card-title { font-size: 16px; font-weight: 700; }
.drill-card-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.drill-style-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-text);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.drill-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 20px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--primary-text);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.drill-back:hover { border-color: var(--primary); background: var(--primary-light); }
@media (max-width: 760px) {
  .store-picker { flex-direction: column; }
  .store-map { min-height: 200px; }
}

.search-query-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 8px 8px 14px;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.search-query-row:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,.14);
}
.search-icon-wrap { color: var(--muted); display: flex; align-items: center; flex-shrink: 0; }
.search-query-row input {
  flex: 1; border: none; background: transparent;
  font-size: 15px; color: var(--text); outline: none;
}
.search-query-row input::placeholder { color: var(--muted); }

#search-btn {
  height: 38px; padding: 0 20px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: background .15s; flex-shrink: 0;
}
#search-btn:hover:not(:disabled) { background: var(--primary-hover); }
#search-btn:disabled { opacity: .6; cursor: not-allowed; }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-banner {
  background: #fef2f2; border: 1px solid #fecaca;
  color: var(--red); border-radius: var(--radius);
  padding: 12px 16px; font-size: 14px; margin-bottom: 16px;
}

.home-section { margin-bottom: 32px; }
.section-heading {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 14px; display: flex; align-items: center; gap: 6px;
}
.section-icon { font-size: 16px; }

/* Popular grid */
.popular-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.popular-tile {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px 16px;
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  text-align: center; user-select: none;
}
.popular-tile:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.popular-tile.active { border-color: var(--primary); background: #f0fdf4; }
.popular-tile-emoji { font-size: 36px; line-height: 1; }
.popular-tile-label { font-size: 13px; font-weight: 600; }

/* Store overview */
.store-overview-cards { display: flex; gap: 14px; }
.soc {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.soc-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.soc-logo {
  font-size: 10px; font-weight: 900; border-radius: 4px;
  padding: 3px 6px; color: #fff; letter-spacing: .4px;
}
.soc-logo.walmart { background: var(--blue-walmart); }
.soc-logo.aldi    { background: var(--red-aldi); }
.soc-logo.kroger  { background: var(--blue-kroger); }
.soc-name { font-size: 16px; font-weight: 700; }
.soc-best-badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--primary); color: #fff;
  border-radius: 20px; padding: 2px 9px;
}
.soc-total { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.soc-count { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.soc-savings { font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.soc-savings.green { color: var(--green); }
.soc-savings.red { color: var(--red); }
.soc-view-btn {
  width: 100%; padding: 9px 0;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .12s; margin-top: auto;
}
.soc-view-btn:hover { background: var(--bg); }

/* Recently viewed */
.recently-list { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.recent-chip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; flex-shrink: 0;
  transition: border-color .12s, box-shadow .12s;
  min-width: 160px;
}
.recent-chip:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(34,197,94,.12); }
.recent-chip-img {
  width: 40px; height: 40px; object-fit: contain;
  border-radius: 6px; background: #f8f9fc; flex-shrink: 0;
}
.recent-chip-img-placeholder {
  width: 40px; height: 40px; background: var(--border);
  border-radius: 6px; flex-shrink: 0;
}
.recent-chip-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recent-chip-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-chip-size { font-size: 11px; color: var(--muted); }

/* ══════════════════════════════════════════
   RESULTS VIEW
══════════════════════════════════════════ */
#results-view {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.results-layout {
  display: flex;
  flex: 1;
  align-items: flex-start;
}

/* Left content */
.results-content {
  flex: 1;
  min-width: 0;
  padding: 28px 28px 40px;
  border-right: 1px solid var(--border);
}

.results-heading {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 18px;
}

/* Tabs */
.results-tabs-wrap {
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.results-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.results-tabs::-webkit-scrollbar { display: none; }
.results-tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.results-tab:hover { color: var(--text); }
.results-tab.active {
  color: var(--primary-text);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

/* Category section header */
.results-section-header {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 12px;
  margin-top: 24px;
  padding-bottom: 8px;
}
.results-section-header:first-child { margin-top: 0; }

/* List rows */
.result-row {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.result-row:hover {
  box-shadow: var(--shadow-md);
  border-color: #d1d5db;
}
.result-row-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 10px;
  background: #f8f9fc;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.result-row-img-placeholder {
  width: 80px; height: 80px;
  background: #f1f3f6;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.result-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.result-row-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.result-row-size {
  font-size: 13px;
  color: var(--muted);
}
.row-store-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.row-store-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px 3px 4px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-2);
}
.row-store-pill--best {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-text);
  font-weight: 700;
}
.row-store-pill--none {
  color: var(--muted);
  opacity: 0.6;
}
.row-store-pill-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.row-store-pill-logo.walmart  { background: var(--blue-walmart); }
.row-store-pill-logo.aldi     { background: var(--red-aldi); }
.row-store-pill-logo.kroger   { background: var(--blue-kroger); }
.row-store-pill-price {
  font-size: 13px;
  font-weight: 600;
}
.result-row-chevron {
  color: var(--muted);
  flex-shrink: 0;
}

.no-results {
  padding: 48px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* ══════════════════════════════════════════
   RESULTS MY LIST (inline panel)
══════════════════════════════════════════ */
.results-my-list {
  width: 300px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 60px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.rml-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.rml-title { font-size: 15px; font-weight: 700; }
.rml-edit-btn {
  background: none; border: none;
  color: var(--red); font-size: 13px;
  font-weight: 600; cursor: pointer;
  padding: 0; transition: opacity .12s;
}
.rml-edit-btn:hover { opacity: .7; }

.rml-empty {
  padding: 32px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.rml-items { list-style: none; flex: 1; }

/* Inline list item */
.rml-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.rml-row:last-child { border-bottom: none; }
.rml-row-img {
  width: 46px; height: 46px;
  object-fit: contain;
  border-radius: 7px;
  background: #f8f9fc;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.rml-row-img-placeholder {
  width: 46px; height: 46px;
  background: #f1f3f6;
  border-radius: 7px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.rml-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rml-row-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.rml-row-store {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
.rml-store-tag {
  font-size: 9px; font-weight: 900;
  border-radius: 3px; padding: 1px 4px;
  color: #fff; letter-spacing: .3px;
}
.rml-store-tag.walmart { background: var(--blue-walmart); }
.rml-store-tag.aldi    { background: var(--red-aldi); }
.rml-store-tag.kroger  { background: var(--blue-kroger); }
.rml-qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.qty-controls {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}
.qty-btn {
  background: none; border: none;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--text-2);
  transition: background .12s;
}
.qty-btn:hover { background: var(--bg); }
.qty-val {
  min-width: 26px; text-align: center;
  font-size: 13px; font-weight: 600;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  line-height: 26px;
}
.rml-price-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.rml-price { font-size: 14px; font-weight: 700; }
.rml-unit-price { font-size: 11px; color: var(--muted); }
.rml-remove-btn {
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 2px;
  transition: color .12s;
}
.rml-remove-btn:hover { color: var(--red); }

/* Footer */
.rml-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
}
.rml-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rml-total-label { font-size: 14px; color: var(--muted); font-weight: 500; }
.rml-total-val { font-size: 26px; font-weight: 800; color: var(--primary-text); }
.rml-savings {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-text);
}
.compare-btn {
  width: 100%;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s;
}
.compare-btn:hover { background: var(--primary-hover); }

/* ══════════════════════════════════════════
   BOTTOM BAR
══════════════════════════════════════════ */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}
.bottom-bar-link {
  background: none; border: none;
  color: var(--primary-text);
  font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 0;
  transition: opacity .12s;
}
.bottom-bar-link:hover { opacity: .7; }

/* ══════════════════════════════════════════
   DETAIL DIALOG
══════════════════════════════════════════ */
#detail-dialog {
  position: fixed;
  inset: 0;
  width: 100%; max-width: 100vw;
  height: 100dvh; max-height: 100dvh;
  margin: 0; padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.16);
  background: var(--surface);
  overflow: hidden;
}
#detail-dialog[open] {
  display: flex; flex-direction: column;
}
#detail-dialog::backdrop { background: rgba(0,0,0,.4); }

.detail-dialog-header {
  display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.detail-dialog-header h2 { font-size: 23px; font-weight: 800; line-height: 1.2; }
.detail-subtitle { font-size: 13px; color: var(--muted); margin-top: 3px; }
.detail-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.source-link {
  font-size: 11px; color: var(--muted);
  text-decoration: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px;
  transition: color .12s, border-color .12s;
}
a.source-link:hover { color: var(--primary-text); border-color: var(--primary); }
.source-link--plain { cursor: default; }

.detail-info-banner {
  background: #f0fdf4; border-bottom: 1px solid #bbf7d0;
  padding: 9px 24px; font-size: 13px; font-weight: 500;
  color: var(--primary-text);
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
/* Size filter chips */
.detail-size-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.detail-size-filters-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  align-self: center;
  margin-right: 2px;
  white-space: nowrap;
}
.size-chip {
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 4px 13px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-2);
  transition: border-color .12s, background .12s, color .12s;
  white-space: nowrap;
}
.size-chip:hover { border-color: var(--primary); color: var(--primary-text); }
.size-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

.detail-items-scroll {
  overflow-y: auto;
  padding: 14px 24px 24px;
  flex: 1;
}

/* Body: stacked size-group sections (All view) or a flat grid (one size) */
#detail-items { display: block; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: max-content;
  gap: 12px;
  align-content: start;
}
@media (max-width: 1100px) { .detail-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .detail-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Size group sections ── */
.detail-group { margin-bottom: 26px; }
.detail-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.detail-group-icon {
  color: var(--primary-text);
  align-self: center;
  display: inline-flex;
}
.detail-group-title { font-size: 17px; font-weight: 800; }
.detail-group-count { font-size: 12.5px; color: var(--muted); }
.detail-group-seeall {
  margin-left: auto;
  border: none; background: none;
  font-size: 13px; font-weight: 600;
  color: var(--primary-text);
  cursor: pointer;
}
.detail-group-seeall:hover { text-decoration: underline; }

.detail-group-rowwrap { position: relative; }
.detail-group-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 36px) / 4);
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
@media (max-width: 1100px) { .detail-group-row { grid-auto-columns: calc((100% - 24px) / 3); } }
@media (max-width: 800px)  { .detail-group-row { grid-auto-columns: calc((100% - 12px) / 2); } }

.detail-group-arrow {
  position: absolute;
  right: -8px; top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  z-index: 2;
}
.detail-group-arrow:hover { color: var(--primary-text); border-color: var(--primary); }

/* ── Per-card actions + Compare ── */
.detail-card-actions { display: flex; align-items: center; gap: 6px; }
.compare-mini-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1.5px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--text-2);
  font-size: 11.5px; font-weight: 700; padding: 5px 8px;
  cursor: pointer; white-space: nowrap;
  transition: border-color .12s, color .12s;
}
.compare-mini-btn:hover { border-color: var(--primary); color: var(--primary-text); }

/* ── Compare popup (a <dialog> so it sits above the detail dialog) ── */
.compare-overlay {
  border: none; padding: 0; background: transparent;
  max-width: min(920px, 96vw); width: min(920px, 96vw);
  max-height: 90vh; overflow: visible;
}
.compare-overlay::backdrop { background: rgba(0,0,0,.5); }
.compare-modal {
  background: var(--surface); border-radius: 16px;
  max-height: 90vh; overflow-y: auto;
  padding: 20px 22px; box-shadow: var(--shadow-md);
}
.compare-modal-head { display: flex; align-items: center; justify-content: space-between; }
.compare-modal-title { font-size: 18px; font-weight: 800; }
.compare-sub { font-size: 14px; color: var(--text-2); margin: 2px 0 16px; font-weight: 600; }
.compare-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 640px) { .compare-grid { grid-template-columns: 1fr; } }
.compare-card {
  position: relative;
  border: 1.5px solid var(--border); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 6px;
}
.compare-card--best { border-color: var(--primary); background: var(--primary-light); }
.compare-card--none { justify-content: center; opacity: .7; }
.compare-img { width: 96px; height: 96px; object-fit: contain; }
.compare-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.compare-size { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.compare-price { font-size: 16px; font-weight: 800; margin-top: 2px; }
.compare-unit { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.compare-none { font-size: 12.5px; color: var(--muted); font-style: italic; margin-top: 8px; }
.compare-note { font-size: 11.5px; color: var(--muted); margin-top: 14px; text-align: center; }

/* ── Best-per-store summary section ── */
.detail-best-store {
  background: linear-gradient(0deg, #f6fbf7, #f6fbf7);
  border: 1px solid #d6ebd9;
  border-radius: 14px;
  padding: 12px 14px;
}
.detail-best-store .detail-group-title { color: var(--primary-text); }

/* ── Shopping tip footer ── */
.detail-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
  margin: 4px 0 8px;
}
.detail-tip svg { color: #eab308; flex-shrink: 0; }

/* ── Header actions + store-brand pill ── */
.detail-dialog-headline { min-width: 0; }
.detail-header-actions {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.detail-add-best {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--primary);
  color: var(--primary-text);
  background: var(--surface);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13.5px; font-weight: 700;
  cursor: pointer;
  transition: background .12s;
}
.detail-add-best:hover { background: var(--primary-light); }
.store-brand-pill {
  font-size: 10px; font-weight: 700;
  color: var(--green); background: #dcfce7;
  border-radius: 4px; padding: 1px 5px;
  white-space: nowrap;
}

.detail-row {
  display: flex; flex-direction: column;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  transition: box-shadow .15s, border-color .15s;
}
.detail-row:hover { box-shadow: var(--shadow-md); border-color: #d1d5db; }
.detail-row-best { border-color: var(--primary); }

/* Image area — top. Fixed height keeps cards aligned across a row now that
   grid rows are auto-sized; the body below grows to fit its content. */
.detail-row-top {
  background: #f8f9fc;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  position: relative;
  flex: none;
  height: 176px;
}
.detail-prod-img {
  width: 100%; height: 100%; max-width: 160px; max-height: 160px;
  object-fit: contain;
}
.detail-prod-img-placeholder {
  width: 160px; height: 160px; background: #e9ebee; border-radius: 8px;
}

/* Best price badge overlaid top-left of image area */
.best-price-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 9px; font-weight: 700;
  background: var(--primary); color: #fff;
  border-radius: 20px; padding: 2px 8px; white-space: nowrap;
}

/* Organic badge overlaid top-right of image area */
.organic-badge {
  position: absolute; top: 8px; right: 8px;
  font-size: 9px; font-weight: 700;
  background: #dcfce7; color: var(--green);
  border: 1px solid #86efac;
  border-radius: 20px; padding: 2px 8px; white-space: nowrap;
}

/* Organic-only toggle in the filter bar */
.organic-toggle {
  border: 1.5px solid #86efac;
  border-radius: 20px;
  padding: 4px 13px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
  color: var(--primary-text);
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
  margin-left: auto;
}
.organic-toggle:hover { background: #f0fdf4; border-color: var(--primary); }
.organic-toggle.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

.detail-row-body {
  display: flex; flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

/* Text info */
.detail-row-info {
  padding: 10px 12px 4px;
  display: flex; flex-direction: column; gap: 4px;
}
.detail-prod-name {
  font-size: 13px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.detail-store-line {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--muted);
}
.store-logo-tag {
  font-size: 9px; font-weight: 900; border-radius: 3px;
  padding: 2px 4px; color: #fff; letter-spacing: .3px; flex-shrink: 0;
}
.store-logo-tag.walmart { background: var(--blue-walmart); }
.store-logo-tag.aldi    { background: var(--red-aldi); }
.store-logo-tag.kroger  { background: var(--blue-kroger); }

/* Price + add button row */
.detail-row-bottom {
  display: flex; align-items: center;
  justify-content: space-between; gap: 6px;
  padding: 6px 12px 12px;
}
.detail-row-right {
  display: flex; flex-direction: row;
  align-items: baseline; gap: 6px;
  min-width: 0;
}
.detail-price { font-size: 17px; font-weight: 800; color: var(--text); line-height: 1; }
.detail-price-sep { font-size: 12px; color: var(--border); }
.detail-unit-price { font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }

.add-outline-btn {
  border: 1.5px solid var(--border); border-radius: 7px;
  padding: 6px 12px; background: var(--surface);
  font-size: 12px; font-weight: 600;
  cursor: pointer; flex-shrink: 0; color: var(--text);
  transition: border-color .12s, color .12s, background .12s;
  white-space: nowrap;
}
.add-outline-btn:hover { border-color: var(--primary); color: var(--primary-text); }
.add-outline-btn.added { background: var(--primary-light); border-color: #86efac; color: var(--green); }

.detail-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.detail-footer-note { font-size: 12px; color: var(--muted); }
.info-circle { font-size: 13px; }
.close-outline-btn {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 20px; background: var(--surface);
  font-size: 13px; font-weight: 600;
  cursor: pointer; color: var(--text); transition: background .12s;
}
.close-outline-btn:hover { background: var(--bg); }

/* ══════════════════════════════════════════
   FULL LIST MODAL (home view)
══════════════════════════════════════════ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.3); z-index: 205;
}
.list-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px; background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  z-index: 210; display: flex; flex-direction: column;
}
.list-panel-header {
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.list-panel-header h2 { font-size: 17px; font-weight: 700; flex: 1; }
.list-actions { display: flex; align-items: center; gap: 8px; }
.ghost-btn {
  background: none; border: none; color: var(--red);
  font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 4px 8px; border-radius: 5px; transition: background .12s;
}
.ghost-btn:hover { background: #fef2f2; }
.icon-btn {
  background: none; border: none; font-size: 16px;
  cursor: pointer; color: var(--muted);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: background .12s;
}
.icon-btn:hover { background: var(--bg); }
.list-empty {
  padding: 32px 18px; text-align: center;
  color: var(--muted); font-size: 14px;
}
.list-items { flex: 1; overflow-y: auto; list-style: none; }
.list-row {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: start; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row-img {
  width: 44px; height: 44px;
  object-fit: contain;
  border-radius: 7px;
  background: #f8f9fc;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.list-row-img-placeholder {
  width: 44px; height: 44px;
  background: #f1f3f6;
  border-radius: 7px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.list-row-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.list-row-store { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.list-row-name { font-size: 13px; font-weight: 500; line-height: 1.3; }
.list-row-name a { color: inherit; text-decoration: none; }
.list-row-name a:hover { color: var(--primary-text); }
.list-row-size { font-size: 11px; color: var(--muted); }
.list-row-price { font-size: 14px; font-weight: 700; color: var(--green); }
.list-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.remove-btn {
  background: none; border: none; color: var(--muted);
  font-size: 14px; cursor: pointer; padding: 0; transition: color .12s;
}
.remove-btn:hover { color: var(--red); }
.list-total {
  padding: 14px 18px; border-top: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted);
}
.list-total strong { font-size: 18px; color: var(--text); }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 900px) {
  .results-my-list { width: 260px; }
  .popular-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 700px) {
  .sidebar { display: none; }
  .app-shell { margin-left: 0; }
  .results-layout { flex-direction: column; }
  .results-my-list { width: 100%; position: static; max-height: none; border-left: none; border-top: 1px solid var(--border); }
  .app-main { padding: 20px 16px 40px; }
  .results-content { padding: 20px 16px; }
}

/* ── First-run welcome modal ─────────────────────────────── */
.welcome-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: fit-content;
  height: fit-content;
  border: none;
  padding: 0;
  border-radius: 18px;
  background: transparent;
  max-width: 92vw;
  box-shadow: var(--shadow-md);
  overflow: visible;
}
.welcome-dialog::backdrop {
  background: rgba(17, 24, 39, .5);
  backdrop-filter: blur(2px);
}
.welcome-card {
  width: 420px; max-width: 92vw;
  background: var(--surface);
  border-radius: 18px;
  padding: 36px 34px 26px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.welcome-logo {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 14px;
}
.welcome-title {
  font-size: 25px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.01em;
}
.welcome-sub {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 10px;
  max-width: 320px;
}
.welcome-stores {
  display: flex;
  gap: 8px;
  margin: 20px 0 24px;
}
.welcome-store {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  color: #fff;
}
.welcome-store.walmart { background: var(--blue-walmart); }
.welcome-store.aldi    { background: var(--red-aldi); }
.welcome-store.kroger  { background: var(--blue-kroger); }
.welcome-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s;
}
.welcome-cta:hover { background: var(--primary-hover); }
.welcome-skip {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 12px 8px 2px;
  transition: color .12s;
}
.welcome-skip:hover { color: var(--text-2); }

/* ── Settings modal ──────────────────────────────────────── */
.settings-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: fit-content;
  height: fit-content;
  border: none;
  padding: 0;
  border-radius: 16px;
  background: transparent;
  max-width: 92vw;
  box-shadow: var(--shadow-md);
  overflow: visible;
}
.settings-dialog::backdrop {
  background: rgba(17, 24, 39, .5);
  backdrop-filter: blur(2px);
}
.settings-card {
  width: 440px; max-width: 92vw;
  background: var(--surface);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
}
.settings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.settings-header h2 { font-size: 19px; font-weight: 800; color: var(--text); }
.settings-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.settings-field { display: flex; flex-direction: column; gap: 6px; }
.settings-label {
  font-size: 12.5px; font-weight: 700;
  color: var(--text-2); letter-spacing: .01em;
}
.settings-field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg);
  transition: border-color .12s, box-shadow .12s;
}
.settings-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--surface);
}
.settings-note {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12px; line-height: 1.45;
  color: var(--muted);
  background: var(--bg);
  border-radius: 9px;
  padding: 10px 12px;
}
.settings-note svg { flex-shrink: 0; margin-top: 1px; opacity: .7; }
.settings-danger {
  align-self: flex-start;
  background: none;
  border: 1px solid var(--border);
  color: var(--red);
  font-size: 13px; font-weight: 600;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.settings-danger:hover { background: #fef2f2; border-color: #fecaca; }
.settings-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.settings-cancel {
  background: none; border: none;
  color: var(--muted);
  font-size: 14px; font-weight: 600;
  padding: 10px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.settings-cancel:hover { background: var(--bg); color: var(--text-2); }
.settings-save {
  background: var(--primary);
  color: #fff; border: none;
  font-size: 14px; font-weight: 700;
  padding: 10px 20px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s;
}
.settings-save:hover { background: var(--primary-hover); }

/* ── Auth modal (signup gate) ────────────────────────────── */
.auth-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: fit-content;
  height: fit-content;
  border: none;
  padding: 0;
  border-radius: 18px;
  background: transparent;
  max-width: 92vw;
  box-shadow: var(--shadow-md);
  overflow: visible;
}
.auth-dialog::backdrop {
  background: rgba(17, 24, 39, .55);
  backdrop-filter: blur(2px);
}
.auth-card {
  width: 400px; max-width: 92vw;
  background: var(--surface);
  border-radius: 18px;
  padding: 30px 30px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.auth-close { position: absolute; top: 12px; right: 12px; }
.auth-logo { font-size: 34px; line-height: 1; margin-bottom: 10px; }
.auth-title {
  font-size: 21px; font-weight: 800; color: var(--text);
  letter-spacing: -.01em;
}
.auth-sub {
  font-size: 13.5px; line-height: 1.45; color: var(--muted);
  margin-top: 6px; max-width: 300px;
}
.auth-tabs {
  display: flex; gap: 4px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin: 18px 0 16px;
  width: 100%;
}
.auth-tab {
  flex: 1;
  background: none; border: none;
  font-size: 13.5px; font-weight: 700;
  color: var(--muted);
  padding: 8px 0;
  border-radius: 7px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.auth-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.auth-form {
  width: 100%;
  display: flex; flex-direction: column; gap: 10px;
}
.auth-form input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg);
  transition: border-color .12s, box-shadow .12s;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--surface);
}
.auth-error {
  font-size: 13px; font-weight: 600; color: var(--red);
  background: #fef2f2; border-radius: 8px;
  padding: 9px 12px;
  text-align: left;
}
.auth-submit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary);
  color: #fff; border: none;
  border-radius: 11px;
  padding: 13px 20px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: background .12s;
  margin-top: 2px;
}
.auth-submit:hover { background: var(--primary-hover); }
.auth-submit:disabled { opacity: .7; cursor: default; }
.auth-fineprint {
  font-size: 11.5px; color: var(--muted);
  margin-top: 14px;
}

/* Settings: signed-in account row */
.settings-account {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--primary-light);
  border-radius: 10px;
  padding: 10px 14px;
}
.settings-account-email {
  font-size: 13.5px; font-weight: 700; color: var(--primary-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Verify-email banner ─────────────────────────────────── */
.verify-banner {
  display: flex; align-items: center; gap: 14px;
  background: #fef9c3;
  border-bottom: 1px solid #fde68a;
  color: #854d0e;
  font-size: 13.5px; font-weight: 600;
  padding: 9px 28px;
}
.verify-banner-text { flex: 1; min-width: 0; }
.verify-resend {
  background: #fff;
  border: 1px solid #fde68a;
  color: #854d0e;
  font-size: 12.5px; font-weight: 700;
  padding: 5px 12px; border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
}
.verify-resend:hover { background: #fefce8; }
.verify-resend:disabled { opacity: .65; cursor: default; }
.verify-dismiss {
  background: none; border: none;
  color: #a16207; font-size: 13px;
  cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.verify-dismiss:hover { background: rgba(0,0,0,.06); }
.verify-banner--ok {
  background: var(--primary-light);
  border-bottom-color: #bbf7d0;
  color: var(--primary-text);
}

/* ── Results list: two-up card grid ──────────────────────── */
/* Everything else in the container (section headers, drill cards, back
   buttons, empty states) stays full width; only result cards flow 2-up. */
#results-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#results-list > * { grid-column: 1 / -1; }
#results-list > .result-row {
  grid-column: auto;
  margin-bottom: 0;
}
.row-store-pill-name { font-size: 12px; font-weight: 600; }
@media (max-width: 980px) {
  #results-list { grid-template-columns: 1fr; }
}

/* ── Store outage notice ─────────────────────────────────── */
.store-outage {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: 10px;
  color: #854d0e;
  font-size: 13.5px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.store-outage-retry {
  margin-left: auto;
  background: #fff;
  border: 1px solid #fde68a;
  color: #854d0e;
  font-size: 12.5px; font-weight: 700;
  padding: 5px 12px; border-radius: 8px;
  cursor: pointer;
}
.store-outage-retry:hover { background: #fefce8; }
