:root {
  --bg: #f5f6f1;
  --panel: #ffffff;
  --panel-2: #eef1e9;
  --line: #dfe4da;
  --text: #17221d;
  --muted: #68736c;
  --accent: #f4b83f;
  --accent-strong: #d9940d;
  --best: #1f7a50;
  --up: #c44f44;
  --down: #1f7a50;
  --ww: #285d8f;
  --pnp: #a05c00;
  --checkers: #147447;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 35, 25, .04), 0 8px 28px rgba(16, 35, 25, .05);
  --shadow-lg: 0 20px 60px rgba(9, 34, 22, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 18%, rgba(31,122,80,.055) 0 3px, transparent 4px),
    radial-gradient(circle at 92% 42%, rgba(244,184,63,.07) 0 4px, transparent 5px);
  background-size: 82px 82px, 116px 116px;
  color: var(--text);
  font: 17px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-header { display: block; margin: 0; background: #102d21; color: #fff; }
.header-inner { max-width: 1240px; margin: auto; min-height: 82px; padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 48px; height: 48px; flex: none; object-fit: contain; filter: drop-shadow(0 5px 10px rgba(0,0,0,.16)); }
.brand b { display: block; font: 700 19px/1.1 Georgia, "Times New Roman", serif; letter-spacing: -.01em; }
.brand small { display: block; margin-top: 4px; color: #aebdb5; font-size: 14px; letter-spacing: .04em; }
.stats { color: #b9c7c0; font-size: 14px; }
.stats b { color: #fff; font-weight: 650; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.location-pill, .account-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 5px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #d8e2dd; text-decoration: none; font-size: 14px; }
.location-pill:hover, .account-pill:hover { border-color: rgba(255,255,255,.35); color: #fff; }
.location-pill > span { color: var(--accent); font-size: 14px; }
.account-pill img, .avatar-fallback { width: 23px; height: 23px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--accent); color: #102d21; font-weight: 800; }
.logout-link, .quiet-link { color: #adbbb4; text-decoration: none; font-size: 14px; }
.logout-link:hover, .quiet-link:hover { color: #fff; }
.brand-link { color: inherit; text-decoration: none; }

.nav-shell { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.tabs { max-width: 1240px; margin: 0 auto; padding: 0 28px; display: flex; gap: 8px; border: 0; }
.tabs button { position: relative; border: 0; background: none; color: var(--muted); padding: 16px 14px 15px; cursor: pointer; font-size: 15px; font-weight: 600; }
.tabs button::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px; background: transparent; }
.tabs button.on { color: var(--text); }
.tabs button.on::after { background: var(--best); }
.tabs .badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 5px; border-radius: 10px; background: var(--panel-2); color: var(--muted); font-size: 14px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 34px 28px 60px; }
.hero { position: relative; overflow: hidden; padding: 54px 58px 42px; border-radius: 26px; color: #fff; background: linear-gradient(125deg, #174733 0%, #0d2b20 70%); box-shadow: var(--shadow-lg); }
.hero::before { content: ""; position: absolute; z-index: 0; width: 340px; height: 340px; right: 45px; top: 50%; transform: translateY(-50%) rotate(5deg); background: url('/static/images/basketwise-logo.png') center/contain no-repeat; opacity: .105; filter: saturate(.8); pointer-events: none; }
.hero::after { content: ""; position: absolute; width: 430px; height: 430px; right: -180px; top: -220px; border: 86px solid rgba(244,184,63,.12); border-radius: 50%; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.eyebrow { color: #c6952f; text-transform: uppercase; letter-spacing: .13em; font-size: 14px; font-weight: 800; }
.hero .eyebrow { color: #f6c96f; }
.hero h1 { max-width: 720px; margin: 11px 0 13px; font: 600 clamp(34px, 5vw, 58px)/1.02 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
.hero > p { max-width: 680px; margin: 0 0 29px; color: #c5d1cb; font-size: 17px; }
.grocery-cues { display: flex; flex-wrap: wrap; gap: 8px; margin: -13px 0 22px; }
.grocery-cues span { padding: 6px 10px; border: 1px solid rgba(255,255,255,.11); border-radius: 999px; background: rgba(255,255,255,.065); color: #d7e1dc; font-size: 14px; backdrop-filter: blur(3px); }

form.search { display: flex; align-items: center; gap: 10px; margin: 0; }
.hero form.search { position: relative; z-index: 1; max-width: 870px; background: #fff; padding: 7px; border-radius: 16px; box-shadow: 0 12px 38px rgba(0,0,0,.2); }
.search-icon { width: 18px; height: 18px; margin-left: 13px; border: 2px solid #7c8780; border-radius: 50%; position: relative; flex: none; }
.search-icon::after { content: ""; width: 7px; height: 2px; background: #7c8780; position: absolute; right: -5px; bottom: -3px; transform: rotate(45deg); border-radius: 2px; }
input[type=search], input[type=text] { flex: 1; min-width: 0; padding: 14px 15px; font-size: 17px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 13px; appearance: none; }
.hero input[type=search] { border: 0; padding-left: 5px; font-size: 18px; }
input:focus { outline: 3px solid rgba(31,122,80,.18); border-color: var(--best); }
.hero input:focus { outline: 0; }
button.go { display: inline-flex; justify-content: center; align-items: center; gap: 18px; padding: 14px 20px; border: 0; border-radius: 11px; background: var(--accent); color: #17221d; font-weight: 750; cursor: pointer; transition: transform .16s, background .16s; }
button.go:hover { background: #ffc957; transform: translateY(-1px); }
button.go:disabled { opacity: .55; cursor: wait; transform: none; }
.recent-row { display: flex; align-items: center; gap: 12px; margin-top: 18px; color: #95aaa0; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; }
.chip { padding: 5px 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; background: rgba(255,255,255,.07); color: #d7e0db; font-size: 14px; cursor: pointer; }
.chip:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.3); color: #fff; }

.results-workspace { margin-top: 28px; }
.status { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-size: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.02); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #a7afa9; }
.pill.running .dot { background: var(--accent-strong); animation: pulse 1s infinite; box-shadow: 0 0 0 4px rgba(244,184,63,.15); }
.pill.ok .dot { background: var(--best); }
.pill.error .dot { background: var(--up); }
.pill.off { opacity: .6; }
@keyframes pulse { 50% { opacity: .25; } }

.filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.tool-group { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.toolbar .lbl { margin: 0 5px; color: #89928c; text-transform: uppercase; letter-spacing: .09em; font-size: 14px; font-weight: 800; }
.toolbar button, .filters button { padding: 7px 11px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.filters button { border-color: var(--line); background: #fff; }
.toolbar button:hover, .filters button:hover { color: var(--text); background: var(--panel-2); }
.toolbar button.on, .filters button.on { color: #fff; background: #194a36; border-color: #194a36; }

.note { margin-bottom: 10px; padding: 11px 14px; border: 1px solid #f0d4cf; border-left: 3px solid var(--up); border-radius: 10px; background: #fff9f8; color: var(--muted); font-size: 14px; white-space: pre-wrap; }
.note.miss, .note.info { border-color: #ecdfbd; border-left-color: var(--accent-strong); background: #fffcf3; white-space: normal; }
.note.correction { border-color: #cfe4d5; border-left-color: var(--best); background: #f4faf6; white-space: normal; }
.note b { color: var(--text); }
.note code { padding: 2px 6px; border-radius: 5px; background: #f5ecda; color: #8d6010; }
.linkish { padding: 0; border: 0; background: none; color: var(--best); text-decoration: underline; cursor: pointer; }

#results { overflow: visible; }
#results:empty { border: 0; box-shadow: none; }
.intent-results { display: grid; gap: 16px; }
.intent-section details { overflow: visible; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.intent-section summary { min-height: 66px; padding: 11px 16px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto 20px; align-items: center; gap: 11px; cursor: pointer; list-style: none; user-select: none; }
.intent-section summary::-webkit-details-marker { display: none; }
.intent-section summary::after { content: "⌄"; grid-column: 4; color: #87928b; font-size: 20px; transition: transform .18s ease; }
.intent-section details[open] summary::after { transform: rotate(180deg); }
.intent-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: #edf6ef; color: var(--best); font-size: 19px; }
.intent-section.related .intent-icon { background: #fff5dc; color: #9a6914; }
.intent-section.containing .intent-icon { background: #f2f3ef; color: #717c75; }
.intent-summary-copy { min-width: 0; }
.intent-summary-copy b, .intent-summary-copy small { display: block; }
.intent-summary-copy b { color: var(--text); font: 650 19px/1.15 Georgia, serif; letter-spacing: -.015em; }
.intent-summary-copy small { margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.3; }
.intent-count { min-width: 34px; padding: 5px 9px; border-radius: 999px; background: #f1f4ef; color: #526159; text-align: center; font-size: 14px; font-weight: 800; }
.intent-section-body { border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; }
.intent-table-wrap { overflow: visible; border-radius: 0 0 16px 16px; }
.intent-table-wrap table { min-width: 760px; }
.intent-table-wrap thead { position: sticky; z-index: 15; top: 49px; }
.intent-table-wrap thead th { position: static; top: auto; line-height: 1.25; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
thead { background: #f9faf7; }
thead th { position: sticky; z-index: 15; top: 49px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: #818b84; background: #f9faf7; box-shadow: 0 7px 12px -12px rgba(15,45,32,.65); text-align: left; text-transform: uppercase; letter-spacing: .09em; font-size: 14px; font-weight: 800; }
thead th:first-child { border-top-left-radius: 16px; }
thead th:last-child { border-top-right-radius: 16px; }
thead th.num { text-align: right; }
tbody tr { border: 0; transition: background .15s; }
tbody tr:hover { background: #fafbf8; }
tbody tr.best { background: #f5fbf7; }
tbody td { padding: 13px 14px; border-bottom: 1px solid #edf0eb; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prod { display: flex; align-items: center; gap: 15px; min-width: 270px; }
.prod img { width: 68px; height: 68px; padding: 4px; object-fit: contain; border: 1px solid #edf0eb; border-radius: 12px; background: #fff; flex: none; }
.pname { max-width: 430px; color: var(--text); font-size: 15px; font-weight: 650; line-height: 1.35; }
.pname a { color: inherit; text-decoration: none; }
.pname a:hover { color: var(--best); }
.sub { margin-top: 4px; color: var(--muted); font-size: 14px; }
.tag { font-size: 14px; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
.tag.woolworths { color: var(--ww); } .tag.pnp { color: var(--pnp); } .tag.checkers { color: var(--checkers); }
.unit, .storeprice { font-size: 16px; font-weight: 750; }
.best .unit, td.store.cheap .storeprice { color: var(--best); }
.storeprice a { color: inherit; text-decoration: none; }
.was { color: #919993; text-decoration: line-through; font-size: 14px; }
.delta.up { color: var(--up); font-size: 14px; } .delta.down { color: var(--down); font-size: 14px; }
.star, .inshops { color: var(--best); font-weight: 700; }
.oneshop, .match { color: var(--muted); }
.match { font-size: 14px; }
.match.high { color: var(--best); font-weight: 750; }
.missing { color: #b46f17; font-size: 14px; }
table.grouped th.store { min-width: 112px; }
.branch-name { display: block; max-width: 150px; margin: 3px 0 0 auto; overflow: hidden; color: #a0aaa3; text-overflow: ellipsis; text-transform: none; letter-spacing: 0; white-space: nowrap; font-size: 14px; font-weight: 600; }
.stock { display: inline-block; margin-top: 4px; font-size: 14px; font-weight: 700; }
.storeprice + .stock { margin-left: 8px; }
.stock.in { color: var(--best); }
.stock.out { color: var(--up); }
.stock.unknown { color: #8a938d; }
table.grouped td.store.cheap { position: relative; background: #e4f4e9; border-radius: 0; box-shadow: inset 3px 0 #2f8b5b, inset -1px 0 #b9dec7; }
table.grouped td.store.empty { color: #cfd5d0; }
td.saving b { display: inline-block; padding: 4px 7px; border-radius: 7px; background: #fff4d8; color: #99620b; font-size: 14px; }
.best-price-badge { width: max-content; margin: 0 0 7px auto; padding: 4px 8px; display: flex; align-items: center; gap: 5px; border-radius: 999px; background: #237a4c; color: #fff; font-size: 12px; font-weight: 850; line-height: 1; letter-spacing: .025em; text-transform: uppercase; box-shadow: 0 3px 8px rgba(35,122,76,.2); }
.best-price-badge + .storeprice { color: #17663d; font-size: 18px; }

.acts { display: flex; gap: 6px; justify-content: flex-end; }
.store-offer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.store-product-link { display: block; min-width: 72px; padding: 6px; margin: -6px; border-radius: 8px; color: inherit; text-decoration: none; }
.store-product-link:hover { background: rgba(31,122,80,.07); }
.shop-link { display: block; margin-top: 5px; color: var(--best); font-size: 14px; font-weight: 750; }
.store-offer .acts { flex-direction: column; gap: 4px; }
.store-offer .iconbtn { min-width: 28px; width: 28px; height: 28px; padding: 3px; border-radius: 8px; }
.fav-shop { margin-bottom: 3px; }
.legacy-choice { color: #a06a1b; font-weight: 700; }
.freshness { display: block; margin-top: 2px; color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; }
.iconbtn { min-width: 32px; height: 32px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); cursor: pointer; }
.iconbtn:hover { color: var(--text); border-color: #9eaaa2; background: #f8faf7; }
.iconbtn.on { color: #c28a18; border-color: #e5c372; background: #fffaf0; }
.iconbtn.added { color: var(--best); border-color: #9ac9ad; background: #f3fbf6; }

.section-head { max-width: 650px; margin: 18px 0 28px; }
.section-head h2 { margin: 6px 0 7px; font: 600 34px/1.1 Georgia, serif; letter-spacing: -.025em; }
.section-head p { margin: 0; color: var(--muted); }
#tab-lists > form.search { max-width: 700px; margin-bottom: 22px; }
.card { margin-bottom: 13px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 3px; font: 600 18px/1.2 Georgia, serif; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.totals { display: flex; gap: 10px; flex-wrap: wrap; margin: 15px 0 6px; }
.stat { min-width: 150px; padding: 11px 14px; border: 1px solid #e8ece5; border-radius: 11px; background: #f8faf6; }
.stat .k { color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.stat .v { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat.win .v { color: var(--best); } .stat.warn .v { color: #aa6b12; }
.storehead { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 6px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.storehead .nm, .storehead .amt { font-weight: 750; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf0eb; }
.li:last-child { border-bottom: 0; }
.li img { width: 54px; height: 54px; padding: 3px; object-fit: contain; border: 1px solid #edf0eb; border-radius: 10px; background: #fff; flex: none; }
.li .grow { flex: 1; min-width: 0; }
.product-image-link { display: flex; flex: none; border-radius: 10px; }
.list-product-link { color: var(--text); text-decoration: none; font-weight: 700; }
.list-product-link:hover { color: var(--best); text-decoration: underline; }
.li.done .grow { opacity: .45; text-decoration: line-through; }
.qty { display: flex; align-items: center; gap: 5px; }
.qty button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 7px; background: #f6f8f4; color: var(--text); cursor: pointer; }
.qty span { min-width: 20px; text-align: center; }
.empty { padding: 48px 20px; color: var(--muted); text-align: center; }
.list-actions { display: flex; align-items: center; gap: 14px; }
.print-list { padding: 8px 12px; border: 1px solid #b9c9be; border-radius: 9px; background: #f4f8f4; color: var(--text); font: inherit; font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; }
.print-list:hover { border-color: var(--best); background: #edf6f0; }
.print-list-brand { display: none; }

dialog { width: min(460px, calc(100% - 32px)); padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--text); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(5,21,14,.62); backdrop-filter: blur(3px); }
dialog h3 { margin: 0 0 4px; font: 600 20px/1.2 Georgia, serif; }
dialog .close { float: right; border: 0; background: none; color: var(--muted); font-size: 23px; cursor: pointer; }
.hrow, .pickrow { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translate(-50%, 12px); padding: 11px 17px; border-radius: 999px; background: #102d21; color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; opacity: 0; pointer-events: none; transition: .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Full-screen produce loader: stays visible until every active shop finishes. */
body.searching { overflow: hidden; }
.search-overlay[hidden] { display: none; }
.search-overlay { position: fixed; z-index: 1000; inset: 0; display: grid; place-content: center; justify-items: center; gap: 30px; padding: 28px; color: #fff; text-align: center; background: rgba(7,31,22,.88); backdrop-filter: blur(12px) saturate(.8); }
.produce-loader { position: relative; width: 210px; height: 210px; display: grid; place-items: center; }
.loader-core { position: relative; z-index: 2; width: 106px; height: 106px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 34px; background: rgba(255,255,255,.09); box-shadow: 0 24px 70px rgba(0,0,0,.28), inset 0 0 0 7px rgba(255,255,255,.025); backdrop-filter: blur(8px); animation: loader-breathe 1.8s ease-in-out infinite; }
.loader-core img { width: 88px; height: 88px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0,0,0,.22)); }
.produce-orbit { position: absolute; inset: 10px; border: 1px solid rgba(244,184,63,.28); border-radius: 50%; animation: produce-spin 3.4s linear infinite; }
.produce-orbit::before, .produce-orbit::after { content: ""; position: absolute; inset: 18px; border: 1px dashed rgba(255,255,255,.09); border-radius: inherit; }
.produce-orbit::after { inset: -6px; border-style: solid; border-color: transparent; border-top-color: rgba(244,184,63,.72); border-bottom-color: rgba(244,184,63,.3); }
.orbit-fruit { position: absolute; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #fff9ed; font-size: 25px; box-shadow: 0 9px 25px rgba(0,0,0,.26); animation: fruit-counter-spin 3.4s linear infinite; }
.fruit-apple { left: 50%; top: -21px; transform: translateX(-50%); }
.fruit-lemon { right: -21px; top: 50%; transform: translateY(-50%); }
.fruit-broccoli { left: 50%; bottom: -21px; transform: translateX(-50%); }
.fruit-carrot { left: -21px; top: 50%; transform: translateY(-50%); }
.loader-copy { width: min(430px, calc(100vw - 44px)); }
.loader-copy .eyebrow { color: #f3be55; }
.loader-copy h2 { margin: 8px 0; font: 600 clamp(27px, 5vw, 38px)/1.08 Georgia, serif; letter-spacing: -.025em; }
.loader-copy p { margin: 0 0 15px; color: #d1ddd7; }
.loader-copy small { display: block; margin-top: 12px; color: #92a69c; }
.loader-track { width: 100%; height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.11); }
.loader-track span { display: block; width: 7%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f0bc52, #ffdb81); box-shadow: 0 0 18px rgba(244,184,63,.5); transition: width .45s ease; }
@keyframes produce-spin { to { transform: rotate(360deg); } }
@keyframes fruit-counter-spin { to { rotate: -360deg; } }
@keyframes loader-breathe { 50% { transform: scale(1.055); } }

/* Authentication and location */
.auth-page { min-height: 100vh; padding: 0; background: #102d21; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); }
.auth-story { min-height: 100vh; padding: clamp(34px, 6vw, 84px); display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: radial-gradient(circle at 85% 10%, rgba(244,184,63,.17), transparent 33%), linear-gradient(140deg, #174431, #0c291e); }
.auth-brand { align-self: flex-start; }
.auth-brand .brand-mark { width: 64px; height: 64px; }
.auth-story h1 { max-width: 750px; margin: 14px 0 18px; font: 600 clamp(42px, 6vw, 74px)/.98 Georgia, serif; letter-spacing: -.045em; }
.auth-story > div > p { max-width: 580px; color: #b9c9c1; font-size: 18px; }
.auth-benefits { display: flex; flex-wrap: wrap; gap: 22px; color: #d5dfda; font-size: 14px; }
.auth-benefits span::before { content: "✓"; margin-right: 7px; color: var(--accent); font-weight: 900; }
.auth-benefits a { color: #f3c464; font-weight: 800; text-decoration: none; }
.auth-card { padding: clamp(34px, 7vw, 90px); display: flex; flex-direction: column; justify-content: center; gap: 34px; background: #f8f9f5; }
.auth-card h2 { margin: 7px 0 10px; font: 600 38px/1.08 Georgia, serif; letter-spacing: -.025em; }
.auth-card p { max-width: 390px; color: var(--muted); }
.google-button { width: 100%; max-width: 440px; display: flex; align-items: center; justify-content: center; gap: 13px; padding: 14px 18px; border: 1px solid #d7ddd7; border-radius: 12px; background: #fff; color: var(--text); text-decoration: none; font-weight: 700; box-shadow: var(--shadow-sm); }
.google-button:hover { border-color: #aeb9b1; transform: translateY(-1px); }
.google-g { width: 25px; height: 25px; display: grid; place-items: center; color: #4285f4; font: 800 18px/1 Arial, sans-serif; }
.auth-warning { max-width: 440px; padding: 14px; border: 1px solid #ead8a7; border-radius: 11px; background: #fffbef; color: #775618; }
.auth-warning b, .auth-warning span { display: block; }
.auth-warning span { margin-top: 4px; font-size: 14px; }
.privacy-copy { max-width: 440px; color: #8a938d; line-height: 1.5; }
.privacy-copy a { color: #567467; }
.auth-success { max-width: 440px; padding: 13px 15px; border: 1px solid #bcd9c5; border-radius: 11px; background: #f1faf4; color: #245d3d; font-size: 14px; font-weight: 700; }

.settings-page { min-height: 100vh; padding: 0; }
.settings-shell { max-width: 1040px; margin: 0 auto; padding: clamp(40px, 8vw, 90px) 24px; display: grid; grid-template-columns: minmax(0, .9fr) minmax(390px, 1.1fr); gap: clamp(45px, 8vw, 100px); align-items: start; }
.settings-copy h1 { margin: 9px 0 14px; font: 600 46px/1.03 Georgia, serif; letter-spacing: -.035em; }
.settings-copy > p { color: var(--muted); }
.account-summary { display: flex; align-items: center; gap: 11px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.account-summary img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.account-summary b, .account-summary span { display: block; }
.account-summary span { color: var(--muted); font-size: 14px; }
.account-controls { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.account-controls h2 { margin: 0 0 6px; font: 600 21px/1.2 Georgia, serif; }
.account-controls p { color: var(--muted); font-size: 14px; }
.account-controls > div { display: flex; gap: 16px; margin-top: 12px; font-size: 14px; font-weight: 700; }
.account-controls a { color: var(--best); }
.account-controls .danger-link { color: #b34239; }
.location-card { padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.location-card > label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 800; }
.location-search-wrap { position: relative; }
.location-card input[type=search] { width: 100%; padding: 14px 15px; }
.town-options { position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; right: 0; max-height: 340px; overflow: auto; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-lg); }
.town-options button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 0; border-radius: 8px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.town-options button:hover { background: #f2f6f1; }
.town-options b, .town-options small { display: block; }
.town-options small { color: var(--muted); }
.town-count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.field-error { margin-top: 10px; color: var(--up); font-size: 14px; }
.selected-town { margin-top: 17px; padding: 13px; display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid #cfe2d5; border-radius: 11px; background: #f4faf6; }
.selected-town b, .selected-town span { display: block; }
.selected-town > div > span { color: var(--muted); font-size: 14px; }
.town-retailers { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.branch-picker { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.branch-loading { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 11px; background: #f6f9f4; color: var(--text); }
.branch-loading b, .branch-loading small { display: block; }
.branch-loading small { margin-top: 3px; color: var(--muted); font-size: 14px; }
.mini-produce { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #fff; font-size: 22px; animation: produce-spin 1.5s linear infinite; box-shadow: var(--shadow-sm); }
.branch-field { margin-top: 16px; }
.branch-field label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 800; }
.branch-field select { width: 100%; padding: 13px 38px 13px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--text); font: inherit; }
.branch-field select:focus { outline: 3px solid rgba(31,122,80,.18); border-color: var(--best); }
.branch-failed { padding: 12px; border: 1px solid #f0d4cf; border-radius: 10px; background: #fff9f8; }
.branch-failed p { margin: 4px 0 0; color: var(--up); font-size: 14px; }
.location-save { width: 100%; margin-top: 23px; }
.cancel-link { display: block; margin-top: 13px; color: var(--muted); text-align: center; font-size: 14px; }

/* Public legal and account lifecycle pages */
.site-footer { max-width: 1180px; margin: 26px auto 0; padding: 24px 28px 34px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: var(--muted); text-decoration: none; font-weight: 700; }
.site-footer a:hover { color: var(--best); }
.auth-footer { max-width: none; margin: 0; background: #f8f9f5; }
.legal-page { min-height: 100vh; background: #f6f7f3; }
.legal-shell { width: min(840px, calc(100% - 36px)); margin: 0 auto; padding: 54px 0 70px; }
.legal-shell article { padding: clamp(28px, 6vw, 64px); border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); }
.legal-shell h1 { margin: 8px 0 5px; font: 600 clamp(38px, 6vw, 58px)/1 Georgia, serif; letter-spacing: -.04em; }
.legal-date { margin: 0 0 34px; color: var(--muted); font-size: 14px; }
.legal-shell h2 { margin: 30px 0 8px; font: 600 21px/1.2 Georgia, serif; }
.legal-shell p, .legal-shell li { color: #566159; font-size: 15px; line-height: 1.75; }
.legal-shell li + li { margin-top: 7px; }
.legal-shell a { color: var(--best); }
.consent-page { min-height: 100vh; padding: 0; background: radial-gradient(circle at 80% 10%, rgba(244,184,63,.13), transparent 30%), #103022; }
.consent-shell { width: min(620px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; padding: 48px 0; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.consent-shell > .brand { align-self: flex-start; color: #fff; }
.consent-card { padding: clamp(28px, 7vw, 52px); border-radius: 20px; background: #fff; box-shadow: 0 28px 80px rgba(0,0,0,.25); }
.consent-card h1 { margin: 8px 0 12px; font: 600 clamp(34px, 7vw, 48px)/1.02 Georgia, serif; letter-spacing: -.035em; }
.consent-card > p { color: var(--muted); }
.consent-card form { margin-top: 24px; }
.consent-check { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf7; color: #465149; font-size: 14px; line-height: 1.55; }
.consent-check input { margin-top: 3px; accent-color: var(--best); }
.consent-check a { color: var(--best); font-weight: 750; }
.consent-card .go { width: 100%; }
.cancel-signup { margin-top: 15px !important; text-align: center; }
.danger-card { border-top: 5px solid #b84a40; }
.danger-card label { display: block; margin-bottom: 8px; font-size: 14px; }
.danger-card input[type=text] { width: 100%; }
.danger-button { width: 100%; margin-top: 14px; padding: 13px 18px; border: 0; border-radius: 11px; background: #a9362f; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.danger-button:hover { background: #8e2d28; }

/* BasketWise 50 monthly index */
.tabs .bw50-tab-link { margin-left: auto; display: flex; align-items: center; gap: 7px; padding: 14px 18px; color: #174733; text-decoration: none; font-size: 14px; font-weight: 850; }
.tabs .bw50-tab-link span { padding: 3px 7px; border-radius: 999px; background: #fff3d6; color: #966000; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.bw50-promo { margin-top: 20px; padding: 22px 24px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; overflow: hidden; border: 1px solid #d8e4da; border-radius: 19px; background: radial-gradient(circle at 96% -30%, rgba(244,184,63,.24), transparent 40%), #fff; color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.bw50-promo:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(19,54,36,.1); }
.bw50-promo-mark { width: 82px; height: 82px; display: grid; place-items: center; align-content: center; border-radius: 50%; background: #154632; color: #fff; box-shadow: inset 0 0 0 5px rgba(255,255,255,.08); }
.bw50-promo-mark span { font-size: 14px; font-weight: 800; letter-spacing: .06em; }
.bw50-promo-mark strong { color: #f6c254; font: 700 32px/.95 Georgia, serif; }
.bw50-promo-copy h2 { margin: 3px 0 4px; font: 600 24px/1.15 Georgia, serif; letter-spacing: -.02em; }
.bw50-promo-copy p { margin: 0; color: var(--muted); font-size: 14px; }
.bw50-promo-result { min-width: 150px; padding-left: 20px; border-left: 1px solid var(--line); }
.bw50-promo-result small, .bw50-promo-result b, .bw50-promo-result span { display: block; }
.bw50-promo-result small { color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
.bw50-promo-result b { margin: 3px 0; color: var(--best); font-size: 16px; }
.bw50-promo-result span { color: #715c2b; font-size: 14px; font-weight: 800; }

.bw50-page { padding-bottom: 0; background: #f5f6f1; }
.bw50-header-actions { display: flex; align-items: center; gap: 18px; }
.bw50-header-actions a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 800; }
.bw50-header-actions .quiet-button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #fff; }
.bw50-hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(circle at 80% 20%, rgba(244,184,63,.22), transparent 29%), linear-gradient(125deg, #174733, #0a291d 78%); }
.bw50-hero::after { content: ""; position: absolute; width: 520px; height: 520px; right: -240px; bottom: -360px; border: 95px solid rgba(255,255,255,.035); border-radius: 50%; }
.bw50-hero-inner { width: min(1180px, calc(100% - 48px)); min-height: 470px; margin: 0 auto; padding: 80px 0 72px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 54px; align-items: center; }
.bw50-intro { position: relative; z-index: 1; }
.bw50-intro .eyebrow { color: #f4c25e; }
.bw50-intro h1 { margin: 10px 0 16px; font: 600 clamp(52px, 7vw, 84px)/.94 Georgia, serif; letter-spacing: -.05em; overflow-wrap: anywhere; }
.bw50-intro h1 em { color: #f4bd4d; font-style: normal; }
.bw50-intro > p { max-width: 680px; margin: 0; color: #c7d5ce; font-size: 18px; line-height: 1.6; }
.bw50-edition-line { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.bw50-edition-line b, .bw50-edition-line span { padding: 7px 11px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; color: #d3ded8; font-size: 14px; }
.bw50-edition-line b { border-color: rgba(244,184,63,.4); color: #f7ce78; }
.bw50-basket { position: relative; z-index: 1; width: 300px; height: 300px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; background: rgba(255,255,255,.035); box-shadow: inset 0 0 70px rgba(244,184,63,.04); }
.bw50-basket::before { content: ""; position: absolute; inset: 40px; border: 1px dashed rgba(244,184,63,.24); border-radius: inherit; }
.bw50-basket strong { color: #f5c45f; font: 600 96px/1 Georgia, serif; }
.bw50-basket span { position: absolute; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: #fff9ed; font-size: 28px; box-shadow: 0 10px 24px rgba(0,0,0,.25); }
.bw50-basket span:nth-child(1) { top: 5px; left: 62px; transform: rotate(-10deg); }
.bw50-basket span:nth-child(2) { top: 32px; right: 26px; transform: rotate(8deg); }
.bw50-basket span:nth-child(3) { right: -5px; bottom: 76px; }
.bw50-basket span:nth-child(4) { left: 19px; bottom: 30px; transform: rotate(-8deg); }
.bw50-basket span:nth-child(5) { left: -8px; top: 82px; }
.bw50-section, .bw50-method { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.bw50-section { padding: 58px 0; }
.bw50-kicker { display: flex; justify-content: space-between; margin-bottom: 18px; color: var(--muted); font-size: 14px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.ranking-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.rank-card { position: relative; min-height: 155px; padding: 24px; display: flex; align-items: center; gap: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.rank-card.rank-1 { color: #fff; border-color: #174733; background: linear-gradient(135deg, #1d6246, #123d2c); }
.rank-number { color: #dfe7e2; font: 600 68px/.8 Georgia, serif; }
.rank-1 .rank-number { color: #f2bd52; }
.rank-card span, .rank-card strong, .rank-card small { display: block; }
.rank-card span { font-size: 14px; font-weight: 850; }
.rank-card strong { margin: 3px 0 5px; font: 600 29px/1 Georgia, serif; }
.rank-card small { color: var(--muted); font-size: 14px; }
.rank-1 small { color: #bcd0c5; }
.result-summary { margin: 18px 0 32px; padding: 18px 20px; border-left: 4px solid var(--accent); border-radius: 0 11px 11px 0; background: #fffaf0; color: #5c5f55; }
.bw50-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.bw50-table { min-width: 820px; }
.bw50-table thead th { position: sticky; top: 0; z-index: 2; padding: 15px 13px; background: #f8faf6; }
.bw50-table tbody td { padding: 12px 13px; }
.bw50-table tbody td:first-child { width: 42px; color: #99a29c; font-size: 14px; }
.bw50-table tbody td:nth-child(2) { width: 27%; }
.bw50-table td b, .bw50-table td small, .bw50-table td a strong, .bw50-table td a small { display: block; }
.bw50-table td small { color: var(--muted); font-size: 14px; font-weight: 500; }
.bw50-table td a { color: inherit; text-decoration: none; }
.bw50-table td a:hover strong { color: var(--best); }
.bw50-table td a strong { font-size: 15px; }
.bw50-table td a small { max-width: 190px; margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bw50-table .not-priced { color: var(--up); font-size: 14px; }
.bw50-table tfoot th { padding: 16px 13px; border-top: 2px solid #bed0c3; background: #eef5ef; color: #173f2e; font-size: 15px; text-align: left; }
.bw50-method { margin-bottom: 40px; padding: 48px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 65px; border-radius: 22px; background: #173f2e; color: #fff; }
.bw50-method h2 { margin: 7px 0 12px; font: 600 38px/1.05 Georgia, serif; letter-spacing: -.03em; }
.bw50-method > div > p { color: #b9cbc2; }
.bw50-method ol { margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; list-style: none; counter-reset: rules; }
.bw50-method li { counter-increment: rules; position: relative; padding-left: 35px; }
.bw50-method li::before { content: counter(rules); position: absolute; left: 0; top: -2px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #f4bd4d; color: #173f2e; font-size: 14px; font-weight: 900; }
.bw50-method li b, .bw50-method li span { display: block; }
.bw50-method li b { font-size: 14px; }
.bw50-method li span { margin-top: 4px; color: #aebfb6; font-size: 14px; line-height: 1.55; }
.bw50-disclaimer { grid-column: 1 / -1; margin: 2px 0 0; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); color: #8fa69a; font-size: 14px; }
.bw50-disclaimer a { color: #ecc46d; }
.bw50-empty { padding: 60px 30px; text-align: center; border: 1px solid var(--line); border-radius: 19px; background: #fff; box-shadow: var(--shadow-sm); }
.bw50-empty > span { display: block; font-size: 45px; }
.bw50-empty h2, .bw50-empty h3 { max-width: 620px; margin: 8px auto 10px; font: 600 34px/1.08 Georgia, serif; }
.bw50-empty h3 { font-size: 26px; }
.bw50-empty p { max-width: 620px; margin: 0 auto; color: var(--muted); }
.category-cloud { margin-top: 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.category-cloud div { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.category-cloud b, .category-cloud span { display: block; }
.category-cloud b { font-size: 14px; }
.category-cloud span { color: var(--muted); font-size: 14px; }
.edition-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.edition-grid a { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: #fff; color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); }
.edition-grid b, .edition-grid span, .edition-grid strong { display: block; }
.edition-grid span { margin: 4px 0 18px; color: var(--muted); font-size: 14px; }
.edition-grid strong { color: var(--best); font: 600 25px/1 Georgia, serif; }

/* Private administration */
.admin-page { min-height: 100vh; padding: 0; background: #f3f5f0; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 242px; padding: 28px 18px 22px; display: flex; flex-direction: column; color: #fff; background: linear-gradient(180deg, #153e2d, #0e2e21); }
.admin-brand { padding: 0 10px 27px; color: #fff; }
.admin-brand .brand-mark { width: 47px; height: 47px; }
.admin-sidebar nav { display: grid; gap: 5px; padding-top: 17px; border-top: 1px solid rgba(255,255,255,.1); }
.admin-sidebar nav a { padding: 11px 12px; display: flex; align-items: center; gap: 11px; border-radius: 10px; color: #aec0b6; text-decoration: none; font-size: 14px; font-weight: 750; }
.admin-sidebar nav a span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: rgba(255,255,255,.07); color: #e6c36c; font-size: 14px; font-weight: 900; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.on { color: #fff; background: rgba(255,255,255,.09); }
.admin-sidebar nav a.on span { background: #f2bd50; color: #173c2d; }
.admin-side-foot { margin-top: auto; padding: 20px 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.admin-side-foot a { display: block; margin-bottom: 14px; color: #e7c56d; text-decoration: none; font-size: 14px; font-weight: 800; }
.admin-side-foot small { color: #789185; font-size: 14px; line-height: 1.6; }
.admin-side-foot b { color: #b7c8bf; font-weight: 650; }
.admin-main { min-height: 100vh; margin-left: 242px; padding: 34px clamp(24px, 4vw, 58px) 70px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.admin-topbar h1 { margin: 2px 0 0; font: 600 34px/1.1 Georgia, serif; letter-spacing: -.03em; }
.admin-avatar { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: #1b5b40; color: #fff; font-weight: 850; box-shadow: 0 0 0 4px #fff; }
.admin-welcome { position: relative; overflow: hidden; min-height: 230px; padding: 42px 46px; display: flex; align-items: center; justify-content: space-between; border-radius: 21px; color: #fff; background: radial-gradient(circle at 85% 20%, rgba(244,184,63,.2), transparent 30%), linear-gradient(125deg, #194a35, #0f3324); box-shadow: var(--shadow-lg); }
.admin-welcome::after { content: ""; position: absolute; width: 300px; height: 300px; right: -120px; bottom: -220px; border: 65px solid rgba(255,255,255,.04); border-radius: 50%; }
.admin-welcome span { color: #b9cbc1; font-size: 14px; }
.admin-welcome h2 { margin: 2px 0 12px; font: 600 48px/1 Georgia, serif; }
.admin-welcome p { max-width: 620px; margin: 0; color: #b9c9c1; }
.admin-welcome-mark { position: relative; z-index: 1; width: 110px; height: 110px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; background: rgba(255,255,255,.05); font-size: 55px; }
.admin-stat-grid { margin: 16px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.admin-stat-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.admin-stat-grid article > span { color: var(--muted); font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.admin-stat-grid strong { display: block; margin: 7px 0 4px; font: 650 29px/1 Georgia, serif; }
.admin-stat-grid strong small { margin-left: 4px; color: #a2aaa4; font: 600 14px/1 Inter, sans-serif; }
.admin-stat-grid p { margin: 0; color: var(--muted); font-size: 14px; }
.admin-stat-grid .waiting strong { color: #b47a10; }
.admin-stat-grid .ready strong { color: var(--best); }
.admin-panel { padding: 28px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.admin-panel h2 { margin: 4px 0 8px; font: 600 27px/1.1 Georgia, serif; }
.admin-panel p { color: var(--muted); }
.admin-next { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.admin-next p { margin: 0; }
.admin-primary { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border: 0; border-radius: 9px; background: #1b6545; color: #fff !important; text-decoration: none; font: inherit; font-size: 14px; font-weight: 850; cursor: pointer; white-space: nowrap; }
.admin-primary:hover { background: #155137; }
.admin-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.admin-panel-head > span, .admin-status-dot { padding: 6px 9px; border-radius: 999px; background: #eef7f0; color: var(--best); font-size: 14px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.settings-admin-panel + .settings-admin-panel { margin-top: 14px; }
.admin-email-row { margin-top: 20px; padding: 14px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf7; }
.admin-email-row b, .admin-email-row span { display: block; }
.admin-email-row span { color: var(--muted); font-size: 14px; }
.admin-store-list { margin-top: 20px; display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.admin-store-list div { padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.admin-store-list span, .admin-store-list b, .admin-store-list small { display: block; }
.admin-store-list span { color: var(--best); font-size: 14px; font-weight: 850; text-transform: uppercase; }
.admin-store-list b { margin: 3px 0; font-size: 14px; }
.admin-store-list small { color: var(--muted); font-size: 14px; }
.admin-rules { margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; list-style: none; }
.admin-rules li { padding: 11px 12px; border-radius: 9px; background: #f5f8f4; color: #526058; font-size: 14px; }
.admin-rules li::before { content: "✓"; margin-right: 8px; color: var(--best); font-weight: 900; }
.admin-review-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; }
.admin-review-head h2 { margin: 4px 0 8px; font: 600 31px/1.1 Georgia, serif; }
.admin-review-head p { max-width: 680px; margin: 0; color: var(--muted); }
.edition-health { display: flex; gap: 8px; }
.edition-health > div { min-width: 80px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; text-align: center; }
.edition-health b, .edition-health span { display: block; }
.edition-health b { font: 650 20px/1 Georgia, serif; }
.edition-health span { margin-top: 3px; color: var(--muted); font-size: 14px; }
.edition-health .ready { border-color: #bcd9c5; background: #f2faf4; }
.admin-progress { height: 6px; margin: 20px 0 22px; overflow: hidden; border-radius: 999px; background: #dfe5df; }
.admin-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1e704b, #efba4c); }
.admin-review-tools { margin-bottom: 13px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.admin-review-tools > div { display: flex; gap: 6px; }
.filter-chip { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 14px; font-weight: 750; cursor: pointer; }
.filter-chip.on { border-color: #1d6646; background: #edf6f0; color: #18563c; }
.admin-review-tools label { color: var(--muted); font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.admin-review-tools input { width: 230px; margin-top: 4px; padding: 9px 11px; display: block; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.admin-product-list { display: grid; gap: 12px; }
.admin-product { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.admin-product > header { padding: 16px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: #fafbf8; }
.product-index { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #e8efe9; color: #4e6257; font-size: 14px; font-weight: 900; }
.admin-product header > div:nth-child(2) { flex: 1; }
.admin-product header span, .admin-product header small { display: block; color: var(--muted); font-size: 14px; }
.admin-product header span { color: #9b6c13; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.admin-product h3 { margin: 1px 0; font-size: 15px; }
.product-completeness { padding: 5px 8px; border-radius: 999px; background: #fff4dc; color: #93620b; font-size: 14px; font-weight: 850; }
.product-completeness.complete { background: #eaf6ed; color: #207047; }
.admin-offer-grid { display: grid; grid-template-columns: repeat(3,1fr); }
.admin-offer { min-width: 0; padding: 15px; border-right: 1px solid var(--line); }
.admin-offer:last-child { border-right: 0; }
.admin-offer.missing { background: #fcfbf7; }
.admin-offer-head { margin-bottom: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.admin-offer-head b { font-size: 14px; }
.admin-offer-head small { max-width: 150px; overflow: hidden; color: var(--muted); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.admin-offer-product { min-height: 56px; display: flex; align-items: flex-start; gap: 10px; }
.admin-offer-product img, .offer-image-empty { width: 50px; height: 50px; flex: none; object-fit: contain; border: 1px solid #edf0ea; border-radius: 9px; background: #fff; }
.offer-image-empty { display: grid; place-items: center; font-size: 22px; }
.admin-offer-product > div { min-width: 0; }
.admin-offer-product a { display: -webkit-box; overflow: hidden; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 750; line-height: 1.35; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.admin-offer-product span { display: block; margin-top: 3px; color: var(--muted); font-size: 14px; }
.admin-offer-price { margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.admin-offer-price > div { padding: 8px; border-radius: 8px; background: #f4f7f3; }
.admin-offer-price small, .admin-offer-price b { display: block; }
.admin-offer-price small { color: var(--muted); font-size: 14px; }
.admin-offer-price b { font-size: 14px; }
.admin-offer-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.admin-offer-actions label { flex: 1 1 100%; margin-right: auto; color: #536159; font-size: 14px; font-weight: 750; }
.admin-offer-actions input { accent-color: var(--best); vertical-align: -2px; }
.admin-offer-actions button { padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #536159; font-size: 14px; font-weight: 750; cursor: pointer; }
.admin-offer-actions .remove-offer { color: #a3453d; }
.admin-missing-offer { min-height: 148px; padding: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #d6ddd6; border-radius: 10px; text-align: center; }
.admin-missing-offer > span { color: #b99037; font-size: 24px; }
.admin-missing-offer b { font-size: 14px; }
.admin-missing-offer p { min-height: 27px; margin: 3px 0 10px; color: var(--muted); font-size: 14px; }
.admin-search-dialog { width: min(900px, calc(100% - 32px)); max-width: 900px; padding: 28px; }
.admin-search-dialog h2 { margin: 3px 0 2px; font: 600 29px/1.1 Georgia, serif; }
.admin-search-dialog > p { margin: 0; color: var(--muted); font-size: 14px; }
.admin-search-dialog form { margin: 18px 0; display: flex; gap: 8px; }
.admin-search-dialog form input { flex: 1; padding: 11px 13px; }
#adminSearchResults { max-height: 55vh; overflow: auto; }
.admin-search-result { padding: 12px 10px; display: grid; grid-template-columns: 52px minmax(180px,1fr) 140px auto; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.admin-search-result img { width: 50px; height: 50px; object-fit: contain; border-radius: 8px; background: #fff; }
.search-result-copy { min-width: 0; }
.search-result-copy a, .search-result-copy span { display: block; }
.search-result-copy a { overflow: hidden; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 750; white-space: nowrap; text-overflow: ellipsis; }
.search-result-copy span { color: var(--muted); font-size: 14px; }
.admin-search-result label { position: relative; color: var(--muted); font-size: 14px; font-weight: 800; text-transform: uppercase; }
.admin-search-result label span { position: absolute; left: 8px; bottom: 7px; color: var(--text); font-size: 14px; }
.admin-search-result input { width: 100%; margin-top: 3px; padding: 6px 7px 6px 20px; border: 1px solid var(--line); border-radius: 7px; }
.admin-searching, .admin-search-error { padding: 34px; color: var(--muted); text-align: center; }
.admin-searching span { display: block; font-size: 26px; animation: produce-spin 1.5s linear infinite; }
.admin-search-error { color: var(--up); }

@media (min-width: 801px) {
  .intent-table-wrap tbody tr + tr td { border-top: 6px solid #f5f6f1; }
}

@media (max-width: 800px) {
  .header-inner { min-height: 70px; padding: 13px 18px; }
  .header-actions .stats, .account-pill > span, .logout-link { display: none; }
  .nav-shell { position: static; }
  .tabs { padding: 0 12px; overflow-x: auto; }
  .tabs button { white-space: nowrap; padding: 14px 10px; }
  .tabs .bw50-tab-link { margin-left: 0; padding: 14px 10px; white-space: nowrap; }
  .wrap { padding: 18px 14px 48px; }
  .hero { padding: 34px 22px 25px; border-radius: 20px; }
  .hero::before { width: 245px; height: 245px; right: -82px; opacity: .075; }
  .hero h1 { font-size: 36px; }
  .hero > p { font-size: 15px; }
  .grocery-cues { margin-top: -12px; gap: 6px; }
  .grocery-cues span { padding: 5px 8px; font-size: 14px; }
  .hero form.search { display: grid; grid-template-columns: 26px 1fr; padding: 7px; }
  .hero button.go { grid-column: 1 / -1; width: 100%; }
  .recent-row { align-items: flex-start; }
  .toolbar { align-items: flex-start; }
  .tool-group { width: 100%; }
  .intent-results { gap: 12px; }
  .intent-section details { overflow: hidden; }
  .intent-section summary { min-height: 64px; padding: 10px 12px; grid-template-columns: 36px minmax(0,1fr) auto 16px; gap: 9px; }
  .intent-section summary::after { grid-column: 4; }
  .intent-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 17px; }
  .intent-summary-copy b { font-size: 18px; }
  .intent-summary-copy small { font-size: 14px; line-height: 1.35; }
  .intent-count { min-width: 31px; padding: 4px 8px; }
  .intent-table-wrap { overflow-x: auto; }
  .intent-table-wrap table { min-width: 0; }
  .intent-table-wrap thead { position: static; }
  thead { display: none; }
  tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 15px; border-bottom: 1px solid var(--line); }
  .intent-table-wrap tbody tr + tr { border-top: 6px solid #f5f6f1; }
  tbody tr:last-child { border-bottom: 0; }
  tbody td { padding: 0; border: 0; }
  td.c-prod { grid-column: 1; grid-row: 1 / span 5; }
  td.c-unit { grid-column: 2; grid-row: 1; text-align: right; }
  td.c-price { grid-column: 2; grid-row: 2; text-align: right; }
  td.c-meta { grid-column: 2; grid-row: 3; text-align: right; }
  td.c-match { grid-column: 2; grid-row: 4; text-align: right; }
  td.c-acts { grid-column: 2; grid-row: 5; margin-top: 5px; text-align: right; }
  .prod { align-items: flex-start; min-width: 0; gap: 11px; }
  .prod img { width: 62px; height: 62px; }
  .pname { font-size: 14px; }
  table.grouped tbody tr { display: block; }
  table.grouped td.c-prod { display: block; margin-bottom: 11px; }
  table.grouped td.store { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; padding: 7px 9px; border-radius: 8px; text-align: right; }
  table.grouped td.store.cheap { border-radius: 10px; box-shadow: inset 3px 0 #2f8b5b; }
  .best-price-badge { margin-bottom: 6px; }
  table.grouped .store-offer { flex: 1; margin-left: 12px; }
  table.grouped .store-offer .acts { flex-direction: row; }
  table.grouped td.store::before { content: attr(data-label); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: 14px; font-weight: 800; }
  table.grouped td.store.empty { display: none; }
  table.grouped td.saving, table.grouped td.c-acts { display: block; margin-top: 7px; text-align: right; }
  table.grouped td.saving:not(:empty)::before { content: "Save "; color: var(--muted); font-size: 14px; }
  .li { flex-wrap: wrap; }
  .li img, .li input[type=checkbox], .li .grow, .li .qty,
  .li > div:nth-last-child(2), .li > button[data-del] { order: initial; }
  .li .grow { flex: 1 1 calc(100% - 80px); }
  .li .qty { margin-left: auto; }
  .stat { min-width: calc(50% - 5px); flex: 1; }
  .auth-shell { display: block; }
  .auth-story { min-height: 52vh; padding: 34px 24px; gap: 48px; }
  .auth-story h1 { font-size: 44px; }
  .auth-benefits { display: none; }
  .auth-card { min-height: 48vh; padding: 40px 24px; gap: 24px; }
  .settings-shell { display: block; padding: 42px 18px; }
  .settings-copy { margin-bottom: 30px; }
  .settings-copy h1 { font-size: 38px; }
  .location-card { padding: 22px; }
  .site-footer { align-items: flex-start; flex-direction: column; padding: 22px 18px 30px; }
  .legal-shell { padding: 28px 0 46px; }
  .legal-shell article { padding: 25px 21px; border-radius: 15px; }
  .bw50-promo { grid-template-columns: auto 1fr; padding: 18px; gap: 15px; }
  .bw50-promo-mark { width: 67px; height: 67px; }
  .bw50-promo-copy h2 { font-size: 20px; }
  .bw50-promo-result { grid-column: 1 / -1; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .bw50-header-actions > a:first-child { display: none; }
  .bw50-hero-inner { width: calc(100% - 36px); min-height: auto; padding: 55px 0 50px; display: block; }
  .bw50-intro h1 { font-size: clamp(44px, 13vw, 54px); }
  .bw50-intro > p { font-size: 17px; }
  .bw50-basket { display: none; }
  .bw50-section, .bw50-method { width: calc(100% - 28px); }
  .bw50-section { padding: 38px 0; }
  .ranking-grid { grid-template-columns: 1fr; }
  .rank-card { min-height: 110px; }
  .rank-number { font-size: 52px; }
  .bw50-method { padding: 30px 23px; display: block; }
  .bw50-method h2 { font-size: 32px; }
  .bw50-method ol { margin-top: 30px; grid-template-columns: 1fr; }
  .bw50-disclaimer { margin-top: 28px; }
  .category-cloud, .edition-grid { grid-template-columns: 1fr 1fr; }
  .admin-sidebar { position: static; width: auto; padding: 15px; }
  .admin-brand { padding: 0 0 13px; }
  .admin-sidebar nav { grid-template-columns: repeat(3,1fr); padding-top: 11px; }
  .admin-sidebar nav a { justify-content: center; padding: 8px; }
  .admin-sidebar nav a span { display: none; }
  .admin-side-foot { display: none; }
  .admin-main { margin: 0; padding: 25px 14px 50px; }
  .admin-topbar { margin-bottom: 22px; }
  .admin-topbar h1 { font-size: 28px; }
  .admin-welcome { min-height: 220px; padding: 30px 25px; }
  .admin-welcome h2 { font-size: 40px; }
  .admin-welcome-mark { display: none; }
  .admin-stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-next, .admin-review-head, .admin-review-tools { align-items: stretch; flex-direction: column; }
  .edition-health { width: 100%; }
  .edition-health > div { flex: 1; }
  .admin-review-tools { display: flex; }
  .admin-review-tools input { width: 100%; }
  .admin-offer-grid { grid-template-columns: 1fr; }
  .admin-offer { border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-offer:last-child { border-bottom: 0; }
  .admin-store-list, .admin-rules { grid-template-columns: 1fr; }
  .admin-search-result { grid-template-columns: 44px 1fr; }
  .admin-search-result img, .admin-search-result .offer-image-empty { width: 42px; height: 42px; }
  .admin-search-result label, .admin-search-result button { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
}

@media print {
  @page { size: auto; margin: 14mm; }
  * { box-shadow: none !important; }
  body { padding: 0 !important; background: #fff !important; color: #17221c !important; font-size: 10pt; }
  .app-header, .nav-shell, .site-footer, #tab-search, #tab-favs,
  #tab-lists > .section-head, #newListForm, .list-tabs, .list-actions,
  .toast, dialog, .search-overlay { display: none !important; }
  main.wrap { width: 100%; max-width: none; padding: 0; margin: 0; }
  #tab-lists { display: block !important; }
  .print-list-brand { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid #194a36; }
  .print-list-brand b { color: #194a36; font: 700 20pt/1 Georgia, serif; }
  .print-list-brand span { color: #68746d; font-size: 8pt; }
  #listsBody .card { padding: 0; border: 0; background: #fff; }
  #listsBody .card h3 { font-size: 18pt; }
  .totals { margin: 10px 0 20px; }
  .stat { padding: 7px 10px; border: 1px solid #dfe5df; background: #f7f9f6; }
  .storehead { break-after: avoid; margin-top: 18px; border-bottom: 1px solid #66746b; }
  .li { break-inside: avoid; padding: 7px 0; border-bottom: 1px solid #e5e9e5; }
  .li img { width: 34px; height: 34px; border: 0; }
  .li a { color: inherit; text-decoration: none; }
  .li .sub { color: #59645e; }
  .li .qty button, .li > button[data-del] { display: none !important; }
  .li .qty::before { content: "Qty"; margin-right: 4px; color: #68746d; font-size: 8pt; }
  .li .iconbtn { display: none !important; }
}
