:root {
  --ink: #17211c;
  --muted: #68736c;
  --paper: #f4f0e7;
  --paper-deep: #eae4d8;
  --card: #fffdf8;
  --green: #2d5c4d;
  --green-dark: #193d33;
  --green-soft: #dbe7df;
  --orange: #c35028;
  --yellow: #f3c968;
  --red: #a84132;
  --line: rgba(23, 33, 28, .13);
  --shadow: 0 18px 45px rgba(40, 50, 43, .09);
  --radius: 24px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 82% 0%, rgba(243, 201, 104, .24), transparent 26rem), var(--paper); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
:focus-visible { outline: 3px solid rgba(45,92,77,.42); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--green); }
.loading-screen .brand-seal { animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.92); opacity: .66; } }

.brand-seal { width: 44px; height: 44px; display: grid; place-items: center; flex: none; border-radius: 50% 50% 46% 54% / 52% 42% 58% 48%; color: #fff; background: var(--green); font: 700 23px Georgia, serif; box-shadow: inset 0 -5px 10px rgba(0,0,0,.13); transform: rotate(-4deg); }
.wordmark { display: inline-flex; align-items: center; gap: 12px; }
.wordmark > span:last-child { display: grid; line-height: 1.05; }
.wordmark strong { font: 700 21px Georgia, serif; letter-spacing: -.02em; }
.wordmark small { margin-top: 5px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.access-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, .9fr) minmax(480px, 1.1fr); overflow: hidden; }
.access-art { position: relative; min-height: 100vh; overflow: hidden; background: var(--green); }
.access-art::before, .access-art::after { content: ""; position: absolute; border-radius: 50%; }
.access-art::before { width: 440px; height: 440px; left: -150px; top: -70px; background: var(--yellow); }
.access-art::after { width: 520px; height: 520px; left: 23%; bottom: -230px; background: var(--orange); }
.access-art span { position: absolute; z-index: 2; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.9); border-radius: 50%; color: #fff; font: italic 700 22px Georgia, serif; transform: rotate(-8deg); }
.access-art span:nth-child(1) { width: 150px; height: 150px; top: 22%; left: 48%; }
.access-art span:nth-child(2) { width: 110px; height: 110px; top: 47%; left: 16%; transform: rotate(9deg); }
.access-art span:nth-child(3) { width: 190px; height: 190px; top: 58%; right: 8%; transform: rotate(4deg); }
.access-card { width: min(520px, calc(100% - 48px)); margin: auto; padding: 52px 0; }
.access-card .wordmark { margin-bottom: 76px; }
.eyebrow { margin: 0 0 12px; color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.access-card h1, .view-heading h1 { margin: 0; font: 700 clamp(38px, 5vw, 64px)/.94 Georgia, serif; letter-spacing: -.045em; }
.access-card h1 em, .view-heading h1 em { color: var(--green); font-weight: 400; }
.lede { max-width: 440px; margin: 24px 0 28px; color: var(--muted); line-height: 1.6; }
.stack-form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: #39443e; font-size: 12px; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; outline: none; background: rgba(255,255,255,.77); padding: 13px 14px; transition: border .2s, box-shadow .2s, background .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--green); background: #fff; box-shadow: 0 0 0 4px rgba(45,92,77,.11); }
textarea { resize: vertical; }
.check-row { grid-template-columns: auto 1fr; align-items: center; gap: 10px; font-weight: 500; }
.check-row input { width: 18px; height: 18px; accent-color: var(--green); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid transparent; border-radius: 999px; padding: 10px 18px; background: transparent; font-size: 13px; font-weight: 800; transition: transform .16s, background .16s, color .16s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--green); box-shadow: 0 8px 20px rgba(45,92,77,.18); }
.button.primary:hover { background: var(--green-dark); }
.button.quiet { border-color: var(--line); background: rgba(255,255,255,.54); }
.button.quiet:hover { background: #fff; }
.button.danger { color: var(--red); border-color: rgba(168,65,50,.23); background: rgba(168,65,50,.06); }
.wide { width: 100%; }
.text-button { min-height: 44px; margin-top: 7px; padding: 7px 0; border: 0; color: var(--green); background: none; font-size: 13px; font-weight: 750; }
.form-error { margin: 0; color: var(--red); font-size: 12px; line-height: 1.45; }
.pending-icon { width: 58px; height: 58px; margin-bottom: 25px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 24px; }
.pending-actions { display: flex; gap: 10px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 244px; display: flex; flex-direction: column; padding: 32px 24px; border-right: 1px solid var(--line); background: rgba(246,243,235,.89); backdrop-filter: blur(18px); }
.main-nav { display: grid; gap: 5px; margin-top: 56px; }
.nav-button { border: 0; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 13px; color: var(--muted); background: transparent; font-weight: 720; text-align: left; }
.nav-button > span { width: 24px; display: inline-grid; place-items: center; font-size: 19px; }
.nav-button:hover { color: var(--ink); background: rgba(255,255,255,.55); }
.nav-button.is-active { color: #fff; background: var(--green); box-shadow: 0 8px 21px rgba(45,92,77,.15); }
.sidebar-foot { margin-top: auto; padding: 14px 4px 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #48a56f; box-shadow: 0 0 0 4px rgba(72,165,111,.12); }
.sync-dot.is-offline { background: var(--orange); }
.offline-banner { position: sticky; top: 10px; z-index: 35; max-width: 1120px; min-height: 38px; margin: -42px auto 12px; padding: 7px 10px; border: 1px solid rgba(173,102,35,.24); border-radius: 12px; background: rgba(255,246,224,.96); color: #6b4a28; display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 20px rgba(71,53,30,.08); font-size: 13px; backdrop-filter: blur(10px); }
.offline-banner[hidden] { display: none; }
.offline-banner-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); }
.offline-banner button { min-height: 30px; margin-left: auto; padding: 3px 9px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-weight: 750; cursor: pointer; }
.offline-banner button:hover, .offline-banner button:focus-visible { background: rgba(173,102,35,.1); }
.avatar-button { width: 44px; height: 44px; margin-left: auto; border: 0; border-radius: 50%; color: #fff; background: var(--orange); font-weight: 850; }
.avatar-button.has-sync-warning { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px #d59819; }
.workspace { min-height: 100vh; margin-left: 244px; padding: 54px clamp(28px, 5vw, 82px) 100px; }
.view { display: none; max-width: 1120px; margin: 0 auto; }
.view.is-active { display: block; animation: enter .25s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.view-heading { min-height: 100px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.view-heading h1 { font-size: clamp(38px, 4.8vw, 62px); }
.view-subtitle { margin: 12px 0 0; color: var(--muted); line-height: 1.5; }
.view-heading .button { margin-bottom: 4px; }
.mobile-header, .mobile-nav { display: none; }

.quick-add { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 22px; padding: 7px 8px 7px 17px; border: 1px solid rgba(45,92,77,.16); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.quick-add > span { color: var(--orange); font-size: 23px; }
.quick-add input { border: 0; padding: 12px 4px; background: transparent; box-shadow: none; font-size: 16px; }
.quick-add button { min-height: 44px; border: 0; border-radius: 12px; padding: 11px 19px; color: #fff; background: var(--orange); font-weight: 800; }
.filter-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.list-view-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.completed-visibility-toggle { min-height: 44px; }
.history-controls { display: flex; justify-content: flex-end; gap: 8px; margin: -9px 0 14px; }
.segment { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.35); }
.segment button { min-height: 44px; border: 0; border-radius: 999px; padding: 8px 15px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; }
.segment button.is-active { color: var(--ink); background: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.06); }
.search-box { width: min(260px, 40vw); grid-template-columns: auto 1fr; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.45); }
.search-box span { color: var(--muted); font-size: 20px; }
.search-box input { border: 0; padding: 9px 0; background: transparent; box-shadow: none; }
.item-list { display: grid; gap: 9px; }
.history-pagination { display: flex; justify-content: center; padding: 14px 0 2px; }
.history-pagination[hidden] { display: none; }
.history-pagination .button { min-width: 132px; }
.empty-card { padding: 64px 20px; border: 1px dashed rgba(45,92,77,.3); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty-card span { display: block; margin-bottom: 12px; font-size: 32px; }
.item-card { position: relative; display: grid; grid-template-columns: auto 42px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 76px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.83); transition: border .16s, transform .16s, opacity .16s; }
.item-product-thumb { width: 42px; height: 50px; flex: none; }
.item-card:hover { transform: translateY(-1px); border-color: rgba(45,92,77,.28); }
.item-check { width: 44px; height: 44px; display: grid; place-items: center; border: 1.5px solid rgba(45,92,77,.32); border-radius: 50%; color: transparent; background: var(--paper); font-size: 20px; }
.item-check:hover { color: #fff; background: var(--green); }
.item-copy { min-width: 0; }
.item-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.item-meta { display: flex; flex-wrap: wrap; gap: 5px 11px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.item-meta span { display: inline-flex; align-items: center; gap: 4px; }
.scope-badge, .priority-badge, .item-status-badge, .urgency-badge { padding: 4px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.priority-badge { color: #99411f; background: #f7dfd1; }
.urgency-badge.urgency-important { color: #674b04; background: #fff0bd; }
.urgency-badge.urgency-high { color: #8b421c; background: #f9dfc9; }
.urgency-badge.urgency-urgent, .urgency-badge.urgency-today, .urgency-badge.urgency-overdue { color: #8c2c26; background: #f9ded9; }
.item-card.urgency-important { border-left: 4px solid #d7a61f; }
.item-card.urgency-high { border-left: 4px solid #da7c39; }
.item-card.urgency-urgent, .item-card.urgency-today, .item-card.urgency-overdue { border-left: 4px solid var(--red); }
.item-status-badge.status-unavailable { color: #8c2c26; background: #f9ded9; }
.item-status-badge.status-postponed { color: #76520c; background: #fff0bd; }
.item-actions { display: flex; align-items: center; gap: 4px; }
.item-actions button { width: 44px; height: 44px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; }
.item-actions button:hover { color: var(--ink); background: var(--paper-deep); }
.item-card.is-unavailable { border-style: dashed; background: #fff8f5; }
.item-card.is-postponed { border-style: dashed; background: #fffbef; }
.item-card.is-complete { border-color: rgba(23,33,28,.1); background: #e8e8e4; color: #626a65; opacity: .78; }
.item-card.is-complete .item-check { color: #fff; border-color: #7a837d; background: #7a837d; }
.completed-divider { display: flex; align-items: center; gap: 12px; margin: 13px 2px 3px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.completed-divider::before, .completed-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.favourite-card { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 44px; align-items: center; gap: 5px; padding: 7px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.favourite-add { min-width: 0; min-height: 58px; display: grid; grid-template-columns: 42px minmax(0,1fr) 24px; align-items: center; gap: 10px; border: 0; border-radius: 13px; padding: 7px 9px; background: transparent; text-align: left; }
.favourite-add:hover { background: var(--green-soft); }
.favourite-add > .item-product-thumb { width: 42px; height: 50px; }
.favourite-add strong, .favourite-add small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favourite-add small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.favourite-add b { color: var(--green); font-size: 20px; }
.favourite-remove, .activity-remove { width: 44px; height: 44px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; }
.favourite-remove:hover, .activity-remove:hover { color: var(--red); background: rgba(168,65,50,.08); }
.item-card.is-pending { border-style: dashed; background: rgba(255,253,248,.62); }
.item-card.is-pending button:disabled { cursor: default; opacity: 1; }
.pending-badge { padding: 3px 7px; border-radius: 999px; color: #76520c; background: #fff0bd; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.pending-spinner { width: 18px; height: 18px; display: inline-block; flex: 0 0 auto; border: 2px solid rgba(118,82,12,.2); border-top-color: #76520c; border-radius: 50%; animation: pending-spin .9s linear infinite; }
@keyframes pending-spin { to { transform: rotate(360deg); } }
.item-card.is-complete .item-copy strong { text-decoration: line-through; }

.shop-heading { align-items: center; }
.shop-count { min-width: 100px; display: grid; justify-items: end; }
.shop-count strong { font: 700 42px Georgia, serif; }
.shop-count span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.trip-command { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; margin-bottom: 12px; padding: 20px 22px; overflow: hidden; border: 1px solid rgba(45,92,77,.2); border-radius: 23px; background: linear-gradient(125deg,#eef7ef 0%,#fff4dc 100%); box-shadow: 0 10px 28px rgba(40,50,43,.09); }
.trip-command.is-active { border-color: rgba(45,92,77,.35); background: linear-gradient(125deg,#dceee4 0%,#f6f1d4 100%); }
.trip-command-copy { min-width: 0; }
.trip-command-copy .eyebrow { margin-bottom: 4px; }
.trip-command-copy h2 { margin: 0; color: var(--green-dark); font: 700 clamp(22px,3vw,30px)/1.05 Georgia,serif; }
.trip-command-copy p:last-child { max-width: 650px; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.trip-command-actions { display: flex; align-items: center; gap: 9px; }
.trip-command .trip-start { min-height: 54px; padding-inline: 24px; font-size: 14px; box-shadow: 0 8px 20px rgba(45,92,77,.2); }
.trip-location-assist { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid rgba(45,92,77,.22); border-radius: 16px; background: var(--card); box-shadow: 0 5px 16px rgba(40,50,43,.06); }
.trip-location-assist p { margin: 0; color: var(--green-dark); font-size: 12px; line-height: 1.45; }
.trip-location-assist > div { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 7px; }
.trip-end-bottom { width: 100%; min-height: 56px; margin: 4px 0 88px; font-size: 14px; }
.shop-toolbar { display: grid; grid-template-columns: minmax(180px,1fr) minmax(160px,.8fr) auto auto auto; gap: 9px; align-items: end; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.55); }
.select-field { gap: 4px; }
.select-field span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.select-field select { padding: 10px 12px; background-color: #fff; }
.select-field.compact { grid-template-columns: auto minmax(120px,1fr); align-items: center; gap: 10px; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 18px; }
.icon-button.is-active { color: #fff; background: var(--green); }
.shop-options { display: flex; align-items: center; gap: 20px; margin: 12px 2px 24px; }
.shop-quick-setup { margin: -10px 2px 22px; padding: 13px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.5); }
.shop-quick-setup > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shop-quick-setup > header strong, .shop-quick-setup > header small { display: block; }
.shop-quick-setup > header strong { font-size: 13px; }
.shop-quick-setup > header small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.shop-quick-setup > header .button { min-height: 44px; flex: none; padding: 8px 12px; }
.shop-retailer-choices { display: flex; gap: 8px; overflow-x: auto; margin-top: 11px; padding: 1px 1px 3px; scrollbar-width: none; scroll-snap-type: x proximity; }
.shop-retailer-choices:empty { display: none; }
.shop-retailer-choices::-webkit-scrollbar { display: none; }
.shop-retailer-choice { min-width: max-content; min-height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; font: inherit; font-size: 12px; font-weight: 800; scroll-snap-align: start; }
.shop-retailer-choice:hover { border-color: var(--green); background: var(--green-soft); }
.shop-retailer-choice:disabled { cursor: wait; opacity: .6; }
.shop-empty-setup { max-width: 620px; margin: 8vh auto 0; padding: 23px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); text-align: center; }
.shop-empty-setup > span { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 11px; border-radius: 16px; color: var(--green); background: var(--green-soft); font-size: 24px; }
.shop-empty-setup h2 { margin: 0; font: 700 25px Georgia, serif; }
.shop-empty-setup p { margin: 7px auto 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.shop-empty-setup .shop-retailer-choices { justify-content: center; }
.toggle { display: flex; grid-template-columns: none; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.toggle input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.toggle > span { width: 36px; height: 20px; position: relative; border-radius: 99px; background: #b9c1bc; transition: background .2s; }
.toggle > span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(16px); }
.toggle input:focus-visible + span { outline: 3px solid rgba(45,92,77,.42); outline-offset: 3px; }
.shop-list { display: grid; gap: 18px; padding-bottom: 76px; }
.aisle-group { display: grid; gap: 7px; }
.aisle-heading { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 9px 6px; color: var(--green); background: linear-gradient(var(--paper) 70%, transparent); font: 700 17px Georgia, serif; }
.aisle-heading span { color: var(--muted); font: 700 10px Inter, sans-serif; text-transform: uppercase; letter-spacing: .1em; }
.shop-item { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 12px; align-items: center; min-height: 88px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 6px 18px rgba(40,50,43,.05); }
.shop-item-copy { min-width: 0; }
.shop-aisle-label { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.shop-aisle-select { max-width: 190px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 24px 5px 9px; color: var(--ink); background: var(--paper); font: inherit; font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.shop-item strong { display: block; font-size: 17px; }
.shop-item p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.shop-item-actions { display: flex; gap: 7px; }
.shop-item-actions button { min-width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); font-size: 19px; }
.shop-item-actions .out-of-stock-button { color: #a84435; border-color: rgba(168,68,53,.3); background: #fff4f1; }
.out-of-stock-icon { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.shop-item-actions .buy-button { color: #fff; border-color: var(--green); background: var(--green); }
.shop-item-actions .buy-button.is-ticked { color: var(--green-dark); border-color: rgba(45,92,77,.35); background: var(--green-soft); }
.shop-item-actions .shop-reopen { min-width: 48px; padding: 0; border-radius: 50%; color: var(--green); border-color: rgba(45,92,77,.3); background: var(--green-soft); font-size: 18px; font-weight: 850; }
.shop-item.is-trolley { border-color: rgba(220,102,55,.38); background: #fff7f1; }
.shop-item.is-unavailable { border-style: dashed; background: #fff8f5; }
.shop-item.is-postponed { border-style: dashed; background: #fffbef; }
.shop-item.is-complete { border-color: rgba(23,33,28,.1); background: #e8e8e4; color: #626a65; opacity: .8; }
.shop-item.is-complete strong { text-decoration: line-through; }
.shop-item p .item-status-badge { margin-right: 7px; }
.shop-item.is-pending { border-style: dashed; background: rgba(255,253,248,.75); }
.shop-item.is-pending .pending-badge { display: inline-flex; margin-top: 8px; }
.running-total { position: fixed; z-index: 10; right: clamp(28px,5vw,82px); bottom: 24px; display: flex; align-items: center; gap: 18px; padding: 12px 18px; border-radius: 999px; color: #fff; background: var(--green-dark); box-shadow: 0 10px 28px rgba(25,61,51,.28); }
.running-total span { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .08em; }

.activity-list { position: relative; max-width: 770px; display: grid; gap: 0; }
.activity-list::before { content: ""; position: absolute; left: 19px; top: 20px; bottom: 20px; width: 1px; background: var(--line); }
.activity-entry { position: relative; display: grid; grid-template-columns: 40px minmax(0,1fr) auto 44px; gap: 10px; align-items: center; padding: 8px 0; }
.activity-avatar { z-index: 1; width: 40px; height: 40px; display: grid; place-items: center; border: 4px solid var(--paper); border-radius: 50%; color: #fff; background: var(--orange); font-size: 12px; font-weight: 850; }
.activity-entry p { margin: 3px 0; font-size: 14px; }
.activity-entry strong { font-weight: 800; }
.activity-entry small, .activity-time { color: var(--muted); font-size: 11px; }

.privacy-note { display: flex; gap: 14px; max-width: 760px; margin-bottom: 25px; padding: 15px 18px; border: 1px solid rgba(45,92,77,.16); border-radius: 18px; background: var(--green-soft); }
.privacy-note > span { font-size: 23px; }
.privacy-note p { margin: 0; color: #405047; font-size: 12px; line-height: 1.55; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px,1fr)); gap: 16px; }
.loyalty-card { position: relative; min-height: 185px; padding: 20px; overflow: hidden; border-radius: 23px; color: #fff; background: var(--green); box-shadow: var(--shadow); }
.loyalty-card:nth-child(3n+2) { background: var(--orange); }
.loyalty-card:nth-child(3n+3) { color: var(--ink); background: var(--yellow); }
.loyalty-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -75px; bottom: -90px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; }
.loyalty-card header { display: flex; justify-content: space-between; align-items: start; }
.loyalty-card header span { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; opacity: .72; }
.loyalty-card h3 { margin: 28px 0 4px; font: 700 25px Georgia, serif; }
.loyalty-card p { margin: 0; font-size: 13px; opacity: .77; }
.loyalty-card footer { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 17px; display: flex; gap: 8px; }
.loyalty-card footer button { min-height: 44px; border: 1px solid rgba(255,255,255,.34); border-radius: 999px; padding: 8px 13px; color: inherit; background: rgba(255,255,255,.12); font-size: 11px; font-weight: 800; }
.loyalty-card:nth-child(3n+3) footer button { border-color: rgba(23,33,28,.22); }
.loyalty-card .card-last-used { margin-top: 7px; font-size: 10px; }
.recovery-list { display: grid; gap: 7px; max-width: 760px; margin-top: 18px; }
.recovery-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 11px 13px; border: 1px dashed var(--line); border-radius: 14px; background: rgba(255,253,248,.64); }
.recovery-row strong, .recovery-row small { display: block; }
.recovery-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.recovery-row button { min-height: 44px; }

.receipt-flow { max-width: 530px; display: flex; align-items: center; gap: 8px; margin-bottom: 24px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.receipt-flow i { height: 1px; flex: 1; background: var(--line); }
.receipt-list { display: grid; gap: 10px; }
.receipt-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; gap: 14px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.receipt-icon { width: 46px; height: 52px; display: grid; place-items: center; border-radius: 8px 8px 13px 13px; color: var(--green); background: var(--green-soft); font-size: 20px; }
.receipt-row strong { display: block; }
.receipt-row p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.status-badge { padding: 5px 9px; border-radius: 999px; color: #8a5318; background: #f7e7c2; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status-badge.confirmed { color: var(--green); background: var(--green-soft); }
.receipt-retention-note { margin-top: -9px; }
.receipt-row .proof-expired { color: #8a5318; }
.receipt-trip-label { display: block; margin-bottom: 4px; color: var(--orange); font-size: 10px; font-weight: 800; line-height: 1.35; }
.receipt-trip-field small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.receipt-icon { padding: 5px; font-size: 8px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.trip-end-card { width: min(620px,calc(100vw - 32px)); }
.trip-end-summary { margin: 0; color: var(--muted); line-height: 1.5; }
.checkout-loyalty, .checkout-receipt { padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.checkout-loyalty h3, .checkout-receipt h3 { margin: 0 0 8px; color: var(--green-dark); font-size: 15px; }
.checkout-loyalty p, .checkout-receipt p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
#checkout-loyalty-options, .checkout-receipt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.checkout-card-stage { display: grid; justify-items: center; gap: 8px; margin-top: 12px; padding: 12px; border-radius: 14px; background: #fff; }
.checkout-card-stage img { width: min(100%,390px); max-height: 210px; object-fit: contain; }
.checkout-card-stage small { color: var(--muted); font-size: 9px; text-align: center; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-card { padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,253,248,.82); }
.mobile-more-links { display: none; }
.mobile-more-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.settings-card.wide-card { grid-column: 1 / -1; }
.settings-card > header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.settings-card > header > div { display: flex; align-items: center; gap: 12px; }
.settings-card h2 { margin: 0; font: 700 19px Georgia, serif; }
.settings-card header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.setting-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--green); background: var(--green-soft); font-size: 18px; }
.store-config { border-top: 1px solid var(--line); padding: 14px 0 4px; }
.store-config:first-child { border-top: 0; }
.store-config > header { display: flex; justify-content: space-between; align-items: center; }
.store-config > header > div { min-width: 0; display: grid; gap: 3px; }
.store-config > header small { color: var(--muted); }
.store-config strong { font-size: 14px; }
.store-config header button { min-height: 44px; border: 0; color: var(--green); background: none; font-size: 12px; font-weight: 800; }
.aisle-route { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.aisle-chip { min-height: 50px; display: inline-flex; align-items: center; gap: 7px; padding: 3px 3px 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 11px; cursor: grab; }
.aisle-chip .aisle-position { color: var(--muted); }
.aisle-chip .aisle-name { color: var(--ink); }
.aisle-move-controls { display: inline-flex; gap: 2px; margin-left: 2px; cursor: default; }
.aisle-move { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--green); background: var(--green-soft); font: 900 16px/1 Inter, sans-serif; }
.aisle-move:disabled { color: var(--muted); background: var(--paper-deep); opacity: .42; }
.aisle-route.is-saving { opacity: .65; pointer-events: none; }
.token-list { display: grid; gap: 8px; margin-top: 14px; }
.token-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 11px; border-radius: 13px; background: var(--paper); }
.token-row strong { font-size: 12px; }
.token-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.token-row button { min-height: 44px; border: 0; color: var(--red); background: none; font-size: 11px; font-weight: 800; }
.settings-logout { margin-top: 9px; }

dialog { padding: 0; border: 0; color: var(--ink); background: transparent; }
dialog::backdrop { background: rgba(12,25,20,.48); backdrop-filter: blur(6px); }
.sheet-dialog { width: min(720px, calc(100vw - 28px)); max-height: min(90vh, 850px); overflow: auto; border-radius: 25px; }
.dialog-card { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 26px; background: var(--card); }
.dialog-card > header, .dialog-card > footer, .full { grid-column: 1 / -1; }
.dialog-card > header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 6px; }
.dialog-card h2 { margin: 0; font: 700 28px Georgia, serif; }
.dialog-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--paper-deep); font-size: 21px; }
.dialog-card > footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 5px; }
.field-with-action { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-top: 7px; }
.field-with-action .button { min-width: 82px; }
.dialog-card details { border: 1px solid var(--line); border-radius: 15px; padding: 12px 14px; }
.dialog-card summary { cursor: pointer; color: var(--green); font-size: 12px; font-weight: 800; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 15px; }
.upload-field { padding: 17px; border: 1px dashed rgba(45,92,77,.35); border-radius: 15px; background: rgba(219,231,223,.28); }
.upload-field input { padding: 10px 0 0; border: 0; background: transparent; box-shadow: none; }
.upload-field em, .hint { color: var(--muted); font-size: 10px; font-style: normal; line-height: 1.5; }
.scope-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; border: 0; padding: 0; }
.scope-list legend { margin-bottom: 8px; font-size: 12px; font-weight: 800; }
.scope-list label { grid-template-columns: auto 1fr; align-items: center; gap: 8px; padding: 9px; border-radius: 10px; background: var(--paper); font-weight: 600; }
.scope-list input { width: 17px; height: 17px; accent-color: var(--green); }
.compact-dialog { grid-template-columns: 1fr; }
.large-dialog { width: min(900px, calc(100vw - 28px)); }
.receipt-step { display: grid; gap: 15px; }
.receipt-step footer { display: flex; justify-content: flex-end; gap: 9px; }
.receipt-step footer > span { flex: 1; }
.receipt-preview { min-height: 260px; max-height: 420px; display: grid; place-items: center; overflow: auto; border-radius: 15px; background: #e7e4dc; }
.receipt-preview img { max-width: 100%; max-height: 420px; object-fit: contain; }
.receipt-preview #receipt-preview-pdf { margin: 24px; }
.receipt-matches { display: grid; gap: 8px; }
.receipt-match { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(170px,.8fr); align-items: center; gap: 12px; padding: 11px; border-radius: 13px; background: var(--paper); }
.receipt-match > span { color: var(--muted); }
.receipt-match small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.receipt-match.is-ignored { opacity: .64; }
.receipt-confirm-summary { margin: 0; padding: 12px 14px; border-radius: 13px; color: #405047; background: var(--green-soft); font-size: 11px; line-height: 1.5; }
.receipt-confirm-summary.is-error { color: var(--red); background: #fff0eb; }
.confirmed-proof { display: grid; gap: 5px; padding: 16px; border: 1px solid rgba(45,92,77,.18); border-radius: 16px; background: var(--green-soft); }
.confirmed-proof strong { font: 700 20px Georgia, serif; }
.confirmed-proof p { margin: 0; color: var(--muted); font-size: 11px; }
.confirmed-lines .receipt-match { grid-template-columns: minmax(0,1fr) auto; }
.confirmed-lines .receipt-match > span { color: var(--green); font-weight: 800; }

.reveal-dialog { width: min(520px, calc(100vw - 28px)); border-radius: 26px; }
.reveal-card { position: relative; padding: 29px; text-align: center; background: var(--card); }
.reveal-card .dialog-close { position: absolute; right: 16px; top: 16px; }
.reveal-card h2 { margin: 0 0 20px; font: 700 29px Georgia, serif; }
.barcode-stage { min-height: 310px; display: grid; place-items: center; padding: 18px; border-radius: 20px; background: #fff; }
.barcode-stage img { max-width: 100%; max-height: 360px; image-rendering: auto; }
.reveal-card > p:last-child { color: var(--muted); font-size: 11px; }
.token-secret-card { text-align: left; }
.secret-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; }
.secret-row code { max-height: 120px; overflow: auto; padding: 13px; border-radius: 12px; background: var(--paper); word-break: break-all; font-size: 11px; }

.toast-region { position: fixed; z-index: 100; right: 22px; bottom: calc(22px + var(--safe-bottom)); display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 340px; padding: 12px 16px; border-radius: 14px; color: #fff; background: var(--green-dark); box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease-out; }
.toast.is-error { background: var(--red); }
.install-suggestion { width: min(390px, calc(100vw - 44px)); padding: 18px; border: 1px solid rgba(45,92,77,.2); border-radius: 20px; background: var(--card); box-shadow: 0 18px 45px rgba(25,61,51,.2); pointer-events: auto; animation: toast-in .2s ease-out; }
.install-suggestion strong { display: block; color: var(--green-dark); font: 700 19px Georgia, serif; }
.install-suggestion p { margin: 7px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.install-suggestion-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.install-suggestion-actions .button { min-height: 44px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(9px); } }

/* Fast, progressive shopping controls */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.quick-composer { position: relative; z-index: 9; margin-bottom: 16px; }
.quick-composer .quick-add { grid-template-columns: minmax(0,1fr) 86px auto; margin: 0; padding: 7px; }
.quick-name, .quick-quantity { display: block; }
.quick-name input, .quick-quantity input { min-height: 44px; }
.quick-quantity { position: relative; border-left: 1px solid var(--line); }
.quick-quantity::before { content: "×"; position: absolute; z-index: 1; left: 7px; top: 50%; color: var(--muted); font-size: 12px; transform: translateY(-50%); pointer-events: none; }
.quick-quantity input { padding-left: 22px !important; text-align: center; }
.quick-submit { min-width: 66px; min-height: 44px; }
.quick-tools { display: flex; justify-content: flex-end; gap: 15px; padding: 8px 10px 0; }
.quick-tools button { min-height: 44px; padding: 3px 0; border: 0; color: var(--green); background: transparent; font-size: 11px; font-weight: 800; }
.quick-suggestions { position: absolute; z-index: 14; top: calc(100% - 31px); left: 0; right: 0; max-height: min(520px, 64vh); overflow: auto; padding: 12px; border: 1px solid rgba(45,92,77,.2); border-radius: 0 0 20px 20px; background: var(--card); box-shadow: 0 22px 48px rgba(25,61,51,.18); overscroll-behavior: contain; }
.generic-suggestion { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 0; border-radius: 14px; padding: 10px 13px; color: var(--ink); background: var(--green-soft); text-align: left; }
.generic-suggestion strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.generic-suggestion span { flex: none; color: var(--green); font-size: 11px; font-weight: 850; }
.generic-suggestion.is-key-active, .generic-option.is-key-active, .recent-suggestions button.is-key-active, .product-option.is-key-active { outline: 3px solid rgba(45,92,77,.28); outline-offset: 2px; }
.generic-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 42%); gap: 9px; overflow-x: auto; padding: 1px 1px 9px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.generic-rail::-webkit-scrollbar { display: none; }
.generic-option { min-width: 0; min-height: 76px; display: grid; grid-template-columns: 48px minmax(0,1fr) 22px; gap: 9px; align-items: center; padding: 8px 10px; border: 1px solid rgba(45,92,77,.18); border-radius: 14px; color: var(--ink); background: var(--green-soft); text-align: left; scroll-snap-align: start; }
.generic-option:hover, .generic-option:focus-visible { border-color: var(--green); box-shadow: 0 6px 16px rgba(45,92,77,.1); }
.generic-copy { min-width: 0; display: grid; gap: 2px; }
.generic-option strong, .generic-option small, .generic-offer-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.generic-option small { color: var(--muted); font-size: 11px; }
.generic-option b { color: var(--green); font-size: 20px; }
.generic-thumb { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #fff; font-size: 19px; }
.generic-offer-summary { color: var(--green-dark); font-size: 10px; font-weight: 800; }
.generic-grid { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 10px; margin-bottom: 14px; }
.canonical-option { min-width: 0; overflow: hidden; border: 1px solid rgba(45,92,77,.18); border-radius: 16px; background: var(--green-soft); }
.canonical-option .canonical-select { width: 100%; min-height: 90px; grid-template-columns: 58px minmax(0,1fr) 22px; border: 0; border-radius: 0; background: transparent; }
.canonical-option .canonical-select:hover, .canonical-option .canonical-select:focus-visible { box-shadow: inset 0 0 0 2px var(--green); transform: none; }
.canonical-offers { border-top: 1px solid rgba(45,92,77,.16); background: rgba(255,255,255,.72); }
.canonical-offers summary { min-height: 44px; display: flex; align-items: center; padding: 8px 12px; color: var(--green-dark); cursor: pointer; font-size: 11px; font-weight: 850; }
.canonical-offers summary:focus-visible { outline: 3px solid rgba(45,92,77,.28); outline-offset: -3px; }
.canonical-offer-list { display: grid; gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.canonical-offer { min-width: 0; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 9px 11px; background: #fff; }
.canonical-offer .offer-thumb { width: 42px; height: 48px; }
.canonical-offer-copy { min-width: 0; display: grid; gap: 4px; }
.canonical-offer-copy > strong { min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 11px; }
.canonical-offer-copy > small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.canonical-offer-meta { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; }
.canonical-offer-link { min-height: 44px; display: inline-flex; align-items: center; padding: 7px; color: var(--green); font-size: 10px; font-weight: 850; }
.canonical-offer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.canonical-offer .canonical-health-button { position: static; min-height: 44px; padding: 7px 10px; }
.image-attribution { display: block; padding: 8px 12px 10px; color: var(--muted); font-size: 10px; }
#product-search-results > .image-attribution { grid-column: 1 / -1; }
.image-attribution a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.suggestion-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 13px 2px 8px; }
.suggestion-heading strong { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; }
.suggestion-heading small { color: var(--muted); font-size: 10px; }
.retailer-filter-rail { display: flex; gap: 7px; overflow-x: auto; padding: 2px 1px 9px; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-inline: contain; touch-action: pan-x; }
.retailer-filter-rail::-webkit-scrollbar, .product-rail::-webkit-scrollbar { display: none; }
.specific-product-filters { grid-column: 1 / -1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 10px; }
.specific-filter-toggle { min-height: 44px; flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; color: var(--muted); background: var(--card); font-size: 10px; font-weight: 850; }
.specific-filter-toggle.is-open, .specific-filter-toggle.has-filters { color: #fff; border-color: var(--green); background: var(--green); }
.specific-filter-panel { display: none; width: 100%; align-items: center; flex-wrap: wrap; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.specific-product-filters.is-open .specific-filter-panel { display: flex; }
.specific-product-filters.is-compact { flex-wrap: nowrap; overflow-x: auto; margin-top: -2px; scrollbar-width: none; }
.specific-product-filters.is-compact::-webkit-scrollbar { display: none; }
.specific-product-filters.is-compact.is-open { flex-wrap: wrap; overflow: visible; }
.specific-filter-count { flex: none; padding: 0 4px; color: var(--muted); font-size: 10px; font-weight: 800; white-space: nowrap; }
.specific-filter-chip { min-height: 44px; flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; color: var(--muted); background: var(--card); font-size: 10px; font-weight: 850; white-space: nowrap; }
.specific-filter-chip.is-active { color: #fff; border-color: var(--green); background: var(--green); }
.specific-sort { min-width: 126px; flex: 1 1 126px; }
.specific-sort select { min-height: 44px; border-radius: 999px; padding: 7px 30px 7px 11px; color: var(--ink); background: var(--card); font-size: 10px; font-weight: 800; }
.specific-filter-empty { min-width: min(310px,80vw); margin: 0; padding: 22px 14px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; font-size: 11px; }
.retailer-chip { min-width: max-content; min-height: 44px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px 6px 7px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 800; scroll-snap-align: start; }
.retailer-chip.is-active { color: #fff; border-color: var(--green); background: var(--green); }
.retailer-chip small { max-width: 58px; overflow: hidden; color: inherit; opacity: .68; font-size: 8px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.retailer-mark { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: 9px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.retailer-mark img { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: contain; background: #fff; }
.retailer-mark.retailer-aldi img, .retailer-mark.retailer-lidl img, .retailer-mark.retailer-dunnes-stores img, .retailer-mark.retailer-supervalu img, .retailer-mark.retailer-tesco img { padding: 0; background: transparent; }
.retailer-chip.is-active .retailer-mark { color: var(--green-dark); background: #fff; }
.retailer-mark.retailer-tesco { color: #fff; background: #00539f; }
.retailer-mark.retailer-aldi { color: #fff; background: #00005f; }
.retailer-mark.retailer-lidl { color: #0050aa; background: #0050aa; }
.retailer-mark.retailer-dunnes-stores { color: #111; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.retailer-mark.retailer-supervalu { color: #c8102e; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.retailer-chip.is-active .retailer-mark.retailer-tesco,
.retailer-chip.is-active .retailer-mark.retailer-aldi,
.retailer-chip.is-active .retailer-mark.retailer-lidl,
.retailer-chip.is-active .retailer-mark.retailer-dunnes-stores,
.retailer-chip.is-active .retailer-mark.retailer-supervalu { background: #fff; }
.product-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(238px, 45%); gap: 9px; overflow-x: auto; padding: 1px 1px 9px; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-inline: contain; touch-action: pan-x; }
.product-option { min-width: 0; display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 10px; align-items: center; min-height: 118px; border: 1px solid var(--line); border-radius: 15px; padding: 9px; background: #fff; text-align: left; scroll-snap-align: start; transition: border .16s, transform .16s, box-shadow .16s; }
.product-option:hover, .product-option:focus-visible, .product-option.is-selected { border-color: var(--green); box-shadow: 0 7px 18px rgba(45,92,77,.11); transform: translateY(-1px); }
.product-option.is-unavailable { border-style: dashed; background: #f9f7f3; }
.product-thumb { width: 48px; height: 58px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; color: var(--green); background: var(--paper); font: 800 12px Georgia, serif; }
.product-thumb.item-product-thumb { width: 42px; height: 50px; }
.product-thumb > * { grid-area: 1 / 1; }
.product-thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.generic-option .generic-thumb { width: 48px; height: 58px; }
.canonical-option .canonical-select .generic-thumb { width: 58px; height: 70px; }
.product-image-fallback { opacity: .72; }
.product-copy { min-width: 0; }
.product-copy > small { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.product-source > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.freshness-label { margin-left: auto; color: var(--green); font-size: 8px; white-space: nowrap; }
.product-copy strong { display: -webkit-box; margin: 4px 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 12px; line-height: 1.25; }
.product-details { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.product-facts { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.availability-pill { width: max-content; max-width: 100%; display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 6px; color: var(--muted); background: var(--paper-deep); font-size: 8px; font-weight: 800; line-height: 1.35; white-space: nowrap; }
.availability-available, .availability-in-stock { color: var(--green-dark); background: var(--green-soft); }
.availability-limited, .availability-low-stock { color: #744300; background: #fff0cd; }
.availability-unavailable, .availability-out-of-stock { color: #8c2c26; background: #f9ded9; }
.product-prices { min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 7px; }
.member-price { display: inline-flex; align-items: baseline; gap: 5px; color: var(--green-dark); font-size: 12px; }
.member-price span { border-radius: 999px; padding: 2px 5px; color: #fff; background: var(--green); font-size: 7px; font-weight: 900; line-height: 1.3; text-transform: uppercase; letter-spacing: .03em; }
.regular-price { color: var(--muted); font-size: 9px; white-space: nowrap; }
.regular-only-price { color: var(--ink); font-size: 12px; }
.price-unknown { color: var(--muted); font-size: 9px; }
.product-source-note { margin: 8px 2px 0; color: var(--muted); font-size: 10px; }
.product-skeleton { min-height: 118px; border-radius: 15px; background: linear-gradient(100deg,var(--paper-deep) 30%,#faf8f2 45%,var(--paper-deep) 60%); background-size: 300% 100%; animation: shimmer 1.1s infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.list-filter-tools { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.compact-select select { min-height: 44px; border-radius: 999px; padding: 7px 28px 7px 11px; color: var(--muted); background: rgba(255,255,255,.65); font-size: 11px; font-weight: 750; }
.item-essential { display: grid; grid-template-columns: minmax(0,1fr) 94px; gap: 12px; }
.item-more-options > summary { display: flex; align-items: center; justify-content: space-between; }
.item-more-options > summary span, .product-search-trigger span { color: var(--muted); font-size: 10px; font-weight: 600; }
.product-search-trigger { min-height: 50px; display: flex; justify-content: space-between; align-items: center; border: 1px dashed rgba(45,92,77,.34); border-radius: 14px; padding: 12px 14px; color: var(--green); background: rgba(219,231,223,.22); font-weight: 800; text-align: left; }
.selected-product { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 11px; border: 1px solid rgba(45,92,77,.22); border-radius: 15px; background: var(--green-soft); }
.selected-product strong { display: block; font-size: 13px; }
.selected-product small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.selected-product-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; margin-top: 6px; }
.selected-product-meta .product-prices { display: inline-flex; }
.selected-product a { display: inline-flex; margin-top: 5px; color: var(--green); font-size: 10px; font-weight: 850; }
.selected-product button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.65); }
.item-dialog-footer { display: grid !important; grid-template-columns: auto 1fr auto auto; position: sticky; bottom: -26px; z-index: 2; margin: 4px -26px -26px !important; padding: 14px 26px calc(14px + var(--safe-bottom)); border-top: 1px solid var(--line); background: rgba(255,253,248,.96); backdrop-filter: blur(12px); }
.product-search-dialog-card { grid-template-columns: 1fr; }
.product-search-input input { font-size: 17px; }
.product-search-results { display: grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: 10px; min-height: 160px; }
.product-search-results .product-option { width: 100%; }
.search-section-heading { grid-column: 1 / -1; }
.search-empty { grid-column: 1 / -1; padding: 40px 16px; color: var(--muted); text-align: center; }

.shop-control-head { display: none; }
.shop-mobile-command { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.shop-icon-bar { display: flex; align-items: center; gap: 6px; }
.shop-icon-bar .icon-button { width: 44px; height: 44px; }
.shop-shoppers { display: flex; align-items: center; margin-left: auto; padding-right: 4px; }
.shop-shoppers[hidden] { display: none; }
.shop-shopper { width: 28px; height: 28px; margin-left: -8px; display: grid; place-items: center; border: 2px solid var(--card); border-radius: 50%; color: #fff; background: var(--green); font-size: 11px; font-weight: 850; }
.shop-shopper:first-child { margin-left: 0; }
.shop-shopper.is-self { background: var(--orange); }
.shop-shopper.is-more { background: var(--ink); font-size: 9px; }
.sheet-backdrop { position: fixed; z-index: 34; inset: 0; border: 0; background: rgba(12,25,20,.44); }

.scanner-dialog { width: min(640px, 100vw); height: min(880px, 100dvh); max-width: none; max-height: none; border-radius: 28px; overflow: hidden; background: #0d1713; }
.scanner-shell { min-height: 100%; display: flex; flex-direction: column; color: #fff; background: #0d1713; }
.scanner-shell > header { min-height: 68px; display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 10px; padding: 10px 14px; }
.scanner-shell > header div { display: grid; text-align: center; }
.scanner-shell > header strong { font: 700 20px Georgia,serif; }
.scanner-shell > header small { margin-top: 3px; color: rgba(255,255,255,.65); font-size: 10px; }
.scanner-close, .scanner-torch { width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; color: #fff; background: rgba(255,255,255,.1); font-size: 20px; }
.scanner-modes { align-self: center; display: flex; gap: 3px; margin: 3px 14px 12px; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.1); }
.scanner-modes button { min-height: 44px; border: 0; border-radius: 999px; padding: 7px 15px; color: rgba(255,255,255,.7); background: transparent; font-size: 11px; font-weight: 850; }
.scanner-modes button.is-active { color: var(--ink); background: #fff; }
.scanner-camera { position: relative; min-height: 320px; flex: 1; display: grid; place-items: center; overflow: hidden; background: #15241e; }
.scanner-camera video { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.scanner-frame { position: relative; z-index: 2; width: min(76%,410px); aspect-ratio: 1.65; border: 2px solid rgba(255,255,255,.9); border-radius: 22px; box-shadow: 0 0 0 999px rgba(5,12,9,.36); }
.scanner-camera > p { position: absolute; z-index: 3; bottom: 18px; margin: 0; padding: 8px 12px; border-radius: 999px; background: rgba(5,12,9,.7); font-size: 11px; }
.scanner-result { min-height: 74px; padding: 12px 16px 2px; }
.scanner-result-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 12px; border-radius: 15px; color: var(--ink); background: #fff; }
.scanner-result-card small { display: block; margin-top: 4px; color: var(--muted); }
.scanner-product-card { display: grid; gap: 11px; max-height: min(430px,46dvh); overflow-y: auto; padding: 13px; border-radius: 17px; color: var(--ink); background: #fff; }
.scanner-product-card > header, .health-product-head { display: grid; grid-template-columns: 58px minmax(0,1fr); align-items: center; gap: 11px; }
.scanner-product-card > header strong, .health-product-head strong { display: block; }
.scanner-product-card > header small, .health-product-head small { display: block; margin-top: 4px; color: var(--muted); }
.scan-product-thumb { width: 58px; height: 70px; }
.scan-health { display: grid; gap: 8px; padding: 11px; border: 1px solid rgba(45,92,77,.18); border-radius: 14px; background: var(--green-soft); }
.scan-health > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scan-health p { margin: 0; font-size: 11px; line-height: 1.45; }
.scan-health details p { margin-top: 7px; }
.scan-health footer { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.scan-health footer a { flex: none; color: var(--green); font-size: 10px; font-weight: 850; }
.nutri-score { width: 47px; height: 47px; flex: none; display: grid; place-items: center; border-radius: 12px; color: #fff; font-size: 22px; font-weight: 950; }
.nutri-score small { margin: 0; color: inherit; font-size: 7px; line-height: 1; }
.nutri-score.grade-a { background: #16834b; }.nutri-score.grade-b { background: #73a934; }.nutri-score.grade-c { background: #d3ac24; }.nutri-score.grade-d { background: #df7a24; }.nutri-score.grade-e { background: #b83d32; }
.scan-health-missing { color: var(--muted); font-size: 9px; font-weight: 800; }
.scan-score-source { color: var(--muted); }
.scan-nutrients { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.scan-nutrients span { padding: 6px; border-radius: 9px; background: #fff; font-size: 10px; }
.scan-nutrients b { display: block; color: var(--muted); font-size: 8px; }
.scan-verify-warning { padding: 8px; border-radius: 9px; color: #74451f; background: #fff3df; }
.scan-add-controls { display: grid; grid-template-columns: minmax(80px,.55fr) minmax(130px,1fr) auto; align-items: end; gap: 8px; }
.scan-add-controls label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 800; }
.scan-add-controls input, .scan-add-controls select { min-height: 44px; padding: 8px 10px; }
.product-health-result { position: relative; min-width: 0; }
.product-health-result .product-option { padding-bottom: 52px; }
.product-health-button { position: absolute; z-index: 2; right: 10px; bottom: 5px; min-height: 44px; border: 1px solid rgba(45,92,77,.2); border-radius: 999px; padding: 7px 11px; color: var(--green); background: #fff; font-size: 10px; font-weight: 850; }
.product-health-button:focus-visible { outline: 3px solid rgba(45,92,77,.42); outline-offset: 2px; }
.health-facts-dialog { width: min(580px,calc(100vw - 24px)); }
.health-facts-card { grid-template-columns: 1fr; }
.health-facts-content { display: grid; gap: 12px; }
.health-dialog-loading { display: grid; gap: 5px; min-height: 130px; place-content: center; color: var(--muted); text-align: center; }
.scanner-fallbacks { display: flex; justify-content: center; gap: 8px; padding: 12px 16px calc(16px + var(--safe-bottom)); }
.scanner-fallbacks .button { color: #fff; border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.08); }
.manual-code { grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 9px; padding: 0 16px 16px; }
.manual-code label { color: #fff; }

.import-card { grid-template-columns: 1fr; }
.import-card footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 13px; }
.import-summary { display: flex; align-items: center; justify-content: space-between; }
.import-rows { display: grid; gap: 8px; margin-top: 12px; }
.import-row { display: grid; grid-template-columns: auto minmax(0,1fr) 74px 92px; gap: 8px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.import-row > input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--green); }
.import-row input { padding: 9px; }
.import-row.is-optional { border-style: dashed; }
.import-note-field { grid-column: 2 / -1; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 9px; color: var(--muted); font-size: 10px; }
.import-note-field > span { min-width: max-content; color: var(--orange); font-weight: 850; }
.import-note-field input { min-width: 0; }
.import-match { grid-column: 2 / -1; }
.import-product-summary { display: grid; grid-template-columns: 38px minmax(0,1fr) 44px; gap: 9px; align-items: center; margin-bottom: 6px; padding: 8px; border-radius: 12px; background: var(--green-soft); }
.import-product-thumb { width: 38px; height: 46px; }
.import-product-choices { display: grid; gap: 6px; margin-bottom: 6px; }
.use-import-suggestion { min-width: 0; min-height: 52px; display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 9px; border: 0; border-radius: 12px; padding: 7px; color: var(--ink); background: var(--green-soft); text-align: left; }
.use-import-suggestion strong, .use-import-suggestion small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.use-import-suggestion small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.import-product-summary strong, .import-product-summary small { display: block; }
.import-product-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.import-product-summary small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.import-product-summary button { min-width: 44px; min-height: 44px; border: 0; border-radius: 999px; padding: 6px 9px; color: var(--green); background: rgba(255,255,255,.68); font-weight: 850; }
.import-product-button { min-height: 44px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; color: var(--green); background: #fff; font-size: 10px; font-weight: 850; }

.more-dialog { width: min(420px,calc(100vw - 28px)); border-radius: 25px; }
.more-sheet { padding: 23px; background: var(--card); }
.more-sheet > header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 10px; }
.more-sheet h2 { margin: 0; font: 700 29px Georgia,serif; }
.more-sheet nav { display: grid; gap: 5px; margin: 12px 0 18px; }
.more-sheet nav > button { min-height: 58px; display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 11px; border: 0; border-radius: 14px; padding: 8px 10px; background: transparent; text-align: left; }
.more-sheet nav > button[hidden], .shop-toolbar .icon-button[hidden] { display: none; }
.more-sheet nav > button:hover { background: var(--paper); }
.more-sheet nav > button > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--green); background: var(--green-soft); font-size: 18px; }
.more-sheet nav strong, .more-sheet nav small { display: block; }
.more-sheet nav small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.more-sheet nav > button.danger-row { color: var(--red); }
.more-sheet nav > button.danger-row > span { color: var(--red); background: rgba(168,65,50,.08); }
.item-copy.edit-item, .item-copy.history-item { position: relative; width: 100%; min-width: 0; min-height: 44px; display: block; border: 0; padding: 0 48px 0 0; background: transparent; text-align: left; }
.item-edit-cue { position: absolute; top: 4px; right: 1px; color: var(--green); font-size: 10px; font-weight: 850; opacity: .72; }
.item-copy:hover .item-edit-cue, .item-copy:focus-visible .item-edit-cue { opacity: 1; }
.item-actions .edit-icon { font-size: 16px; }
.item-card.is-acting { border-color: var(--green); background: var(--green-soft); transform: scale(.985); opacity: .62; }
.item-action-quantity { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 13px 0 8px; padding: 11px 10px 11px 13px; border: 1px solid rgba(45,92,77,.18); border-radius: 15px; background: var(--green-soft); }
.item-action-quantity[hidden] { display: none; }
.item-action-quantity strong, .item-action-quantity small { display: block; }
.item-action-quantity small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.item-quantity-stepper { display: grid; grid-template-columns: 44px minmax(54px,auto) 44px; align-items: center; overflow: hidden; border: 1px solid rgba(45,92,77,.22); border-radius: 999px; background: #fff; }
.item-quantity-stepper button { width: 44px; height: 44px; border: 0; color: var(--green); background: transparent; font-size: 20px; font-weight: 800; }
.item-quantity-stepper button:hover:not(:disabled) { background: var(--paper-deep); }
.item-quantity-stepper button:disabled { color: var(--muted); opacity: .4; }
.item-quantity-stepper output { min-width: 54px; padding: 0 4px; color: var(--ink); font-size: 13px; font-weight: 850; text-align: center; }
.recent-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.recent-suggestions button { min-height: 44px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: var(--ink); background: #fff; font-size: 11px; }
.recent-suggestions button span { color: var(--muted); }
.repeat-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 240px); gap: 8px; overflow-x: auto; padding: 2px 1px 7px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.repeat-option { display: grid; grid-template-columns: 34px minmax(0,1fr) 24px; align-items: center; gap: 9px; min-height: 58px; border: 1px solid rgba(45,92,77,.18); border-radius: 14px; padding: 8px 9px; color: var(--ink); background: #fff; text-align: left; scroll-snap-align: start; }
.repeat-option > span:nth-child(2), .repeat-option strong, .repeat-option small { display: block; min-width: 0; }
.repeat-option strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.repeat-option small { margin-top: 3px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.repeat-option b { color: var(--orange); font-size: 18px; text-align: center; }
.repeat-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: var(--green); background: var(--green-soft); font-size: 18px; }
.repeat-option:hover, .repeat-option.is-key-active { border-color: var(--orange); background: var(--paper); }
.show-all-products { width: 100%; min-height: 44px; border: 0; border-radius: 12px; color: var(--green); background: transparent; font-size: 11px; font-weight: 850; }
.action-toast { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto 36px; align-items: center; gap: 9px; overflow: hidden; padding: 10px 8px 10px 14px; pointer-events: auto; touch-action: pan-y; will-change: transform, opacity; }
.action-toast button { min-height: 44px; border: 0; border-radius: 999px; padding: 6px 10px; color: var(--green-dark); background: #fff; font-size: 11px; font-weight: 900; }
.action-toast .action-toast-close { width: 36px; min-height: 36px; padding: 0; color: rgba(255,255,255,.76); background: transparent; font-size: 18px; }
.action-toast-progress { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: rgba(255,255,255,.64); transform: scaleX(1); transform-origin: left; }
.action-toast-progress.is-running { animation-name: toast-progress; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes toast-progress { to { transform: scaleX(0); } }
.scan-result-actions { display: flex; gap: 7px; }
.scan-result-actions .button { white-space: nowrap; }
.unknown-scan { grid-template-columns: minmax(0,1fr) auto; }
.unknown-scan label { margin-top: 8px; }
.unknown-scan input { padding: 10px 12px; }
@media (max-width: 560px) { .scan-add-controls { grid-template-columns: 1fr 1fr; }.scan-add-controls .button { grid-column: 1 / -1; }.scan-nutrients { grid-template-columns: repeat(2,minmax(0,1fr)); } }

.recipe-search { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; margin-bottom: 13px; padding: 7px; border: 1px solid rgba(45,92,77,.16); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.recipe-search input { min-height: 44px; border: 0; padding: 10px 12px; background: transparent; box-shadow: none; font-size: 16px; }
.recipe-tabs { width: max-content; margin-bottom: 10px; }
.recipe-source-note { margin: 0 0 16px; color: var(--muted); font-size: 10px; }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 12px; }
.recipe-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 6px 18px rgba(40,50,43,.05); }
.recipe-open { width: 100%; min-height: 150px; display: grid; grid-template-columns: 112px minmax(0,1fr); align-items: stretch; border: 0; padding: 0; background: transparent; text-align: left; }
.recipe-art { display: grid; place-items: center; align-content: center; gap: 6px; color: #fff; background: linear-gradient(145deg,var(--green),#4a806d); }
.recipe-art b { font: 700 43px Georgia,serif; }
.recipe-art small { font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; opacity: .72; }
.recipe-card:nth-child(3n+2) .recipe-art { background: linear-gradient(145deg,var(--orange),#e68c55); }
.recipe-card:nth-child(3n+3) .recipe-art { color: var(--ink); background: linear-gradient(145deg,var(--yellow),#f5df9a); }
.recipe-card-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 17px 42px 17px 15px; }
.recipe-card-copy > small { color: var(--orange); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.recipe-card-copy > strong { display: -webkit-box; margin: 7px 0 10px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font: 700 18px/1.13 Georgia,serif; }
.recipe-card-copy > span { color: var(--muted); font-size: 10px; }
.recipe-bookmark { position: absolute; right: 9px; top: 9px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--green); background: rgba(255,255,255,.9); font-size: 20px; }
.recipe-bookmark.is-saved { color: #a86805; background: #fff4d8; }
.recipe-skeleton { min-height: 150px; border-radius: 20px; background: linear-gradient(100deg,var(--paper-deep) 30%,#faf8f2 45%,var(--paper-deep) 60%); background-size: 300% 100%; animation: shimmer 1.1s infinite; }
.recipe-detail-card { grid-template-columns: 1fr; }
.recipe-detail-hero { min-height: 120px; display: grid; grid-template-columns: 100px minmax(0,1fr); align-items: center; gap: 16px; padding: 14px; border-radius: 18px; background: var(--paper); }
.recipe-detail-art { width: 100px; height: 100px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: var(--green); font: 700 40px Georgia,serif; }
.recipe-detail-hero p { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.recipe-detail-hero small { display: block; margin-top: 8px; color: var(--orange); font-size: 10px; }
.recipe-ingredient-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.recipe-ingredient-head .text-button { margin: 0; }
#recipe-ingredient-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.recipe-ingredient { display: grid; gap: 6px; min-height: 52px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; font-weight: 600; }
.recipe-ingredient > label { grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.recipe-ingredient input { width: 20px; height: 20px; accent-color: var(--green); }
.recipe-ingredient strong, .recipe-ingredient small { display: block; }
.recipe-ingredient strong { font-size: 12px; }
.recipe-ingredient small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 500; }
.recipe-product-match { min-width: 0; min-height: 44px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 7px; border: 0; border-radius: 10px; padding: 6px; color: var(--ink); background: var(--green-soft); text-align: left; }
.recipe-product-thumb { width: 34px; height: 41px; }
.recipe-product-match strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.recipe-product-match small { font-size: 8px; }
.recipe-product-match em { color: var(--green); font-size: 9px; font-style: normal; font-weight: 850; }
.recipe-product-match.empty { display: block; min-height: 44px; color: var(--green); border: 1px dashed rgba(45,92,77,.28); background: transparent; font-size: 10px; font-weight: 850; text-align: center; }
.recipe-dialog-footer { display: grid !important; grid-template-columns: auto 1fr auto auto; position: sticky; bottom: -26px; z-index: 2; margin: 4px -26px -26px !important; padding: 14px 26px calc(14px + var(--safe-bottom)); border-top: 1px solid var(--line); background: rgba(255,253,248,.96); backdrop-filter: blur(12px); }

@media (max-width: 900px) {
  .access-screen { grid-template-columns: 1fr; }
  .access-art { display: none; }
  .access-card { padding: 35px 0 60px; }
  .access-card .wordmark { margin-bottom: 68px; }
  .sidebar { display: none; }
  .workspace { margin-left: 0; padding: 64px 18px calc(88px + var(--safe-bottom)); }
  .install-suggestion { width: 100%; }
  .mobile-header { position: fixed; inset: 0 0 auto; z-index: 20; height: 56px; display: flex; align-items: center; padding: 6px 14px; border-bottom: 1px solid var(--line); background: rgba(246,243,235,.94); backdrop-filter: blur(18px); }
  .mobile-header .wordmark { min-height: 44px; }
  .mobile-header .brand-seal { width: 38px; height: 38px; font-size: 20px; }
  .mobile-header .wordmark strong { font-size: 18px; }
  .mobile-nav { position: fixed; z-index: 30; inset: auto 0 0; height: calc(66px + var(--safe-bottom)); display: grid; grid-template-columns: 1fr 76px 1fr; align-items: start; padding: 6px 18px var(--safe-bottom); border-top: 1px solid var(--line); background: rgba(255,253,248,.95); backdrop-filter: blur(18px); }
  .mobile-nav .nav-button { height: 54px; justify-content: center; display: grid; justify-items: center; gap: 1px; padding: 4px; border-radius: 12px; font-size: 18px; }
  .mobile-nav .nav-button > span { width: auto; font-size: 19px; }
  .mobile-nav .nav-button small { font-size: 11px; font-weight: 800; }
  .mobile-nav .nav-button.is-active { color: var(--green); background: var(--green-soft); box-shadow: none; }
  .mobile-add { width: 62px; height: 62px; display: grid; place-items: center; gap: 0; margin: -18px auto 0; border: 6px solid var(--card); border-radius: 50%; color: #fff; background: var(--orange); box-shadow: 0 8px 20px rgba(220,102,55,.25); font-size: 23px; }
  .mobile-add small { margin-top: -7px; font-size: 9px; font-weight: 850; }
  .view-heading { min-height: 0; margin-bottom: 25px; }
  .view-heading h1 { font-size: 42px; }
  .desktop-add { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .mobile-more-links { display: block; }
  .settings-card.wide-card { grid-column: auto; }
  .shop-toolbar { grid-template-columns: 1fr 1fr auto auto; }
  .shop-toolbar .button { grid-column: 1 / -1; }
  .running-total { right: 16px; bottom: calc(84px + var(--safe-bottom)); }
  .list-heading { display: none; }
  .quick-composer { position: sticky; top: 61px; z-index: 18; margin: 0 -2px 8px; }
  .quick-composer .quick-add { box-shadow: 0 8px 24px rgba(40,50,43,.11); }
  .quick-tools { display: none; padding-top: 4px; }
  .quick-composer:focus-within .quick-tools { display: flex; }
  .quick-suggestions { top: 55px; max-height: calc(100dvh - 190px); }
  .filter-row { min-height: 42px; margin-bottom: 8px; }
  .list-filter-tools { flex: 1; }
  .list-filter-tools .compact-select select { max-width: 104px; }
  .list-filter-tools .search-box { width: 42px; flex: 0 0 42px; overflow: hidden; transition: width .16s, flex-basis .16s; }
  .list-filter-tools .search-box:focus-within { width: 132px; flex-basis: 132px; }
  .item-card { min-height: 62px; border-radius: 15px; }
  .item-check { width: 44px; height: 44px; }
  .item-actions button { width: 44px; height: 44px; }
  .shop-heading { display: none; }
  .shop-mobile-command { position: sticky; z-index: 17; top: 61px; min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; padding: 5px 8px 5px 13px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,253,248,.96); box-shadow: 0 8px 24px rgba(40,50,43,.1); }
  .shop-mobile-count { color: var(--muted); font-size: 10px; }
  .shop-mobile-count strong { color: var(--green); font-size: 16px; }
  .shop-icon-bar { gap: 4px; }
  .shop-icon-bar .icon-button { width: 42px; height: 42px; }
  .shop-control-panel { position: fixed; z-index: 35; inset: auto 0 0; max-height: min(78dvh,680px); overflow: auto; padding: 18px 14px calc(20px + var(--safe-bottom)); border-radius: 25px 25px 0 0; background: var(--card); box-shadow: 0 -16px 44px rgba(20,35,27,.18); transform: translateY(105%); transition: transform .2s ease-out; }
  .shop-control-panel.is-open { transform: translateY(0); }
  .shop-control-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .shop-toolbar { grid-template-columns: 1fr 1fr auto auto; }
  .shop-options { margin-bottom: 0; }
  .shop-quick-setup { margin: 13px 0 0; background: var(--paper); }
  .shop-quick-setup > header { align-items: flex-start; }
  .shop-retailer-choice { min-height: 48px; }
  .shop-list { gap: 12px; padding-bottom: 20px; }
  .shop-item { min-height: 70px; border-radius: 16px; padding: 11px 12px; }
  .shop-item strong { font-size: 15px; }
  .shop-item p { margin-top: 4px; }
  .shop-item .shop-trolley, .shop-aisle-label { display: none; }
  .shop-item-actions button { min-width: 48px; height: 48px; }
  .more-dialog { width: 100vw; max-width: none; margin: auto 0 0; border-radius: 25px 25px 0 0; }
  .more-dialog[open] { position: fixed; top: auto; bottom: 0; }
  .recipe-heading { display: none; }
  .recipe-search { position: sticky; z-index: 17; top: 61px; margin-bottom: 9px; }
  .recipe-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .recipe-open { min-height: 132px; grid-template-columns: 88px minmax(0,1fr); }
  .recipe-card-copy { padding: 12px 36px 12px 11px; }
  .recipe-card-copy > strong { font-size: 15px; }
}

@media (max-width: 600px) {
  .workspace { padding-left: 12px; padding-right: 12px; }
  .view-heading { align-items: start; }
  .view-heading h1 { font-size: 37px; }
  .view-subtitle { font-size: 12px; }
  .filter-row { align-items: center; flex-wrap: wrap; gap: 7px; }
  .list-filter-tools { min-width: 230px; flex: 1 1 230px; }
  .list-filter-tools .compact-select { min-width: 0; max-width: 128px; flex: 1 1 104px; }
  .list-filter-tools .compact-select select { width: 100%; max-width: none; }
  .segment button { min-height: 44px; padding: 7px 10px; }
  .item-card { padding: 8px 8px; gap: 9px; }
  .item-actions .unavailable-item { display: none; }
  .item-actions .item-menu { display: grid; place-items: center; font-size: 14px; }
  .item-meta { margin-top: 3px; flex-wrap: nowrap; overflow: hidden; }
  .item-meta span { white-space: nowrap; }
  .shop-heading .view-subtitle { display: none; }
  .trip-command { grid-template-columns: 1fr; gap: 13px; padding: 17px; }
  .trip-command-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .trip-command-actions .button { min-height: 50px; padding-inline: 10px; }
  .trip-location-assist { align-items: stretch; flex-direction: column; }
  .trip-location-assist > div, .trip-location-assist .button { width: 100%; }
  .trip-end-bottom { margin-bottom: 18px; }
  .checkout-receipt-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .checkout-receipt-actions .button:first-child { grid-column: 1 / -1; }
  .shop-toolbar { grid-template-columns: 1fr 1fr auto; padding: 11px; }
  .shop-options { flex-wrap: wrap; gap: 12px 17px; }
  .shop-quick-setup > header { display: grid; grid-template-columns: minmax(0,1fr) auto; }
  .shop-quick-setup > header .button { padding-inline: 10px; }
  .shop-empty-setup { margin-top: 3vh; padding: 19px 14px; }
  .shop-empty-setup .shop-retailer-choices { justify-content: flex-start; }
  .select-field.compact { width: 100%; }
  .shop-item { min-height: 96px; padding: 14px; }
  .shop-item-actions button { min-width: 50px; height: 50px; }
  .running-total span { display: none; }
  .running-total { position: static; width: max-content; margin: -55px 0 18px auto; }
  .dialog-card { grid-template-columns: 1fr; padding: 20px; }
  .dialog-card > *, .dialog-card > header, .dialog-card > footer, .full { grid-column: 1; }
  .details-grid { grid-template-columns: 1fr; }
  .details-grid > * { grid-column: 1; }
  .scope-list { grid-template-columns: 1fr; }
  .sheet-dialog { width: 100vw; max-width: none; max-height: 92vh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .sheet-dialog[open] { position: fixed; top: auto; bottom: 0; }
  .card-grid { grid-template-columns: 1fr; }
  .receipt-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .receipt-row .button { grid-column: 2 / -1; }
  .receipt-match { grid-template-columns: 1fr auto; }
  .receipt-match select { grid-column: 1 / -1; }
  .receipt-step footer { flex-wrap: wrap; }
  .receipt-step footer > span { display: none; }
  .receipt-step footer .receipt-remove { margin-right: auto; }
  .receipt-step footer .button, .receipt-step footer a.button { min-height: 44px; }
  .recovery-row { grid-template-columns: minmax(0,1fr) auto; }
  .secret-row { grid-template-columns: 1fr; }
  .quick-composer .quick-add { grid-template-columns: minmax(0,1fr) 62px 60px; gap: 3px; padding: 4px; border-radius: 16px; }
  .quick-name input { font-size: 16px; }
  .quick-quantity input { padding-left: 17px !important; }
  .product-rail { grid-auto-columns: min(225px, 76vw); }
  .generic-rail { grid-auto-columns: min(270px, 82vw); }
  .generic-grid { grid-template-columns: 1fr; }
  .product-option { grid-template-columns: 42px minmax(0,1fr); min-height: 112px; padding: 7px; }
  .product-thumb { width: 42px; height: 52px; }
  .generic-option { grid-template-columns: 42px minmax(0,1fr) 20px; }
  .generic-option .generic-thumb { width: 42px; height: 52px; }
  .canonical-option .canonical-select { grid-template-columns: 50px minmax(0,1fr) 20px; }
  .canonical-option .canonical-select .generic-thumb { width: 50px; height: 62px; }
  .canonical-offer { grid-template-columns: 38px minmax(0,1fr); padding-inline: 9px; }
  .canonical-offer .offer-thumb { width: 38px; height: 45px; }
  .canonical-offer-link { padding-inline: 4px; }
  .canonical-offer-actions { grid-column: 2 / -1; justify-content: flex-start; flex-wrap: wrap; }
  .item-essential { grid-template-columns: minmax(0,1fr) 78px; }
  .item-dialog-footer { bottom: -20px; margin: 4px -20px -20px !important; padding: 12px 20px calc(12px + var(--safe-bottom)); }
  .item-dialog-footer .button { padding-inline: 13px; }
  .product-search-results { grid-template-columns: 1fr; }
  .scanner-dialog { width: 100vw; height: 100dvh; margin: 0; border-radius: 0; }
  .scanner-camera { min-height: 300px; }
  .import-row { grid-template-columns: auto minmax(0,1fr) 62px; }
  .import-row .import-unit { grid-column: 2 / -1; }
  .import-match { grid-column: 2 / -1; }
  .toast-region { left: 12px; right: 12px; bottom: calc(78px + var(--safe-bottom)); }
  .toast { max-width: none; }
  .recipe-grid { grid-template-columns: 1fr; }
  .recipe-open { min-height: 118px; grid-template-columns: 92px minmax(0,1fr); }
  #recipe-ingredient-list { grid-template-columns: 1fr; }
  .recipe-detail-hero { grid-template-columns: 72px minmax(0,1fr); min-height: 92px; padding: 10px; }
  .recipe-detail-art { width: 72px; height: 72px; font-size: 30px; }
  .recipe-dialog-footer { bottom: -20px; grid-template-columns: auto 1fr auto; margin: 4px -20px -20px !important; padding: 12px 20px calc(12px + var(--safe-bottom)); }
  .recipe-dialog-footer #recipe-source-link { grid-column: 1 / -1; }
}

@media (max-width: 360px) {
  .mobile-header .avatar-button { width: 44px; height: 44px; margin-right: -3px; }
  .item-edit-cue { opacity: 1; }
  .item-copy.edit-item:focus-visible, .item-copy.edit-item:active { border-radius: 10px; background: var(--green-soft); }
  .filter-row { flex-wrap: wrap; }
  .list-filter-tools { width: 100%; min-width: 0; flex: 1 0 100%; }
  .list-filter-tools .compact-select { min-width: 0; max-width: none; flex: 1 1 0; }
  .list-filter-tools .compact-select select { width: 100%; max-width: none; }
  .list-filter-tools .search-box:focus-within { width: 118px; flex-basis: 118px; }
  .import-note-field { grid-template-columns: 1fr; gap: 5px; }
}

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

@media (prefers-reduced-transparency: reduce) {
  .sidebar, .mobile-header, .mobile-nav, .item-dialog-footer, .recipe-dialog-footer { background: var(--card); backdrop-filter: none; }
  dialog::backdrop { backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --muted: #4d5751; --line: rgba(23,33,28,.34); }
  .item-card, .shop-item, .quick-add, .recipe-card { box-shadow: none; }
}

@media (forced-colors: active) {
  .item-check, .button, .nav-button, .generic-option, .product-option, .product-health-button, .retailer-chip, .quick-add, .item-card, .shop-item { border: 1px solid ButtonText; }
  .item-check { color: ButtonText; }
  .nav-button.is-active, .button.primary, .shop-item-actions .buy-button { color: HighlightText; background: Highlight; }
  .scope-badge, .priority-badge, .retailer-mark { color: ButtonText; background: Canvas; border: 1px solid ButtonText; }
}

.branch-switcher { min-width: 0; min-height: 52px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 16px; padding: 6px 9px; background: var(--card); text-align: left; }
.branch-switcher-logo, .branch-switcher-logo-image { width: 38px; height: 38px; display: grid; place-items: center; }
.branch-switcher-logo-image img { width: 100%; height: 100%; border-radius: 10px; object-fit: contain; background: #fff; }
.branch-switcher-copy { min-width: 0; display: grid; }
.branch-switcher-copy small { color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.branch-switcher-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.branch-switcher em { color: var(--green); font-size: 11px; font-style: normal; font-weight: 850; }
.item-image-card { width: min(820px,calc(100vw - 32px)); }
.item-image-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 10px; }
.item-image-choice { min-width: 0; min-height: 92px; display: grid; grid-template-columns: 58px minmax(0,1fr); align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 15px; padding: 10px; background: var(--card); text-align: left; }
.item-image-choice:hover, .item-image-choice:focus-visible { border-color: var(--green); box-shadow: 0 8px 22px rgba(45,92,77,.12); }
.item-image-choice .product-thumb { width: 58px; height: 70px; }
.item-image-choice span:last-child { min-width: 0; display: grid; gap: 5px; }
.item-image-choice strong, .item-image-choice small { overflow: hidden; text-overflow: ellipsis; }
.item-image-choice small { color: var(--muted); font-size: 10px; }
.item-image-footer { display: flex; flex-wrap: wrap; gap: 8px; }
.item-image-upload { cursor: pointer; }
.location-start-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.location-branch-list { display: grid; gap: 8px; max-height: min(48vh,430px); overflow-y: auto; }
.location-branch-choice { min-height: 66px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 15px; padding: 8px 11px; background: var(--card); text-align: left; }
.location-branch-choice:hover, .location-branch-choice:focus-visible { border-color: var(--green); }
.location-branch-logo { width: 48px; height: 48px; }
.location-branch-logo img { width: 100%; height: 100%; border-radius: 10px; object-fit: contain; background: #fff; }
.location-branch-choice > span { min-width: 0; display: grid; gap: 3px; }
.location-branch-choice small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.location-branch-choice b { color: var(--green); font-size: 11px; }
.location-nearest { padding: 12px; border-radius: 18px; background: var(--green-soft); }
.theme-choice { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.theme-choice button { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 750; }
.theme-choice button.is-active { color: #fff; border-color: var(--green); background: var(--green); }

html[data-theme="dark"] { --ink:#edf4ef; --muted:#a9b7af; --paper:#101713; --paper-deep:#1a241e; --card:#18211c; --green:#77b49d; --green-dark:#9ed2bd; --green-soft:#263c33; --orange:#ef855f; --yellow:#8b6d2c; --red:#f08a7b; --line:rgba(235,244,238,.15); --shadow:0 18px 45px rgba(0,0,0,.28); }
html[data-theme="dark"] body { background:radial-gradient(circle at 82% 0%,rgba(139,109,44,.16),transparent 26rem),var(--paper); }
html[data-theme="dark"] .sidebar, html[data-theme="dark"] .mobile-header, html[data-theme="dark"] .mobile-nav { background:rgba(16,23,19,.92); }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea, html[data-theme="dark"] .button.quiet, html[data-theme="dark"] .retailer-chip, html[data-theme="dark"] .product-option, html[data-theme="dark"] .generic-option, html[data-theme="dark"] .item-card, html[data-theme="dark"] .shop-item, html[data-theme="dark"] .settings-card, html[data-theme="dark"] .dialog-card { color:var(--ink); background:var(--card); }
html[data-theme="dark"] label { color:var(--ink); }
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus { background:#202c25; }
html[data-theme="dark"] .product-option.is-unavailable { background:#151d19; }
html[data-theme="dark"] .shop-item-actions .out-of-stock-button { color:#f2a093; border-color:rgba(242,160,147,.35); background:#33201d; }
html[data-theme="dark"] .aisle-chip { background:var(--paper-deep); }
html[data-theme="dark"] .shop-mobile-command, html[data-theme="dark"] .shop-toolbar, html[data-theme="dark"] .shop-quick-setup, html[data-theme="dark"] .icon-button { color:var(--ink); background:var(--card); }
html[data-theme="dark"] .segment, html[data-theme="dark"] .search-box, html[data-theme="dark"] .quick-suggestions, html[data-theme="dark"] .shop-quick-setup, html[data-theme="dark"] .specific-product-filters { color:var(--ink); background:#121a16; }
html[data-theme="dark"] .segment button.is-active { color:#f5faf7; background:#315d4c; box-shadow:0 3px 12px rgba(0,0,0,.32); }
html[data-theme="dark"] .compact-select select, html[data-theme="dark"] .specific-sort select, html[data-theme="dark"] .select-field select, html[data-theme="dark"] .retailer-chip, html[data-theme="dark"] .specific-filter-chip, html[data-theme="dark"] .shop-retailer-choice, html[data-theme="dark"] .canonical-offer, html[data-theme="dark"] .canonical-offers { color:var(--ink); background:var(--card); }
html[data-theme="dark"] .specific-filter-chip.is-active, html[data-theme="dark"] .retailer-chip.is-active, html[data-theme="dark"] .specific-filter-toggle.is-open, html[data-theme="dark"] .specific-filter-toggle.has-filters { color:#fff; background:#315d4c; }
html[data-theme="dark"] .item-dialog-footer { background:rgba(24,33,28,.97); }
html[data-theme="dark"] .selected-product button, html[data-theme="dark"] .dialog-close { color:var(--ink); background:var(--paper-deep); }
html[data-theme="dark"] .product-skeleton { background:linear-gradient(100deg,#1a241e 30%,#2b3931 45%,#1a241e 60%); background-size:300% 100%; }
html[data-theme="dark"] .trip-command { border-color:var(--line); background:linear-gradient(125deg,#1c3028 0%,#2d291c 100%); }
html[data-theme="dark"] .trip-command.is-active { background:linear-gradient(125deg,#234237 0%,#37321f 100%); }
html[data-theme="dark"] .offline-banner { color:#f2d7a9; background:rgba(60,44,24,.96); }
html[data-theme="dark"] .product-thumb img, html[data-theme="dark"] .retailer-mark img, html[data-theme="dark"] .location-branch-logo img, html[data-theme="dark"] .branch-switcher-logo-image img { background:#fff; }

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] { --ink:#edf4ef; --muted:#a9b7af; --paper:#101713; --paper-deep:#1a241e; --card:#18211c; --green:#77b49d; --green-dark:#9ed2bd; --green-soft:#263c33; --orange:#ef855f; --yellow:#8b6d2c; --red:#f08a7b; --line:rgba(235,244,238,.15); --shadow:0 18px 45px rgba(0,0,0,.28); }
  html[data-theme="system"] body { background:radial-gradient(circle at 82% 0%,rgba(139,109,44,.16),transparent 26rem),var(--paper); }
  html[data-theme="system"] .sidebar, html[data-theme="system"] .mobile-header, html[data-theme="system"] .mobile-nav { background:rgba(16,23,19,.92); }
  html[data-theme="system"] input, html[data-theme="system"] select, html[data-theme="system"] textarea, html[data-theme="system"] .button.quiet, html[data-theme="system"] .retailer-chip, html[data-theme="system"] .product-option, html[data-theme="system"] .generic-option, html[data-theme="system"] .item-card, html[data-theme="system"] .shop-item, html[data-theme="system"] .settings-card, html[data-theme="system"] .dialog-card { color:var(--ink); background:var(--card); }
  html[data-theme="system"] label { color:var(--ink); }
  html[data-theme="system"] .shop-item-actions .out-of-stock-button { color:#f2a093; border-color:rgba(242,160,147,.35); background:#33201d; }
  html[data-theme="system"] .aisle-chip { background:var(--paper-deep); }
  html[data-theme="system"] .shop-mobile-command, html[data-theme="system"] .shop-toolbar, html[data-theme="system"] .shop-quick-setup, html[data-theme="system"] .icon-button { color:var(--ink); background:var(--card); }
  html[data-theme="system"] .segment, html[data-theme="system"] .search-box, html[data-theme="system"] .quick-suggestions, html[data-theme="system"] .shop-quick-setup, html[data-theme="system"] .specific-product-filters { color:var(--ink); background:#121a16; }
  html[data-theme="system"] .segment button.is-active { color:#f5faf7; background:#315d4c; box-shadow:0 3px 12px rgba(0,0,0,.32); }
  html[data-theme="system"] .compact-select select, html[data-theme="system"] .specific-sort select, html[data-theme="system"] .select-field select, html[data-theme="system"] .retailer-chip, html[data-theme="system"] .specific-filter-chip, html[data-theme="system"] .shop-retailer-choice, html[data-theme="system"] .canonical-offer, html[data-theme="system"] .canonical-offers { color:var(--ink); background:var(--card); }
  html[data-theme="system"] .specific-filter-chip.is-active, html[data-theme="system"] .retailer-chip.is-active, html[data-theme="system"] .specific-filter-toggle.is-open, html[data-theme="system"] .specific-filter-toggle.has-filters { color:#fff; background:#315d4c; }
  html[data-theme="system"] .item-dialog-footer { background:rgba(24,33,28,.97); }
  html[data-theme="system"] .selected-product button, html[data-theme="system"] .dialog-close { color:var(--ink); background:var(--paper-deep); }
  html[data-theme="system"] .product-skeleton { background:linear-gradient(100deg,#1a241e 30%,#2b3931 45%,#1a241e 60%); background-size:300% 100%; }
  html[data-theme="system"] .trip-command { border-color:var(--line); background:linear-gradient(125deg,#1c3028 0%,#2d291c 100%); }
  html[data-theme="system"] .trip-command.is-active { background:linear-gradient(125deg,#234237 0%,#37321f 100%); }
  html[data-theme="system"] .product-thumb img, html[data-theme="system"] .retailer-mark img { background:#fff; }
}

@media (max-width: 620px) {
  .item-image-grid { grid-template-columns: 1fr 1fr; }
  .item-image-choice { grid-template-columns: 46px minmax(0,1fr); padding: 8px; }
  .item-image-choice .product-thumb { width: 46px; height: 58px; }
  .location-start-actions { grid-template-columns: 1fr; }
}
