/* ttSpecials site styles.
   Mobile first: the base rules are for phones; the media queries add tablet (640px) and desktop (960px) layouts.
   Colours come from the logo: blue "Specials", red "tt", and the shopping-bag colours. */

:root {
    --blue: #006fb9;
    --blue-dark: #00548c;
    --blue-soft: #e6f1f9;
    --cyan: #00b8e8;
    --red: #d50000;
    --red-dark: #a00000;
    --red-soft: #fdecec;
    --green: #90c840;
    --whatsapp: #11823b;
    --whatsapp-dark: #0c6a2f;
    --purple: #7b2cbf;
    --amber: #b45309;
    --amber-soft: #fef3e2;
    --ink: #1b2430;
    --muted: #5b6675;
    --line: #e3e8ef;
    --bg: #f4f6f9;
    --card: #ffffff;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 10%);
    --shadow-hover: 0 6px 16px rgb(16 24 40 / 14%);
    --photo-mat: linear-gradient(180deg, #f8fafc, #eef2f6);
    --photo-edge: rgb(16 24 40 / 12%);
    --photo-shadow: 0 1px 2px rgb(16 24 40 / 8%), 0 4px 10px rgb(16 24 40 / 8%);
    --header-h: 60px;
    --bottom-nav-h: 62px;
    --gutter: 16px;
    --stripe: linear-gradient(90deg, var(--red) 0 25%, var(--green) 25% 50%, var(--cyan) 50% 75%, var(--purple) 75%);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

@media (min-width: 640px) {
    :root { --gutter: 24px; }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 8px);
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
}

img { max-width: 100%; height: auto; }

a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--blue-dark); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

h1:focus, main:focus { outline: none; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Sideways-scrolling rows must be positioned, or hidden text (.sr-only) in off-screen
   cards escapes them and makes the whole page wider on phones. */
.chips, .shelf-row, .gallery-track, .deal-card { position: relative; }

.skip-link {
    position: absolute; left: 8px; top: -100px; z-index: 100;
    background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 8px; color: #fff; }

.muted { color: var(--muted); }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: 760px; }

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }

@media (min-width: 960px) {
    body { padding-bottom: 0; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.4rem; }
}

/* ---------- Buttons ---------- */

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 18px;
    border: 1px solid transparent; border-radius: 999px;
    font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2;
    text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover { background: var(--blue-dark); color: #fff; }
.button-whatsapp { background: var(--whatsapp); color: #fff; }
.button-whatsapp:hover { background: var(--whatsapp-dark); color: #fff; }
.button-outline { background: #fff; color: var(--ink); border-color: #cfd7e1; }
.button-outline:hover { background: var(--bg); color: var(--ink); border-color: #b8c3d0; }
.button-outline-light { background: transparent; color: #fff; border-color: rgb(255 255 255 / 65%); }
.button-outline-light:hover { background: rgb(255 255 255 / 12%); color: #fff; border-color: #fff; }
.button-ghost { background: transparent; color: var(--muted); }
.button-ghost:hover { background: var(--bg); color: var(--ink); }
.button-small { min-height: 36px; padding: 6px 14px; font-size: .875rem; }
.button-large { min-height: 50px; padding: 12px 24px; font-size: 1rem; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions-center { justify-content: center; }

.icon-button {
    display: inline-grid; place-items: center; width: 42px; height: 42px;
    border-radius: 50%; color: var(--ink);
}
.icon-button:hover { background: var(--bg); color: var(--ink); }
.icon-button .icon { width: 22px; height: 22px; }

/* ---------- Header ---------- */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgb(255 255 255 / 96%);
    -webkit-backdrop-filter: saturate(1.4) blur(8px);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--line);
    padding-top: env(safe-area-inset-top);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.brand { display: block; flex: none; }
.brand img { display: block; height: 32px; width: auto; }
.header-search, .header-nav, .header-signout { display: none; }
.header-account { margin-left: auto; display: flex; align-items: center; gap: 4px; }

@media (min-width: 960px) {
    .header-inner { gap: 20px; }
    .header-search { display: flex; align-items: center; position: relative; flex: 1; max-width: 440px; }
    .header-search .icon { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
    .header-search input {
        width: 100%; height: 40px; padding: 0 14px 0 38px;
        border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
        font: inherit; font-size: .95rem; color: var(--ink);
    }
    .header-search input:focus { outline: none; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
    .header-nav { display: flex; gap: 2px; margin-left: auto; }
    .header-nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
    .header-nav a:hover { background: var(--bg); color: var(--ink); }
    .header-nav a.active { color: var(--blue); background: var(--blue-soft); }
    .header-account { margin-left: 0; }
    .header-search-link { display: none; }
    .header-signout { display: block; margin: 0; }
}

/* ---------- Bottom navigation (phones and tablets) ---------- */

.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: rgb(255 255 255 / 97%);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    height: var(--bottom-nav-h);
    color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.bottom-nav a .icon { width: 24px; height: 24px; }
.bottom-nav a.active { color: var(--blue); }

@media (min-width: 960px) {
    .bottom-nav { display: none; }
}

/* Live totals (Services\LiveCounts.cs): the Deals link's count in the header, its badge in the phone menu,
   and the "166 specials running now" line in the home banner. */
.nav-count {
    display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
    background: var(--red); color: #fff; font-size: .78rem; font-weight: 800; line-height: 1.5; vertical-align: 1px;
}
.bottom-nav-icon { position: relative; display: inline-flex; }
.nav-badge {
    position: absolute; top: -7px; left: 13px; min-width: 20px; padding: 0 5px; border-radius: 999px;
    background: var(--red); color: #fff; border: 2px solid #fff;
    font-size: .66rem; font-weight: 800; line-height: 15px; text-align: center;
}
.hero-live {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 6px 12px 6px 12px;
    border-radius: 999px; background: rgb(255 255 255 / 16%); border: 1px solid rgb(255 255 255 / 30%);
    color: #fff; text-decoration: none; font-size: .95rem; font-weight: 600;
}
.hero-live:hover { background: rgb(255 255 255 / 24%); color: #fff; }
.hero-live strong { font-weight: 800; font-size: 1.08em; }
.hero-live .icon { width: 16px; height: 16px; opacity: .85; }
.live-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #7cf29c; animation: live-pulse 2s infinite; }
@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgb(124 242 156 / 60%); }
    70% { box-shadow: 0 0 0 8px rgb(124 242 156 / 0%); }
    100% { box-shadow: 0 0 0 0 rgb(124 242 156 / 0%); }
}
@media (prefers-reduced-motion: reduce) {
    .live-dot { animation: none; }
}

/* ---------- Footer ---------- */

.site-footer {
    position: relative; margin-top: 48px; padding: 28px 0 24px;
    background: #fff; border-top: 1px solid var(--line);
}
.site-footer::before { content: ""; position: absolute; inset: -1px 0 auto; height: 4px; background: var(--stripe); }
.footer-inner { display: grid; gap: 18px; }
.footer-brand img { display: block; height: 28px; width: auto; margin-bottom: 8px; }
.footer-brand p { margin: 0 0 4px; color: var(--muted); font-size: .92rem; }
.footer-brand .tagline { color: var(--blue); font-weight: 700; font-size: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-content: start; }
.footer-links a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem; }
.footer-links a:hover { color: var(--blue); text-decoration: underline; }
.footer-note { margin: 0; color: var(--muted); font-size: .82rem; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-legal a { color: var(--muted); }
.footer-legal a:hover { color: var(--blue); }
.fine-print a { color: var(--muted); }

@media (min-width: 960px) {
    .footer-inner { grid-template-columns: 1fr auto; }
    .footer-note { grid-column: 1 / -1; }
}

/* ---------- Hero and search ---------- */

.hero {
    color: #fff;
    padding: 28px 0 32px;
    background:
        radial-gradient(circle at 92% 8%, rgb(0 184 232 / 45%), transparent 42%),
        radial-gradient(circle at 4% 110%, rgb(144 200 64 / 30%), transparent 45%),
        linear-gradient(135deg, #00548c 0%, #006fb9 50%, #0089cc 100%);
}
.hero h1 { font-size: 1.75rem; max-width: 20ch; margin-bottom: .4em; }
.hero-accent { background: linear-gradient(transparent 64%, rgb(213 0 0 / 85%) 64%, rgb(213 0 0 / 85%) 92%, transparent 92%); }
.hero-lead { max-width: 48ch; font-size: 1.02rem; opacity: .94; margin-bottom: 20px; }
.eyebrow { margin: 0 0 .6em; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }

@media (min-width: 960px) {
    .hero { padding: 56px 0 60px; }
    .hero h1 { font-size: 2.6rem; }
    .hero-lead { font-size: 1.15rem; }
}

.search-box {
    display: flex; align-items: center; gap: 8px; max-width: 640px;
    padding: 6px 6px 6px 16px;
    background: #fff; border: 1px solid transparent; border-radius: 999px;
    box-shadow: 0 6px 24px rgb(0 0 0 / 16%);
    color: var(--muted);
}
.search-box:focus-within { box-shadow: 0 0 0 3px rgb(0 184 232 / 65%), 0 6px 24px rgb(0 0 0 / 16%); }
.search-box input {
    flex: 1; min-width: 0; padding: 8px 4px;
    border: 0; outline: none; background: transparent;
    font: inherit; font-size: 1rem; color: var(--ink);
}
.search-box .button { min-height: 40px; padding: 8px 18px; }
.search-box-compact { max-width: none; box-shadow: none; border-color: #cfd7e1; }
.search-box-compact:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

/* ---------- Category chips ---------- */

.chips {
    display: flex; gap: 8px;
    margin: 0 calc(var(--gutter) * -1); padding: 16px var(--gutter) 4px;
    overflow-x: auto; scrollbar-width: none; scroll-padding: 0 var(--gutter);
    -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px;
    background: #fff; border: 1px solid var(--line);
    color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 600; white-space: nowrap;
}
.chip:hover { color: var(--ink); border-color: #b8c3d0; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-icon { font-size: 1.05rem; line-height: 1; }
.chip-removable { background: var(--blue-soft); border-color: transparent; color: var(--blue-dark); }
.chip-removable:hover { color: var(--blue-dark); border-color: var(--blue); }
.chip-removable .icon { width: 14px; height: 14px; }

@media (min-width: 960px) {
    .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 18px 0 4px; }
}

/* ---------- Sections and shelves ---------- */

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-head h2 { margin: 0; }
.section-title { margin: 36px 0 16px; }
.see-all { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap; }
.see-all:hover { text-decoration: underline; }

.deal-grid, .shelf-row, .store-grid, .steps, .features, .store-contact { list-style: none; margin: 0; padding: 0; }

.deal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.shelf-row {
    display: grid; grid-auto-flow: column; grid-auto-columns: 44%; gap: 12px;
    margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter) 10px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none;
}
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-row > li { scroll-snap-align: start; }

@media (min-width: 640px) {
    .deal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .shelf-row { grid-auto-columns: 30%; gap: 16px; }
}

@media (min-width: 960px) {
    .deal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .shelf-row { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; overflow: visible; }
    .shelf-row > li:nth-child(n+9) { display: none; } /* two full rows of four */
}

@media (min-width: 1200px) {
    .deal-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .shelf-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .shelf-row > li:nth-child(n+9) { display: block; }
}

/* ---------- Deal card ---------- */

.deal-card {
    display: flex; flex-direction: column; height: 100%;
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
    color: inherit; text-decoration: none;
    transition: box-shadow .15s, transform .15s;
}
.deal-card:hover { color: inherit; box-shadow: var(--shadow-hover); }
@media (hover: hover) {
    .deal-card:hover { transform: translateY(-2px); }
}
/* Photos sit on a soft grey mat with a thin border and shadow, like a mounted print, whatever their shape.
   Each photo carries its shape (--ar = width / height, from the server) and is scaled to the largest size that fits
   the frame less --mat on each side, so the border follows the photo's own edges, small newspaper crops included. */
.deal-media img, .gallery-slide img {
    position: absolute; inset: 0; margin: auto; display: block; box-sizing: border-box;
    width: min(100cqw - 2 * var(--mat), (100cqh - 2 * var(--mat)) * var(--ar, 1));
    height: min(100cqh - 2 * var(--mat), (100cqw - 2 * var(--mat)) / var(--ar, 1));
    object-fit: contain;
    background: #fff; border: 1px solid var(--photo-edge); border-radius: var(--photo-radius); box-shadow: var(--photo-shadow);
}
.deal-media { position: relative; aspect-ratio: 1; container-type: size; --mat: 10px; --photo-radius: 6px; background: var(--photo-mat); border-bottom: 1px solid var(--line); }
.deal-placeholder {
    display: grid; place-items: center; height: 100%; font-size: 3.6rem;
    background: linear-gradient(135deg, var(--blue-soft), #f1f8e6);
}
.deal-badges { position: absolute; top: 8px; left: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.pill { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; line-height: 1.3; letter-spacing: .02em; }
.pill-off { background: var(--red); color: #fff; }
.pill-new { background: var(--purple); color: #fff; }
.pill-count { background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; white-space: nowrap; }

.deal-body { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.deal-title {
    margin: 0; font-size: .95rem; font-weight: 600; line-height: 1.3; letter-spacing: 0;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.deal-store { margin: auto 0 0; padding-top: 4px; font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-ends { margin: 0; display: flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--muted); }
.deal-ends.soon { color: var(--amber); font-weight: 700; }
.deal-ends .countdown-text { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.deal-ends { white-space: nowrap; }
/* Narrow cards (phone shelves): just the clock and the time; "Ends in" stays for screen readers. */
.deal-card { container-type: inline-size; }
@container (max-width: 199px) {
    .deal-ends-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.deal-ends.ended { color: var(--muted); }

.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.price-now { color: var(--red); font-size: 1.15rem; font-weight: 800; }
.price-was { color: var(--muted); font-size: .85rem; }
.deal-text { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--red-soft); color: var(--red-dark); font-size: .8rem; font-weight: 700; }

.price-large .price-now { font-size: 2rem; }
.price-large .price-was { font-size: 1.05rem; }
.price-large .deal-text { padding: 4px 10px; font-size: 1rem; }

/* ---------- Deal page ---------- */

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 12px 0; font-size: .875rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }
.crumbs .icon { width: 14px; height: 14px; }

.deal-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }

.gallery-frame {
    position: relative; overflow: hidden;
    margin: 0 calc(var(--gutter) * -1);
    background: #fff; box-shadow: var(--shadow);
}
.gallery-track {
    display: flex; aspect-ratio: 4 / 3;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
    position: relative; flex: 0 0 100%; margin: 0; scroll-snap-align: center; scroll-snap-stop: always;
    container-type: size; --mat: 28px; --photo-radius: 8px; background: var(--photo-mat); /* 28px keeps the dots on the mat */
}
.gallery-empty { aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: 5rem; background: linear-gradient(135deg, var(--blue-soft), #f1f8e6); }
.deal-badges-large { top: 12px; left: 12px; }
.deal-badges-large .pill { padding: 4px 10px; font-size: .9rem; }

.gallery-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    display: none; place-items: center; width: 40px; height: 40px; padding: 0;
    border: 0; border-radius: 50%; background: rgb(255 255 255 / 94%); box-shadow: var(--shadow-hover);
    color: var(--ink); cursor: pointer;
}
.gallery-nav .icon { width: 22px; height: 22px; }
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }
@media (hover: hover) {
    .gallery-nav { display: grid; }
}

.gallery-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 2px; }
.gallery-dots button { width: 20px; height: 20px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.gallery-dots button::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: rgb(27 36 48 / 30%); transition: width .2s, background-color .2s; }
.gallery-dots button[aria-current="true"]::before { width: 18px; background: var(--blue); }

.gallery-thumbs { display: none; }

.deal-info h1 { font-size: 1.45rem; margin-bottom: 10px; }
.you-save { margin: 6px 0 0; color: var(--red); font-weight: 700; }
.deal-dates {
    display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; padding: 10px 12px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .95rem;
}
.deal-dates .icon { margin-top: 3px; color: var(--muted); }
.deal-dates.soon { background: var(--amber-soft); border-color: #f3d6ab; color: var(--amber); }
.deal-dates.soon .icon { color: var(--amber); }
.deal-dates.soon .muted { color: #874510; }

/* Deal page: live countdown to the end of the special */
.countdown {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; padding: 10px 12px;
    background: var(--blue-soft); border: 1px solid #b9d8ee; border-radius: var(--radius-sm); color: #0b3a5c;
}
.countdown-label { font-weight: 700; margin-right: 4px; }
.countdown-box {
    display: inline-flex; flex-direction: column; align-items: center; min-width: 52px; padding: 4px 6px;
    background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
}
.countdown-box strong { font-size: 1.35rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.countdown-box small { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.countdown.soon { background: var(--amber-soft); border-color: #f3d6ab; color: var(--amber); }
.countdown.ended { opacity: .6; }

.store-card { margin-top: 16px; padding: 14px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.store-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; color: inherit; text-decoration: none; }
.store-card-head:hover { color: inherit; }
.store-card-head:hover strong { color: var(--blue); }
.store-card-head > span:not(.avatar) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.store-card-head > .avatar { flex: none; }
.store-card-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-card-head .muted { font-size: .875rem; }
.store-card-arrow { color: var(--muted); }
.store-card-address { display: flex; gap: 6px; margin: -4px 0 12px; color: var(--muted); font-size: .9rem; }
.store-card-address .icon { margin-top: 3px; }

/* A store's locations: main address and other branches (store page and deal page) */
.store-locations { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; font-size: .9rem; }
.store-locations li { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.store-locations li:last-child { border-bottom: 0; padding-bottom: 0; }
.store-locations li > .icon { margin-top: 3px; color: var(--muted); flex: none; }
.store-location-text { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.store-location-text .muted { display: block; }
.store-location-links { display: flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 600; }
.store-location-links a { white-space: nowrap; }
.store-hero .store-locations { margin-top: 12px; }

/* Store details form: other branches */
.branch-row { margin: 0 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.branch-row-title { margin: 0 0 8px; font-weight: 700; }

/* Category chips with nothing running right now */
.chip.chip-empty { opacity: .55; cursor: default; }
.chip.chip-empty:hover { border-color: var(--line); }
.plain-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.store-card .actions .button { flex: 1 1 calc(50% - 8px); }

.deal-description { margin-top: 22px; }
.deal-description h2 { font-size: 1.1rem; }
.deal-description p { white-space: pre-line; overflow-wrap: anywhere; }
.fine-print { margin-top: 20px; color: var(--muted); font-size: .82rem; }

@media (min-width: 640px) {
    .gallery-frame { margin: 0; border-radius: var(--radius); }
}

@media (min-width: 960px) {
    .deal-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: start; }
    .gallery { position: sticky; top: calc(var(--header-h) + 16px); }
    .gallery-track, .gallery-empty { aspect-ratio: 1; }
    .gallery-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
    .gallery-thumbs button {
        width: 68px; height: 68px; padding: 0; overflow: hidden; cursor: pointer;
        background: #fff; border: 2px solid var(--line); border-radius: var(--radius-sm);
    }
    .gallery-thumbs button[aria-current="true"] { border-color: var(--blue); }
    .gallery-thumbs img { display: block; width: 100%; height: 100%; object-fit: contain; }
    .deal-info h1 { font-size: 1.9rem; }
    .deal-info { padding-top: 4px; }
}

/* ---------- Store avatar, store page and store list ---------- */

.avatar {
    flex: none; display: block; width: 48px; height: 48px; border-radius: 12px;
    object-fit: contain; background: #fff; border: 1px solid var(--line);
}
.avatar-initials {
    display: grid; place-items: center; border: 0;
    background: hsl(var(--hue, 205) 50% 30%); color: #fff;
    font-weight: 800; font-size: 1rem; letter-spacing: .02em;
}
.avatar-large { width: 64px; height: 64px; border-radius: 16px; font-size: 1.4rem; }

.store-hero { margin-top: 16px; padding: 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.store-hero-head { display: flex; align-items: center; gap: 14px; }
.store-hero-head > div { min-width: 0; }
.store-hero h1 { margin-bottom: 4px; overflow-wrap: anywhere; }
.store-hero-head .muted { display: flex; gap: 6px; margin: 0; font-size: .95rem; }
.store-hero-head .muted .icon { margin-top: 4px; }
.store-description { max-width: 70ch; margin: 14px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.store-hero .actions { margin-top: 14px; }
.store-hero .actions .button { flex: 1 1 calc(50% - 8px); }
.store-contact { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 14px; color: var(--muted); font-size: .92rem; }
.store-contact li { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }

.store-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 16px; }
.store-tile {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    color: inherit; text-decoration: none; transition: box-shadow .15s;
}
.store-tile:hover { color: inherit; box-shadow: var(--shadow-hover); }
.store-tile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.store-tile-text strong {
    line-height: 1.3; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.store-tile-text .muted { font-size: .875rem; }

@media (min-width: 640px) {
    .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .store-hero { padding: 24px; }
    .store-hero-head { gap: 20px; }
    .avatar-large { width: 96px; height: 96px; border-radius: 22px; font-size: 2rem; }
    .store-hero .actions .button { flex: 0 0 auto; }
}

@media (min-width: 960px) {
    .store-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Listing pages: headings, filters, pager, empty states ---------- */

.page-head { padding: 20px 0 8px; }
.page-head h1 { margin-bottom: 2px; }
.page-head p { margin: 0; }

.filters { display: grid; gap: 10px; margin-top: 8px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.select { position: relative; display: flex; flex: 1 1 150px; }
.select select {
    width: 100%; min-height: 42px; padding: 8px 36px 8px 14px;
    appearance: none; -webkit-appearance: none;
    border: 1px solid #cfd7e1; border-radius: 999px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6675' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
    font: inherit; font-size: 1rem; color: var(--ink); cursor: pointer;
}
.select select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 14px;
    border: 1px solid #cfd7e1; border-radius: 999px; background: #fff;
    font-weight: 600; font-size: .95rem; cursor: pointer; user-select: none;
}
.toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.toggle:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }

@media (min-width: 640px) {
    .select { flex: 0 1 230px; }
}
/* Search and filters side by side only when both fit; below this the search box would be squeezed. */
@media (min-width: 1000px) {
    .filters { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}

.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 4px; }
.clear-filters { margin-left: 4px; font-size: .9rem; font-weight: 600; }
.deals-page .deal-grid { margin-top: 16px; }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 28px 0 8px; }
.pager > :first-child { justify-self: start; }
.pager > :last-child { justify-self: end; }
.pager-info { color: var(--muted); font-size: .9rem; }

.empty { margin: 24px 0; padding: 36px 20px; text-align: center; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-icon { margin: 0 0 8px; font-size: 2.6rem; line-height: 1; }
.empty p { max-width: 46ch; margin-left: auto; margin-right: auto; color: var(--muted); }

/* ---------- Call-to-action band ---------- */

.cta-band {
    position: relative; overflow: hidden;
    display: grid; gap: 16px; margin: 40px 0 8px; padding: 26px 20px 22px;
    border-radius: 20px; color: #fff;
    background: linear-gradient(135deg, #1b2430, #2c3e57);
}
.cta-band::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--stripe); }
.cta-band h2 { margin-bottom: 6px; }
.cta-band p { margin: 0; max-width: 60ch; opacity: .9; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (min-width: 960px) {
    .cta-band { grid-template-columns: 1fr auto; align-items: center; padding: 34px 36px 30px; }
}

/* ---------- For business ---------- */

.steps { display: grid; gap: 12px; }
.steps li, .features li { padding: 18px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.step-number {
    display: inline-grid; place-items: center; width: 34px; height: 34px; margin-bottom: 10px;
    border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800;
}
.steps h3, .features h3 { margin-bottom: 4px; }
.steps p, .features p { margin: 0; color: var(--muted); font-size: .95rem; }
.features { display: grid; gap: 12px; }
.features li { display: flex; gap: 14px; }
.features li > .icon { width: 42px; height: 42px; padding: 10px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); }

.faq details { margin-bottom: 8px; background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.faq summary {
    display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px;
    font-weight: 600; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 16px 14px; color: var(--muted); }

@media (min-width: 640px) {
    .steps, .features { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

@media (min-width: 960px) {
    .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Notices ---------- */

.notice {
    display: block; margin: 0 0 16px; padding: 12px 14px;
    border: 1px solid; border-radius: var(--radius-sm); font-size: .95rem;
}
.notice .icon { margin-right: 4px; }
.notice a { font-weight: 600; }
.notice-info { background: var(--blue-soft); border-color: #b9d8ee; color: #0b3a5c; }
.notice-success { background: #eaf6ec; border-color: #b7dfbf; color: #14532d; }
.notice-error { background: var(--red-soft); border-color: #f3b9b9; color: #7f1d1d; }
.notice-note { display: block; margin: 6px 0; font-style: italic; }

/* ---------- Forms (dashboard and sign-in) ---------- */

.form-card { margin-bottom: 16px; padding: 18px 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.form-card > h2 { font-size: 1.1rem; margin-bottom: 12px; }
.form-card > .hint:first-of-type { margin-top: -6px; }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label, .field .label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .95rem; }
.optional { color: var(--muted); font-weight: 400; font-size: .9em; }
.input {
    display: block; width: 100%; min-height: 46px; padding: 10px 12px;
    border: 1px solid #c5ced9; border-radius: var(--radius-sm); background: #fff;
    font: inherit; font-size: 1rem; color: var(--ink);
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.45; }
select.input {
    appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6675' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
}
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.input.invalid { outline: none; border-color: #c81e1e; }
.input-short { max-width: 240px; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: .875rem; }
.admin-version { margin-top: 28px; text-align: center; font-size: .8rem; }
.validation-message { margin: 6px 0 0; color: #b91c1c; font-size: .9rem; font-weight: 600; }
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 640px) {
    .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-card { padding: 22px 24px; }
}
.field-row .field:last-child { margin-bottom: 16px; }

.switch, .check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.switch input, .check input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue); flex: none; }

.form-actions {
    position: sticky; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); z-index: 5;
    display: flex; flex-wrap: wrap; gap: 8px; margin: 0 calc(var(--gutter) * -1) 16px; padding: 12px var(--gutter);
    background: rgb(244 246 249 / 94%); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    border-top: 1px solid var(--line);
}
@media (min-width: 960px) {
    .form-actions { bottom: 0; margin: 0 0 16px; padding: 12px 0; }
}
.button[disabled], .button:disabled { opacity: .55; cursor: not-allowed; }
.button-danger { background: #c81e1e; color: #fff; }
.button-danger:hover { background: #a31919; color: #fff; }
.button-block { width: 100%; }

.saving-preview { display: flex; align-items: center; gap: 8px; margin: -6px 0 16px; color: var(--muted); font-size: .9rem; }

/* Picking files: the real input covers the styled tile, so taps and keyboard both work. */
.upload-tile, .file-button { position: relative; overflow: hidden; cursor: pointer; }
.upload-tile input[type=file], .file-button input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-tile:focus-within, .file-button:focus-within { outline: 3px solid var(--cyan); outline-offset: 2px; }
.upload-tile.busy, .file-button.busy { opacity: .7; cursor: progress; }

.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) {
    .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.photo-tile { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: #fff; border: 1px solid var(--line); }
.photo-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pill-cover { position: absolute; top: 6px; left: 6px; background: var(--ink); color: #fff; }
.photo-tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgb(0 0 0 / 45%)); }
.tool-button {
    display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
    border: 0; border-radius: 50%; background: rgb(255 255 255 / 94%); color: var(--ink); cursor: pointer;
}
.tool-button:disabled { opacity: .35; cursor: default; }
.tool-button .icon { width: 18px; height: 18px; }
.tool-danger { color: #b91c1c; }
.upload-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    aspect-ratio: 1; padding: 8px; text-align: center;
    border: 2px dashed #b8c3d0; border-radius: var(--radius-sm); background: var(--bg);
    color: var(--blue); font-weight: 700; font-size: .9rem;
}
.upload-tile:hover { border-color: var(--blue); background: var(--blue-soft); }
.upload-tile .icon { width: 28px; height: 28px; }

.logo-field { display: flex; align-items: center; gap: 16px; }
.logo-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Dashboard ---------- */

.dash { padding-top: 16px; }
.dash-narrow { max-width: 820px; }
.dash-head { margin-bottom: 16px; }
.dash-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dash-title-row h1 { margin: 0; }
.dash-tabs { display: flex; gap: 4px; margin-top: 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tabs a {
    padding: 10px 14px; margin-bottom: -1px; border-bottom: 3px solid transparent;
    color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap;
}
.dash-tabs a:hover { color: var(--ink); }
.dash-tabs a.active { color: var(--blue); border-bottom-color: var(--blue); }
.dash-lead { color: var(--muted); }
.loading { padding: 24px 0; }
.store-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 16px; color: var(--muted); font-size: .92rem; }
.store-link a { font-weight: 600; overflow-wrap: anywhere; }
.setup-card { text-align: center; padding: 32px 20px; }
.setup-card p { max-width: 46ch; margin-left: auto; margin-right: auto; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { padding: 12px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 1.5rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .82rem; }

.dash-filters { padding-top: 0; padding-bottom: 12px; }
.dash-filters .chip { font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.chip-count { color: inherit; opacity: .7; font-weight: 700; }

.dash-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dash-item {
    display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: start;
    padding: 12px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
}
.dash-thumb {
    display: grid; place-items: center; width: 72px; height: 72px; overflow: hidden;
    border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg); font-size: 2rem; text-decoration: none;
}
.dash-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.dash-item-main { min-width: 0; display: grid; gap: 2px; }
.dash-item-title { color: var(--ink); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.dash-item-title:hover { color: var(--blue); text-decoration: underline; }
.dash-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.dash-item-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.confirm-text { font-weight: 700; color: #b91c1c; margin-right: 4px; }
@media (min-width: 760px) {
    .dash-item { grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; }
    .dash-item-actions { grid-column: auto; justify-content: flex-end; }
}

.state { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.state-live { background: #dcf3e2; color: #14532d; }
.state-waitingforapproval { background: var(--blue-soft); color: #0b3a5c; }
.state-scheduled { background: #ede4f8; color: #4c1d95; }
.state-paused { background: #eef1f4; color: #374151; }
.state-hiddenbyadmin, .state-storesuspended { background: var(--red-soft); color: #7f1d1d; }
.state-ended { background: #eef1f4; color: #6b7280; }

/* ---------- Admin ---------- */

.admin-tag { padding: 4px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.tab-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: .75rem; font-weight: 800; }
.header-admin { display: none; }
@media (min-width: 960px) {
    .header-admin { display: inline-flex; }
}
.section-title-sm { margin: 24px 0 12px; font-size: 1.15rem; }
.stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) {
    .stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.admin-toolbar { margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-toolbar .search-box { flex: 1 1 260px; }
.review-head + .actions { margin-bottom: 16px; }

/* Bulk import (admin) */
.import-rules { margin: 10px 0 14px; padding-left: 18px; }
.import-rules li { margin-bottom: 4px; }
.import-example { margin-top: 14px; }
.import-example summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.import-example pre {
    margin: 8px 0 0; padding: 12px; overflow-x: auto; background: var(--bg); border: 1px solid var(--line);
    border-radius: var(--radius-sm); font-size: .8rem; line-height: 1.45;
}
.import-links { margin: 0 0 16px; padding-left: 18px; }

/* "Is this your store?" on the page of a store an admin manages */
.claim-store { margin: 28px 0 8px; padding: 18px 16px; background: var(--blue-soft); border: 1px solid #b9d8ee; border-radius: var(--radius); color: #0b3a5c; }
.claim-store h2 { margin: 0 0 6px; font-size: 1.15rem; }
.claim-store p { margin: 0 0 12px; }
.claim-store .hint { margin: 10px 0 0; color: #0b3a5c; }

.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.review-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.review-head > div { min-width: 0; }
.review-head h2, .review-head h3 { margin: 0 0 4px; overflow-wrap: anywhere; }
.review-head h3 a { color: var(--ink); text-decoration: none; }
.review-head h3 a:hover { color: var(--blue); text-decoration: underline; }
.review-head p { margin: 0 0 4px; }
.detail-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: .95rem; }
.detail-list dt { color: var(--muted); font-weight: 600; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.detail-heading { margin: 16px 0 4px; font-size: .95rem; color: var(--muted); }
.review-description { margin: 10px 0 12px; white-space: pre-line; overflow-wrap: anywhere; }
.review-card .actions { margin-top: 12px; }

.state-pending { background: var(--blue-soft); color: #0b3a5c; }
.state-approved { background: #dcf3e2; color: #14532d; }
.state-rejected { background: var(--red-soft); color: #7f1d1d; }
.state-suspended { background: #fde8d0; color: #7c2d12; }

.admin-store-row .dash-thumb { border: 0; background: none; }
.admin-store-row .avatar { width: 56px; height: 56px; }

.category-row { grid-template-columns: 44px minmax(0, 1fr); align-items: center; }
.category-row.is-hidden { opacity: .7; }
.category-icon { font-size: 1.8rem; text-align: center; }
.category-edit { grid-column: 1 / -1; display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 0 12px; align-items: end; }
.category-edit .field:nth-child(3), .category-edit .switch, .category-edit .actions { grid-column: 1 / -1; }
.category-edit .switch { margin-bottom: 14px; }
.input-icon { text-align: center; font-size: 1.4rem; padding: 6px; }
.input-number { max-width: 120px; }
.add-category { margin-top: 20px; }
kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: #fff; font: inherit; font-size: .85em; }
@media (min-width: 760px) {
    .category-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
    .category-edit { grid-template-columns: 80px minmax(0, 1fr) 120px auto auto; gap: 0 12px; }
    .category-edit .field:nth-child(3), .category-edit .switch, .category-edit .actions { grid-column: auto; }
    .category-edit .field, .category-edit .switch, .category-edit .actions { margin-bottom: 0; }
    .category-edit .switch { align-self: center; }
}

/* ---------- Sign-in and register ---------- */

.auth-wrap { max-width: 460px; padding-top: 24px; padding-bottom: 24px; }
.auth-card { padding: 22px 18px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-card > p { color: var(--muted); }
.auth-card form { margin-top: 18px; }
.auth-card .check { margin: 4px 0 18px; font-weight: 500; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: .85rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-links { display: grid; gap: 8px; margin-top: 18px; font-size: .95rem; }
.auth-switch { margin-top: 16px; text-align: center; }
.auth-legal { margin: 14px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; text-align: center; }

/* ---------- Terms, privacy and disclaimer ---------- */

.legal { padding-bottom: 36px; }
.legal .page-head { padding-top: 14px; }
.legal [id] { scroll-margin-top: calc(var(--header-h) + 12px); }
.legal h2 { margin: 32px 0 10px; font-size: 1.2rem; }
.legal h3 { margin: 22px 0 6px; font-size: 1rem; }
.legal p, .legal li { line-height: 1.6; }
.legal p { margin: 0 0 10px; }
.legal ul { margin: 0 0 10px; padding-left: 1.3em; }
.legal li + li { margin-top: 6px; }
.legal-summary {
    margin: 14px 0 8px; padding: 14px 18px;
    background: var(--blue-soft); border: 1px solid #b9d8ee; border-radius: var(--radius); color: #0b3a5c;
}
.legal .legal-summary h2 { margin: 0 0 6px; font-size: 1rem; }
.legal-summary ul { margin: 0; }
.legal-cookies { display: grid; gap: 8px; margin: 14px 0; }
.legal-cookies > div { padding: 12px 16px; background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.legal-cookies dt { font-weight: 700; }
.legal-cookies dd { margin: 2px 0 0; line-height: 1.5; }
.legal-cookies dd.muted { font-size: .875rem; }
.form-rules { margin: 0 0 12px; }
@media (min-width: 640px) {
    .auth-card { padding: 28px 30px; }
}

/* ---------- Toast ("Link copied") ---------- */

.toast {
    position: fixed; left: 50%; z-index: 60;
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 16px);
    transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
    padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff;
    font-weight: 600; font-size: .92rem; box-shadow: var(--shadow-hover);
    transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 960px) {
    .toast { bottom: 24px; }
}

/* ---------- Account pages (template, Bootstrap) ---------- */

.account-wrap { max-width: 980px; padding-top: 24px; padding-bottom: 24px; }
.account-wrap h1 { font-size: 1.6rem; margin-bottom: .6em; }
.account-wrap h2 { font-size: 1.15rem; }
.account-wrap .btn-primary {
    --bs-btn-bg: var(--blue); --bs-btn-border-color: var(--blue);
    --bs-btn-hover-bg: var(--blue-dark); --bs-btn-hover-border-color: var(--blue-dark);
    --bs-btn-active-bg: var(--blue-dark); --bs-btn-active-border-color: var(--blue-dark);
}
.account-wrap a { color: var(--blue); }

.account-wrap .valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.account-wrap .invalid { outline: 1px solid #e50000; }

.darker-border-checkbox.form-check-input { border-color: #929292; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ---------- Blazor error UI ---------- */

#blazor-error-ui {
    display: none; position: fixed; left: 0; bottom: 0; z-index: 1000; width: 100%;
    padding: .6rem 1.25rem .7rem; background: lightyellow; box-shadow: 0 -1px 2px rgb(0 0 0 / 20%);
}
#blazor-error-ui .dismiss { position: absolute; right: .75rem; top: .5rem; cursor: pointer; }

.blazor-error-boundary { padding: 1rem; background: #b32121; color: #fff; }
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ---------- Less motion when the phone asks for it ---------- */

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

/* Admin > Email (v1.6) */
.email-from { margin: -6px 0 14px; }
.form-card .detail-list + .hint { margin: 12px 0 16px; }

/* Not interested page, /not-interested (v1.7) */
.not-interested { max-width: 640px; padding-top: 24px; padding-bottom: 36px; }
.ni-card { padding: 28px 18px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.ni-emoji { margin: 0 0 8px; font-size: 3.2rem; line-height: 1; }
.ni-eyebrow { color: var(--red); opacity: 1; }
.ni-card h1 { font-size: 1.75rem; margin-bottom: 8px; }
.ni-lead { max-width: 44ch; margin: 0 auto 14px; color: var(--muted); font-size: 1.05rem; }
.ni-count { max-width: 46ch; margin: 0 auto 22px; padding: 12px 14px; background: var(--amber-soft); border-radius: var(--radius-sm); color: #7a3e06; }
.ni-subtitle { margin: 0 0 10px; font-size: 1.05rem; }
.ni-missing { display: grid; gap: 8px; max-width: 46ch; margin: 0 auto 24px; padding: 0; list-style: none; text-align: left; }
.ni-missing li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); }
.ni-missing li span { flex: none; font-size: 1.2rem; line-height: 1.3; }
.ni-notice, .ni-form { max-width: 400px; margin-left: auto; margin-right: auto; text-align: left; }
.ni-actions { display: grid; gap: 10px; }
.ni-leave { color: var(--muted); }
.ni-fine { max-width: 46ch; margin: 20px auto 0; color: var(--muted); font-size: .85rem; }
.ni-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ni-done .actions { margin-top: 20px; }
@media (min-width: 640px) {
    .ni-card { padding: 36px 32px; }
    .ni-card h1 { font-size: 2.1rem; }
}

/* ---------- Store subscription (v1.8): dashboard Subscription tab, Admin > Payments ---------- */

.state-notpaid { background: var(--red-soft); color: #7f1d1d; }
.notice-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.notice-action > div { flex: 1 1 260px; }
.sub-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sub-card .sub-head h2 { margin: 0; font-size: 1.1rem; }
.sub-price { margin: 4px 0 0; color: var(--muted); }
.sub-price strong { color: var(--ink); font-size: 1.6rem; }
.sub-status { margin: 0 0 14px; font-size: 1rem; }
.sub-claim p { margin: 0 0 10px; }
.sub-pay { margin: 4px 0 0; }
.sub-pay .button { width: 100%; }
.sub-benefits { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.sub-benefits li { display: flex; align-items: flex-start; gap: 10px; }
.sub-benefits .icon { flex: none; margin-top: 3px; color: var(--blue); }
.sub-history { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.sub-history li { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.sub-history li:first-child { border-top: 0; padding-top: 0; }
.sub-history li > div { display: grid; gap: 2px; }
.sub-history .muted { font-size: .85rem; }
.sub-admin-form { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.sub-admin-history { gap: 10px; }
.payment-row .dash-item-title { margin: 0 0 4px; }
.payment-row .dash-item-meta { margin: 0; }
.notice .payment-row { margin-bottom: 10px; }
@media (min-width: 640px) {
    .sub-pay .button { width: auto; }
}
/* List rows without a picture (Admin > Payments). */
.dash-item.dash-item-text { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) {
    .dash-item.dash-item-text { grid-template-columns: minmax(0, 1fr) auto; }
}
