/* Circulaires — design tokens from design-system/circulaires/MASTER.md (flat, fresh green + food amber). */
:root {
  --bg: #f4faf7;
  --surface: #ffffff;
  --surface-2: #eef6f2;
  --text: #0f172a;
  --muted: #475569;
  --line: #dcebe4;
  --primary: #047857;        /* white text 5.5:1 */
  --primary-hover: #065f46;
  --primary-soft: #d1fae5;
  --on-primary: #ffffff;
  --accent: #b45309;         /* amber text on white 5.0:1 */
  --accent-soft: #fef3c7;
  --on-accent: #ffffff;
  --danger: #b91c1c;
  --ring: #059669;
  --page-bg: #e6efe9;
  --shadow: 0 1px 2px rgb(15 23 42 / .06);
  --shadow-lg: 0 12px 32px rgb(15 23 42 / .16);
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 64px;
  --font-head: "Rubik", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1311; --surface: #131c19; --surface-2: #1a2622; --text: #e8f1ed; --muted: #a3b5ad;
    --line: #253430; --primary: #34d399; --primary-hover: #6ee7b7; --primary-soft: #12352a; --on-primary: #052e22;
    --accent: #fbbf24; --accent-soft: #3a2a0a; --on-accent: #1f1300; --danger: #f87171; --ring: #34d399; --page-bg: #1d2925;
    --shadow: 0 1px 2px rgb(0 0 0 / .4); --shadow-lg: 0 12px 32px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1311; --surface: #131c19; --surface-2: #1a2622; --text: #e8f1ed; --muted: #a3b5ad;
  --line: #253430; --primary: #34d399; --primary-hover: #6ee7b7; --primary-soft: #12352a; --on-primary: #052e22;
  --accent: #fbbf24; --accent-soft: #3a2a0a; --on-accent: #1f1300; --danger: #f87171; --ring: #34d399; --page-bg: #1d2925;
  --shadow: 0 1px 2px rgb(0 0 0 / .4); --shadow-lg: 0 12px 32px rgb(0 0 0 / .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font-body); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0; letter-spacing: -.01em; }
a { color: var(--primary); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 24px; } }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { height: var(--header-h); display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--font-head); font-weight: 700; font-size: 19px; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; }
.brand small { display: block; font: 600 12px/1 var(--font-body); color: var(--muted); }
.top-search { flex: 1; max-width: 520px; margin-left: auto; position: relative; display: none; }
@media (min-width: 720px) { .top-search { display: block; } }
.list-btn { margin-left: auto; position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; transition: background .15s, border-color .15s; }
@media (min-width: 720px) { .list-btn { margin-left: 0; } }
.list-btn:hover { background: var(--surface-2); }
.count-pill { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 13px; display: inline-grid; place-items: center; }
.count-pill[data-zero="true"] { background: var(--surface-2); color: var(--muted); }

/* ---------- Inputs ---------- */
.field { position: relative; }
.field .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input, .select { width: 100%; min-height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
.field .input { padding-left: 40px; }
.input:focus, .select:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); }
.input::placeholder { color: var(--muted); opacity: .85; }
.clear-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; color: var(--muted); display: none; place-items: center; }
.field.has-value .clear-btn { display: grid; }

/* ---------- Buttons & chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 700; text-decoration: none; transition: background .15s, color .15s, border-color .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-icon { width: 44px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip .n { opacity: .7; font-weight: 500; margin-left: 4px; }
.chip-more { border-style: dashed; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-live { background: var(--primary-soft); color: var(--primary); }
.badge-soon { background: var(--accent-soft); color: var(--accent); }
.badge-muted { background: var(--surface-2); color: var(--muted); }

/* ---------- Home ---------- */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(26px, 4vw, 40px); max-width: 18ch; }
.hero p { color: var(--muted); margin: 8px 0 0; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.stats strong { color: var(--text); font-family: var(--font-head); font-size: 18px; margin-right: 4px; }
.toolbar { position: sticky; top: var(--header-h); z-index: 20; background: var(--bg); padding: 14px 0 12px; display: grid; gap: 12px; border-bottom: 1px solid transparent; }
.toolbar.stuck { border-bottom-color: var(--line); }
.toolbar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar-row .field { flex: 1 1 260px; }
.toolbar-row .select { width: auto; min-width: 190px; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: none; font-weight: 700; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.result-line { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 18px; padding-bottom: 48px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s var(--ease), box-shadow .15s; }
.card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-cover { aspect-ratio: 4 / 5; background: var(--page-bg); overflow: hidden; position: relative; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card-cover .badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.card-body { padding: 12px 12px 14px; display: grid; gap: 6px; }
.card-merchant { display: flex; align-items: center; gap: 8px; font-weight: 800; font-family: var(--font-head); }
.logo { width: 28px; height: 28px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.logo-fallback { display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--primary); }
.card-meta { color: var(--muted); font-size: 14px; }
.card-variants { font-size: 13px; color: var(--muted); }
.skeleton { background: linear-gradient(100deg, var(--page-bg) 30%, color-mix(in srgb, var(--page-bg) 60%, var(--surface)) 50%, var(--page-bg) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -150% 0; } }
.placeholder-page { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 12px; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty h2 { color: var(--text); font-size: 20px; margin-bottom: 6px; }
.empty .chips { justify-content: center; margin-top: 14px; }

/* ---------- Flyer view ---------- */
.crumb { display: inline-flex; align-items: center; gap: 6px; margin: 16px 0 10px; color: var(--muted); text-decoration: none; font-weight: 700; min-height: 44px; }
.crumb:hover { color: var(--primary); }
.fl-head { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between; }
.fl-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.fl-title .logo { width: 52px; height: 52px; border-radius: 12px; }
.fl-title h1 { font-size: clamp(20px, 2.6vw, 28px); }
.fl-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--muted); font-size: 14px; margin-top: 4px; }
.fl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.variant-select { min-width: 200px; }
.fl-tabs { display: none; margin: 16px 0 0; }
.fl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; margin: 18px 0 48px; align-items: start; }
@media (max-width: 1023px) {
  .fl-layout { grid-template-columns: minmax(0, 1fr); }
  .fl-tabs { display: flex; position: sticky; top: var(--header-h); z-index: 15; background: var(--bg); padding: 8px 0; }
  .fl-tabs .seg { width: 100%; }
  .fl-tabs .seg button { flex: 1; }
  .fl-layout[data-tab="pages"] .deals-panel { display: none; }
  .fl-layout[data-tab="deals"] .viewer-col { display: none; }
}

/* Viewer */
.viewer-col, .deals-panel { min-width: 0; }
.viewer { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); }
.viewer-bar .page-label { font-weight: 800; font-family: var(--font-head); font-size: 15px; }
.viewer-bar .tools { display: flex; gap: 6px; }
.stage { position: relative; background: var(--page-bg); overflow: hidden; touch-action: pan-y; user-select: none; display: flex; justify-content: center; min-height: 320px; }
.stage.zoomed { touch-action: none; cursor: grab; }
.stage.zoomed.dragging { cursor: grabbing; }
.page-wrap { position: relative; width: min(100%, 720px); transform-origin: 0 0; }  /* no will-change: it freezes the page bitmap at 1x, so zoom would only blow up pixels */
.page-wrap img { width: 100%; height: auto; }
.page-wrap .placeholder-page { aspect-ratio: var(--ratio, .45); align-content: start; padding-top: 48px; }  /* tall pages: keep the message in view */
.hotspot { position: absolute; border: 2px solid transparent; border-radius: 8px; background: transparent; padding: 0; transition: border-color .15s, background .15s; }
.hotspot:hover, .hotspot:focus-visible { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); outline: none; }
.hotspot.listed { border-color: color-mix(in srgb, var(--primary) 60%, transparent); }
.hotspot.listed::after { content: ""; position: absolute; top: -9px; right: -9px; width: 20px; height: 20px; border-radius: 50%; background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/13px no-repeat; }
.hotspot.flash { animation: flash 1.6s var(--ease) 1; }
@keyframes flash { 0%, 60% { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); } 100% { border-color: transparent; } }
.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-lg); display: grid; place-items: center; z-index: 2; transition: opacity .15s, background .15s; }
.nav-arrow:hover { background: var(--surface-2); }
.nav-arrow[disabled] { opacity: 0; pointer-events: none; }
.nav-prev { left: 10px; }
.nav-next { right: 10px; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 2px 0; }
.strip { display: flex; gap: 10px; overflow-x: auto; padding: 12px 2px 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.thumb { flex: none; width: 84px; scroll-snap-align: start; border: 2px solid transparent; border-radius: 10px; padding: 0; background: var(--page-bg); overflow: hidden; position: relative; transition: border-color .15s; }
.thumb img, .thumb .placeholder-page { width: 100%; aspect-ratio: var(--ratio, .45); object-fit: cover; object-position: top; }
.thumb .n { position: absolute; bottom: 4px; right: 4px; background: var(--surface); font-size: 11px; font-weight: 800; padding: 0 6px; border-radius: 999px; }
.thumb[aria-current="true"] { border-color: var(--primary); }
.viewer:fullscreen { border-radius: 0; display: flex; flex-direction: column; background: #0b0f0e; border: 0; }
.viewer:fullscreen .stage { flex: 1; align-items: flex-start; overflow: hidden; }
.viewer:fullscreen .page-wrap { width: auto; height: 100%; max-width: 100%; }
.viewer:fullscreen .page-wrap img { height: calc(100vh - 62px); width: auto; }

/* Deals panel */
.deals-panel { position: sticky; top: calc(var(--header-h) + 12px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - var(--header-h) - 24px); overflow: hidden; }
@media (max-width: 1023px) { .deals-panel { position: static; max-height: none; } }
.dp-head { padding: 14px 16px 10px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.dp-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dp-title h2 { font-size: 18px; }
.dp-title span { color: var(--muted); font-size: 14px; }
.dp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dp-row .select { min-height: 40px; padding: 8px 10px; font-size: 14px; }
.dp-chips .chip { min-height: 32px; font-size: 13px; padding: 0 12px; }
.deals { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.group-label { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 6px 16px; border-bottom: 1px solid var(--line); }
.deal { display: grid; grid-template-columns: 28px 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--line); transition: background .15s; }
.deal:hover { background: var(--surface-2); }
.deal.active { background: var(--primary-soft); }
.check { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; padding: 0; color: transparent; transition: background .15s, border-color .15s, color .15s; }
.check:hover { border-color: var(--primary); }
.check[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.deal-img { width: 52px; height: 52px; border-radius: 8px; background: #fff; border: 1px solid var(--line); object-fit: contain; }
.deal-main { min-width: 0; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; }
.deal-name { font-size: 14px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.deal-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.deal-price { text-align: right; font-family: var(--font-head); font-weight: 800; font-size: 16px; white-space: nowrap; }
.deal-off { display: block; font-family: var(--font-body); font-size: 12px; font-weight: 800; color: var(--accent); }
.deal.done .deal-name { color: var(--muted); }
.dp-foot { padding: 10px 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.dp-foot .input { min-height: 44px; }

/* Deal popover (from a hotspot) */
.pop { position: fixed; inset: auto 0 0 0; z-index: 60; background: var(--surface); border-top-left-radius: 18px; border-top-right-radius: 18px; box-shadow: var(--shadow-lg); padding: 16px; transform: translateY(105%); transition: transform .22s var(--ease); max-width: 560px; margin: 0 auto; }
.pop.open { transform: none; }
.pop-grid { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }
.pop img { width: 96px; height: 96px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.pop h3 { font-size: 18px; }
.pop .price { font-family: var(--font-head); font-size: 26px; font-weight: 800; margin-top: 6px; }
.pop .row { display: flex; gap: 8px; margin-top: 14px; }
.pop .row .btn { flex: 1; }
.pop-close { position: absolute; top: 8px; right: 8px; }

/* Grocery list drawer */
.scrim { position: fixed; inset: 0; background: rgb(6 12 10 / .45); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 55; background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .24s var(--ease); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 20px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.drawer-body .group-label { position: static; }
.li { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.li.done .li-name { text-decoration: line-through; color: var(--muted); }
.li-name { font-size: 15px; }
.li-price { font-weight: 800; font-family: var(--font-head); }
.li-del { width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; color: var(--muted); display: grid; place-items: center; }
.li-del:hover { color: var(--danger); background: var(--surface-2); }
.drawer-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: 10px; }
.drawer-foot .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); z-index: 70; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 20px 0 32px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .top, .toolbar, .fl-layout, .scrim, .pop, footer.site, .drawer-head button, .drawer-foot { display: none !important; }
  .drawer { position: static; transform: none; box-shadow: none; width: 100%; }
}

/* ---------- Deal cards (best deals, coupon flyers) ---------- */
.section { padding: 8px 0 24px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 16px; margin: 18px 0 12px; }
.section-head h2 { font-size: clamp(20px, 2.6vw, 26px); }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.best-chips { margin-bottom: 14px; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 176px), 1fr)); gap: 14px; }
.dcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.dcard:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.dcard-img { position: relative; display: block; aspect-ratio: 1; background: #fff; border-bottom: 1px solid var(--line); }
.dcard-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.dcard-off { position: absolute; top: 8px; left: 8px; background: var(--accent); color: var(--on-accent); font: 800 13px/1 var(--font-head); padding: 6px 8px; border-radius: 8px; }
.dcard-body { padding: 10px 12px 12px; display: grid; gap: 4px; flex: 1; align-content: start; }
.dcard-store { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--muted); min-width: 0; }
.dcard-store .logo { width: 20px; height: 20px; border-radius: 6px; }
.dcard-store span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcard-title { color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dcard-title:hover { color: var(--primary); }
.dcard-title .size { color: var(--muted); font-weight: 600; }
.dcard-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.dcard-price strong { font: 800 20px/1.1 var(--font-head); }
.dcard-price s { color: var(--muted); font-size: 13px; }
.dcard-meta { font-size: 12px; color: var(--muted); }
.dcard-add { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--primary); display: grid; place-items: center; box-shadow: var(--shadow); transition: background .15s, color .15s, border-color .15s; }
.dcard-add:hover { border-color: var(--primary); }
.dcard-add[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.more-row { display: flex; justify-content: center; margin-top: 16px; }
.best-filters { display: grid; gap: 12px; margin-bottom: 14px; }
.best-filters .toolbar-row .select { min-width: 180px; }

/* Cover collage for flyers without page images (coupon books) */
.collage { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; width: 100%; height: 100%; background: var(--line); }
.collage img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 8px; }

/* Flyers without pages: filters on top, cards below */
.fl-layout.no-pages { grid-template-columns: minmax(0, 1fr); }
.no-pages .deals-panel { order: 1; position: static; max-height: none; }
.no-pages .deals-panel .deals { display: none; }
.no-pages .viewer-col { order: 2; }
.no-pages .viewer, .no-pages .strip, .no-pages .hint { display: none; }
.fl-tabs.hidden { display: none !important; }
