/* Birthday.Gold dev8 — app theme. Mobile-first, layered on Bootstrap 5.3. */

/* Always show the vertical scrollbar to avoid layout shift between
   scrolling and non-scrolling pages. */
html { overflow-y: scroll; }

:root {
    --bg-gold: #E8B500;
    --bg-gold-soft: #FFF3CD;
    --bg-ink: #1A1523;
    --bg-ink-2: #2A2335;
    --bg-grad: linear-gradient(135deg, #6D28D9 0%, #9333EA 45%, #E8B500 120%);
    --bg-radius: 16px;
    --bg-shadow: 0 6px 24px rgba(26, 21, 35, 0.10);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #F7F6FB;
    color: var(--bg-ink);
    padding-bottom: 76px;            /* room for mobile bottom nav */
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* App column: comfortable on phones, widens into a real layout on desktop. */
.app-shell { width: 100%; max-width: 560px; margin: 0 auto; padding-left: .25rem; padding-right: .25rem; }
@media (min-width: 768px)  { .app-shell { max-width: 720px; } }
@media (min-width: 992px)  { .app-shell { max-width: 960px; } }

/* Forms read better narrow even when the shell is wide. */
.form-narrow { max-width: 480px; margin-left: auto; margin-right: auto; }

/* Sticky footer: footer sits at the bottom of the viewport on short pages. */
body { display: flex; flex-direction: column; min-height: 100vh; }
body > main { flex: 1 0 auto; }
body > header, body > footer, body > nav { flex-shrink: 0; }

/* Missing-in-Bootstrap helper: lets flex children shrink so text-truncate works. */
.min-w-0 { min-width: 0 !important; }

a { color: #6D28D9; }

/* ---- Top bar ---- */
.bg-topbar {
    position: sticky; top: 0; z-index: 1020;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #ECE9F3;
    height: 56px;
}
.bg-brand { font-weight: 800; letter-spacing: -0.02em; color: var(--bg-ink); text-decoration: none; }
.bg-brand .dot { color: var(--bg-gold); }

/* ---- Buttons ---- */
.btn-gold {
    background: var(--bg-gold); border: none; color: #2A2200; font-weight: 700;
}
.btn-gold:hover, .btn-gold:focus { background: #D4A600; color: #2A2200; }
.btn-ink { background: var(--bg-ink); border: none; color: #fff; font-weight: 600; }
.btn-ink:hover { background: #000; color: #fff; }
/* brand-gradient pill (e.g. the staff "Admin Dashboard" header button) */
.btn-grad { background: var(--bg-grad); border: none; color: #fff; font-weight: 700; box-shadow: 0 2px 10px rgba(109,40,217,.28); }
.btn-grad:hover, .btn-grad:focus { color: #fff; filter: brightness(1.06); box-shadow: 0 4px 16px rgba(109,40,217,.36); }

/* ---- Hero ---- */
.bg-hero {
    position: relative; overflow: hidden; text-align: center;
    background:
        radial-gradient(900px 380px at 50% -8%, #FBE9B8 0%, rgba(251,233,184,0) 62%),
        radial-gradient(700px 320px at 88% 0%, #EADCFB 0%, rgba(234,220,251,0) 55%),
        #FCFBFE;
    border-bottom: 1px solid #EFEAF6;
    padding: 2.4rem 1.25rem 1.4rem;
}
.bg-hero .hero-inner { max-width: 660px; margin: 0 auto; position: relative; z-index: 2; }
.bg-hero h1 {
    font-weight: 800; letter-spacing: -0.035em; line-height: 1.08;
    color: var(--bg-ink); font-size: 2rem;
}
/* highlighter swash on the key phrase */
.bg-hero h1 .hl {
    background: linear-gradient(transparent 58%, #FFD75E 58% 92%, transparent 92%);
    padding: 0 .1em; white-space: nowrap;
}
.bg-hero .lead { color: #5C5570; }
.bg-hero .eyebrow {
    display: inline-flex; align-items: center; gap: .4rem;
    background: #fff; border: 1px solid #ECE6F5; color: #6D28D9;
    font-weight: 700; font-size: .8rem; border-radius: 999px;
    padding: .35rem .8rem; box-shadow: var(--bg-shadow);
}
.bg-hero .trust { color: #8A8398; font-size: .82rem; }
.bg-hero .trust .stars { color: #E8B500; letter-spacing: 1px; }
@media (min-width: 768px) {
    .bg-hero { padding: 3.6rem 1.5rem 1.8rem; }
    .bg-hero h1 { font-size: 3rem; }
}

/* confetti sprinkle (decorative, behind content) */
.confetti { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.confetti i {
    position: absolute; width: 9px; height: 9px; border-radius: 2px; opacity: .85;
    transform: rotate(var(--r, 20deg));
}
.confetti i:nth-child(1){left:8%;  top:24%; background:#E8B500; --r:18deg;}
.confetti i:nth-child(2){left:18%; top:62%; background:#9333EA; --r:-22deg; border-radius:50%;}
.confetti i:nth-child(3){left:30%; top:14%; background:#FF7AB2; --r:35deg;}
.confetti i:nth-child(4){left:72%; top:18%; background:#3BC9A6; --r:-12deg; border-radius:50%;}
.confetti i:nth-child(5){left:86%; top:52%; background:#E8B500; --r:28deg;}
.confetti i:nth-child(6){left:62%; top:70%; background:#9333EA; --r:-30deg;}
.confetti i:nth-child(7){left:48%; top:8%;  background:#FF7AB2; --r:14deg; border-radius:50%;}
.confetti i:nth-child(8){left:90%; top:30%; background:#3BC9A6; --r:-18deg;}

/* brand marquee (social proof) */
.brand-marquee { overflow: hidden; padding: .9rem 0 .2rem;
    -webkit-mask: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
            mask: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.brand-marquee .track { display: flex; gap: .5rem; width: max-content; animation: bg-marquee 38s linear infinite; }
.brand-marquee:hover .track { animation-play-state: paused; }
.brand-chip {
    display: inline-flex; align-items: center; gap: .45rem; flex: 0 0 auto;
    background: #fff; border: 1px solid #ECE6F5; border-radius: 999px;
    padding: .3rem .7rem .3rem .35rem; font-size: .82rem; font-weight: 600; color: #3A3348;
}
.brand-chip .ic { width: 24px; height: 24px; border-radius: 50%; background: #F1EEF8;
    color: #6D28D9; font-weight: 800; font-size: .66rem; display: flex; align-items: center; justify-content: center; }
/* Real brand logo inside a ticker chip (rendered via brand_logo_html). */
.brand-chip .brand-logo { width: 24px; height: 24px; border-radius: 50%; font-size: .6rem; }
.brand-chip .brand-logo img { padding: 2px; }
@keyframes bg-marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .brand-marquee .track { animation: none; } }
/* The brand ticker is a deliberate "live" element, so it keeps scrolling even
   under Reduce Motion (matches the approved preview). !important re-asserts it
   over the guard above. */
.brand-marquee .track { animation: bg-marquee 38s linear infinite !important; }

/* ---- Cards ---- */
.bg-card {
    background: #fff; border: 1px solid #EFEDF5; border-radius: var(--bg-radius);
    box-shadow: var(--bg-shadow);
}
/* Action list: one card, rows split by hairlines (vs. separate tiles). */
.acct-list .acct-list-item { color: var(--bg-ink); transition: background .08s ease; }
.acct-list .acct-list-item + .acct-list-item { border-top: 1px solid #EFEDF5; }
.acct-list .acct-list-item:hover { background: #FAF8FF; }
.brand-tile { border: 1px solid #EFEDF5; border-radius: 14px; background:#fff; transition: transform .08s ease, box-shadow .08s ease; }
.brand-tile:active { transform: scale(0.99); }
.brand-logo {
    position: relative; overflow: hidden;
    width: 44px; height: 44px; border-radius: 10px;
    background: #F1EEF8; display:flex; align-items:center; justify-content:center;
    font-weight: 800; color:#6D28D9; flex-shrink: 0;
}
.brand-logo img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; background: #fff; padding: 4px;
}
/* user avatar (gradient initials) */
.bg-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; color: #fff; font-weight: 700; line-height: 1;
    overflow: hidden; flex-shrink: 0;
}
.dropdown-toggle.no-caret::after { display: none; }

/* enrollment-profile completion ring (wraps an avatar; --pct = 0..100) */
.profile-ring {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 2px; border-radius: 50%;
    background: conic-gradient(var(--bg-gold) calc(var(--pct, 0) * 1%), #E6E1F0 0);
}
.profile-ring .bg-avatar { box-shadow: 0 0 0 2px #fff; }
/* larger labelled ring for the nudge banner */
.profile-ring-lg { width: 44px; height: 44px; padding: 3px; }
.profile-ring-lg .profile-ring-num {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; border-radius: 50%; background: #fff;
    font-size: .68rem; font-weight: 700; color: var(--bg-ink);
}
.profile-nudge { border-left: 4px solid var(--bg-gold); }

/* ---- Admin layout ---- */
/* Admin is a tool — full browser width (with breathing room) + a touch of color. */
body.admin .app-shell { max-width: none; width: 100%; padding-left: 1.25rem; padding-right: 1.25rem; }
@media (min-width: 1700px) { body.admin .app-shell { max-width: 1680px; } }
body.admin {
    padding-bottom: 0;
    background:
        radial-gradient(900px 480px at 100% -8%, #ECDBFF 0%, rgba(236,219,255,0) 55%),
        radial-gradient(760px 420px at 0% 2%,  #FFEACB 0%, rgba(255,234,203,0) 50%),
        #F5F2FB;
    background-attachment: fixed;
}
.admin-sidebar { position: sticky; top: 84px; border-radius: 14px; }
/* Section heading (colored) with its sub-actions indented beneath it. */
.admin-sec { text-transform: uppercase; letter-spacing: .04em; font-size: .68rem; font-weight: 700; color: #9333EA; padding: .55rem .6rem .2rem; }
.admin-sec-items { border-left: 2px solid #ECE0FB; margin-left: .8rem; padding-left: .3rem; margin-bottom: .35rem; }
.admin-link {
    display: flex; align-items: center; gap: .5rem; padding: .38rem .55rem;
    border-radius: 8px; color: #564F66; text-decoration: none; font-size: .9rem; font-weight: 500;
}
.admin-link i { width: 18px; text-align: center; color: #9333EA; }
.admin-link:hover { background: #F3ECFF; color: #6D28D9; }
.admin-link.active { background: var(--bg-grad); color: #fff; }
.admin-link.active i { color: #fff; }
.admin-content { min-width: 0; }
.admin-wrap { padding-top: 1rem; }
@media (min-width: 992px) { .admin-wrap { padding-top: 1.5rem; } }
@media (max-width: 767.98px) { .admin-sidebar { position: static; } }
/* Reusable section header for admin pages — uppercase divider above a group of cards,
   giving the same roomier, sectioned rhythm the field-mappings console uses (which
   defined this locally as .fm-label). Pair with mb-4/mb-5 between sections. */
.admin-label { text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; font-weight: 700; color: #8B8398; }
/* Universal section rhythm: every section header carries the inter-section gap itself, so
   groups breathe consistently across every admin page (a generous 5rem between sections).
   A label opening a card/column (:first-child) gets no leading gap, and any page that tuned
   spacing with an explicit Bootstrap mt-* utility keeps its value (those are !important). */
.admin-label { margin-top: 5rem; }
.admin-label:first-child { margin-top: 0; }
/* Public marketing pages: the same generous rhythm between stacked content sections.
   Adjacent-sibling only, so a page-opening hero/full-bleed banner stays flush at the top —
   only sections that FOLLOW another section get the gap. Scoped to the .app-shell <main>
   wrapper (header.inc) so the selector carries a class: that lifts specificity to (0,1,2),
   which is needed to beat the Bootstrap mt-* utilities the sections carry — those are class
   (0,1,0) AND !important, so !important alone can't win; the higher specificity does. This
   normalizes every inter-section gap to ~5rem instead of the old mt-4/mt-lg-5 (1.5–3rem). */
.app-shell section + section { margin-top: 5rem !important; }
/* Centered, constrained column for a calmer admin page (same as the field-mappings .fm-wrap). */
.admin-narrow { max-width: 1100px; margin-inline: auto; }
/* Lighter placeholder text in admin forms so example hints read as hints, not values. */
.admin-narrow .form-control::placeholder,
.admin-narrow .form-select::placeholder { color: #c2c7cf; opacity: 1; }
/* Icon-led edit rows: a big coloured tile on the left, the field on the right. Used by the
   Social and Links cards on brand-details. When a value exists the tile is an <a ...> that
   opens the URL in a new tab; otherwise a dimmed <span>. */
.icon-rows .ir-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.icon-rows .ir-ico { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; color: #fff; font-size: 1.4rem; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.icon-rows .ir-field { flex: 1 1 auto; min-width: 0; }
.icon-rows .ir-field .form-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 .1rem; color: #8a8f98; }
.icon-rows a.ir-ico { text-decoration: none; transition: transform .12s, box-shadow .12s; }
.icon-rows a.ir-ico:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.28); }
.icon-rows .ir-ico-empty { opacity: .4; }
/* Cleaner admin list table: uppercase header, roomier rows, soft hover, hairline dividers. */
.admin-table { margin-bottom: 0; }
.admin-table thead th { text-transform: uppercase; letter-spacing: .04em; font-size: .68rem; font-weight: 700; color: #8B8398; background: transparent; border-bottom: 1px solid rgba(26,21,35,.09); padding: .55rem .75rem; }
.admin-table td { vertical-align: middle; padding: .65rem .75rem; border-color: rgba(26,21,35,.05); }
/* Each row (and its optional expandable detail row) is its own <tbody class="admin-group">,
   so hovering anywhere in the group highlights BOTH the main row and the detail row. */
.admin-table tbody.admin-group > tr > td { transition: background .12s ease; }
.admin-table tbody.admin-group .admin-subrow > td { background: #FBF9FF; }
.admin-table tbody.admin-group:hover > tr > td { background: #F7F3FF; }
.admin-table tbody.admin-group:last-child > tr:last-child > td { border-bottom: 0; }
/* Round initials avatar for people lists. */
.admin-avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .78rem; color: #fff; background: var(--bg-grad); flex: 0 0 auto; }

/* ---- Legal documents: safe rendering of migrated content ---- */
.legal-body { overflow-wrap: anywhere; word-break: break-word; }
.legal-body a, .legal-body code, .legal-body pre { overflow-wrap: anywhere; word-break: break-word; }
.legal-body img { max-width: 100%; height: auto; }
.legal-body pre { white-space: pre-wrap; }
.legal-body table { display: block; max-width: 100%; overflow-x: auto; }
.legal-body h1 { font-size: clamp(1.6rem, 6vw, 2.4rem); }

/* ---- Blog / article body ---- */
.content-body { overflow-wrap: anywhere; line-height: 1.7; }
.content-body h1, .content-body h2, .content-body h3 { font-weight: 800; letter-spacing: -0.01em; margin: 1.4rem 0 .6rem; line-height: 1.2; }
.content-body h1 { font-size: 1.6rem; } .content-body h2 { font-size: 1.3rem; } .content-body h3 { font-size: 1.1rem; }
.content-body p { margin: 0 0 1rem; }
.content-body ul, .content-body ol { margin: 0 0 1rem 1.25rem; }
.content-body li { margin-bottom: .35rem; }
.content-body img { max-width: 100%; height: auto; border-radius: 12px; }
.content-body a { color: #6D28D9; overflow-wrap: anywhere; }
.content-body blockquote { border-left: 3px solid var(--bg-gold); margin: 1rem 0; padding: .25rem 0 .25rem 1rem; color: #5C5570; }
.content-body table { display: block; max-width: 100%; overflow-x: auto; }

/* ---- Address autocomplete ---- */
.bg-ac-wrap { position: relative; }
.bg-ac-menu {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 1060;
    background: #fff; border: 1px solid #ECE6F5; border-radius: 10px; margin-top: 4px;
    box-shadow: 0 8px 24px rgba(26,21,35,.12); overflow: hidden; max-height: 280px; overflow-y: auto;
}
.bg-ac-item { padding: .5rem .7rem; font-size: .9rem; cursor: pointer; }
.bg-ac-item:hover, .bg-ac-item.active { background: #F1EEF8; color: #6D28D9; }

/* ---- Tour route map (Leaflet) ---- */
.tour-map-wrap { height: 320px; border-radius: 14px; overflow: hidden; padding: 0; }
#tourMap { height: 100%; width: 100%; }
.tour-pin {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: #6D28D9; color: #fff; font-weight: 700; font-size: .82rem;
    border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35);
}
.tour-pin-home { background: #198754; }

@media print {
    .tour-map-wrap { height: 300px; page-break-inside: avoid; border: 1px solid #ccc; }
    .leaflet-control-zoom, .leaflet-control-attribution { display: none !important; }
    #tourMap, .leaflet-tile, .tour-pin {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    body.no-print-map .tour-map-wrap { display: none !important; }
    .bg-bottomnav { display: none !important; }
}

/* ---- Status pills ---- */
.pill { font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }
a.pill { transition: filter .12s ease, box-shadow .12s ease; }
a.pill:hover { filter: brightness(.96); box-shadow: 0 1px 6px rgba(26,21,35,.12); }
.pill-enrolled    { background:#D1F2E1; color:#0F7A4A; }
.pill-in_progress { background:#FFE9C7; color:#9A5B00; }
.pill-queued      { background:#E5E0F5; color:#5B33C8; }
.pill-pending     { background:#EDEBF2; color:#564F66; }
.pill-failed      { background:#FBD9D9; color:#B02525; }
.pill-apponly     { background:#0E1726; color:#fff; }
a.pill-apponly:hover { background:#1d2b45; color:#fff; }
.qr-box { width:170px; height:170px; }
.qr-box svg { width:100%; height:100%; display:block; }
/* App-store buttons — each in its store's brand colour. */
.btn-appstore   { background:#0A84FF; color:#fff; border:0; }
.btn-appstore:hover, .btn-appstore:focus   { background:#0a74e0; color:#fff; }
.btn-googleplay { background:#01875F; color:#fff; border:0; }
.btn-googleplay:hover, .btn-googleplay:focus { background:#016b4b; color:#fff; }
/* App-only flag — red phone in the brand card's upper-right corner. */
.brand-grid-card, .brand-tile { position: relative; }
.brand-appflag { position:absolute; top:.5rem; right:.6rem; color:#dc3545; font-size:1.05rem; line-height:1; z-index:3; cursor:help; }
/* Small-font tooltip variant (Bootstrap custom-class). */
.tip-sm .tooltip-inner { font-size:.72rem; max-width:220px; padding:.4rem .55rem; }
.pill-supported   { background:#D1F2E1; color:#0F7A4A; }
.pill-experimental{ background:#FFF3CD; color:#856404; }
.pill-unsupported { background:#EDEBF2; color:#564F66; }

/* ---- Mobile bottom nav ---- */
.bg-bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    background: #fff; border-top: 1px solid #ECE9F3;
    display: flex; justify-content: space-around; align-items: center;
    height: 64px; padding-bottom: env(safe-area-inset-bottom);
}
.bg-bottomnav a {
    flex: 1; text-align: center; color: #8A8398; text-decoration: none;
    font-size: .68rem; font-weight: 600; padding-top: .35rem;
}
.bg-bottomnav a i { display:block; font-size: 1.35rem; line-height: 1; margin-bottom: 2px; }
.bg-bottomnav a.active { color: #6D28D9; }

@media (min-width: 560px) {
    .bg-bottomnav { max-width: 460px; margin: 0 auto; border-radius: 18px 18px 0 0; box-shadow: 0 -4px 20px rgba(26,21,35,.08); }
}
/* Roomier tap targets / wrapping safety for brand rows */
.brand-tile .fw-semibold { line-height: 1.2; }
.brand-tile { padding: .6rem !important; }

/* ==========================================================================
   dev8 THEME + DESKTOP SYSTEM (rolled out 2026-06-01)
   - Theme (brand lockup, button rims, cards, tags, cta-band) applies to ALL
     tiers, including the mobile-device design (themed functional components).
   - Desktop LAYOUT (wide column, top nav, multi-column footer, split/full-bleed
     hero) is gated under `body.wide`, which the SSR chrome adds only for
     NON-mobile-device agents. Mobile devices keep the app-style layout, themed.
   ========================================================================== */

/* ----- Brand lockup: gold cake mark + black "birthday.gold" wordmark ------- */
.brand-lockup { text-decoration: none; }
.brand-cake { height: 30px; width: auto; display: block; flex-shrink: 0; }
.brand-word { font-weight: 800; letter-spacing: -.02em; font-size: 1.2rem; color: #111; line-height: 1; }
.brand-dot  { color: #111; }

/* ----- Buttons: 1px rim 15% darker than the fill (static + color-mix) ------ */
.btn-gold  { border: 1px solid #C59A00; border-color: color-mix(in srgb, var(--bg-gold) 85%, #000); }
.btn-ink   { border: 1px solid #16121E; border-color: color-mix(in srgb, var(--bg-ink)  85%, #000); }
.btn-light { border: 1px solid #D3D4D5; }
.btn-glass {
  background: rgba(255,255,255,.7); border: 1px solid #D9D9D9; color: var(--bg-ink); font-weight: 600;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.btn-glass:hover, .btn-glass:focus { background: rgba(255,255,255,.92); color: var(--bg-ink); }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--bg-ink); font-weight: 600; }
.btn-ghost:hover { background: #F1EEF8; color: #6D28D9; }

/* ----- Brand grid card (richer tile used on home/discover) ------------------ */
.brand-grid-card {
  background:#fff; border:1px solid #EFEDF5; border-radius:16px; padding:1.15rem 1.15rem 1.1rem;
  height:100%; display:flex; flex-direction:column; gap:.85rem;
  transition: transform .1s ease, box-shadow .1s ease, border-color .1s ease;
}
.brand-grid-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(26,21,35,.10); border-color:#E1D8F5; }
.brand-grid-card .head { display:flex; align-items:center; gap:.7rem; }
.brand-grid-card .head .fw-semibold { margin-bottom:.2rem; }
.brand-grid-card .reward { color:#564F66; font-size:.88rem; line-height:1.4; flex-grow:1; }

/* Anchor target after add (PRG redirect lands on #brand-<id>): offset below the sticky nav. */
[id^="brand-"] { scroll-margin-top: 80px; }

/* ----- Impersonation indicator (admin viewing as another user) -------------- */
/* Muted: a subtle amber wash on the header bar + a small chip; the Stop action
   lives in the avatar menu. No loud striping. */
body.is-impersonating .bg-topbar {
  background: repeating-linear-gradient(45deg, #fbf1d9, #fbf1d9 11px, #f4e3b8 11px, #f4e3b8 22px);
  box-shadow: inset 0 -1px 0 rgba(180,130,0,.25);
}
.impersonation-chip {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
  color: #7a5600; background: #ffefc2; border: 1px solid #f0d488;
}

/* ----- Floating "scroll to top" button -------------------------------------- */
.scroll-top-btn {
  position: fixed; right: 20px; bottom: 24px; z-index: 1035;
  width: 46px; height: 46px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: #2A2435; border: 1px solid #E6E1F0;
  box-shadow: 0 6px 20px rgba(26,21,35,.14);
  font-size: 1.2rem; line-height: 1; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s, box-shadow .18s ease, border-color .18s ease;
}
.scroll-top-btn.show { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(26,21,35,.18); border-color: #C9B3EC; color: #6D28D9; }
/* On mobile, clear the fixed bottom tab nav (64px tall). */
.scroll-top-btn.above-tabbar { bottom: calc(64px + env(safe-area-inset-bottom) + 14px); }

/* Cookie consent bar — fun, lightweight, dismissed via JS (cookieconsent.inc). */
.cookie-consent {
  position: fixed; left: 14px; right: 14px; bottom: 16px; z-index: 1040;
  margin: 0 auto; max-width: 640px;
  display: flex; align-items: center; gap: .65rem .9rem; flex-wrap: wrap;
  padding: .7rem .85rem .7rem 1rem;
  background: var(--bg-ink); color: #F4F0FB;
  border: 1px solid #2A2335; border-left: 4px solid var(--bg-gold);
  border-radius: 16px; box-shadow: 0 12px 34px rgba(26,21,35,.28);
  opacity: 0; transform: translateY(14px);
  transition: opacity .22s ease, transform .22s ease;
}
.cookie-consent.show { opacity: 1; transform: translateY(0); }
.cookie-consent[hidden] { display: none; }
.cookie-consent .cookie-emoji { font-size: 1.5rem; line-height: 1; flex: 0 0 auto; }
.cookie-consent .cookie-copy { margin: 0; flex: 1 1 220px; font-size: .85rem; line-height: 1.35; color: #E7E1F2; }
.cookie-consent .cookie-copy strong { color: #fff; }
.cookie-consent .cookie-copy a { color: var(--bg-gold); text-decoration: none; white-space: nowrap; font-weight: 600; }
.cookie-consent .cookie-copy a:hover { text-decoration: underline; }
.cookie-consent .cookie-ok { flex: 0 0 auto; white-space: nowrap; }
/* On mobile, clear the fixed bottom tab nav (64px tall). */
.cookie-consent.above-tabbar { bottom: calc(64px + env(safe-area-inset-bottom) + 14px); }

/* Brands in the member's collection (added → enrolled): muted green "selected" cue. */
.brand-grid-card.brand-selected,
.brand-tile.brand-selected {
  border: 1.5px solid #C7E4D2;
  background: #FAFDFB;
}
.brand-grid-card.brand-selected:hover { border-color:#A9D6BA; box-shadow: 0 12px 28px rgba(26,21,35,.08); }

/* Already-enrolled brands: dimmed, no hover lift. The action area stays full opacity. */
.brand-enrolled { opacity:.6; background:#F4FBF7; }
.brand-grid-card.brand-enrolled:hover { transform:none; }
.brand-enrolled .badge { opacity:1; }

/* ----- Category tags: small, subtle, color-coded ---------------------------- */
.cat-pill {
  display:inline-block; font-size:.62rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  border:none; border-radius:999px; padding:.12rem .5rem; line-height:1.5; background:#F1EEF8; color:#6D28D9;
}
.cat-Food{background:#FFEAD9;color:#C2410C} .cat-Dining{background:#FCE3EA;color:#B5295A}
.cat-Bakery{background:#FBEFD6;color:#946400} .cat-Dessert{background:#F7E2F8;color:#9F2BAE}
.cat-Coffee{background:#EFE5DC;color:#7A4A22} .cat-Beverage{background:#D9F2EA;color:#0F7A5F}
.cat-Beauty{background:#FCE1F0;color:#BE2E86} .cat-Retail{background:#E6E9FF;color:#3A45B8}
.cat-Snacks{background:#FCEBD3;color:#9A6200} .cat-Other{background:#EDE7FB;color:#6D28D9}

/* ----- Discover filter pills: shrink on small screens ---------------------- */
@media (max-width: 575.98px) {
  .discover-filters .btn {
    font-size: .75rem;
    padding: .2rem .6rem;
  }
  .discover-filters .btn .text-muted { display: none; }
  /* Looser vertical rhythm so search + pills don't feel crowded. */
  .discover-search { margin-top: 1rem; }
  .discover-filters {
    margin-top: 1.25rem;
    margin-bottom: 2rem !important;
    row-gap: .5rem;
  }
}

/* On small screens the brand card is full-width, so anchor the Add button
   bottom-right (matches the mobile tile; uses the otherwise-empty right space). */
@media (max-width: 767.98px) {
  .brand-grid-card .mt-auto { display: flex; justify-content: flex-end; }
}

/* ----- Closing CTA band: light/airy, thick frame --------------------------- */
.cta-band {
  position:relative; overflow:hidden; border:4px solid #C9B3EC; border-radius:var(--bg-radius);
  background:
    radial-gradient(640px 260px at 10% -25%, rgba(255,201,74,.42), rgba(255,201,74,0) 72%),
    radial-gradient(680px 280px at 102% 125%, rgba(147,51,234,.34), rgba(147,51,234,0) 70%),
    radial-gradient(520px 240px at 60% 135%, rgba(255,122,178,.22), rgba(255,122,178,0) 68%),
    #F4ECFB;
}
.cta-band h2 { color:var(--bg-ink); } .cta-band p { color:#5C5570; }

/* ----- Pricing tiers ------------------------------------------------------- */
.price-card { position:relative; transition: transform .1s ease, box-shadow .1s ease; }
.price-card.featured { border:2px solid #6D28D9 !important; box-shadow:0 16px 40px rgba(109,40,217,.16); }
@media (min-width:992px){ .price-card:hover { transform:translateY(-3px); } }

/* ----- Split hero pieces (used by desktop Hero B) -------------------------- */
.hero-split .hl, .hero-bleed .hl { background:linear-gradient(transparent 58%, #FFD75E 58% 92%, transparent 92%); padding:0 .1em; }
.hero-cluster { position:relative; min-height:280px; }
.hero-cluster .float-card { background:#fff; border:1px solid #EFEDF5; border-radius:16px; box-shadow:0 12px 32px rgba(26,21,35,.12); padding:.7rem .9rem; display:flex; align-items:center; gap:.7rem; }
.hero-cluster .float-card .reward { color:#0F7A4A; font-weight:700; font-size:.78rem; }
.hero-bleed .hero-h1 { font-weight:800; letter-spacing:-.035em; line-height:1.08; color:var(--bg-ink); font-size:1.95rem; }
.hero-bleed .hero-lead { color:#4A4458; font-size:1rem; max-width:30rem; }

/* ===== DESKTOP-ONLY LAYOUT (non-mobile agents carry body.wide) ============= */
/* No bottom tab nav on desktop at any width → reclaim the mobile 76px reserve. */
body.wide { padding-bottom: 0; overflow-x: hidden; }
@media (min-width: 992px) {
  body.wide {
    background:
      radial-gradient(1100px 620px at 90% -8%, #EAD6FF 0%, rgba(234,214,255,0) 58%),
      radial-gradient(1000px 560px at 5% 4%,  #FFE7A8 0%, rgba(255,231,168,0) 55%),
      radial-gradient(900px 520px at 50% 108%, #FFD9EC 0%, rgba(255,217,236,0) 60%),
      #F6F2FC;
    background-attachment: fixed;
  }
  body.wide .app-shell { max-width: 1180px; padding-left: 1.25rem; padding-right: 1.25rem; }
  .bg-topbar { height: 68px; }
  .hero-bleed { padding: 4.5rem 0; }
  .hero-bleed .hero-h1 { font-size: 3.4rem; line-height: 1.07; }
  .hero-bleed .hero-lead { font-size: 1.2rem; }
  .hero-cluster { min-height: 380px; }
  .hero-cluster .float-card { position:absolute; width:300px; }
  .hero-cluster .float-card.c1 { top:6%;  right:4%;  transform:rotate(2.5deg); }
  .hero-cluster .float-card.c2 { top:36%; right:22%; transform:rotate(-3deg); z-index:2; }
  .hero-cluster .float-card.c3 { top:66%; right:8%;  transform:rotate(1.5deg); }
  .pricing-row { max-width: 1040px; margin-left:auto; margin-right:auto; }
}
@media (min-width: 1440px) { body.wide .app-shell { max-width: 1280px; } }

.bg-readable { max-width: 760px; margin-left:auto; margin-right:auto; }

/* Full-bleed escape for the hero band (span viewport inside the centered shell) */
.full-bleed { width:100vw; position:relative; left:50%; right:50%; margin-left:-50vw; margin-right:-50vw; }
.hero-bleed { position:relative; overflow:hidden; border-bottom:1px solid rgba(109,40,217,.10); padding:2.2rem 0;
  background:
    radial-gradient(900px 460px at 12% -20%, rgba(255,201,74,.55) 0%, rgba(255,201,74,0) 62%),
    radial-gradient(820px 480px at 102% 0%,  rgba(147,51,234,.40) 0%, rgba(147,51,234,0) 60%),
    radial-gradient(700px 420px at 60% 120%, rgba(255,122,178,.30) 0%, rgba(255,122,178,0) 60%),
    linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,0) 70%); }
.hero-bleed .hero-bleed-inner { max-width:1180px; margin:0 auto; padding:0 1.25rem; }
@media (min-width:1440px){ .hero-bleed .hero-bleed-inner { max-width:1280px; } }

/* Desktop top nav */
.bg-desktopnav { gap:.15rem; }
.bg-navlink { color:#4A4458; text-decoration:none; font-weight:600; font-size:.95rem; padding:.5rem .85rem; border-radius:10px; line-height:1; transition:background .12s, color .12s; }
.bg-navlink:hover { background:#F1EEF8; color:#6D28D9; }
.bg-navlink.active { color:#6D28D9; }

/* Desktop multi-column footer */
.bg-footer { background:#fff; border-top:1px solid #ECE9F3; margin-top:5rem; }
.bg-footer h6 { font-size:.78rem; text-transform:uppercase; letter-spacing:.04em; color:#8A8398; font-weight:700; margin-bottom:.7rem; }
.bg-footer a { color:#564F66; text-decoration:none; font-size:.92rem; display:inline-block; padding:.18rem 0; }
.bg-footer a:hover { color:#6D28D9; }
.bg-footer .foot-base { border-top:1px solid #F0EEF5; color:#8A8398; font-size:.85rem; }

/* ----- Hero animation (entrance + falling confetti + card bob) ------------- */
@keyframes pp-rise { from { opacity:0; transform:translateY(18px);} to { opacity:1; transform:none; } }
.hero-bleed .eyebrow, .hero-bleed h1, .hero-bleed .hero-h1, .hero-bleed .lead, .hero-bleed .hero-lead,
.hero-bleed .d-grid, .hero-bleed .trust { animation: pp-rise .7s cubic-bezier(.2,.7,.2,1) both; }
.hero-bleed .hero-h1 { animation-delay:.10s; } .hero-bleed .hero-lead { animation-delay:.20s; }
.hero-bleed .d-grid { animation-delay:.30s; } .hero-bleed .trust { animation-delay:.40s; }
.hero-bleed .confetti i { animation: pp-fall 9s linear infinite; opacity:0; }
@keyframes pp-fall { 0%{transform:translateY(-24px) rotate(var(--r,20deg));opacity:0;} 15%{opacity:.9;} 85%{opacity:.9;} 100%{transform:translateY(260px) rotate(calc(var(--r,20deg) + 180deg));opacity:0;} }
@keyframes pp-cardin { from{opacity:0;transform:translateY(26px) scale(.96);} to{opacity:1;transform:none;} }
@media (min-width:992px){
  @keyframes pp-bob { 0%,100%{transform:translateY(0) rotate(var(--cr,0deg));} 50%{transform:translateY(-10px) rotate(var(--cr,0deg));} }
  .hero-cluster .float-card { opacity:0; }
  .hero-cluster .float-card.c1 { --cr:2.5deg; animation: pp-cardin .7s ease-out .45s both, pp-bob 6s ease-in-out 1.15s infinite; }
  .hero-cluster .float-card.c2 { --cr:-3deg;  animation: pp-cardin .7s ease-out .60s both, pp-bob 7s ease-in-out 1.30s infinite; }
  .hero-cluster .float-card.c3 { --cr:1.5deg; animation: pp-cardin .7s ease-out .75s both, pp-bob 6.5s ease-in-out 1.45s infinite; }
}
/* Respect the OS Reduce-Motion setting (production). */
@media (prefers-reduced-motion: reduce) {
  .hero-bleed .eyebrow, .hero-bleed h1, .hero-bleed .hero-h1, .hero-bleed .lead, .hero-bleed .hero-lead,
  .hero-bleed .d-grid, .hero-bleed .trust, .hero-bleed .confetti i, .hero-cluster .float-card {
    animation: none !important; opacity: 1 !important;
  }
}
/* The hero motion is a core part of this brand's first impression, so we play it
   even when the OS asks to reduce motion (matches the approved preview). Higher
   specificity (leading `body`) + !important re-assert the animations over the
   reduce-motion guard above. To revert to fully honoring Reduce Motion, delete
   this block. */
body .hero-bleed .eyebrow, body .hero-bleed .hero-h1, body .hero-bleed .hero-lead,
body .hero-bleed .d-grid,  body .hero-bleed .trust { animation: pp-rise .7s cubic-bezier(.2,.7,.2,1) both !important; }
body .hero-bleed .hero-h1  { animation-delay: .10s !important; }
body .hero-bleed .hero-lead{ animation-delay: .20s !important; }
body .hero-bleed .d-grid   { animation-delay: .30s !important; }
body .hero-bleed .trust    { animation-delay: .40s !important; }
body .hero-bleed .confetti i { animation: pp-fall 9s linear infinite !important; }
@media (min-width:992px){
  body .hero-cluster .float-card.c1 { animation: pp-cardin .7s ease-out .45s both, pp-bob 6s   ease-in-out 1.15s infinite !important; }
  body .hero-cluster .float-card.c2 { animation: pp-cardin .7s ease-out .60s both, pp-bob 7s   ease-in-out 1.30s infinite !important; }
  body .hero-cluster .float-card.c3 { animation: pp-cardin .7s ease-out .75s both, pp-bob 6.5s ease-in-out 1.45s infinite !important; }
}

/* ----- Tier-2: reduced content for NON-mobile narrow windows (< 992px) ----- */
@media (max-width: 991.98px) {
  body.wide .hero-bleed { padding: 1.1rem 0 .5rem; }
  body.wide .hero-bleed .confetti { display:none; }
  body.wide .hero-bleed .btn-lg, body.wide .hero-bleed .btn { font-size:1rem; padding-top:.6rem; padding-bottom:.6rem; }
  body.wide .popular-grid > [class*="col-"]:nth-child(n+5) { display:none; }
}

/* ----- Account hub + sub-pages -------------------------------------------- */
/* Tappable card with a gentle hover (used on hubs, legal hub, profile links). */
.acct-tile { transition: transform .08s ease, box-shadow .08s ease, border-color .08s ease; border:1px solid #EFEDF5; }
.acct-tile:hover { transform: translateY(-2px); box-shadow: var(--bg-shadow); border-color:#E1D8F5; }
/* Categorized hub: ONE card per category, plain rows inside (tight; dividers). */
.acct-cat-title { font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color:#8A8398; font-weight:700; padding:.5rem .65rem .35rem; }
.acct-row { display:flex; align-items:center; gap:.75rem; padding:.6rem .65rem; border-radius:10px; color:#2A2335; text-decoration:none; }
.acct-row + .acct-row { border-top:1px solid #F2EEF8; }
.acct-row:hover { background:#F6F4FB; color:#2A2335; }
.acct-row i.lead { width:20px; text-align:center; color:#6D28D9; font-size:1.05rem; }
.acct-row .chev { color:#C4BDD2; }
.acct-row.danger, .acct-row.danger i.lead { color:#B02525; }
.acct-row.danger:hover { background:#FBEFEF; }
/* Category cards float/pack (masonry) rather than locking to grid rows. */
.acct-cat { break-inside: avoid; -webkit-column-break-inside: avoid; margin-bottom: 1rem; }
@media (min-width: 992px) {
  .acct-cats { column-count: 2; column-gap: 1.5rem; }
  .acct-cat { margin-bottom: 1.5rem; }
}
/* Staff/admin-only card — amber outline matching the impersonation banner, so it's
   visually obvious these links are elevated/back-office (not part of a member's account). */
.acct-cat-staff { border: 2px solid #e7b53d; }

/* Settings sub-pages: capped, centered content column on desktop (no left rail). */
.acct-page { max-width: 720px; margin-left:auto; margin-right:auto; }
/* Notifications: hide read items in the "Unread" tab; subtle unread tint. */
.notif-list.show-unread .notif-item[data-unread="0"] { display: none !important; }
.notif-item.notif-unread { background: #FbF9FF; border-left: 3px solid #6D28D9; }
/* Richer sub-pages (e.g. enrollment profile): two explicit columns on desktop —
   form data on the left, preference/consent switches on the right. */
.profile-col { display: flex; flex-direction: column; }

/* Toggle switches everywhere: larger toggles, green when on. */
.form-switch { padding-left: 3.25em; min-height: 1.6em; }
.form-switch .form-check-input {
  width: 2.75em; height: 1.5em; margin-left: -3.25em; margin-top: .05em;
}
.form-switch .form-check-input:checked {
  background-color: #1f9d57; border-color: #1f9d57;
}
.form-switch .form-check-input:focus {
  border-color: #1f9d57; box-shadow: 0 0 0 .2rem rgba(31,157,87,.25);
}
.form-switch .form-check-label { font-size: .95rem; padding-top: .15em; }
@media (min-width: 992px) {
  body.acct-wide .acct-page { max-width: 1180px; }
  .profile-cols { display: flex; align-items: flex-start; gap: 2rem; }
  .profile-col { flex: 1 1 0; min-width: 0; }
  /* Settings hub: a stack of independent cards laid out as a balanced two-column
     masonry on desktop. Each card keeps its existing mb-3 as the gutter and must
     not split across columns. Below 992px the cards stack single-column (block). */
  .settings-cols { column-count: 2; column-gap: 1.5rem; }
  .settings-cols > .bg-card { break-inside: avoid; -webkit-column-break-inside: avoid; }
}

/* ----- Long-form readability: cap the text column on desktop --------------- */
@media (min-width:992px){
  body.wide .legal-body, body.wide .content-body, body.wide .form-narrow { margin-left:auto; margin-right:auto; }
  body.wide .legal-body, body.wide .content-body { max-width:760px; }
}

/* ===== Auth (signup/login) desktop split: value panel + action card ========= */
/* Desktop only — the wrapper markup is emitted just for non-mobile agents, so
   these rules never touch the mobile app-style flow. */
@media (min-width: 992px) {
  .auth-wrap {
    position: relative; overflow: hidden;
    background:
      radial-gradient(820px 460px at 8% -10%, rgba(255,201,74,.42) 0%, rgba(255,201,74,0) 60%),
      radial-gradient(760px 480px at 100% 8%, rgba(147,51,234,.30) 0%, rgba(147,51,234,0) 60%),
      radial-gradient(640px 420px at 30% 118%, rgba(255,122,178,.22) 0%, rgba(255,122,178,0) 62%);
  }
  .auth-split {
    display: grid; grid-template-columns: 1.04fr .96fr; gap: 3.5rem;
    max-width: 1080px; margin: 0 auto; padding: 3rem 1.25rem 3.5rem;
    align-items: start; min-height: min(62vh, 560px);
  }
  /* Nudge the explainer down to optically line up with the right card's heading. */
  .auth-aside { padding-top: .35rem; }
  .auth-aside { position: relative; }
  .auth-aside .eyebrow {
    display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .8rem;
    color: #6D28D9; background: #F1E9FE; border: 1px solid #E4D4FB; padding: .34rem .72rem; border-radius: 999px;
  }
  .auth-aside-h {
    font-weight: 800; letter-spacing: -.035em; line-height: 1.07; color: var(--bg-ink);
    font-size: 2.7rem; margin: 1rem 0 .8rem;
  }
  .auth-aside-lead { color: #4A4458; font-size: 1.08rem; max-width: 31rem; margin-bottom: 1.6rem; }
  /* Contextual explainer list (what each option is). */
  .auth-explain { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
  .auth-explain li { display: flex; align-items: flex-start; gap: .8rem; }
  .auth-explain .ax-ic {
    width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    background: #F1E9FE; color: #6D28D9; font-size: 1.05rem;
  }
  .auth-explain .ax-tx { display: block; color: #2C2638; font-size: .98rem; line-height: 1.3; }
  .auth-explain .ax-d { display: block; color: #6B6478; font-size: .86rem; font-weight: 400; margin-top: .1rem; }
  /* Order recap on the final (form) step. */
  .auth-recap { background: #fff; border: 1px solid #ECE6F5; border-radius: 14px; padding: .35rem 1rem; box-shadow: var(--bg-shadow); }
  .auth-recap .ar-row { display: flex; justify-content: space-between; align-items: center; padding: .55rem 0; }
  .auth-recap .ar-row + .ar-row { border-top: 1px solid #F2EFF8; }
  .auth-recap .ar-row span { color: #6B6478; font-size: .9rem; }
  .auth-recap .ar-row b { color: #2C2638; }
  /* Right column: the existing view fills the panel (no mobile padding/clamp). */
  .auth-main > section { padding: 0 !important; max-width: none; }
  .auth-main .form-narrow { max-width: none; }
  /* In the narrower right column, stack the type/plan choices vertically. */
  .auth-main > section > .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  /* Reuse the hero entrance animation. */
  .auth-aside .eyebrow, .auth-aside-h, .auth-aside-lead,
  .auth-explain, .auth-recap { animation: pp-rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .auth-aside-h    { animation-delay: .06s; }
  .auth-aside-lead { animation-delay: .12s; }
  .auth-recap      { animation-delay: .16s; }
  .auth-explain    { animation-delay: .18s; }
}
@media (min-width: 1200px) { .auth-split { gap: 4.5rem; } .auth-aside-h { font-size: 3rem; } }
