/* Bring Back The Snack — mobile / tablet UI
   Structure & patterns from TCA new__ui; BBTS purple + gold colour scheme. */

:root {
    --bb-purple: #5c2b8a;
    --bb-purple-deep: #3b1c59;
    --bb-purple-soft: #9b6fd4;
    --bb-gold: #ffd34d;
    --bb-gold-deep: #f2a828;
    --bg: #12081f;
    --bg-2: #1a0f2e;
    --surface: rgba(255, 255, 255, 0.055);
    --surface-2: rgba(255, 255, 255, 0.09);
    --stroke: rgba(255, 255, 255, 0.1);
    --stroke-strong: rgba(255, 255, 255, 0.18);
    --text: #f6f0ff;
    --muted: #b5a4cc;
    --faint: #7d6b96;
    --brand-1: var(--bb-purple);
    --brand-2: #7c4dd4;
    --brand-3: var(--bb-purple-soft);
    --accent: var(--bb-gold);
    --danger: #fb7185;
    --ok: #34d399;
    --grad: linear-gradient(110deg, var(--bb-purple-deep) 0%, var(--bb-purple) 45%, var(--brand-2) 100%);
    --grad-soft: linear-gradient(135deg, rgba(92, 43, 138, 0.28), rgba(155, 111, 212, 0.12));
    --grad-gold: linear-gradient(135deg, #f7c443, #ffd86a);
    --stroke-brand: rgba(155, 111, 212, 0.45);
    --stroke-brand-soft: rgba(92, 43, 138, 0.4);
    --topbar-fade: rgba(18, 8, 31, 0.92);
    --radius: 18px;
    --radius-sm: 14px;
    --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.85);
    --nav-h: 76px;
    --maxw: 480px;
    --sidenav-w: 0px;
    --shell-w: var(--maxw);
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
    margin: 0;
    padding: 0;
    background:
        radial-gradient(ellipse 100% 60% at 50% -15%, rgba(92, 43, 138, 0.45), transparent 55%),
        radial-gradient(ellipse 50% 40% at 100% 40%, rgba(242, 168, 40, 0.08), transparent 50%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0 auto;
    padding: 0;
    max-width: var(--maxw);
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
    overflow-x: hidden;
    background: transparent;
    color: var(--text);
    font-family: var(--font);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.container {
    width: 100%;
    padding: 0 20px;
    margin: 0 auto;
}

/* ---------- App top bar (new__ui-style) ---------- */
.bb-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(env(safe-area-inset-top) + 14px) 16px 12px;
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(180deg, var(--topbar-fade) 60%, transparent);
    backdrop-filter: blur(14px);
}
.bb-brand {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--grad);
    overflow: hidden;
    border: 1px solid var(--stroke-brand);
}
.bb-brand img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}
.bb-topbar-titles { flex: 1; min-width: 0; }
.bb-topbar-titles h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bb-topbar-titles p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--muted);
}
.bb-topbar-actions { display: flex; align-items: center; gap: 6px; }
.bb-iconbtn {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--stroke);
    color: var(--text);
}
.bb-iconbtn:active { transform: scale(0.94); }

.bb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    border: 0;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: var(--grad);
}
.bb-btn:active { transform: scale(0.98); }
.bb-btn-sm {
    width: auto;
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 999px;
}
.bb-btn-gold {
    background: var(--grad-gold);
    color: #2b1a08;
}
.bb-btn-secondary {
    background: var(--surface-2);
    border: 1px solid var(--stroke-strong);
    color: var(--text);
}
.bb-btn-ghost {
    background: transparent;
    border: 1px solid var(--stroke-strong);
    color: var(--text);
}

/* ---------- Bottom nav ---------- */
.bb-bottomnav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: var(--maxw);
    height: calc(var(--nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-2) 75%, transparent), color-mix(in srgb, var(--bg) 96%, transparent));
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--stroke);
    z-index: 50;
}
.bb-navitem {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--faint);
    font-size: 10.5px;
    font-weight: 600;
    flex: 1;
    padding-top: 6px;
}
.bb-navitem.is-active { color: var(--text); background: rgba(255,255,255,0.06); border-radius: 14px; }
.bb-navitem.is-active svg { color: var(--bb-gold); }
.bb-fab {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #2b1a08;
    margin-top: -24px;
    background: var(--grad-gold);
    box-shadow: 0 0 0 5px var(--bg), 0 12px 28px -8px rgba(242, 168, 40, 0.55);
}
.bb-fab:active { transform: scale(0.94); }

/* ---------- Legacy header → collapse into app chrome when present ---------- */
.site-header {
    display: none;
}

/* ---------- Cards / surfaces ---------- */
.bb-card,
.petition-card,
.content-card,
.auth-card,
.memory-card,
.contributor-card {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.bb-wrap { padding: 0 20px 28px; }
.bb-section { margin-top: 24px; }
.bb-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.bb-section-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}
.bb-section-head a {
    font-size: 13px;
    font-weight: 600;
    color: var(--bb-gold);
}

/* ---------- Page heroes ---------- */
.page-hero,
.list-hero,
.home-hero,
.hero {
    background: transparent;
    padding: 8px 0 20px;
    border: 0;
}
.page-hero h1,
.list-hero h1,
.home-hero h1,
.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(1.5rem, 5vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}
.page-hero p,
.list-hero p,
.home-hero p,
.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.hero-copy { max-width: none; }
.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bb-gold);
    margin-bottom: 8px;
}

/* ---------- Petition cards / grids ---------- */
.petition-grid,
.list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 0 20px;
}
.petition-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.petition-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: var(--surface-2);
}
.petition-body {
    padding: 14px 16px 16px;
}
.petition-body h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 800;
}
.petition-subtitle,
.petition-meta {
    margin: 0 0 6px;
    font-size: 13px;
    color: var(--muted);
}
.petition-progress {
    height: 7px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin: 10px 0;
}
.petition-progress > span {
    display: block;
    height: 100%;
    background: var(--grad-gold);
    border-radius: 99px;
}
.petition-stats {
    font-size: 12px;
    color: var(--faint);
}
.petition-link {
    display: inline-flex;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--bb-gold);
}

/* ---------- Content sections ---------- */
.content-section,
.list-section,
.auth-section {
    padding: 0 0 24px;
}
.content-card {
    padding: 16px 18px;
    margin-bottom: 12px;
}
.content-card h2 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 800;
}
.content-card p,
.content-card li {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}
.content-card ul {
    margin: 0;
    padding-left: 1.1em;
}

/* ---------- Auth ---------- */
.auth-section .container {
    max-width: 420px;
}
.auth-card {
    padding: 22px 18px;
    margin-top: 8px;
}
.auth-card h1 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.auth-card > p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 14px;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.auth-field input,
.auth-form input,
.auth-form textarea,
.auth-form select,
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="search"],
form textarea,
form select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--stroke-strong);
    background: rgba(0, 0, 0, 0.28);
    color: var(--text);
    font: inherit;
    font-size: 16px;
}
.auth-form button,
.auth-form .btn,
button[type="submit"],
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    border: 0;
    font-size: 15px;
    font-weight: 700;
    color: #2b1a08;
    background: var(--grad-gold);
}
.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    border: 1px solid rgba(251, 113, 133, 0.4);
    background: rgba(251, 113, 133, 0.12);
    color: #fecdd3;
}
.alert.success {
    border-color: rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.12);
    color: #a7f3d0;
}

/* ---------- Home specifics ---------- */
.hero-card,
.feature-card,
.stat-card {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}
.progress-bar,
.hero-progress {
    height: 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.progress-bar > span,
.hero-progress > span {
    display: block;
    height: 100%;
    background: var(--grad-gold);
}

.cta-row,
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}
.cta-row a,
.hero-actions a,
.hero-actions button {
    flex: 1 1 auto;
    min-width: 120px;
}

/* ---------- Snack scroll (TikTok-style feed) ---------- */
body.snack-scroll-page {
    padding-bottom: 0;
    max-width: none;
}
body.snack-scroll-page .bb-bottomnav,
body.snack-scroll-page .bb-topbar {
    display: none;
}
.snack-scroll-desktop {
    display: none;
    padding: 48px 24px;
    text-align: center;
}
.snack-scroll-desktop h1 {
    font-size: 1.5rem;
    margin: 0 0 10px;
}
.snack-scroll-desktop p { color: var(--muted); }
.snack-scroll-feed {
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}
.snack-card {
    position: relative;
    height: 100dvh;
    scroll-snap-align: start;
    overflow: hidden;
    background: #000;
}
.snack-card-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.snack-card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(18, 8, 31, 0.15) 0%, rgba(18, 8, 31, 0.2) 40%, rgba(18, 8, 31, 0.92) 100%);
}
.snack-card-body {
    position: absolute;
    left: 16px;
    right: 72px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.snack-card-tag {
    display: inline-flex;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--grad-gold);
    color: #2b1a08;
    font-size: 11px;
    font-weight: 800;
}
.snack-card-title {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.snack-card-subtitle,
.snack-card-manufacturer {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
}
.snack-card-confidence {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(18, 8, 31, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
}
.snack-card-confidence-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--bb-gold);
    margin-bottom: 4px;
}
.snack-card-confidence-value {
    font-size: 15px;
    font-weight: 800;
}
.snack-card-confidence-value span { color: var(--bb-gold); }
.snack-card-confidence-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 4px;
}
.snack-card-insights { display: none; }
.snack-card-actions {
    position: absolute;
    left: 16px;
    right: 72px;
    bottom: calc(110px + env(safe-area-inset-bottom));
    z-index: 3;
    display: flex;
    gap: 8px;
}
.snack-action-btn {
    flex: 1;
    padding: 12px 14px;
    border-radius: 999px;
    border: 0;
    font-weight: 800;
    font-size: 14px;
}
.snack-action-vote {
    background: var(--grad-gold);
    color: #2b1a08;
}
.snack-action-skip {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.snack-card-recent {
    position: absolute;
    left: 16px;
    right: 72px;
    bottom: calc(168px + env(safe-area-inset-bottom));
    z-index: 2;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
}
.snack-card-side {
    position: absolute;
    right: 12px;
    bottom: calc(140px + env(safe-area-inset-bottom));
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}
.snack-side-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}
.snack-side-btn,
.snack-side-link {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(18, 8, 31, 0.45);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 18px;
    backdrop-filter: blur(8px);
}
.snack-card-empty {
    display: grid;
    place-items: center;
    padding: 40px;
    text-align: center;
}

.snack-comment-sheet,
.snack-auth-sheet {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(110%);
    bottom: 0;
    width: min(100%, var(--maxw));
    max-height: 70vh;
    background: var(--bg-2);
    border: 1px solid var(--stroke);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    z-index: 80;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.snack-comment-sheet.is-open,
.snack-auth-sheet.is-open {
    transform: translateX(-50%) translateY(0);
}
.snack-comment-handle {
    width: 42px;
    height: 4px;
    border-radius: 99px;
    background: var(--stroke-strong);
    margin: 0 auto 4px;
}
.snack-comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.snack-comment-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}
.snack-comment-close,
.snack-auth-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--stroke);
    background: var(--surface);
    color: var(--text);
    font-size: 20px;
}
.snack-comment-list {
    overflow: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.snack-comment-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--stroke);
}
.snack-comment-item img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.snack-comment-form textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--stroke-strong);
    background: rgba(0, 0, 0, 0.28);
    color: var(--text);
    padding: 12px;
    font: inherit;
    font-size: 16px;
}
.snack-comment-form button,
.snack-auth-btn {
    display: inline-flex;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 12px;
    border: 0;
    font-weight: 700;
    background: var(--grad-gold);
    color: #2b1a08;
    text-decoration: none;
}
.snack-auth-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.snack-auth-register {
    background: var(--surface-2);
    border: 1px solid var(--stroke-strong);
    color: var(--text);
}

/* ---------- Manufacturers / contributors ---------- */
.manufacturer-grid,
.contributor-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.manufacturer-card,
.contributor-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
}

/* ---------- Profile ---------- */
.profile-section {
    padding: 8px 0 28px;
}
.profile-card {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
}

/* ---------- Footer hide (app shell replaces) ---------- */
.site-footer { display: none; }

/* ---------- Prompt / toast ---------- */
.snack-scroll-prompt {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
    width: calc(100% - 32px);
    max-width: calc(var(--maxw) - 32px);
    z-index: 60;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--grad);
    border: 1px solid var(--stroke-brand);
    box-shadow: var(--shadow);
}
.snack-scroll-prompt a {
    color: var(--bb-gold);
    font-weight: 700;
}

/* ---------- Tablet / desktop ---------- */
@media (min-width: 720px) {
    :root { --maxw: 680px; }

    .petition-grid,
    .list-grid,
    .manufacturer-grid,
    .contributor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .snack-card-insights {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .snack-insight-panel,
    .snack-insight-tiles {
        padding: 10px 12px;
        border-radius: 12px;
        background: rgba(18, 8, 31, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.12);
    }
    .snack-insight-header {
        font-size: 11px;
        font-weight: 700;
        color: var(--bb-gold);
        margin-bottom: 6px;
    }
    .snack-insight-row,
    .snack-insight-tiles {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .snack-insight-label,
    .snack-tile-title {
        display: block;
        font-size: 11px;
        color: rgba(255, 255, 255, 0.6);
    }
    .snack-insight-value,
    .snack-tile-main {
        display: block;
        font-size: 13px;
        font-weight: 700;
    }
    .snack-tile-sub {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.65);
    }
}

@media (min-width: 1024px) {
    :root {
        --maxw: 900px;
        --sidenav-w: 88px;
        --shell-w: calc(var(--maxw) + var(--sidenav-w));
        --nav-h: 0px;
    }

    body {
        max-width: var(--shell-w);
        padding-left: var(--sidenav-w);
        padding-bottom: 40px;
    }

    .bb-bottomnav {
        left: max(0px, calc(50% - var(--shell-w) / 2));
        right: auto;
        top: 0;
        bottom: 0;
        transform: none;
        width: var(--sidenav-w);
        max-width: none;
        height: auto;
        flex-direction: column;
        justify-content: flex-start;
        gap: 4px;
        padding: 18px 10px;
        border-top: 0;
        border-right: 1px solid var(--stroke);
    }
    .bb-navitem {
        flex: 0 0 auto;
        padding: 12px 4px;
        border-radius: 14px;
    }
    .bb-navitem.is-active {
        background: var(--grad-soft);
    }
    .bb-fab {
        position: fixed;
        left: calc(max(0px, calc(50% - var(--shell-w) / 2)) + var(--sidenav-w) + var(--maxw) / 2);
        bottom: 28px;
        margin: 0;
        transform: translateX(-50%);
        z-index: 55;
    }

    .petition-grid,
    .list-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.snack-scroll-page {
        padding-left: 0;
        max-width: none;
    }
    body.snack-scroll-page .bb-bottomnav { display: none; }
    .snack-scroll-desktop { display: block; }
    .snack-scroll-feed { display: none; }
}

@media (min-width: 1280px) {
    :root {
        --maxw: 1040px;
        --sidenav-w: 200px;
        --shell-w: calc(var(--maxw) + var(--sidenav-w));
    }
    .bb-navitem {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* Auth pages: no bottom nav padding when hidden */
body.bb-auth-page {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

/* ---------- Home extras ---------- */
.subtitle { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 0 0 14px; }
.progress-wrap { margin: 14px 0; }
.progress-text { margin-top: 8px; font-size: 13px; color: var(--muted); }
.progress-text strong { color: var(--text); }
.inline-form { display: contents; }
.cta-row .btn,
.cta-row button,
.hero-actions .btn,
button.btn,
a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 14px;
    border: 0;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}
.btn-primary,
.cta-row button[type="submit"],
#hero-vote-btn {
    background: var(--grad-gold);
    color: #2b1a08;
}
.btn-secondary,
a.btn-secondary {
    background: var(--surface-2);
    border: 1px solid var(--stroke-strong);
    color: var(--text);
}
.section-block {
    padding: 8px 0 24px;
}
.section-block h2 {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 800;
}
.home-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.home-list-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--stroke);
}
.home-list-item img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--surface-2);
}
.home-list-item strong { display: block; font-size: 14px; }
.home-list-item span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.snack-scroll-prompt-card h2 { margin: 0 0 6px; font-size: 16px; }
.snack-scroll-prompt-card p { margin: 0 0 12px; font-size: 13px; color: rgba(255,255,255,0.8); }
.snack-scroll-prompt-actions { display: flex; gap: 8px; }
.snack-scroll-primary {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--grad-gold);
    color: #2b1a08;
    font-weight: 800;
    font-size: 13px;
}
.snack-scroll-secondary {
    flex: 1;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.25);
    background: transparent;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}
.auth-actions span { font-size: 13px; color: var(--muted); text-align: center; }
.auth-actions a { color: var(--bb-gold); font-weight: 700; }
.auth-submit {
    width: 100%;
    padding: 14px;
    border: 0;
    border-radius: 14px;
    background: var(--grad-gold);
    color: #2b1a08;
    font-weight: 800;
    font-size: 15px;
}

/* Admin pages stay usable on dark theme */
.admin-wrap, .admin-table, .admin-nav { color: var(--text); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--stroke);
    text-align: left;
    font-size: 13px;
}

/* ---------- Home featured card (v2) ---------- */
.bb-home { padding-bottom: 12px; }
.bb-home > .container { margin-bottom: 10px; }
.bb-featured { margin-top: 4px; }
.bb-featured-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.bb-featured-media {
    position: relative;
    background: #fff;
    aspect-ratio: 16 / 11;
}
.bb-featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bb-featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(18, 8, 31, 0.82);
    color: var(--bb-gold);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.bb-featured-body {
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bb-kicker {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bb-purple-soft);
}
.bb-featured-body h1 {
    margin: 0;
    font-size: clamp(1.25rem, 4.5vw, 1.55rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}
.bb-featured-body .subtitle {
    margin: 0;
    font-size: 13.5px;
}
.bb-featured-body .progress-wrap { margin: 4px 0 0; }
.bb-featured-body .cta-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 8px;
    margin-top: 6px;
}
.vote-btn,
.comment-btn,
.small-vote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    border-radius: 12px;
    border: 0;
    font: inherit;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
}
.vote-btn {
    background: var(--grad-gold);
    color: #2b1a08;
}
.vote-btn:disabled {
    opacity: 0.55;
    cursor: default;
}
.comment-btn {
    background: var(--surface-2);
    border: 1px solid var(--stroke-strong);
    color: var(--text);
}
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.list-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.admin-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--bb-gold);
}
.petition-votes {
    font-size: 12px;
    color: var(--faint);
    margin-bottom: 10px;
}
.petition-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.small-vote {
    padding: 8px 12px;
    font-size: 12.5px;
    background: var(--grad);
    color: #fff;
}
.small-vote.outline {
    background: transparent;
    border: 1px solid var(--stroke-strong);
    color: var(--text);
}
.small-vote.is-done {
    opacity: 0.6;
    cursor: default;
}
.bb-empty {
    color: var(--muted);
    font-size: 14px;
    padding: 8px 0 20px;
}
.bb-week-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bb-week-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--stroke);
}
.bb-week-rank {
    font-weight: 800;
    color: var(--bb-gold);
}
.bb-week-title {
    font-size: 14px;
    font-weight: 700;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bb-week-meta {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

@media (min-width: 720px) {
    .bb-featured-card {
        grid-template-columns: 1.05fr 1fr;
        align-items: stretch;
    }
    .bb-featured-media {
        aspect-ratio: auto;
        min-height: 280px;
    }
    .bb-featured-body {
        padding: 22px 22px 24px;
        justify-content: center;
    }
    .bb-featured-body h1 { font-size: 1.6rem; }
}

@media (min-width: 1024px) {
    .bb-fab {
        right: max(24px, calc(50% - var(--shell-w) / 2 + 24px));
        left: auto;
        transform: none;
    }
    .bb-featured-media { min-height: 320px; }
}

/* ---------- Admin shell ---------- */
body.bb-admin-page {
    max-width: none;
    margin: 0;
    padding: 0;
    min-height: 100dvh;
}
body.bb-admin-page .bb-bottomnav,
body.bb-admin-page .bb-topbar-admin { display: none !important; }

.bb-admin-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
.bb-admin-main {
    flex: 1;
    min-width: 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.bb-admin-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
    position: sticky;
    top: 0;
    z-index: 30;
    background: linear-gradient(180deg, var(--topbar-fade) 65%, transparent);
    backdrop-filter: blur(14px);
}
.bb-admin-top .bb-topbar-titles { flex: 1; min-width: 0; }
.bb-admin-top .bb-topbar-titles h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.bb-admin-top .bb-topbar-titles p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--muted);
}
.bb-admin-menu { flex: 0 0 auto; }

.bb-admin-rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(288px, 86vw);
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: calc(env(safe-area-inset-top) + 16px) 14px calc(16px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg-2) 94%, #000);
    border-right: 1px solid var(--stroke);
    transform: translateX(-105%);
    transition: transform 0.24s ease;
    box-shadow: 20px 0 40px rgba(0,0,0,0.35);
}
body.bb-admin-nav-open .bb-admin-rail { transform: translateX(0); }
.bb-admin-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(4, 2, 12, 0.62);
    border: 0;
}
.bb-admin-rail-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 14px;
    border-bottom: 1px solid var(--stroke);
    margin-bottom: 6px;
}
.bb-admin-rail-brand img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: contain;
    background: var(--grad);
    padding: 4px;
}
.bb-admin-rail-brand strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
}
.bb-admin-rail-brand span {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}
.bb-admin-rail-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow: auto;
}
.bb-admin-rail-foot {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--stroke);
}
.bb-admin-rail-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.bb-admin-rail-link svg { flex: 0 0 auto; opacity: 0.9; }
.bb-admin-rail-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text);
}
.bb-admin-rail-link.is-active {
    background: var(--grad-soft);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--stroke-brand-soft);
}
.bb-admin-rail-link.is-active svg { color: var(--bb-gold); }

.admin-section {
    padding: 8px 0 40px;
}
.admin-section h1 {
    margin: 0 0 16px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.admin-section .container {
    padding: 0 16px;
    max-width: 980px;
}

.bb-admin-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}
.bb-admin-stat {
    padding: 14px 14px 12px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--stroke);
}
.bb-admin-stat span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.bb-admin-stat strong {
    display: block;
    margin-top: 6px;
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}

.bb-admin-block { margin-bottom: 22px; }
.bb-admin-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}
.bb-admin-block-head h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.bb-admin-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bb-admin-tool {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--stroke);
    text-decoration: none;
    color: inherit;
}
.bb-admin-tool:active { background: var(--surface-2); }
.bb-admin-tool-body { flex: 1; min-width: 0; }
.bb-admin-tool-body strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 700;
}
.bb-admin-tool-body small {
    display: block;
    margin-top: 3px;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.35;
}
.bb-admin-tool-arrow {
    color: var(--bb-gold);
    font-weight: 700;
    font-size: 16px;
}

.admin-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
}
.admin-actions {
    margin-top: 18px;
    grid-template-columns: 1fr;
}

.admin-card,
.form-card {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    color: var(--text);
}
.admin-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--bb-gold);
}
.stat-card h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.action-card {
    text-decoration: none;
    color: inherit;
    display: block;
}
.action-card h3 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 800;
}
.action-card p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
}
.action-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--bb-gold);
    font-weight: 700;
    font-size: 13px;
}

.admin-form { display: grid; gap: 12px; }
.admin-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
}
.admin-field input,
.admin-field textarea,
.admin-field select,
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="number"],
.admin-form input[type="url"],
.admin-form textarea,
.admin-form select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--stroke-strong);
    background: rgba(0, 0, 0, 0.28);
    color: var(--text);
    font: inherit;
    font-size: 15px;
}
.admin-field textarea,
.admin-form textarea {
    min-height: 96px;
    resize: vertical;
}
.admin-form input[type="file"] {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}
.form-help {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--faint);
}

.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}
.admin-table th,
.admin-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--stroke);
    font-size: 13px;
    vertical-align: top;
}
.admin-table th {
    color: var(--muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-table td { color: var(--text); }

.admin-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--grad);
    color: #fff;
    border: 0;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.admin-action-btn.danger {
    background: rgba(251, 113, 133, 0.2);
    color: #fecdd3;
    border: 1px solid rgba(251, 113, 133, 0.45);
}
.admin-actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-secondary {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}
.admin-link {
    color: var(--bb-gold);
    font-weight: 700;
    text-decoration: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--stroke);
    background: var(--surface-2);
    color: var(--muted);
    font-style: normal;
}
.status-pending {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.12);
}
.status-approved,
.status-published {
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.12);
}
.status-rejected {
    color: #fecdd3;
    border-color: rgba(251, 113, 133, 0.4);
    background: rgba(251, 113, 133, 0.12);
}
.admin-count-badge { margin-bottom: 8px; }

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.filter-chip {
    border: 1px solid var(--stroke);
    background: var(--surface);
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
}
.filter-chip.is-active {
    background: var(--grad-gold);
    color: #2b1a08;
    border-color: transparent;
}

.logo-thumb,
.logo-preview {
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--stroke);
}
.logo-thumb { width: 40px; height: 40px; padding: 4px; }
.logo-preview { width: 80px; height: 80px; padding: 8px; margin-top: 8px; }

.bb-admin-page .form-card { margin-bottom: 14px; }
.bb-admin-page .admin-card + .admin-card,
.bb-admin-page .form-card + .admin-card { margin-top: 14px; }

.bb-topbar-admin {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--grad-soft);
    border: 1px solid var(--stroke-brand);
    color: var(--bb-gold);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

@media (min-width: 720px) {
    .bb-admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .bb-admin-tools {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .admin-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .admin-actions.admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 980px) {
    .bb-admin-shell {
        flex-direction: row;
        align-items: stretch;
    }
    .bb-admin-menu { display: none; }
    .bb-admin-backdrop { display: none !important; }
    .bb-admin-rail {
        position: sticky;
        top: 0;
        transform: none;
        height: 100dvh;
        width: 232px;
        flex: 0 0 232px;
        box-shadow: none;
    }
    .bb-admin-main {
        flex: 1;
        min-width: 0;
        max-width: 1040px;
    }
    .bb-admin-top {
        padding-left: 24px;
        padding-right: 24px;
    }
    .admin-section .container { padding: 0 24px; }
}
