            html, body { max-width: 100vw; overflow-x: clip; }
            body {
                font-family: 'Inter', sans-serif;
                background: #f9fafb;
                color: #111827;
                display: flex;
                flex-direction: column;
                min-height: 100vh;
                margin: 0;
            }

            .container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; width: 100%; }

            .dropdown {
                position: absolute;
                right: 0;
                margin-top: 0.5rem;
                background: white;
                border-radius: 1rem;
                border: 1px solid #e5e7eb;
                box-shadow: 0 20px 40px rgba(0,0,0,0.08);
                opacity: 0;
                pointer-events: none;
                transform: scale(0.95);
                transition: all .2s ease;
                z-index: 60;
            }

            .dropdown.open {
                opacity: 1;
                pointer-events: auto;
                transform: scale(1);
            }

        /* Centered Command Palette for Search */
            #ai-search.dropdown {
                left: 50%;
                top: 4.5rem;
                margin-top: 0;
                transform-origin: top center;
                transform: translate(-50%, -10px) scale(0.95);
            }
            #ai-search.dropdown.open {
                transform: translate(-50%, 0) scale(1);
            }

        /* Categories / Menu dropdown — viewport-aware sizing on both
           form factors so the panel never stretches past the screen
           when more links are added.

           Desktop inherits the base .dropdown rule (absolute, right: 0)
           and gets a hard ceiling: never taller than the viewport
           minus the nav bar, never taller than 480px regardless of
           screen height (avoids a 1500px laptop showing a giant
           dropdown when the list only needs ~400px to feel full).

           Mobile (<640px): switch to fixed + viewport-center, then
           cap height at viewport minus the top offset (4.5rem) +
           a small bottom margin so the rounded corners and scroll
           hint remain visible above the OS gesture bar. */
            #categories.dropdown {
                max-height: min(480px, calc(100vh - 6rem));
                overflow-y: auto;
                overscroll-behavior: contain;
            }
            @media (max-width: 639px) {
                #categories.dropdown {
                    position: fixed;
                    left: 50%;
                    right: auto;
                    top: 4.5rem;
                    margin-top: 0;
                    transform-origin: top center;
                    transform: translate(-50%, -10px) scale(0.95);
                    /* Compact cap (~40vh) so the panel takes up only
                       the upper third of the screen. Anything past
                       the cap scrolls inside the panel. */
                    max-height: min(40vh, calc(100vh - 18rem));
                }
                #categories.dropdown.open {
                    transform: translate(-50%, 0) scale(1);
                }
            }

            .btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 0.5rem; font-weight: 600; transition: 0.2s; cursor: pointer; text-decoration: none; }
            .btn-primary { background: #2563eb; color: white; padding: 0.5rem 1rem; }
            .btn-primary:hover { background: #1d4ed8; }
            .btn-dark { background: #111827; color: white; padding: 0.5rem 1rem; }
            .btn-dark:hover { background: #000000; }
            .btn-secondary { background: #f3f4f6; color: #374151; padding: 0.5rem 0.75rem; }
            .btn-secondary:hover { background: #e5e7eb; color: #111827; }
            .btn-icon { padding: 0.5rem; border-radius: 999px; transition: 0.2s; cursor: pointer; }

            .input {
                width: 100%;
                border: 2px solid #f3f4f6;
                background: #f9fafb;
                border-radius: 0.75rem;
                padding: 0.75rem 1rem;
                outline: none;
                transition: 0.2s;
            }
            .input:focus { border-color: #3b82f6; background: white; box-shadow: 0 0 0 4px rgba(59,130,246,0.1); }

            .custom-scrollbar::-webkit-scrollbar { width: 4px; }
            .custom-scrollbar::-webkit-scrollbar-thumb { background-color: #e5e7eb; border-radius: 10px; }

            .cookie-banner {
                position: fixed;
                bottom: 0;
                width: 100%;
                background: rgba(255, 255, 255, 0.95);
                backdrop-filter: blur(10px);
                border-top: 1px solid #e5e7eb;
                padding: 1rem;
                display: none;
                justify-content: space-between;
                align-items: center;
                z-index: 9999;
                box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
            }

/* ---- marketplace UX bundle (heart / recently-viewed / draft / PWA / mobile nav) ---- */

/* Watchlist heart button — overlays the top-right of each card and the
   listing detail header. Outline state uses currentColor so the parent
   accent (red) shows through; filled state stays red regardless. */
.wl-heart {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: pointer;
    transition: all .15s ease;
    flex-shrink: 0;
}
.wl-heart:hover { color: #ef4444; border-color: #fecaca; }
.wl-heart[data-watching="1"] { color: #ef4444; border-color: #fecaca; background: #fef2f2; }
.wl-heart svg { width: 16px; height: 16px; }
.wl-heart[data-watching="1"] svg path { fill: currentColor; }
.wl-heart[data-watching="0"] svg path {
    fill: none; stroke: currentColor; stroke-width: 2;
}
.wl-heart.wl-pulse { transform: scale(1.18); }

/* Heart anchored flush to the card's bottom-right corner — zero offset.
   Shaped as a corner tab: only the top-left is rounded so it nests
   visually against the card's curved border (the bottom-right corner
   of the card is overflow-clipped by .dn-card's border-radius:16px,
   so the tab inherits that curve naturally). The card needs extra
   padding-bottom so the meta row above doesn't collide with the tab. */
.dn-card { position: relative; padding-bottom: 36px; }
.wl-heart.wl-heart-corner {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 30px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    border-right: 0;
    border-bottom: 0;
    border-radius: 12px 0 16px 0;
    z-index: 2;
}
.wl-heart.wl-heart-corner svg { width: 14px; height: 14px; }
/* Pulse on toggle should not scale the corner tab off-grid — override
   the global wl-pulse transform with a translateY nudge instead so the
   heart winks without leaving the corner. */
.wl-heart.wl-heart-corner.wl-pulse { transform: translateY(-1px); }

/* Recently-viewed shelf — single horizontal scroll row above the grid. */
.rv-shelf {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.875rem;
}
.rv-shelf-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 0.5rem;
}
.rv-shelf-title {
    font-size: 10px; font-weight: 900; text-transform: uppercase;
    letter-spacing: 0.1em; color: #6b7280;
}
.rv-shelf-clear {
    background: none; border: none; cursor: pointer;
    font-size: 10px; font-weight: 900; text-transform: uppercase;
    letter-spacing: 0.1em; color: #9ca3af;
}
.rv-shelf-clear:hover { color: #ef4444; }
.rv-shelf-row {
    display: flex; gap: 0.5rem; overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 0.25rem;
}
.rv-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: white; border: 1px solid #e5e7eb;
    border-radius: 0.5rem; padding: 0.4rem 0.75rem;
    font-size: 12px; color: #111827; text-decoration: none;
    white-space: nowrap; transition: border-color .15s, transform .1s;
    flex-shrink: 0;
}
.rv-chip:hover { border-color: #93c5fd; }
.rv-chip-name { font-weight: 700; }
.rv-chip-price { color: #059669; font-weight: 700; font-family: ui-monospace, monospace; }

/* Draft-resume toast — slides in from the bottom on offer pages. */
.draft-resume-toast {
    position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 80px);
    background: #111827; color: white; padding: 0.75rem 1rem;
    border-radius: 0.75rem; box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 13px; font-weight: 600; z-index: 9999;
    transition: transform .25s ease, opacity .25s ease;
    opacity: 0;
}
.draft-resume-toast.show { transform: translate(-50%, 0); opacity: 1; }
.draft-resume-toast button {
    background: rgba(255,255,255,0.15); border: none; color: white;
    font-size: 11px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.08em; padding: 0.3rem 0.65rem; border-radius: 0.4rem;
    cursor: pointer;
}
.draft-resume-toast button:hover { background: rgba(255,255,255,0.25); }

/* PWA install banner — slides up from bottom on 2nd visit if browser
   supports beforeinstallprompt. */
.pwa-install-banner {
    position: fixed; left: 50%; bottom: 1.5rem;
    transform: translate(-50%, 100px); opacity: 0;
    background: white; border: 1px solid #e5e7eb;
    border-radius: 0.875rem; padding: 0.75rem 1rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.18);
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 13px; z-index: 10000; max-width: 28rem;
    transition: transform .3s ease, opacity .3s ease;
}
.pwa-install-banner.show { transform: translate(-50%, 0); opacity: 1; }
.pwa-install-text { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.pwa-install-text strong { font-weight: 800; color: #111827; }
.pwa-install-text span { font-size: 11px; color: #6b7280; }
.pwa-install-yes {
    background: #2563eb; color: white; border: none;
    padding: 0.45rem 0.85rem; border-radius: 0.5rem;
    font-size: 11px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.08em; cursor: pointer;
}
.pwa-install-yes:hover { background: #1d4ed8; }
.pwa-install-x {
    background: none; border: none; color: #9ca3af;
    font-size: 22px; line-height: 1; cursor: pointer; padding: 0 0.25rem;
}
.pwa-install-x:hover { color: #111827; }

/* Mobile bottom navigation bar — visible only below sm. Auto-hides on
   scroll-down to keep the content area uncluttered. */
.mobile-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid #e5e7eb;
    display: flex; justify-content: space-around;
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 50;
    transition: transform .25s ease;
}
.mobile-bottom-nav.mb-nav-hidden { transform: translateY(110%); }
.mobile-bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: 0.35rem 0.5rem;
    font-size: 9px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.06em; color: #6b7280;
    text-decoration: none;
    position: relative;
}
.mobile-bottom-nav a:hover { color: #2563eb; }
.mobile-bottom-nav a[aria-current="page"] { color: #2563eb; }
.mobile-bottom-nav svg { width: 22px; height: 22px; }
.mobile-bottom-nav .mb-badge {
    position: absolute; top: 0.15rem; right: 25%;
    min-width: 16px; height: 16px; padding: 0 4px;
    background: #ef4444; color: white;
    border-radius: 999px;
    font-size: 9px; font-weight: 900;
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1;
}
@media (min-width: 640px) {
    .mobile-bottom-nav { display: none; }
}
/* On mobile, push body content up so the bottom nav doesn't cover it. */
@media (max-width: 639px) {
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* ---- saved-search local bookmark strip + toast (anon only) ----
   Hydrated by static/js/saved_search_local.js. Lives directly under
   the homepage saved-search prompt card. JS sets display:none when
   empty or when the user is authenticated, so these rules only kick
   in on the surfaces that actually use them. */
.ssl-strip {
    border: 1px dashed #a7f3d0;
    background: rgba(240, 253, 244, 0.7);
    border-radius: 0.875rem;
    padding: 0.6rem 0.85rem;
}
.ssl-strip-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 0.4rem;
}
.ssl-strip-title {
    font-size: 10px; font-weight: 900; text-transform: uppercase;
    letter-spacing: 0.1em; color: #047857;
}
.ssl-strip-clear {
    background: none; border: none; cursor: pointer;
    font-size: 10px; font-weight: 900; text-transform: uppercase;
    letter-spacing: 0.1em; color: #9ca3af;
}
.ssl-strip-clear:hover { color: #ef4444; }
.ssl-strip-row {
    display: flex; gap: 0.5rem; overflow-x: auto;
    scrollbar-width: thin; padding-bottom: 0.25rem;
}
.ssl-chip {
    display: inline-flex; align-items: center; gap: 0.25rem;
    background: white; border: 1px solid #d1fae5;
    border-radius: 0.5rem; padding: 0.3rem 0.5rem 0.3rem 0.65rem;
    font-size: 12px; color: #111827; white-space: nowrap;
    flex-shrink: 0; transition: border-color .15s;
}
.ssl-chip:hover { border-color: #34d399; }
.ssl-chip-link { color: inherit; text-decoration: none; }
.ssl-chip-label { font-weight: 600; }
.ssl-chip-x {
    background: none; border: none; cursor: pointer;
    color: #9ca3af; font-size: 16px; line-height: 1;
    padding: 0 0.15rem;
}
.ssl-chip-x:hover { color: #ef4444; }

/* Toast — fades in on save / claim, no layout shift when empty. */
.ssl-toast {
    position: absolute; right: 0.75rem; bottom: 0.5rem;
    background: #064e3b; color: white;
    padding: 0.4rem 0.75rem; border-radius: 0.5rem;
    font-size: 11px; font-weight: 700;
    opacity: 0; transform: translateY(4px);
    pointer-events: none; transition: opacity .2s ease, transform .2s ease;
    max-width: 70%;
}
.ssl-toast.ssl-toast-show {
    opacity: 1; transform: translateY(0);
}
.ssl-toast:empty { display: none; }
