/*
 * Shared shell/layout overrides.
 *
 * This file is loaded after the legacy inline stylesheet in index.html so the
 * shared navigation, search, footer, and scroll-performance rules can be tuned
 * without digging through the large app template.
 */

/* ─── Global cursor / caret fix ─────────────────────────────────────────────
   Cardinal red cursor is vivid on every background (cream, white, dark).
   This single rule covers every input and textarea site-wide.
   ─────────────────────────────────────────────────────────────────────────── */
input,
textarea,
[contenteditable] {
    caret-color: #8C1515 !important;
    color: #2f251c;         /* safe dark fallback if not overridden below */
}

input::placeholder,
textarea::placeholder {
    color: rgba(66, 42, 24, 0.46) !important;
    opacity: 1 !important;
}

:root {
    --shell-green: #173323;
    --shell-ink: #39281c;
    --shell-red: #8C1515;
    --shell-cream: #E8C995;
    --shell-cream-deep: #D7A765;
    --shell-panel: #EFD9AF;
    --shell-panel-soft: #F7E6C6;
    --shell-pill: #FFF6E4;
    --shell-paper: #FFFCF2;
    --shell-paper-tint: #FFF5DC;
    --shell-line: rgba(118, 79, 45, 0.16);
    --shell-shadow: rgba(87, 56, 28, 0.16);
    --shell-shadow-strong: rgba(87, 56, 28, 0.24);
}

body,
.flyer-wall-page {
    background:
        radial-gradient(circle at 18% 12%, rgba(255,244,222,0.44), transparent 28%),
        linear-gradient(180deg, #F2D9A8 0%, var(--shell-cream) 38%, var(--shell-cream-deep) 100%) !important;
    color: var(--shell-ink) !important;
}

.ai-result-page {
    background: #D4A574 !important;
    color: var(--shell-ink) !important;
}

/* Signed-in app navbar */
.app-header {
    background:
        linear-gradient(180deg, #F3DEB8, #D9AD72) !important;
    padding: 16px clamp(18px, 5vw, 64px) !important;
    border-bottom: 1px solid rgba(126, 86, 48, 0.14) !important;
    box-shadow: 0 12px 28px rgba(89, 57, 28, 0.12) !important;
    backdrop-filter: blur(18px) saturate(1.08) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.08) !important;
}

.app-header-left {
    gap: 12px !important;
    padding: 8px 16px 8px 8px !important;
    background: var(--shell-pill) !important;
    border: 1px solid rgba(126,86,48,0.14) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.92), 0 8px 18px rgba(89,57,28,0.10) !important;
    min-height: 52px !important;
}

.app-logo {
    width: 42px !important;
    height: 42px !important;
    background: #fff4d6 !important;
    border: 1px solid rgba(126, 86, 48, 0.16) !important;
    box-shadow: 0 6px 14px rgba(89, 57, 28, 0.14) !important;
}

.app-logo .sprout-mascot::before,
.public-home-brand .sprout-mascot::before {
    box-shadow: none !important;
}

.app-title {
    color: var(--shell-ink) !important;
    font-size: 22px !important;
}

.app-nav {
    gap: 10px !important;
    padding: 8px !important;
    background: rgba(255, 253, 247, 0.34) !important;
    border: 1px solid rgba(255, 253, 247, 0.42) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.58), 0 8px 22px rgba(15,81,50,0.10) !important;
    backdrop-filter: blur(18px) saturate(1.14) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.14) !important;
    min-height: 58px !important;
    overflow: visible !important;
}

.app-nav-btn {
    width: 44px !important;
    height: 44px !important;
    background: var(--shell-pill) !important;
    border: 1px solid rgba(126, 86, 48, 0.12) !important;
    color: var(--shell-ink) !important;
    box-shadow: 0 6px 14px rgba(89,57,28,0.10) !important;
    flex: 0 0 44px !important;
}

.nav-leaderboard {
    min-height: 44px !important;
    padding: 10px 15px !important;
}

.profile-avatar-frame-sm {
    width: 34px !important;
    height: 34px !important;
}

/* Public landing navbar — shared base (other pages that reuse .public-home-nav) */
.public-home-nav {
    padding: 16px clamp(18px, 5vw, 36px) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.20) !important;
    box-shadow: 0 10px 26px rgba(15,81,50,0.08) !important;
    backdrop-filter: blur(20px) saturate(1.12) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.12) !important;
}

/* Landing hero navbar only — dark frosted glass over the hero photo */
.public-home-nav--landing {
    padding: 10px clamp(18px, 5vw, 64px) !important;
    background:
        linear-gradient(120deg, rgba(255,253,247,0.12), rgba(255,253,247,0) 34%),
        linear-gradient(180deg, rgba(16, 29, 25, 0.55), rgba(16, 29, 25, 0.38)) !important;
    backdrop-filter: blur(4px) saturate(1.08) !important;
    -webkit-backdrop-filter: blur(4px) saturate(1.08) !important;
    border-bottom: 1px solid rgba(255,255,255,0.10) !important;
    box-shadow: 0 10px 28px rgba(0,0,0,0.10) !important;
}

.public-home-brand {
    gap: 12px !important;
    padding: 8px 16px 8px 8px !important;
    background: linear-gradient(135deg, #a31a1a, #8C1515) !important;
    border: 1px solid rgba(255,255,255,0.28) !important;
    box-shadow: 0 8px 20px rgba(140,21,21,0.28) !important;
    color: #fffdf7 !important;
    font-size: clamp(23px, 2.9vw, 28px) !important;
    min-height: 56px !important;
}

.public-home-brand:hover {
    background: linear-gradient(135deg, #b82020, #7f1212) !important;
    border-color: rgba(255,255,255,0.42) !important;
    box-shadow: 0 10px 24px rgba(140,21,21,0.34) !important;
}

.public-home-brand .sprout-mascot {
    --sprout-size: 42px !important;
}

.public-home-actions {
    gap: 12px !important;
}

.public-home-button {
    padding: 13px 22px !important;
    background: linear-gradient(135deg, #a31a1a, #8C1515) !important;
    border: 1px solid rgba(255,255,255,0.28) !important;
    box-shadow: 0 8px 20px rgba(140,21,21,0.28) !important;
    color: #fffdf7 !important;
    font-size: 15px !important;
}

.public-home-button:hover {
    background: linear-gradient(135deg, #b82020, #7f1212) !important;
    border-color: rgba(255,255,255,0.42) !important;
    box-shadow: 0 10px 24px rgba(140,21,21,0.34) !important;
}

.public-home,
.public-home-shell,
.home-page {
    background:
        radial-gradient(circle at 24% 14%, rgba(255,244,222,0.44), transparent 28%),
        linear-gradient(180deg, #F2D9A8 0%, var(--shell-cream) 38%, var(--shell-cream-deep) 100%) !important;
}

/* Event pages */
.flyer-wall-page {
    background-attachment: scroll !important;
}

.flyer-wall-page::before {
    display: none !important;
}

.flyer-wall-page .main-content,
.flyer-wall-page .tab-content,
.flyer-wall-page .tab-content.active,
.flyer-wall-page section,
.flyer-wall-page .flyer-wall-grid {
    background: transparent !important;
}

.flyer-wall-page .smart-search-container,
.feed-search-surface,
.ai-result-page .ai-event-toolbar,
.flyer-wall-page .tab-container,
.flyer-filter-strip {
    background: var(--shell-panel) !important;
    border-color: rgba(126, 86, 48, 0.16) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.90),
        0 14px 28px rgba(89,57,28,0.12) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.flyer-wall-page .smart-search-bar,
.feed-search-surface .smart-search-bar,
.ai-result-page .ai-event-search-row .smart-search-bar {
    background: var(--shell-pill) !important;
    border: 2px solid rgba(126, 86, 48, 0.13) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.96),
        0 12px 26px rgba(89,57,28,0.14) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.flyer-wall-page .filter-btn,
.flyer-wall-page .filter-btn:nth-child(n),
.flyer-wall-page .tab-button,
.flyer-wall-page .tab-button:nth-child(n),
.flyer-wall-page .map-filter-btn,
.flyer-wall-page .event-card-vibe-tag,
.flyer-wall-page .event-card-save-btn {
    background: var(--shell-pill) !important;
    border: 1px solid rgba(126, 86, 48, 0.13) !important;
    color: var(--shell-ink) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.98),
        0 9px 18px rgba(89,57,28,0.12) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.flyer-wall-page .filter-btn.active,
.flyer-wall-page .filter-btn[aria-selected="true"],
.flyer-wall-page .tab-button.active {
    background: linear-gradient(180deg, var(--shell-red), #a92520) !important;
    border-color: rgba(255,255,255,0.34) !important;
    color: white !important;
    box-shadow: 0 12px 24px rgba(140,21,21,0.20) !important;
}

.flyer-wall-page .smart-search-input,
.feed-search-surface .smart-search-input,
.ai-result-page .smart-search-input {
    color: var(--shell-ink) !important;
    caret-color: #8C1515 !important;
}

.flyer-wall-page .smart-search-input::placeholder,
.feed-search-surface .smart-search-input::placeholder,
.ai-result-page .smart-search-input::placeholder {
    color: rgba(57, 40, 28, 0.62) !important;
}

.flyer-wall-page .smart-search-mark,
.feed-search-surface .smart-search-mark,
.ai-result-page .smart-search-mark {
    background: #F5E2BC !important;
    border: 1px solid rgba(126, 86, 48, 0.12) !important;
}

.flyer-wall-page .smart-search-button,
.feed-search-surface .smart-search-button,
.ai-result-page .smart-search-button {
    background: linear-gradient(180deg, #B8372D, var(--shell-red)) !important;
    color: #fffdf7 !important;
    box-shadow: 0 10px 22px rgba(140,21,21,0.22) !important;
}

.flyer-wall-page .section-title,
.ai-feed-sentinel,
.profile-modal-card,
.map-filter-strip,
.map-legend-strip,
.map-gather-location-btn,
.friend-matcher-board,
.leaderboard-shell,
.ai-result-page .ai-result-card,
.ai-result-page .sprout-surface {
    background: var(--shell-pill) !important;
    border: 1px solid rgba(126, 86, 48, 0.14) !important;
    color: var(--shell-ink) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.86),
        0 16px 32px rgba(89,57,28,0.13) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.flyer-wall-page .section-title *,
.ai-feed-sentinel *,
.profile-modal-card *,
.friend-matcher-board *,
.leaderboard-shell *,
.ai-result-page .ai-result-card *,
.ai-result-page .sprout-surface * {
    color: inherit;
}

.flyer-wall-page .section-count {
    background: #F2D684 !important;
    color: var(--shell-ink) !important;
    border: 1px solid rgba(126, 86, 48, 0.18) !important;
}

.event-card {
    content-visibility: auto;
    contain-intrinsic-size: 360px 560px;
    will-change: auto !important;
}

.flyer-wall-page .event-card,
.flyer-wall-page .event-card:nth-child(n) {
    overflow: visible !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.76), rgba(255,255,255,0.12) 42%),
        var(--shell-paper) !important;
    border: 1px solid rgba(126, 86, 48, 0.12) !important;
    border-radius: 18px !important;
    box-shadow:
        0 22px 42px rgba(89,57,28,0.15),
        0 2px 0 rgba(255,255,255,0.82) inset !important;
    transform: rotate(var(--flyer-tilt, -0.8deg)) translateY(0) !important;
}

.flyer-wall-page .event-card:nth-child(6n + 1) { background-color: #fffdf4 !important; }
.flyer-wall-page .event-card:nth-child(6n + 2) { background-color: #fbfff3 !important; }
.flyer-wall-page .event-card:nth-child(6n + 3) { background-color: #fff7ee !important; }
.flyer-wall-page .event-card:nth-child(6n + 4) { background-color: #fffaf0 !important; }
.flyer-wall-page .event-card:nth-child(6n + 5) { background-color: #f5fbff !important; }
.flyer-wall-page .event-card:nth-child(6n) { background-color: #fff9f6 !important; }

.flyer-wall-page .event-card::before {
    content: "" !important;
    position: absolute !important;
    top: 18px !important;
    left: 50% !important;
    right: auto !important;
    width: min(220px, 48%) !important;
    height: 26px !important;
    display: block !important;
    border-radius: 8px !important;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.30), transparent 30%, rgba(255,255,255,0.20) 62%, transparent),
        linear-gradient(var(--tape, rgba(255,224,117,0.82)), var(--tape, rgba(255,224,117,0.82))) !important;
    border: 1px solid rgba(255,255,255,0.36) !important;
    box-shadow: 0 8px 16px rgba(89,57,28,0.12) !important;
    opacity: 0.96 !important;
    transform: translateX(-50%) !important;
    z-index: 4 !important;
    pointer-events: none !important;
}

.flyer-wall-page .event-card::after {
    content: "" !important;
    position: absolute !important;
    inset: 8px -6px -8px 8px !important;
    display: block !important;
    border-radius: 20px !important;
    background: rgba(226, 190, 129, 0.12) !important;
    z-index: -1 !important;
    transform: rotate(-0.6deg) !important;
    pointer-events: none !important;
}

.event-card-pin,
.event-sheet-pin,
.pushpin-head,
.pushpin-neck,
.pushpin-needle {
    display: none !important;
}

.flyer-wall-page .event-card:hover {
    transform: rotate(0deg) translateY(-8px) scale(1.01) !important;
    box-shadow:
        0 28px 50px rgba(89,57,28,0.19),
        0 2px 0 rgba(255,255,255,0.88) inset !important;
}

.flyer-wall-page .event-card-image {
    border-radius: 16px 16px 10px 10px !important;
    border-color: rgba(255, 255, 255, 0.72) !important;
}

.flyer-wall-page .event-card-content {
    background: transparent !important;
}

.event-pin-sheet {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--tape, #ffe075) 32%, white), var(--shell-paper) 46%) !important;
    border-top: 8px solid var(--tape, #ffe075) !important;
    box-shadow: 0 -18px 46px rgba(89,57,28,0.22) !important;
}

.event-pin-sheet .bottom-sheet-header {
    position: relative;
}

.event-sheet-tape {
    position: absolute;
    top: 12px;
    left: 50%;
    width: min(320px, 64%);
    height: 28px;
    border-radius: 9px;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.32), transparent 30%, rgba(255,255,255,0.20) 62%, transparent),
        linear-gradient(var(--tape, #ffe075), var(--tape, #ffe075));
    border: 1px solid rgba(255,255,255,0.36);
    box-shadow: 0 10px 18px rgba(89,57,28,0.12);
    transform: translateX(-50%) rotate(-1deg);
    pointer-events: none;
}

.public-home-footer,
.app-footer {
    background: var(--shell-panel) !important;
    border-top: 1px solid rgba(126, 86, 48, 0.14) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.70),
        0 -12px 28px rgba(89,57,28,0.10) !important;
    color: var(--shell-ink) !important;
}

.public-home-footer *,
.app-footer * {
    color: var(--shell-ink) !important;
}

.public-home-footer-grid article,
.public-home-footer-contact-pill,
.app-footer-links button {
    background: var(--shell-pill) !important;
    border: 1px solid rgba(126,86,48,0.12) !important;
    box-shadow: 0 8px 18px rgba(89,57,28,0.10) !important;
}

.public-home-footer-brand-name {
    width: fit-content !important;
    padding: 10px 18px 10px 12px !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #a31a1a, #8C1515) !important;
    border: 1px solid rgba(255,255,255,0.28) !important;
    box-shadow: 0 10px 24px rgba(140,21,21,0.26) !important;
    color: #fffdf7 !important;
}

.public-home-footer-brand-name span {
    color: #fffdf7 !important;
}

.public-home-school-card {
    background: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.34) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.38), 0 12px 28px rgba(89,57,28,0.08) !important;
    backdrop-filter: blur(18px) saturate(1.08) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.08) !important;
}

.public-home-footer-bottom {
    background: transparent !important;
    border-top: 1px solid rgba(126, 86, 48, 0.10) !important;
}

.public-home-footer-bottom-links a,
.public-home-footer-bottom-links button {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font: inherit !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    color: var(--shell-ink) !important;
    text-decoration: none !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

/* ─── FAB slide-out transitions ─────────────────────────────────────────────
   Both fixed-position buttons slide down + fade when hidden (footer visible or
   event sheet open). The .fab-hidden class drives the animation; JS toggles it.
   ─────────────────────────────────────────────────────────────────────────── */
.create-event-fab,
.sprout-search-jump {
    --fab-rest-transform: translateY(0) scale(1);
    --fab-hidden-transform: translateY(96px) scale(0.88);
    transform: var(--fab-rest-transform) !important;
    transition:
        transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.26s ease !important;
    will-change: transform, opacity;
}

.create-event-fab.fab-hidden,
.sprout-search-jump.fab-hidden {
    transform: var(--fab-hidden-transform) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.create-event-fab:hover,
.sprout-search-jump:hover {
    --fab-rest-transform: translateY(-2px) scale(1);
}

.sprout-search-jump,
.flyer-wall-page .create-event-fab,
.flyer-wall-page .create-event-fab::before {
    background: var(--shell-pill) !important;
    border-color: rgba(126,86,48,0.14) !important;
    color: var(--shell-ink) !important;
    box-shadow: 0 16px 32px rgba(89,57,28,0.15) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Event pages match the public landing palette */
.flyer-wall-page {
    --event-maroon: #8C1515;
    --event-clay: #cf573b;
    --event-cream: #fff8ed;
    --event-glass: rgba(255, 255, 255, 0.14);
    --event-glass-strong: rgba(255, 253, 247, 0.34);
    --event-ink: #4b392a;
    background:
        radial-gradient(circle at 24% 14%, rgba(255,244,222,0.44), transparent 28%),
        linear-gradient(180deg, #F2D9A8 0%, var(--shell-cream) 38%, var(--shell-cream-deep) 100%),
        url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?w=1800&auto=format&fit=crop") center bottom/cover fixed !important;
    color: var(--event-ink) !important;
}

.flyer-wall-page .app-header {
    background: rgba(255, 255, 255, 0.12) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.20) !important;
    box-shadow: 0 10px 26px rgba(89,57,28,0.08) !important;
    backdrop-filter: blur(20px) saturate(1.12) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.12) !important;
}

.flyer-wall-page .app-header-left {
    background: linear-gradient(135deg, #a31a1a, #8C1515) !important;
    border-color: rgba(255,255,255,0.28) !important;
    box-shadow: 0 8px 20px rgba(140,21,21,0.28) !important;
    margin-left: -28px !important;
}

.flyer-wall-page .app-logo {
    background: rgba(255,253,247,0.94) !important;
    border: 1px solid rgba(255,255,255,0.45) !important;
    box-shadow: 0 6px 14px rgba(89,57,28,0.14) !important;
}

.flyer-wall-page .app-title {
    color: #fffdf7 !important;
}

.flyer-wall-page .app-nav {
    background: var(--event-glass-strong) !important;
    border-color: rgba(255, 253, 247, 0.42) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.58), 0 8px 22px rgba(89,57,28,0.10) !important;
    backdrop-filter: blur(18px) saturate(1.14) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.14) !important;
    margin-right: -28px !important;
}

.flyer-wall-page .nav-leaderboard,
.flyer-wall-page .app-nav-btn {
    background: linear-gradient(135deg, #a31a1a, #8C1515) !important;
    border: 1px solid rgba(255,255,255,0.28) !important;
    color: #fffdf7 !important;
    box-shadow: 0 8px 20px rgba(140,21,21,0.22) !important;
}

.flyer-wall-page .nav-leaderboard {
    color: #fffdf7 !important;
    border-color: rgba(255,255,255,0.28) !important;
    background: linear-gradient(135deg, #a31a1a, #8C1515) !important;
}

.flyer-wall-page .profile-avatar-frame-sm {
    background: linear-gradient(135deg, #a31a1a, #8C1515) !important;
}

.flyer-wall-page .smart-search-container,
.feed-search-surface,
.ai-result-page .ai-event-toolbar {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.20) !important;
    box-shadow: 0 10px 26px rgba(89,57,28,0.08) !important;
    backdrop-filter: blur(20px) saturate(1.12) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.12) !important;
}

.flyer-wall-page .smart-search-bar,
.feed-search-surface .smart-search-bar,
.ai-result-page .ai-event-search-row .smart-search-bar {
    background: rgba(255, 255, 255, 0.82) !important;
    border-color: rgba(126, 86, 48, 0.18) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.88), 0 12px 28px rgba(89,57,28,0.12) !important;
    backdrop-filter: blur(22px) saturate(1.12) !important;
    -webkit-backdrop-filter: blur(22px) saturate(1.12) !important;
}

.flyer-wall-page .smart-search-button,
.feed-search-surface .smart-search-button,
.ai-result-page .smart-search-button {
    background: linear-gradient(135deg, #a31a1a, #8C1515) !important;
    color: #fffdf7 !important;
}

.flyer-wall-page .tab-container,
.flyer-filter-strip {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.20) !important;
    box-shadow: 0 10px 26px rgba(89,57,28,0.08), inset 0 1px 0 rgba(255,255,255,0.34) !important;
    backdrop-filter: blur(20px) saturate(1.12) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.12) !important;
}

.flyer-wall-page .tab-button,
.flyer-wall-page .tab-button:nth-child(n) {
    background: rgba(255, 248, 237, 0.78) !important;
    border-color: rgba(91, 61, 39, 0.12) !important;
    color: var(--event-ink) !important;
    transform: none !important;
}

.flyer-wall-page .tab-button:nth-child(3) {
    background: rgba(255, 255, 255, 0.18) !important;
}

.flyer-wall-page .filter-btn,
.flyer-wall-page .filter-btn:nth-child(n) {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.34) !important;
    color: var(--event-ink) !important;
    box-shadow: 0 8px 20px rgba(89,57,28,0.08) !important;
    transform: none !important;
    backdrop-filter: blur(18px) saturate(1.08) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.08) !important;
}

.flyer-wall-page .filter-btn:nth-child(6n + 1) {
    background: var(--event-maroon) !important;
    color: #fffdf7 !important;
    border-color: var(--event-maroon) !important;
}

.flyer-wall-page .filter-btn:nth-child(6n + 2) {
    background: rgba(255, 255, 255, 0.18) !important;
}

.flyer-wall-page .filter-btn:nth-child(6n + 3) {
    background: rgba(255, 255, 255, 0.18) !important;
}

.flyer-wall-page .filter-btn:nth-child(6n + 4) {
    background: rgba(255, 255, 255, 0.18) !important;
}

.flyer-wall-page .filter-btn:nth-child(6n + 5) {
    background: rgba(255, 255, 255, 0.18) !important;
}

.flyer-wall-page .filter-btn:nth-child(6n) {
    background: rgba(255, 255, 255, 0.18) !important;
}

.flyer-wall-page .filter-btn.active,
.flyer-wall-page .filter-btn[aria-selected="true"],
.flyer-wall-page .tab-button.active {
    background: var(--event-maroon) !important;
    color: #fffdf7 !important;
    border-color: var(--event-maroon) !important;
    box-shadow: 0 12px 24px rgba(140, 21, 21, 0.18) !important;
}

.flyer-wall-page .section-title,
.ai-feed-sentinel {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.34) !important;
    color: var(--event-ink) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.38), 0 12px 28px rgba(89,57,28,0.08) !important;
    backdrop-filter: blur(18px) saturate(1.08) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.08) !important;
}

.flyer-wall-page .section-title span:first-child {
    color: var(--event-maroon) !important;
}

.flyer-wall-page .section-count {
    background: #f8df8a !important;
    color: var(--event-maroon) !important;
    border-color: rgba(140, 21, 21, 0.18) !important;
}

.flyer-wall-page .event-card,
.flyer-wall-page .event-card:nth-child(n) {
    overflow: hidden !important;
    background: rgba(255, 253, 247, 0.96) !important;
    border: 1px solid rgba(126, 86, 48, 0.12) !important;
    box-shadow: 0 18px 42px rgba(89,57,28,0.13) !important;
    transform: translateY(0) !important;
}

.flyer-wall-page .event-card::before,
.flyer-wall-page .event-card::after {
    display: none !important;
}

.flyer-wall-page .event-card:hover {
    transform: translateY(-8px) scale(1.01) !important;
    box-shadow: 0 26px 54px rgba(89,57,28,0.18) !important;
}

.flyer-wall-page .event-card-title {
    color: var(--event-maroon) !important;
}

.flyer-wall-page .event-card-save-btn {
    background: rgba(252, 255, 250, 0.94) !important;
    box-shadow: 0 8px 18px rgba(89,57,28,0.12) !important;
}

.flyer-wall-page .event-card-image {
    background: linear-gradient(135deg, #F2D9A8, #fff8ed) !important;
}

.flyer-wall-page .event-card-meta,
.flyer-wall-page .event-card-meta-item i {
    border-color: rgba(126, 86, 48, 0.14) !important;
    color: var(--event-maroon) !important;
}

.flyer-wall-page .event-card-vibe-tag,
.flyer-wall-page .event-card-vibe-tag:nth-child(n) {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(126, 86, 48, 0.14) !important;
    color: var(--event-ink) !important;
    box-shadow: 0 6px 14px rgba(89,57,28,0.08) !important;
}

/* Scrapbook event-board layout. Keep navbar buttons and search bar unchanged. */
.flyer-wall-page {
    --scrap-board: #b59670;
    --scrap-board-deep: #a8865f;
    --scrap-cream: #f5ead2;
    --scrap-paper: #fffaf0;
    --scrap-ink: #2f251c;
    background:
        radial-gradient(circle at 24% 14%, rgba(255,244,222,0.50), transparent 32%),
        linear-gradient(180deg, #F2D9A8 0%, #E8C995 42%, #D7A765 100%) !important;
    color: var(--scrap-ink) !important;
}

.flyer-wall-page .tab-container {
    margin: 0 !important;
    padding: 12px 34px 16px !important;
    border-radius: 0 !important;
    background: #EFD9AF !important;
    border: 0 !important;
    border-top: 1px solid rgba(140, 21, 21, 0.10) !important;
    border-bottom: 1px solid rgba(140, 21, 21, 0.12) !important;
    box-shadow: 0 4px 16px rgba(89, 57, 28, 0.10) !important;
    display: flex !important;
    gap: 12px !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.flyer-wall-page .tab-button,
.flyer-wall-page .tab-button:nth-child(n) {
    min-height: 48px !important;
    padding: 10px 20px !important;
    border-radius: 999px !important;
    background: #fffdf0 !important;
    border: 1.5px solid rgba(140, 21, 21, 0.22) !important;
    color: #8C1515 !important;
    font-size: clamp(13px, 1.15vw, 17px) !important;
    font-weight: 800 !important;
    box-shadow: 0 3px 12px rgba(140, 21, 21, 0.10) !important;
    transform: none !important;
    transition: all 0.15s !important;
}

.flyer-wall-page .tab-button:first-child {
    background: #fffdf0 !important;
    transform: none !important;
}

.flyer-wall-page .tab-button:nth-child(3) {
    background: #fffdf0 !important;
    transform: none !important;
}

.flyer-wall-page .tab-button.active {
    background: linear-gradient(135deg, #8C1515, #a31a1a) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    box-shadow: 0 6px 18px rgba(140, 21, 21, 0.28) !important;
}

.flyer-wall-page .tab-button:not(.active):hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(140, 21, 21, 0.16) !important;
}

.flyer-filter-strip {
    position: relative !important;
    padding: 18px 0 26px !important;
    overflow: visible !important;  /* prevent hover translate/rotate from being clipped */
    background: #F2D9A8 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(140, 21, 21, 0.10) !important;
    box-shadow: 0 4px 14px rgba(89, 57, 28, 0.08) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.flyer-filter-strip::before,
.flyer-filter-strip::after {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 52px !important;
    z-index: 2 !important;
    pointer-events: none !important;
}

.flyer-filter-strip::before {
    left: 0 !important;
    background: linear-gradient(90deg, #F2D9A8, rgba(242,217,168,0)) !important;
}

.flyer-filter-strip::after {
    right: 0 !important;
    background: linear-gradient(270deg, #F2D9A8, rgba(242,217,168,0)) !important;
}

.flyer-filter-row {
    gap: 18px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding: 6px 40px 12px !important;  /* 6px top gives hovered buttons room to translateY(-3px) */
    scroll-padding-inline: 40px !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(84,54,34,0.38) transparent !important;
    -webkit-overflow-scrolling: touch !important;
}

.flyer-filter-row::-webkit-scrollbar {
    height: 8px !important;
}

.flyer-filter-row::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.16) !important;
    border-radius: 999px !important;
}

.flyer-filter-row::-webkit-scrollbar-thumb {
    background: rgba(84,54,34,0.38) !important;
    border-radius: 999px !important;
}

.flyer-wall-page .filter-btn,
.flyer-wall-page .filter-btn:nth-child(n) {
    border-radius: 999px !important;
    padding: 10px 20px !important;
    background: #fffdf0 !important;
    border: 1.5px solid rgba(140, 21, 21, 0.22) !important;
    color: #8C1515 !important;
    font-size: clamp(12px, 1.05vw, 15px) !important;
    font-weight: 800 !important;
    box-shadow: 0 3px 12px rgba(140, 21, 21, 0.10) !important;
    transform: none !important;
    transition: all 0.15s !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Reset all colorful nth-child variants to match the uniform about-page cream style */
.flyer-wall-page .filter-btn:nth-child(6n + 1),
.flyer-wall-page .filter-btn:nth-child(6n + 2),
.flyer-wall-page .filter-btn:nth-child(6n + 3),
.flyer-wall-page .filter-btn:nth-child(6n + 4),
.flyer-wall-page .filter-btn:nth-child(6n + 5),
.flyer-wall-page .filter-btn:nth-child(6n) {
    background: #fffdf0 !important;
    color: #8C1515 !important;
    border-color: rgba(140, 21, 21, 0.22) !important;
    transform: none !important;
}

.flyer-wall-page .filter-btn.active,
.flyer-wall-page .filter-btn[aria-selected="true"] {
    background: linear-gradient(135deg, #8C1515, #a31a1a) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    box-shadow: 0 6px 18px rgba(140, 21, 21, 0.28) !important;
    transform: none !important;
}

.flyer-wall-page .filter-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(140, 21, 21, 0.16) !important;
}

.flyer-wall-page .main-content {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 14px clamp(30px, 4vw, 78px) 68px !important;  /* reduced top padding — was 36px */
    background: linear-gradient(180deg, #ECD5A0 0%, #E0C38A 100%) !important;
}

.flyer-wall-page .section-title {
    margin: 0 0 18px !important;   /* reduced from 40px — events start closer */
    padding: 13px 22px !important;
    border-radius: 22px !important;
    background: #fffdf0 !important;
    border: 1px solid rgba(140, 21, 21, 0.14) !important;
    box-shadow: 0 8px 28px rgba(66, 42, 24, 0.14) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.flyer-wall-page .section-title span:first-child {
    color: #8C1515 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: clamp(18px, 1.5vw, 24px) !important;
    font-weight: 950 !important;
    letter-spacing: 0 !important;
}

.flyer-wall-page .section-title span:not(:first-child),
.flyer-wall-page .section-title .loading,
.flyer-wall-page .section-title .fizz-loading {
    font-size: clamp(13px, 1vw, 16px) !important;
}

.flyer-wall-page .section-title > div,
.flyer-wall-page .section-title > div span {
    font-size: clamp(13px, 1vw, 16px) !important;
    line-height: 1.15 !important;
}

.flyer-wall-page .section-title > div {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    min-width: 0 !important;
}

.flyer-wall-page .section-title > div span {
    white-space: nowrap !important;
}

.flyer-wall-page .section-title > div i {
    font-size: 16px !important;
}

.flyer-wall-page .section-title .fizz-loading,
.flyer-wall-page .section-title .loading-spinner {
    width: 18px !important;
    height: 18px !important;
}

.flyer-wall-page .section-count {
    background: rgba(140, 21, 21, 0.09) !important;
    color: #8C1515 !important;
    border-radius: 999px !important;
    border: 1.5px solid rgba(140, 21, 21, 0.18) !important;
    box-shadow: none !important;
    font-size: clamp(12px, 0.95vw, 15px) !important;
    padding: 5px 11px !important;
    font-weight: 800 !important;
}

.flyer-wall-grid {
    gap: 34px 34px !important;
    padding: 52px 0 48px !important;
    perspective: 900px !important;
    overflow: visible !important;
}

.flyer-wall-page .event-card,
.flyer-wall-page .event-card:nth-child(n) {
    overflow: visible !important;
    contain: none !important;
    content-visibility: visible !important;
    min-height: 0 !important;
    padding: 24px 20px 18px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(84, 54, 34, 0.14) !important;
    background:
        radial-gradient(circle, rgba(84,54,34,0.07) 1px, transparent 1.4px) 0 0 / 34px 34px,
        var(--scrap-paper) !important;
    box-shadow: 0 26px 38px rgba(66,42,24,0.24), 0 3px 0 rgba(84,54,34,0.15) !important;
    transform: rotate(var(--flyer-tilt, -1.8deg)) translateY(0) !important;
    z-index: 10 !important;
    isolation: visible !important;
}

.flyer-wall-page .event-card:nth-child(6n + 1) { --flyer-tilt: -2.4deg; --tape: rgba(248, 222, 103, 0.76); }
.flyer-wall-page .event-card:nth-child(6n + 2) { --flyer-tilt: 1.3deg; --tape: rgba(161, 207, 244, 0.72); }
.flyer-wall-page .event-card:nth-child(6n + 3) { --flyer-tilt: -1.1deg; --tape: rgba(239, 163, 180, 0.70); }
.flyer-wall-page .event-card:nth-child(6n + 4) { --flyer-tilt: 1.8deg; --tape: rgba(248, 222, 103, 0.76); }
.flyer-wall-page .event-card:nth-child(6n + 5) { --flyer-tilt: -1.6deg; --tape: rgba(161, 207, 244, 0.72); }
.flyer-wall-page .event-card:nth-child(6n) { --flyer-tilt: 1deg; --tape: rgba(239, 163, 180, 0.70); }

.flyer-wall-page .event-card::before {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    top: -22px !important;
    left: 50% !important;
    width: min(270px, 58%) !important;
    height: 28px !important;
    border-radius: 5px !important;
    background:
        linear-gradient(110deg, rgba(255,255,255,0.62) 0 14%, rgba(255,255,255,0.08) 14% 27%, rgba(255,255,255,0.42) 42%, rgba(255,255,255,0.08) 58%, rgba(255,255,255,0.32) 74%, transparent 100%),
        linear-gradient(180deg, rgba(255,255,255,0.30), rgba(255,255,255,0.04) 50%, rgba(83,47,27,0.08)),
        var(--tape, rgba(248, 222, 103, 0.76)) !important;
    border: 1px solid rgba(255,255,255,0.42) !important;
    box-shadow: 0 10px 16px rgba(66,42,24,0.16), inset 0 1px 0 rgba(255,255,255,0.52) !important;
    transform: translateX(-50%) rotate(-0.7deg) !important;
    z-index: 9999 !important;
    pointer-events: none !important;
}

.flyer-wall-page .event-card::after {
    display: none !important;
}

.flyer-wall-page .event-card:hover {
    transform: rotate(0deg) translateY(-8px) scale(1.01) !important;
    box-shadow: 0 32px 54px rgba(66,42,24,0.28), 0 3px 0 rgba(84,54,34,0.16) !important;
}

.flyer-wall-page .event-card-image {
    width: 100% !important;
    height: 160px !important;
    margin: 0 0 14px !important;
    border-radius: 2px !important;
    border: 8px solid rgba(255, 248, 219, 0.92) !important;
    box-shadow: 0 8px 18px rgba(66,42,24,0.12) !important;
    background: #f8ecd2 !important;
}

.flyer-wall-page .event-card-content {
    padding: 0 !important;
    gap: 8px !important;
    background: transparent !important;
}

.flyer-wall-page .event-card-title {
    color: #2f251c !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: clamp(21px, 1.75vw, 27px) !important;
    line-height: 1.12 !important;
    letter-spacing: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.flyer-wall-page .event-card-description,
.flyer-wall-page .event-card-meta {
    color: #493321 !important;
}

.flyer-wall-page .event-card-description {
    font-size: 13px !important;
    line-height: 1.3 !important;
    margin-bottom: 2px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.flyer-wall-page .event-card-description + div[style*="16,185,129"] {
    display: none !important;
}

.flyer-wall-page .creator-chip {
    max-width: 100% !important;
    min-height: 0 !important;
    padding: 5px 9px !important;
    font-size: 11px !important;
}

.flyer-wall-page .event-card-meta {
    padding-top: 8px !important;
    gap: 4px 6px !important;
    /* No max-height — location row now uses full width + ellipsis for long addresses */
}

.flyer-wall-page .event-card-meta-item {
    font-size: 11px !important;
}

/* Location row takes full width so it never fights for space with time/attendees */
.flyer-wall-page .event-card-meta-location {
    flex-basis: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
}

/* Truncate long addresses with ellipsis — full address visible in detail popup */
.flyer-wall-page .event-card-meta-location span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    flex: 1 !important;
}

.flyer-wall-page .event-card-vibes {
    gap: 5px !important;
    margin-bottom: 4px !important;
    max-height: 30px !important;
    overflow: hidden !important;
}

.flyer-wall-page .event-card-vibe-tag,
.flyer-wall-page .event-card-vibe-tag:nth-child(n) {
    background: rgba(240, 255, 249, 0.82) !important;
    border-color: rgba(91, 61, 39, 0.13) !important;
    color: #334155 !important;
    border-radius: 999px !important;
    box-shadow: 0 5px 12px rgba(66,42,24,0.08) !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
}

.flyer-wall-page .event-card-save-btn {
    top: 18px !important;
    right: 18px !important;
    background: #fff4cf !important;
    border-radius: 7px !important;
    box-shadow: 0 5px 0 rgba(83,47,27,0.16), 0 8px 14px rgba(66,42,24,0.12) !important;
}

.flyer-wall-page .event-card-actions {
    margin-top: 4px !important;
    padding-top: 8px !important;
    gap: 6px !important;
    border-top-color: rgba(84,54,34,0.12) !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    overflow: visible !important;   /* allow the envelope flap to show above the action row */
    align-items: end !important;    /* line non-envelope buttons up at the bottom of their cells */
}

.flyer-wall-page .event-card-actions > div:first-child {
    display: none !important;
}

.flyer-wall-page .event-card .sprout-source-actions.compact {
    display: contents !important;
    margin: 0 !important;
}

.flyer-wall-page .event-card .sprout-detail-link,
.flyer-wall-page .event-card .sprout-source-link,
.flyer-wall-page .event-card-actions button {
    min-height: 0 !important;
    height: 32px !important;
    padding: 6px 9px !important;
    border-radius: 7px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    width: 100% !important;
}

/* All [data-rsvp-button] elements now use .rsvp-envelope-btn; this rule
   is kept as a safety net for any un-classed fallback. */
.flyer-wall-page .event-card button[data-rsvp-button]:not(.rsvp-envelope-btn) {
    min-height: 0 !important;
    height: 32px !important;
    padding: 6px 9px !important;
    border-radius: 7px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    width: 100% !important;
}

.flyer-wall-page .create-event-fab {
    --fab-rest-transform: rotate(-0.7deg);
    --fab-hidden-transform: rotate(-0.7deg) translateY(96px) scale(0.88);
    background:
        radial-gradient(circle, rgba(84,54,34,0.07) 1px, transparent 1.4px) 0 0 / 34px 34px,
        #fff8d7 !important;
    border-radius: 6px !important;
    color: #2f251c !important;
    box-shadow: 0 8px 0 rgba(83,47,27,0.16), 0 18px 32px rgba(66,42,24,0.20) !important;
}

.flyer-wall-page .create-event-fab i {
    background: #d65b42 !important;
    color: #fffdf7 !important;
}

.flyer-wall-page .create-event-fab:hover {
    --fab-rest-transform: rotate(-0.2deg) translateY(-4px);
}

/* Match popups, contacts, friend match, and leaderboard to the event board. */
.profile-modal-card,
.social-directory-board,
.friend-matcher-board,
.leaderboard-shell,
.private-invite-content,
.create-step-card {
    background:
        radial-gradient(circle, rgba(84,54,34,0.035) 1px, transparent 1.4px) 0 0 / 30px 30px,
        linear-gradient(180deg, #fffaf0 0%, #fff5e3 100%) !important;
    border: 1px solid rgba(84, 54, 34, 0.16) !important;
    border-radius: 18px !important;
    box-shadow: 0 22px 38px rgba(66,42,24,0.18), 0 3px 0 rgba(84,54,34,0.10) !important;
    color: #2f251c !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.profile-modal-card {
    position: relative !important;
}

.social-directory-board,
.friend-matcher-board,
.leaderboard-shell {
    position: relative !important;
}

.flyer-wall-page .friend-matcher-board,
.flyer-wall-page .leaderboard-shell,
.social-directory-board {
    background:
        radial-gradient(circle, rgba(84,54,34,0.032) 1px, transparent 1.4px) 0 0 / 30px 30px,
        linear-gradient(180deg, #fffaf0 0%, #fff6e8 100%) !important;
}

.flyer-wall-page .friend-matcher-page {
    background: transparent !important;
}

.flyer-wall-page .friend-matcher-board,
.flyer-wall-page .leaderboard-shell,
.social-directory-board {
    border-radius: 22px !important;
    background-clip: padding-box !important;
}

.profile-modal-card::before,
.social-directory-board::before,
.friend-matcher-board::before,
.leaderboard-shell::before {
    content: "" !important;
    position: absolute !important;
    top: -13px !important;
    left: 50% !important;
    width: min(210px, 38%) !important;
    height: 24px !important;
    border-radius: 5px !important;
    background:
        linear-gradient(110deg, rgba(255,255,255,0.58) 0 14%, rgba(255,255,255,0.10) 14% 30%, rgba(255,255,255,0.42) 45%, rgba(255,255,255,0.10) 62%, rgba(255,255,255,0.28) 76%, transparent 100%),
        linear-gradient(180deg, rgba(255,255,255,0.30), rgba(255,255,255,0.04) 50%, rgba(83,47,27,0.08)),
        rgba(246, 222, 121, 0.66) !important;
    border: 1px solid rgba(255,255,255,0.42) !important;
    box-shadow: 0 8px 14px rgba(66,42,24,0.13), inset 0 1px 0 rgba(255,255,255,0.48) !important;
    transform: translateX(-50%) rotate(-0.8deg) !important;
    z-index: 30 !important;
    pointer-events: none !important;
}

#inboxModal .profile-modal-card::before,
#privateInviteModal .profile-modal-card::before,
#friendMessageComposer .friend-message-board::before,
#newMessageComposer .friend-message-board::before,
.friend-message-board::before {
    display: none !important;
    content: none !important;
}

#profileModal .profile-modal-card::before {
    top: 20px !important;
    width: min(190px, 34%) !important;
    height: 22px !important;
    z-index: 6 !important;
}

.social-directory-board::before {
    top: clamp(18px, 3vw, 28px) !important;
    width: min(200px, 34%) !important;
    height: 22px !important;
    z-index: 6 !important;
}

.leaderboard-hero::before,
.leaderboard-hero::after,
.friend-matcher-hero::before,
.friend-matcher-hero::after,
.social-directory-hero::before,
.social-directory-hero::after {
    display: none !important;
    content: none !important;
}

.profile-summary-hero,
.sprout-setup-speaker,
.friend-message-board {
    background:
        radial-gradient(circle, rgba(84,54,34,0.026) 1px, transparent 1.4px) 0 0 / 26px 26px,
        linear-gradient(180deg, #fffaf0 0%, #fff4df 100%) !important;
    border: 1px solid rgba(84,54,34,0.14) !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 18px rgba(66,42,24,0.11), inset 0 1px 0 rgba(255,255,255,0.82) !important;
    color: #2f251c !important;
}

.profile-summary-hero {
    overflow: visible !important;
}

.profile-summary-hero .text-red-900,
.profile-summary-hero h2,
.profile-summary-hero p,
.sprout-setup-speaker h2,
.sprout-setup-speaker p,
.friend-message-board h2,
.friend-message-board p {
    color: #2f251c !important;
    text-shadow: none !important;
}

.profile-summary-hero .text-red-900,
.sprout-setup-eyebrow,
.friend-message-board .friend-matcher-kicker,
.social-directory-hero .friend-matcher-kicker {
    color: #8C1515 !important;
}

.profile-rich-panel,
.sprout-demo-question,
.new-message-section,
.friend-message-disabled {
    background:
        radial-gradient(circle, rgba(84,54,34,0.026) 1px, transparent 1.4px) 0 0 / 24px 24px,
        #fffaf0 !important;
    border: 1px solid rgba(84,54,34,0.14) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 14px rgba(66,42,24,0.09), 0 2px 0 rgba(84,54,34,0.07) !important;
    color: #2f251c !important;
    /* Ensure spacing between consecutive sections and after search results */
    margin-top: 14px !important;
    padding: 10px 12px !important;
}

/* Recipient rows sit inside the section — give them breathing room from the card border */
.new-message-section .new-message-list {
    padding: 0 2px !important;
    gap: 5px !important;
}

/* Header label inside section */
.new-message-section h3 {
    padding: 0 4px 6px !important;
    border-bottom: 1px solid rgba(84,54,34,0.10) !important;
    margin-bottom: 2px !important;
}

/* Search results → first section gap */
.new-message-results + .new-message-section {
    margin-top: 14px !important;
}

/* StanfordWHO results section also needs breathing room */
.stanford-who-results-section {
    margin-top: 10px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(140,21,21,0.18) !important;
    background: rgba(255,250,248,0.96) !important;
    overflow: hidden !important;
}

.profile-panel-title,
.new-message-section h3 {
    color: #2f251c !important;
}

.profile-quick-action,
.new-message-row,
.stanford-who-btn {
    background: #fff4cf !important;
    color: #3b2b20 !important;
    border: 1px solid rgba(84,54,34,0.16) !important;
    border-radius: 999px !important;
    box-shadow: 0 4px 0 rgba(83,47,27,0.11), 0 8px 14px rgba(66,42,24,0.08) !important;
    transform: none !important;
}

.profile-quick-action:nth-child(2n),
.profile-quick-action:hover,
.new-message-row:hover,
.stanford-who-btn:hover {
    background: #f8df8a !important;
    color: #2f251c !important;
    transform: translateY(-1px) !important;
}

.profile-avatar-frame,
.profile-avatar-edit-button {
    border-color: rgba(84,54,34,0.16) !important;
    box-shadow: 0 6px 14px rgba(66,42,24,0.13) !important;
}

.friend-message-board {
    border-radius: 20px !important;
    box-shadow: 0 24px 44px rgba(66,42,24,0.22), 0 3px 0 rgba(84,54,34,0.10) !important;
}

.friend-message-textarea,
.new-message-search {
    background: #fffdf7 !important;
    color: #2f251c !important;
    border: 1px solid rgba(84,54,34,0.16) !important;
    border-radius: 16px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.84) !important;
    caret-color: #2f251c !important;
}

.social-directory-modal,
.friend-matcher-modal {
    background: rgba(66, 42, 24, 0.34) !important;
    backdrop-filter: blur(12px) saturate(1.08) !important;
    -webkit-backdrop-filter: blur(12px) saturate(1.08) !important;
}

.profile-modal-close,
.friend-matcher-close {
    background: #fff4cf !important;
    color: #8C1515 !important;
    border: 1px solid rgba(84,54,34,0.16) !important;
    border-radius: 999px !important;
    box-shadow: 0 5px 0 rgba(83,47,27,0.13), 0 8px 14px rgba(66,42,24,0.12) !important;
}

.profile-primary-btn,
.profile-secondary-btn,
.profile-field,
.create-step-input,
.public-home-school-form input,
.social-directory-card input,
.new-message-search input,
.friend-search-row input {
    border-radius: 999px !important;
    caret-color: #2f251c !important; /* near-black — clearly visible on cream background */
}

/* Textareas should NOT be pill-shaped — a natural rounded rect looks and feels better */
textarea.profile-field {
    border-radius: 12px !important;
}

/* Friend matcher search input — bigger font makes the caret tall enough to see clearly */
.friend-search-row input {
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #2f251c !important;
    caret-color: #2f251c !important;
}

/* New message search input — same dark caret, visually obvious on the cream box */
.new-message-search input {
    caret-color: #2f251c !important;
    color: #2f251c !important;
    font-size: 16px !important;
}

/* Give the search row itself the same look as the new-message search box */
.friend-search-row {
    background: #fffdf7 !important;
    border: 1px solid rgba(84,54,34,0.18) !important;
    border-radius: 16px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.84) !important;
    caret-color: #2f251c !important;
}

/* Friend search panel — wrap the whole search box + results in a warm card */
.friend-search-panel {
    background:
        radial-gradient(circle, rgba(84,54,34,0.024) 1px, transparent 1.4px) 0 0 / 24px 24px,
        #fffaf0 !important;
    border: 1px solid rgba(84,54,34,0.14) !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 16px rgba(66,42,24,0.10), 0 2px 0 rgba(84,54,34,0.07) !important;
    padding: 14px !important;
}

/* new-message-section injected into friend search results has its own margin — don't double it */
#friendSearchResults .new-message-section {
    margin-top: 10px !important;
}

.profile-primary-btn,
.social-directory-actions button,
.leaderboard-scope-btn.active,
.friend-match-events button,
.friend-message-button,
.public-home-school-form button {
    background: #d65b42 !important;
    color: #000000 !important;
    border: 1px solid rgba(84,54,34,0.18) !important;
    box-shadow: 0 5px 0 rgba(83,47,27,0.16), 0 10px 18px rgba(66,42,24,0.12) !important;
}

.friend-message-button,
.friend-message-button *,
.friend-match-events button,
.friend-match-events button * {
    color: #fff !important;
}

.profile-secondary-btn,
.leaderboard-scope-btn,
.social-directory-member-chip,
.friend-match-tags span {
    background: #fff4cf !important;
    color: #3b2b20 !important;
    border: 1px solid rgba(84,54,34,0.16) !important;
    box-shadow: 0 3px 0 rgba(83,47,27,0.10) !important;
}

.leaderboard-hero,
.friend-matcher-hero,
.social-directory-hero {
    background:
        linear-gradient(180deg, rgba(140,21,21,0.62), rgba(182,112,78,0.45)),
        url("https://images.unsplash.com/photo-1529156069898-49953e39b3ac?w=1400&auto=format&fit=crop") center/cover !important;
    border: 1px solid rgba(84,54,34,0.16) !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 18px rgba(66,42,24,0.13) !important;
    color: #fffdf7 !important;
}

.leaderboard-hero h2,
.leaderboard-hero p,
.friend-matcher-hero h2,
.friend-matcher-hero p,
.friend-matcher-hero .friend-matcher-kicker,
.social-directory-hero h2,
.social-directory-hero p,
.social-directory-hero .friend-matcher-kicker {
    color: #fffdf7 !important;
    text-shadow: 0 10px 24px rgba(0,0,0,0.28) !important;
}

.leaderboard-card,
.friend-match-card,
/* Social directory section containers — same warm card as new-message-section */
.social-directory-section {
    background:
        radial-gradient(circle, rgba(84,54,34,0.026) 1px, transparent 1.4px) 0 0 / 24px 24px,
        #fffaf0 !important;
    border: 1px solid rgba(84,54,34,0.14) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 14px rgba(66,42,24,0.09), 0 2px 0 rgba(84,54,34,0.07) !important;
    padding: 12px !important;
}

/* Section title header inside the card — give it the same kicker style */
.social-directory-section .social-directory-section-title {
    border-bottom: 1px solid rgba(84,54,34,0.10) !important;
    padding-bottom: 10px !important;
    margin-bottom: 10px !important;
    font-size: 12px !important;
    font-weight: 950 !important;
    letter-spacing: 0.03em !important;
    text-transform: uppercase !important;
    color: #8C1515 !important;
}

.social-directory-card {
    background:
        radial-gradient(circle, rgba(84,54,34,0.032) 1px, transparent 1.4px) 0 0 / 28px 28px,
        #fffaf0 !important;
    border: 1px solid rgba(84,54,34,0.14) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 18px rgba(66,42,24,0.12), 0 2px 0 rgba(84,54,34,0.08) !important;
    color: #2f251c !important;
}

.leaderboard-card:nth-child(2n),
.friend-match-card:nth-child(2n),
.social-directory-card:nth-child(2n) {
    background:
        radial-gradient(circle, rgba(84,54,34,0.032) 1px, transparent 1.4px) 0 0 / 28px 28px,
        #fff8eb !important;
}

.leaderboard-row-sticker,
.leaderboard-rank.top,
.friend-match-score,
.social-directory-section-title strong,
.section-count {
    background: #f8df8a !important;
    color: #2f251c !important;
    border: 1px solid rgba(84,54,34,0.16) !important;
    border-radius: 999px !important;
    box-shadow: 0 4px 0 rgba(83,47,27,0.12) !important;
}

.leaderboard-score,
.friend-match-meta span,
.social-directory-avatar {
    background: #fff4cf !important;
    color: #3b2b20 !important;
    border-color: rgba(84,54,34,0.16) !important;
}

.social-directory-avatar.group {
    background: #dff0e4 !important;
    color: #493321 !important;
}

.social-directory-section-title,
.friend-match-card h3,
.social-directory-person-head h3,
.leaderboard-card strong,
.profile-modal-card h2,
.profile-modal-card h3 {
    color: #2f251c !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    letter-spacing: 0 !important;
}

.social-directory-person-head p,
.social-directory-members,
.friend-match-card p,
.friend-match-empty,
.profile-modal-card p {
    color: #5f4a38 !important;
}

#privateInviteModal .chat-bubble-row.mine .chat-bubble,
#privateInviteModal .chat-bubble-row.mine .chat-bubble p,
#privateInviteModal .chat-bubble-row.mine .chat-bubble span {
    color: #fff !important;
    opacity: 1 !important;
}

/* Red/dark-red action buttons inside message modals must always show white text */
.chatbox-compose button,
.message-center-new-btn {
    color: #fff !important;
}

.message-center-new-btn *,
.chatbox-compose button * {
    color: inherit !important;
}

.profile-primary-btn,
.profile-primary-btn *,
.profile-danger-btn,
.profile-danger-btn *,
.app-header-left,
.app-header-left .app-title,
.public-home-brand,
.public-home-brand *,
.message-request-actions button:first-child,
.message-request-actions button:first-child *,
.chatbox-compose button,
.chatbox-compose button *,
.message-center-new-btn,
.message-center-new-btn *,
button[style*="#8C1515"],
button[style*="#8C1515"] *,
button[style*="140,21,21"],
button[style*="140,21,21"] * {
    color: #fff !important;
}

.message-thread-card.unread {
    border-color: rgba(140, 21, 21, 0.32) !important;
    box-shadow: 0 10px 22px rgba(140, 21, 21, 0.12) !important;
}

.message-thread-topline h3 {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
}

.message-unread-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #8C1515;
    box-shadow: 0 0 0 3px rgba(140,21,21,0.12);
    flex: 0 0 auto;
}

.stanfordwho-suggestions {
    background: #fffaf0 !important;
    border-color: rgba(84,54,34,0.16) !important;
    box-shadow: 0 16px 28px rgba(66,42,24,0.18) !important;
}

.stanfordwho-suggestions button {
    background: #fff4cf !important;
    border-color: rgba(84,54,34,0.14) !important;
}

@media (max-width: 760px) {
    .flyer-wall-page .tab-container {
        gap: 8px !important;
        padding: 10px 12px 14px !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .flyer-wall-page .tab-container::-webkit-scrollbar {
        display: none !important;
    }

    .flyer-wall-page .tab-button,
    .flyer-wall-page .tab-button:nth-child(n) {
        flex: 0 0 clamp(168px, 62vw, 240px) !important;
        min-height: 50px !important;
        padding: 10px 14px !important;
        font-size: 14px !important;
        white-space: nowrap !important;
    }

    .flyer-filter-strip {
        padding-top: 22px !important;
        padding-bottom: 26px !important;
    }

    .flyer-filter-row {
        gap: 12px !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
        scroll-padding-inline: 18px !important;
    }

    .flyer-wall-page .filter-btn,
    .flyer-wall-page .filter-btn:nth-child(n) {
        flex: 0 0 auto !important;
        min-width: max-content !important;
        max-width: 70vw !important;
        padding: 11px 16px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }

    .flyer-wall-page .main-content {
        padding: 28px 16px 56px !important;
    }

    .flyer-wall-page .section-title {
        align-items: center !important;
        gap: 12px !important;
        padding: 14px 16px !important;
    }

    .flyer-wall-page .section-title span:first-child {
        font-size: clamp(22px, 7vw, 28px) !important;
        min-width: 0 !important;
    }

    .flyer-wall-page .section-count {
        flex-shrink: 0 !important;
        font-size: 16px !important;
        padding: 8px 10px !important;
    }

    .flyer-wall-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 34px !important;
        padding-top: 44px !important;
    }

    .flyer-wall-page .event-card,
    .flyer-wall-page .event-card:nth-child(n) {
        width: min(100%, 390px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        transform: rotate(0deg) !important;
    }

    .flyer-wall-page .event-card:hover {
        transform: translateY(-6px) scale(1.01) !important;
    }
}

@media (max-width: 420px) {
    .flyer-wall-page .tab-button,
    .flyer-wall-page .tab-button:nth-child(n) {
        flex-basis: 74vw !important;
    }

    .flyer-wall-page .section-title {
        border-radius: 22px !important;
        flex-wrap: wrap !important;
    }

    .flyer-wall-page .event-card-image {
        height: 148px !important;
    }

    .flyer-wall-page .event-card-title {
        font-size: 22px !important;
    }
}

@media (max-width: 520px) {
    .app-header {
        padding: 12px 8px !important;
    }

    .app-logo {
        width: 34px !important;
        height: 34px !important;
    }

    .app-nav-btn,
    .nav-leaderboard {
        width: 36px !important;
        height: 36px !important;
        flex-basis: 36px !important;
    }

    .app-logo .sprout-mascot {
        --sprout-size: 30px !important;
    }

    .app-title {
        font-size: 16px !important;
    }

    .flyer-wall-page .event-card::before {
        width: min(180px, 58%) !important;
    }
}

/* Popups no longer use decorative tape; event cards keep their flyer tape. */
.event-sheet-tape,
.profile-modal-card::before,
.social-directory-board::before,
.friend-matcher-board::before,
.leaderboard-shell::before,
#profileModal .profile-modal-card::before,
#inboxModal .profile-modal-card::before,
#privateInviteModal .profile-modal-card::before {
    content: none !important;
    display: none !important;
}

.event-pin-sheet {
    background: var(--shell-paper, rgba(246,251,244,0.96)) !important;
    border-top: 0 !important;
}

/* RSVP matches the plain rectangular action buttons beside it. */

.rsvp-envelope-btn,
.flyer-wall-page .event-card button[data-rsvp-button].rsvp-envelope-btn {
    position: relative !important;
    min-height: 0 !important;
    height: 32px !important;
    border-radius: 7px !important;
    clip-path: none !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 9px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    width: 100% !important;
    transition: transform 0.15s ease,
                filter 0.15s ease !important;
}

.rsvp-envelope-btn:not(:disabled):hover,
.flyer-wall-page .event-card button[data-rsvp-button].rsvp-envelope-btn:not(:disabled):hover {
    transform: translateY(-1px) !important;
    filter: brightness(1.1) !important;
}

.rsvp-envelope-btn::before,
.rsvp-envelope-btn::after {
    content: none !important;
    display: none !important;
}

.rsvp-envelope-label {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    position: relative !important;
    z-index: 1 !important;
}

/* AI results readability polish. */
.ai-result-page .ai-results-main {
    padding-top: 34px !important;
    padding-bottom: clamp(96px, 12vh, 150px) !important;
}

.ai-result-page .ai-result-card {
    background: #fffdf8 !important;
    overflow: visible !important;
}

.ai-result-page .ai-result-hero {
    min-height: 250px !important;
    border-radius: 16px !important;
    margin: 2px 0 24px !important;
    isolation: isolate !important;
}

.ai-result-page .ai-result-hero h1,
.ai-result-page .ai-result-hero p,
.ai-result-page .ai-result-hero * {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.45) !important;
}

.ai-result-page .ai-result-hero h1 {
    font-weight: 900 !important;
}

.ai-result-page .sprout-surface {
    background: #ffffff !important;
}

.ai-result-page .ai-result-pill,
.ai-result-page .event-card-vibe-tag,
.ai-result-page span[style*="rgba(246,251,244"] {
    background: #ffffff !important;
}

.ai-result-page .ai-result-info-icon {
    background: #8C1515 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.45) !important;
    box-shadow: 0 8px 18px rgba(140,21,21,0.18) !important;
}

.ai-result-page .ai-result-info-icon i,
.ai-result-page .sprout-source-actions i,
.ai-result-page button[style*="#8C1515"] i,
.ai-result-page button[style*="a31a1a"] i {
    color: #ffffff !important;
}

.ai-result-page .ai-result-chat-messages {
    background: #ffffff !important;
    border: 1px solid rgba(15,81,50,0.10) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.92) !important;
}

.ai-result-page #chatMessages [data-sprout-bubble],
.ai-result-page #chatMessages .relative > div[style*="rgba(246,251,244"] {
    background: #ffffff !important;
}

/* Keep Sprout's search glass attached and remove the stray hand dot. */
.sprout-magnify-glass {
    top: 31px !important;
    right: -3px !important;
}

.sprout-search-mascot-wrap::after {
    content: none !important;
    display: none !important;
}

/* Extra specificity for cached CSS and inline AI-result surfaces. */
.ai-result-page .ai-result-card > .p-6,
.ai-result-page .ai-result-card > div:not(.ai-result-hero),
.ai-result-page .ai-match-card,
.ai-result-page .sprout-surface,
.ai-result-page .sprout-surface.p-4,
.ai-result-page .mb-6 > .sprout-surface {
    background: #ffffff !important;
}

.ai-result-page .ai-result-hero .absolute.bottom-0,
.ai-result-page .ai-result-hero .absolute.bottom-0 *,
.ai-result-page .ai-result-hero h1,
.ai-result-page .ai-result-hero p {
    color: #ffffff !important;
    text-shadow: 0 2px 12px rgba(0,0,0,0.60) !important;
}

.bottom-sheet.event-pin-sheet .bottom-sheet-header {
    background: #fff8fb !important;
    box-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE & TABLET RESPONSIVE OVERRIDES
   Target: phones ≤ 640 px, tablets ≤ 860 px
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 860 px) ──────────────────────────────────────────────────── */
@media (max-width: 860px) {
    /* Social directory / contacts board — full-width on tablet */
    .social-directory-board {
        width: 100% !important;
        max-height: 95vh !important;
        border-radius: 18px !important;
        padding: clamp(14px, 3vw, 22px) !important;
    }

    /* Profile & profile-customization modals */
    #profileModal > div,
    #profileCustomizationModal > div {
        max-width: 100% !important;
        border-radius: 20px !important;
        padding: 20px !important;
    }

    /* Profile quick-action buttons — 3 cols → 2 cols on narrow tablet */
    #profileModal .profile-quick-actions,
    #profileModal > div > div[style*="repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Bio + feed signal panels — stack vertically */
    #profileModal > div > div[style*="1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Profile stats — 4 cols → 2×2 */
    #profileModal > div > div[style*="repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Friend matcher board */
    .friend-matcher-board {
        padding: clamp(14px, 3vw, 22px) !important;
    }
}

/* ── Phone (≤ 640 px) ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
    /* Modals fill the screen on phones with a safe bottom gap */
    .social-directory-modal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .social-directory-board {
        width: 100% !important;
        max-height: 92dvh !important;
        border-radius: 22px 22px 0 0 !important;
        overflow-y: auto !important;
        padding: 18px 14px 32px !important;
    }

    /* ── Profile modal ── */
    #profileModal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    #profileModal > div {
        max-width: 100% !important;
        max-height: 92dvh !important;
        border-radius: 22px 22px 0 0 !important;
        padding: 18px 14px 28px !important;
    }

    /* ── Profile customization modal ── */
    #profileCustomizationModal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    #profileCustomizationModal > div {
        max-width: 100% !important;
        max-height: 95dvh !important;
        border-radius: 22px 22px 0 0 !important;
        padding: 18px 14px 28px !important;
    }

    /* Profile tab buttons — shrink text on very small screens */
    .profile-tab-btn {
        font-size: 12px !important;
        padding: 8px 10px !important;
    }

    /* Bio + feed signal panels — already 1 col from tablet rule */

    /* Profile stat grid → 2 cols */
    #profileModal > div > div[style*="repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* User profile sheet — slides up from bottom on phones */
    #userProfileSheet {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    #userProfileSheet > div {
        max-width: 100% !important;
        max-height: 90dvh !important;
        border-radius: 22px 22px 0 0 !important;
        padding: 18px 16px 32px !important;
    }

    /* Custom prompt / confirm modals */
    #customPromptModal,
    #customConfirmModal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    #customPromptModal > div,
    #customConfirmModal > div {
        max-width: 100% !important;
        border-radius: 22px 22px 0 0 !important;
        padding: 24px 18px 32px !important;
    }

    /* Inbox modal */
    #inboxModal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    #inboxModal > div {
        max-height: 94dvh !important;
        border-radius: 22px 22px 0 0 !important;
        padding: 18px 14px 28px !important;
    }

    /* Leaderboard / friend matcher */
    .leaderboard-shell,
    .friend-matcher-board {
        border-radius: 22px 22px 0 0 !important;
        padding: clamp(14px, 4vw, 20px) !important;
        max-height: 92dvh !important;
    }

    /* Navigation bar compact on small phones */
    .app-header {
        padding: 10px 10px !important;
    }

    .app-nav-btn,
    .nav-leaderboard {
        width: 38px !important;
        height: 38px !important;
        font-size: 15px !important;
    }

    /* Section title pill — full-width on phone */
    .flyer-wall-page .section-title {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    /* Event grid — single column, centered card */
    .flyer-wall-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 28px !important;
        padding: 32px 0 40px !important;
    }

    .flyer-wall-page .event-card,
    .flyer-wall-page .event-card:nth-child(n) {
        width: min(100%, 370px) !important;
        margin-inline: auto !important;
    }

    /* Filter strip — tighter on phone */
    .flyer-filter-row {
        gap: 10px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .flyer-wall-page .filter-btn,
    .flyer-wall-page .filter-btn:nth-child(n) {
        padding: 9px 14px !important;
        font-size: 12px !important;
    }

    /* Smart search pill — full width on phone */
    .smart-search-container,
    .flyer-wall-page .smart-search-container {
        border-radius: 0 !important;
        padding: 10px 12px !important;
    }

    /* Public home hero text — reduce size */
    .public-home h1,
    .public-home-hero h1 {
        font-size: clamp(26px, 8vw, 38px) !important;
    }
}

/* ── Very small phones (≤ 390 px) ───────────────────────────────────────── */
@media (max-width: 390px) {
    .flyer-wall-page .tab-button,
    .flyer-wall-page .tab-button:nth-child(n) {
        flex-basis: 78vw !important;
        font-size: 13px !important;
    }

    .profile-tab-btn {
        font-size: 11px !important;
        padding: 7px 9px !important;
    }

    #profileModal > div,
    #profileCustomizationModal > div,
    .social-directory-board,
    #userProfileSheet > div {
        padding: 14px 12px 24px !important;
    }
}

/* ── Mobile navigation and scroll reliability ───────────────────────────── */
@media (max-width: 640px) {
    /* Restore sticky for other pages that reuse .public-home-nav */
    .public-home-nav {
        position: sticky !important;
        top: 0 !important;
        gap: 8px !important;
        padding: 8px !important;
    }

    /* Landing hero navbar only — fixed so it floats over the hero photo */
    .public-home-nav--landing {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        gap: 8px !important;
        padding: 10px 16px !important;
    }

    .public-home-brand {
        min-height: 44px !important;
        gap: 5px !important;
        padding: 4px 10px 4px 4px !important;
        font-size: 15px !important;
        flex: 0 1 auto !important;
        min-width: 0 !important;
    }

    .public-home-brand .sprout-mascot {
        --sprout-size: 28px !important;
    }

    .public-home-actions {
        min-width: 0 !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
    }

    .public-home-button,
    .public-home-actions button {
        min-height: 36px !important;
        padding: 7px 7px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
    }

    /* Keep the desktop header styling while tightening its mobile dimensions. */
    .app-header {
        position: sticky !important;
        top: 0 !important;
        gap: 4px !important;
        padding: 6px !important;
    }

    .flyer-wall-page .app-header-left {
        width: auto !important;
        min-width: 0 !important;
        min-height: 36px !important;
        margin-left: 0 !important;
        gap: 4px !important;
        padding: 3px 7px 3px 3px !important;
    }

    .app-header-left .app-title {
        display: inline !important;
        font-size: 13px !important;
    }

    .app-logo {
        width: 26px !important;
        height: 26px !important;
    }

    .app-logo .sprout-mascot {
        --sprout-size: 23px !important;
    }

    .flyer-wall-page .app-nav {
        min-width: 0 !important;
        margin-right: 0 !important;
        gap: 2px !important;
        padding: 3px !important;
        flex: 1 1 auto !important;
        justify-content: space-between !important;
    }

    .app-nav-btn,
    .nav-leaderboard {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        flex: 0 0 30px !important;
        padding: 0 !important;
        font-size: 13px !important;
        justify-content: center !important;
    }

    .profile-avatar-frame-sm {
        width: 26px !important;
        height: 26px !important;
    }

    /* Show all three primary destinations without requiring a hidden swipe. */
    .flyer-wall-page .tab-container {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
        overflow: visible !important;
        padding: 8px !important;
    }

    .flyer-wall-page .tab-button,
    .flyer-wall-page .tab-button:nth-child(n) {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 44px !important;
        padding: 8px 4px !important;
        flex: none !important;
        font-size: 11px !important;
        line-height: 1.15 !important;
        white-space: normal !important;
    }

    /* Make the temporary location ask useful without blocking the feed. */
    .location-prompt-shell {
        left: 10px !important;
        right: 10px !important;
        bottom: max(70px, env(safe-area-inset-bottom, 0px) + 64px) !important;
    }

    .location-prompt-layout {
        gap: 8px !important;
    }

    .location-prompt-pin {
        width: 34px !important;
        height: 34px !important;
        border-radius: 12px !important;
    }

    .location-prompt-card {
        padding: 12px !important;
    }

    .location-prompt-copy {
        margin-bottom: 10px !important;
        font-size: 13px !important;
    }

    .location-prompt-primary,
    .location-prompt-secondary {
        min-height: 40px !important;
        padding: 9px 10px !important;
        font-size: 12px !important;
    }

    .flyer-wall-page .create-event-fab {
        width: auto !important;
        height: auto !important;
        right: 12px !important;
        bottom: max(12px, env(safe-area-inset-bottom, 0px) + 8px) !important;
        gap: 6px !important;
        padding: 10px 12px !important;
        border-radius: 6px !important;
        font-size: 12px !important;
        justify-content: center !important;
    }

    .flyer-wall-page .create-event-fab i {
        width: 24px !important;
        height: 24px !important;
    }

    /* Let full-page panels use body scrolling; keep modal sheets scrollable. */
    .friend-matcher-page .friend-matcher-board,
    .flyer-wall-page .leaderboard-shell {
        max-height: none !important;
        overflow: visible !important;
    }

    .social-directory-board,
    #profileModal > div,
    #profileCustomizationModal > div,
    #inboxModal > div,
    #userProfileSheet > div {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
    }

    .locked-page {
        min-height: 100dvh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Keep social cards and profile sheets inside narrow phone viewports. */
    .friend-matcher-page,
    .friend-matcher-board,
    .friend-matcher-hero,
    .friend-matcher-visual,
    .friend-search-panel,
    .friend-search-row,
    .friend-match-list,
    .friend-match-card,
    .social-directory-modal,
    .social-directory-board,
    .social-directory-grid,
    .social-directory-section,
    .social-directory-list,
    .social-directory-card,
    .social-directory-person-head,
    #userProfileSheet,
    #userProfileSheet > div,
    #profileCustomizationModal,
    #profileCustomizationModal > div,
    #profileTabContent,
    .profile-tab-content {
        box-sizing: border-box !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .friend-matcher-page,
    .friend-matcher-board,
    .social-directory-board,
    #userProfileSheet > div,
    #profileCustomizationModal > div {
        overflow-x: hidden !important;
    }

    .friend-matcher-board {
        padding: 14px 12px 132px !important;
    }

    .friend-match-card,
    .social-directory-card,
    .social-directory-card:nth-child(2n) {
        transform: none !important;
    }

    .friend-match-card {
        overflow: hidden !important;
        padding: 14px !important;
    }

    .friend-match-card h3 {
        padding-right: 58px !important;
        font-size: 21px !important;
        overflow-wrap: anywhere !important;
    }

    .friend-match-card p,
    .social-directory-person-head h3,
    .social-directory-person-head p,
    #userProfileSheet p,
    #profileCustomizationModal p {
        overflow-wrap: anywhere !important;
    }

    .friend-search-row {
        gap: 6px !important;
        padding: 8px !important;
    }

    .friend-search-row button {
        padding: 8px 9px !important;
    }

    .friend-matcher-visual img,
    .social-directory-avatar img,
    #userProfileSheet img,
    #profileModal .profile-avatar-image {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        object-fit: cover !important;
    }

    .social-directory-board {
        transform: none !important;
    }

    .social-directory-card {
        padding: 12px !important;
    }

    .social-directory-person-head > div:not(.social-directory-avatar) {
        min-width: 0 !important;
    }

    .social-directory-person-head h3,
    .social-directory-person-head p {
        max-width: 100% !important;
    }

    .social-directory-actions button {
        flex: 1 1 120px !important;
        justify-content: center !important;
        color: #fffdf7 !important;
    }

    .social-directory-actions button * {
        color: #fffdf7 !important;
    }

    .profile-settings-tabs {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        overflow-x: hidden !important;
        padding-bottom: 2px !important;
    }

    .profile-settings-tabs .profile-tab-btn {
        width: 100% !important;
        min-width: 0 !important;
        white-space: normal !important;
        text-align: center !important;
        line-height: 1.2 !important;
    }

    #userProfileSheet button,
    #userProfileSheet button * {
        opacity: 1 !important;
    }

    #userProfileSheet button:last-child,
    #userProfileSheet button:last-child * {
        color: #8C1515 !important;
    }
}

/* Event feed cards stay static so infinite-scroll loading does not stutter. */
.flyer-wall-page .event-card.card-scroll-reveal,
.flyer-wall-page .event-card.card-scroll-visible,
.flyer-wall-page .event-card.card-scroll-hidden {
    opacity: 1 !important;
    visibility: visible !important;
}

.flyer-wall-page .event-card,
.flyer-wall-page .event-card:nth-child(n),
.flyer-wall-page .event-card::before,
.flyer-wall-page .event-card::after {
    animation: none !important;
    animation-delay: 0s !important;
    animation-duration: 0s !important;
    animation-timeline: auto !important;
    animation-range: normal !important;
    transition: none !important;
}

.flyer-wall-page .event-card:hover,
.flyer-wall-page .event-card:nth-child(n):hover {
    transform: rotate(var(--flyer-tilt, -1.8deg)) translateY(0) scale(1) !important;
}

.flyer-wall-page .ai-event-loading-card,
.flyer-wall-page .ai-event-loading-card:hover {
    transform: rotate(0deg) translateY(0) scale(1) !important;
}
