/* ==========================================================================
   FLUUS UX FOUNDATION (responsive pass, 2026-10-16)
   Loaded AFTER main-new.css. One theme system: the --app-* variables that
   main.js already sets on <html> (applyThemeVars) are the single source of
   truth; the --fx-* names below are semantic aliases + layout primitives.

   Breakpoints (content-driven starting points):
     phone   < 600px   gutter 16px
     tablet  600-1023  gutter 24px
     desktop >= 1024   gutter 32px, bottom tab bar becomes a side rail
   ========================================================================== */

:root {
    /* palette (dark default; light overrides below) */
    --fx-bg: var(--app-bg, #101018);
    --fx-surface: var(--app-card, #1a1b27);
    --fx-surface-raised: var(--app-bg2, #242635);
    --fx-text: var(--app-text, #f5f5fa);
    --fx-text-muted: var(--app-subtext, #b4b5c6);
    --fx-border: var(--app-border, #353749);
    --fx-primary: #a78bfa;          /* accent TEXT/icons on dark: 6.3:1 on surface */
    --fx-primary-solid: #6844db;    /* filled buttons, white text: 6.1:1 */
    --fx-primary-solid-hover: #5b38c9;
    --fx-primary-tint: rgba(139, 108, 255, 0.16);
    --fx-on-primary: #ffffff;
    --fx-success: #4ade80;
    --fx-success-tint: rgba(74, 222, 128, 0.14);
    --fx-warning: #fbbf24;
    --fx-warning-tint: rgba(251, 191, 36, 0.14);
    --fx-danger: #f87171;
    --fx-danger-tint: rgba(248, 113, 113, 0.14);
    --fx-focus: #c4b5fd;
    --fx-scrim: rgba(6, 6, 12, 0.66);

    /* shape + rhythm */
    --fx-radius-card: 16px;
    --fx-radius-control: 12px;
    --fx-radius-pill: 999px;
    --fx-space-1: 4px;
    --fx-space-2: 8px;
    --fx-space-3: 12px;
    --fx-space-4: 16px;
    --fx-space-5: 24px;
    --fx-space-6: 32px;
    --fx-space-7: 48px;

    /* layout primitives */
    --fx-page-max: 1200px;
    --fx-read-max: 70ch;
    --fx-feed-max: 660px;
    --fx-form-max: 520px;
    --fx-gutter: 16px;
    --fx-touch: 44px;
    --fx-tabbar-h: 64px;
    --fx-rail-w: 92px;
    --fx-header-h: 60px;
    --fx-safe-top: env(safe-area-inset-top, 0px);
    --fx-safe-bottom: env(safe-area-inset-bottom, 0px);
    /* space a page must leave below its content for the fixed tab bar */
    --fx-nav-clearance: calc(var(--fx-tabbar-h) + var(--fx-safe-bottom) + 16px);

    /* type */
    --fx-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --fx-fs-xs: 12px;
    --fx-fs-sm: 13px;
    --fx-fs-md: 15px;
    --fx-fs-lg: 17px;
    --fx-fs-xl: 21px;
    --fx-fs-2xl: clamp(22px, 2.2vw + 14px, 30px);
    --fx-shadow-pop: 0 18px 50px rgba(0, 0, 0, 0.45);
}
[data-theme="light"] {
    --fx-primary: #5b3fd0;          /* 6.9:1 on white */
    --fx-primary-solid: #6844db;
    --fx-primary-solid-hover: #5532c4;
    --fx-primary-tint: rgba(104, 68, 219, 0.10);
    --fx-success: #15803d;
    --fx-success-tint: rgba(21, 128, 61, 0.10);
    --fx-warning: #b45309;
    --fx-warning-tint: rgba(180, 83, 9, 0.10);
    --fx-danger: #b91c1c;
    --fx-danger-tint: rgba(185, 28, 28, 0.08);
    --fx-focus: #6844db;
    --fx-scrim: rgba(20, 20, 30, 0.45);
    --fx-shadow-pop: 0 18px 50px rgba(20, 20, 40, 0.18);
}
@media (min-width: 600px) { :root { --fx-gutter: 24px; } }
@media (min-width: 1024px) { :root { --fx-gutter: 32px; --fx-nav-clearance: 32px; } }

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
/* main-new.css clips the whole document horizontally (overflow-x:hidden on
   html/body), which hides layout bugs instead of fixing them. Undo it; any
   intentional horizontal scrolling lives in .fx-scroller / carousels. */
html, body { overflow-x: visible; max-width: none; }
html { background: var(--fx-bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    font-family: var(--fx-font);
    background: var(--fx-bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    min-height: 100dvh;
}
.page { min-height: 100vh; min-height: 100dvh; }
img, video { max-width: 100%; }
button, a, input, select, textarea { font-family: inherit; }

/* Visible keyboard focus everywhere (pointer taps don't trigger it) */
:focus-visible {
    outline: 3px solid var(--fx-focus) !important;
    outline-offset: 2px !important;
    border-radius: 6px;
}
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

/* iOS zooms into inputs under 16px; keep them at 16px on touch devices so
   pinch-zoom can stay enabled (the viewport no longer blocks it). */
@media (pointer: coarse) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: max(16px, 1em) !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.fx-container { width: 100%; max-width: calc(var(--fx-page-max) + 2 * var(--fx-gutter)); margin-inline: auto; padding-inline: var(--fx-gutter); box-sizing: border-box; min-width: 0; }
.fx-read      { width: 100%; max-width: calc(var(--fx-read-max) + 2 * var(--fx-gutter)); margin-inline: auto; padding-inline: var(--fx-gutter); box-sizing: border-box; min-width: 0; }
.fx-feed      { width: 100%; max-width: var(--fx-feed-max); margin-inline: auto; box-sizing: border-box; min-width: 0; }
.fx-form      { width: 100%; max-width: calc(var(--fx-form-max) + 2 * var(--fx-gutter)); margin-inline: auto; padding-inline: var(--fx-gutter); box-sizing: border-box; min-width: 0; }
.fx-bounded   { width: 100%; max-width: calc(760px + 2 * var(--fx-gutter)); margin-inline: auto; box-sizing: border-box; min-width: 0; }
.fx-stack     { display: flex; flex-direction: column; gap: var(--fx-space-4); min-width: 0; }
.fx-row       { display: flex; align-items: center; gap: var(--fx-space-3); min-width: 0; }
.fx-min0, .fx-min0 > * { min-width: 0; }
.fx-nav-clearance { padding-bottom: var(--fx-nav-clearance) !important; }

/* Intentional horizontal scrollers (rails, chips, stories) */
.fx-scroller {
    display: flex; gap: var(--fx-space-3); overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    flex-shrink: 0; padding-bottom: 4px;
}
.fx-scroller::-webkit-scrollbar { display: none; }
.fx-scroller > * { scroll-snap-align: start; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   Section headings
   -------------------------------------------------------------------------- */
.fx-section { margin-top: var(--fx-space-6); min-width: 0; }
.fx-section:first-child { margin-top: var(--fx-space-4); }
.fx-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--fx-space-3); margin-bottom: var(--fx-space-3); min-width: 0; }
.fx-section-title { margin: 0; font-size: var(--fx-fs-lg); font-weight: 700; color: var(--fx-text); letter-spacing: -0.01em; line-height: 1.25; }
.fx-section-sub { margin: 2px 0 0; font-size: var(--fx-fs-sm); color: var(--fx-text-muted); }
.fx-link-btn {
    background: none; border: 0; padding: 10px 4px; margin: -10px -4px; min-height: var(--fx-touch);
    color: var(--fx-primary); font-weight: 600; font-size: var(--fx-fs-sm); cursor: pointer; white-space: nowrap;
    text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.fx-link-btn:hover { text-decoration: underline; }
.fx-page-title { margin: 0; font-size: var(--fx-fs-2xl); line-height: 1.15; font-weight: 800; color: var(--fx-text); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.fx-eyebrow { font-size: var(--fx-fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fx-text-muted); }
.fx-muted { color: var(--fx-text-muted); }
.fx-prose { max-width: var(--fx-read-max); line-height: 1.6; font-size: var(--fx-fs-md); color: var(--fx-text); overflow-wrap: anywhere; }
.fx-prose p { margin: 0 0 1em; }

/* --------------------------------------------------------------------------
   Surfaces, buttons, chips
   -------------------------------------------------------------------------- */
.fx-card { background: var(--fx-surface); border: 1px solid var(--fx-border); border-radius: var(--fx-radius-card); min-width: 0; }
.fx-card-pad { padding: var(--fx-space-4); }
@media (min-width: 600px) { .fx-card-pad { padding: var(--fx-space-5); } }

.fx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--fx-touch); padding: 10px 18px; border-radius: var(--fx-radius-control);
    font-size: var(--fx-fs-md); font-weight: 700; line-height: 1.2; cursor: pointer; text-decoration: none;
    border: 1px solid transparent; transition: background-color .15s ease, border-color .15s ease; box-sizing: border-box;
}
.fx-btn[disabled] { opacity: .55; cursor: not-allowed; }
.fx-btn-primary { background: var(--fx-primary-solid); color: var(--fx-on-primary); }
.fx-btn-primary:hover:not([disabled]) { background: var(--fx-primary-solid-hover); }
.fx-btn-secondary { background: var(--fx-surface-raised); color: var(--fx-text); border-color: var(--fx-border); }
.fx-btn-secondary:hover:not([disabled]) { border-color: var(--fx-primary); }
.fx-btn-ghost { background: transparent; color: var(--fx-text); border-color: var(--fx-border); }
.fx-btn-danger { background: transparent; color: var(--fx-danger); border-color: currentColor; }
.fx-btn-block { width: 100%; }

.fx-iconbtn {
    width: var(--fx-touch); height: var(--fx-touch); min-width: var(--fx-touch); border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
    background: var(--fx-surface-raised); color: var(--fx-text); border: 1px solid var(--fx-border); flex-shrink: 0;
}
.fx-iconbtn:hover { border-color: var(--fx-primary); }

.fx-chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px;
    border-radius: var(--fx-radius-pill); border: 1px solid var(--fx-border); background: var(--fx-surface);
    color: var(--fx-text); font-size: var(--fx-fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; flex-shrink: 0;
}
.fx-chip[aria-pressed="true"], .fx-chip.is-active { background: var(--fx-primary-tint); border-color: var(--fx-primary); color: var(--fx-primary); }
@media (pointer: coarse) { .fx-chip { min-height: var(--fx-touch); } }

/* Segmented control (All / Following / Mine, Discover / Connections ...) */
.fx-segmented { display: flex; gap: 4px; padding: 4px; background: var(--fx-surface); border: 1px solid var(--fx-border); border-radius: var(--fx-radius-control); min-width: 0; }
.fx-segmented > button {
    flex: 1 1 0; min-width: 0; min-height: 40px; border: 0; border-radius: 9px; background: transparent;
    color: var(--fx-text-muted); font-weight: 700; font-size: var(--fx-fs-sm); cursor: pointer; padding: 6px 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fx-segmented > button[aria-selected="true"], .fx-segmented > button[aria-pressed="true"] { background: var(--fx-primary-solid); color: #fff; }

/* Status pills — always text + colour, never colour alone */
.fx-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--fx-radius-pill); font-size: var(--fx-fs-xs); font-weight: 700; line-height: 1.4; white-space: nowrap; }
.fx-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.fx-status-live { background: var(--fx-success-tint); color: var(--fx-success); }
.fx-status-upcoming { background: var(--fx-primary-tint); color: var(--fx-primary); }
.fx-status-ended { background: var(--fx-surface-raised); color: var(--fx-text-muted); }
.fx-status-warn { background: var(--fx-warning-tint); color: var(--fx-warning); }
.fx-status-danger { background: var(--fx-danger-tint); color: var(--fx-danger); }

/* Empty + error states */
.fx-empty { text-align: center; padding: var(--fx-space-6) var(--fx-space-4); max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: var(--fx-space-3); }
.fx-empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--fx-primary-tint); color: var(--fx-primary); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.fx-empty h3 { margin: 0; font-size: var(--fx-fs-lg); color: var(--fx-text); }
.fx-empty p { margin: 0; font-size: var(--fx-fs-md); color: var(--fx-text-muted); line-height: 1.5; }

/* Skeletons (instead of misleading 0s) */
.fx-skel { display: block; background: linear-gradient(90deg, var(--fx-surface-raised) 0%, var(--fx-border) 50%, var(--fx-surface-raised) 100%); background-size: 200% 100%; animation: fxShimmer 1.3s ease-in-out infinite; border-radius: 8px; color: transparent !important; }
.fx-skel-text { display: inline-block; height: 1em; width: 3ch; vertical-align: -0.1em; }
@keyframes fxShimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* --------------------------------------------------------------------------
   Shared page header (renderFluusHeader)
   -------------------------------------------------------------------------- */
.fx-header {
    position: sticky; top: 0; z-index: 100; background: var(--fx-bg);
    border-bottom: 1px solid var(--fx-border); padding-top: var(--fx-safe-top);
}
.fx-header-inner {
    display: grid; grid-template-columns: var(--fx-touch) minmax(0, 1fr) var(--fx-touch); align-items: center; gap: var(--fx-space-3);
    min-height: var(--fx-header-h); padding: 8px var(--fx-gutter); max-width: calc(var(--fx-page-max) + 2 * var(--fx-gutter)); margin: 0 auto; box-sizing: border-box;
}
.fx-header-title { min-width: 0; text-align: center; }
.fx-header-title h1 { margin: 0; font-size: var(--fx-fs-lg); font-weight: 800; color: var(--fx-text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-header-brand { font-size: 17px; font-weight: 800; letter-spacing: 0.08em; color: var(--fx-text); background: none; border: 0; cursor: pointer; padding: 6px 8px; }
@media (min-width: 1024px) {
    .fx-header-title { text-align: left; }
}

/* Event context strip: the selected event stays visible on event screens */
.fx-evctx {
    display: flex; align-items: center; gap: 10px; padding: 8px var(--fx-gutter);
    max-width: calc(var(--fx-page-max) + 2 * var(--fx-gutter)); margin: 0 auto; box-sizing: border-box; min-width: 0;
}
.fx-evctx-bar { background: var(--fx-surface); border-bottom: 1px solid var(--fx-border); }
.fx-evctx-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; text-align: left; min-height: 40px; }
.fx-evctx-thumb { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--fx-surface-raised); }
.fx-evctx-name { font-size: var(--fx-fs-sm); font-weight: 700; color: var(--fx-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.fx-evctx-meta { font-size: var(--fx-fs-xs); color: var(--fx-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.fx-evctx-switch { flex-shrink: 0; min-height: 36px; padding: 6px 12px; border-radius: var(--fx-radius-pill); border: 1px solid var(--fx-border); background: var(--fx-surface-raised); color: var(--fx-text); font-size: var(--fx-fs-xs); font-weight: 700; cursor: pointer; }
@media (pointer: coarse) { .fx-evctx-switch { min-height: var(--fx-touch); } }

/* --------------------------------------------------------------------------
   Global navigation: bottom bar (phone/tablet) -> side rail (desktop)
   -------------------------------------------------------------------------- */
nav.fluus-tabbar {
    background: var(--app-nav, var(--fx-surface)) !important;
    border-top: 1px solid var(--fx-border) !important;
    box-shadow: none !important;
    justify-content: center;
    min-height: var(--fx-tabbar-h);
    box-sizing: border-box;
}
nav.fluus-tabbar > button { max-width: 120px; min-height: var(--fx-touch); border-radius: 12px; }
nav.fluus-tabbar > button[aria-current="page"] { color: var(--fx-primary) !important; }
@media (hover: hover) { nav.fluus-tabbar > button:not([aria-current="page"]):hover { color: var(--fx-text) !important; } }
nav.fluus-tabbar .fx-tab-badge {
    position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: #dc2626; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; box-sizing: border-box;
}
.fx-rail-brand { display: none; }
@media (min-width: 600px) and (max-width: 1023px) {
    nav.fluus-tabbar { padding-inline: calc((100% - 600px) / 2) !important; }
}
@media (min-width: 1024px) {
    nav.fluus-tabbar {
        top: 0 !important; bottom: 0 !important; left: 0 !important; right: auto !important;
        width: var(--fx-rail-w); flex-direction: column !important; justify-content: flex-start !important;
        gap: 6px; padding: calc(16px + var(--fx-safe-top)) 8px 16px !important;
        border-top: 0 !important; border-right: 1px solid var(--fx-border) !important;
    }
    nav.fluus-tabbar > button { flex: 0 0 auto !important; width: 100%; padding: 10px 4px !important; }
    nav.fluus-tabbar > button[aria-current="page"] { background: var(--fx-primary-tint) !important; }
    nav.fluus-tabbar > button > div { margin-top: 0 !important; box-shadow: none !important; }
    nav.fluus-tabbar > button span { font-size: 12px !important; }
    .fx-rail-brand { display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; width: 44px; height: 44px; border-radius: 12px; overflow: hidden; }
    .fx-rail-brand img { width: 100%; height: 100%; }
    /* everything shifts right of the rail; full-screen overlays (z>=1000) still cover it */
    body:has(nav.fluus-tabbar) #root { padding-left: var(--fx-rail-w); }
    body:has(nav.fluus-tabbar) .hamburger-btn { right: 24px; }
}
body.fluus-camera-open nav.fluus-tabbar { display: none !important; }
body.fluus-camera-open #root { padding-left: 0; }

/* --------------------------------------------------------------------------
   Event cards + grids (EventCard component)
   -------------------------------------------------------------------------- */
.fx-egrid { display: grid; gap: var(--fx-space-3); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); min-width: 0; }
@media (min-width: 600px) { .fx-egrid { gap: var(--fx-space-4); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
@media (min-width: 1024px) { .fx-egrid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); } }
.fx-egrid > * { min-width: 0; }

.fx-ecard {
    display: flex; flex-direction: column; text-align: left; width: 100%; min-width: 0; padding: 0; margin: 0;
    background: var(--fx-surface); border: 1px solid var(--fx-border); border-radius: var(--fx-radius-card);
    overflow: hidden; cursor: pointer; color: var(--fx-text); text-decoration: none; font: inherit;
    transition: border-color .15s ease, transform .15s ease;
}
.fx-ecard:hover { border-color: var(--fx-primary); }
@media (hover: hover) { .fx-ecard:hover { transform: translateY(-2px); } }
.fx-ecard-media { position: relative; aspect-ratio: 1 / 1; background: var(--fx-surface-raised); overflow: hidden; }
.fx-ecard-media img { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; display: block; }
.fx-ecard-noimg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--fx-text-muted); font-size: var(--fx-fs-xs); font-weight: 600; padding: 12px; text-align: center;
    background: radial-gradient(120% 90% at 20% 0%, var(--fx-primary-tint), transparent 60%), var(--fx-surface-raised); }
.fx-ecard-noimg span:first-child { font-size: 30px; font-weight: 800; color: var(--fx-primary); letter-spacing: -0.02em; }
.fx-ecard-badges { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; pointer-events: none; }
.fx-ecard-date { background: rgba(10, 10, 18, 0.78); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 8px; border-radius: 8px; line-height: 1.2; }
.fx-ecard-live { background: #15803d; color: #fff; font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 8px; display: inline-flex; align-items: center; gap: 5px; }
.fx-ecard-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.fx-ecard-flag { font-size: 15px; line-height: 1; background: rgba(255,255,255,0.9); border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.fx-ecard-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.fx-ecard-title {
    margin: 0; font-size: 15px; font-weight: 700; line-height: 1.25; color: var(--fx-text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.fx-ecard-meta { font-size: var(--fx-fs-xs); color: var(--fx-text-muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.fx-ecard-meta strong { color: var(--fx-text); font-weight: 600; }
@media (min-width: 600px) { .fx-ecard-title { font-size: 16px; } .fx-ecard-meta { font-size: var(--fx-fs-sm); } }

/* Featured rail variant: fixed card width inside a scroller */
.fx-erail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 72%); gap: var(--fx-space-3); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 6px; overscroll-behavior-x: contain; }
.fx-erail::-webkit-scrollbar { display: none; }
.fx-erail > * { scroll-snap-align: start; }
@media (min-width: 600px) { .fx-erail { grid-auto-columns: minmax(240px, 40%); } }

/* Filters bar (country chips etc.) */
.fx-filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin-bottom: var(--fx-space-3); }
.fx-filters::-webkit-scrollbar { display: none; }
.fx-filters > * { flex-shrink: 0; }
@media (min-width: 1024px) { .fx-filters { flex-wrap: wrap; overflow: visible; } }

/* --------------------------------------------------------------------------
   Dialogs / sheets
   -------------------------------------------------------------------------- */
.fx-scrim { position: fixed; inset: 0; z-index: 3000; background: var(--fx-scrim); display: flex; align-items: flex-end; justify-content: center; }
.fx-sheet {
    background: var(--fx-surface); color: var(--fx-text); width: 100%; max-width: 560px;
    border-radius: 20px 20px 0 0; border: 1px solid var(--fx-border); border-bottom: 0;
    max-height: calc(100dvh - 24px); max-height: calc(100vh - 24px); display: flex; flex-direction: column;
    padding-bottom: var(--fx-safe-bottom); box-shadow: var(--fx-shadow-pop);
}
@supports (height: 100dvh) { .fx-sheet { max-height: calc(100dvh - 24px); } }
.fx-sheet-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 8px; }
.fx-sheet-head h2 { margin: 0; flex: 1; min-width: 0; font-size: var(--fx-fs-lg); font-weight: 800; }
.fx-sheet-body { overflow-y: auto; padding: 4px 16px 16px; min-height: 0; overscroll-behavior: contain; }
@media (min-width: 600px) {
    .fx-scrim { align-items: center; padding: 24px; }
    .fx-sheet { border-radius: 20px; border-bottom: 1px solid var(--fx-border); max-height: min(720px, calc(100vh - 48px)); }
}

/* Sticky action footer for long forms (save/cancel always reachable) */
.fx-actionbar {
    position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; justify-content: flex-end;
    padding: 12px var(--fx-gutter) calc(12px + var(--fx-safe-bottom)); background: var(--fx-bg); border-top: 1px solid var(--fx-border);
}
.fx-actionbar .fx-btn { flex: 1 1 0; }
@media (min-width: 600px) { .fx-actionbar .fx-btn { flex: 0 0 auto; min-width: 140px; } }

/* --------------------------------------------------------------------------
   Landing / discovery
   -------------------------------------------------------------------------- */
.fx-landing { padding-bottom: var(--fx-nav-clearance); }
.fx-landing-head { display: flex; align-items: center; gap: 12px; padding-top: calc(16px + var(--fx-safe-top)); padding-bottom: 8px; min-width: 0; }
.fx-landing-head .fx-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.fx-landing-head .fx-brand img { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.fx-landing-head .fx-brand-name { font-size: 20px; font-weight: 800; color: var(--fx-text); line-height: 1.1; }
.fx-landing-head .fx-brand-tag { font-size: var(--fx-fs-sm); color: var(--fx-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-feature-links { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.fx-feature-links::-webkit-scrollbar { display: none; }
.login-page .fx-landing ~ .hamburger-btn, .fx-landing .hamburger-btn { position: static !important; }
.fx-landing .auth-accordion, .fx-landing .branded-auth-section { max-width: var(--fx-form-max); margin-left: auto !important; margin-right: auto !important; }

/* Generic page shells for pages that render inside renderFluusHeader */
.fx-page-body { padding-top: var(--fx-space-4); padding-bottom: var(--fx-nav-clearance); min-width: 0; }

/* --------------------------------------------------------------------------
   Event hub (HomePage)
   -------------------------------------------------------------------------- */
.fx-hub { padding-bottom: var(--fx-nav-clearance); }
.fx-hub-identity { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: center; padding: var(--fx-space-4); }
.fx-hub-poster { width: 72px; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: var(--fx-surface-raised); border: 1px solid var(--fx-border); padding: 0; cursor: zoom-in; }
.fx-hub-poster img { width: 100%; height: 100% !important; object-fit: cover; display: block; }
.fx-hub-name { margin: 4px 0 2px; font-size: var(--fx-fs-xl); font-weight: 800; line-height: 1.2; color: var(--fx-text); overflow-wrap: anywhere; }
.fx-hub-meta { font-size: var(--fx-fs-sm); color: var(--fx-text-muted); line-height: 1.45; overflow-wrap: anywhere; }
.fx-hub-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fx-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 600px) { .fx-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
.fx-tool {
    display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; text-align: left;
    background: var(--fx-surface); border: 1px solid var(--fx-border); border-radius: var(--fx-radius-card);
    color: var(--fx-text); cursor: pointer; font: inherit; min-width: 0; position: relative;
}
.fx-tool:hover { border-color: var(--fx-primary); }
.fx-tool-icon { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--fx-primary-tint); color: var(--fx-primary); font-size: 20px; }
.fx-tool-icon img, .fx-tool-icon svg { width: 22px; height: 22px; }
.fx-tool-label { font-size: var(--fx-fs-md); font-weight: 700; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.fx-tool-sub { display: block; font-size: var(--fx-fs-xs); color: var(--fx-text-muted); font-weight: 500; margin-top: 2px; }
.fx-tool-primary { background: var(--fx-primary-solid); border-color: var(--fx-primary-solid); color: #fff; }
.fx-tool-primary .fx-tool-icon { background: rgba(255,255,255,0.18); color: #fff; }
.fx-tool-primary .fx-tool-sub { color: rgba(255,255,255,0.85); }
.fx-tool .fx-tab-badge { position: absolute; top: 8px; right: 8px; min-width: 20px; height: 20px; border-radius: 10px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; padding: 0 6px; }
/* odd number of tools on a 2-col phone grid: let the last one span so nothing sits alone */
@media (max-width: 599px) { .fx-tools > .fx-tool:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 600px) { .fx-tools > .fx-tool:last-child:nth-child(3n+1) { grid-column: 1 / -1; } .fx-tools > .fx-tool:nth-last-child(2):nth-child(3n+1) ~ .fx-tool:last-child { grid-column: span 2; } }

.fx-hub-grid { display: grid; gap: var(--fx-space-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) {
    .fx-hub-grid { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: var(--fx-space-5); }
    .fx-hub-side { position: sticky; top: 16px; }
    .fx-hub-identity { grid-template-columns: minmax(0, 1fr); }
    .fx-hub-poster { width: 100%; cursor: zoom-in; }
    .fx-hub-name { font-size: 26px; }
}

/* Balance / wallet card */
.fx-wallet { padding: var(--fx-space-4); display: flex; flex-direction: column; gap: 12px; }
.fx-wallet-amount { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; color: var(--fx-text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.fx-wallet-label { font-size: var(--fx-fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fx-text-muted); }
.fx-money { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Feed (ExplorePage) bounds
   -------------------------------------------------------------------------- */
.fx-feed-root .feed-post-card { max-width: var(--fx-feed-max); margin-left: auto !important; margin-right: auto !important; }
@media (min-width: 600px) { .fx-feed-root .feed-post-card { margin-left: 0 !important; margin-right: 0 !important; } .fx-feed-root .feed-container { padding: 0 var(--fx-gutter); } }
.fx-feed-col { max-width: var(--fx-feed-max); margin-left: auto; margin-right: auto; width: 100%; box-sizing: border-box; }

/* --------------------------------------------------------------------------
   Vendor menu
   -------------------------------------------------------------------------- */
.fx-menu-search { position: relative; margin: 0 0 12px; }
.fx-menu-search input { width: 100%; min-height: var(--fx-touch); padding: 10px 14px 10px 40px; border-radius: var(--fx-radius-control); border: 1px solid var(--fx-border) !important; background: var(--fx-surface) !important; color: var(--fx-text) !important; box-sizing: border-box; font-size: 16px; }
.fx-menu-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--fx-text-muted); pointer-events: none; }
.fx-vendor { margin-bottom: 12px; overflow: hidden; }
.fx-vendor-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: none; border: 0; color: var(--fx-text); cursor: pointer; text-align: left; min-height: 60px; font: inherit; }
.fx-vendor-logo { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--fx-surface-raised); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.fx-vendor-name { font-size: var(--fx-fs-lg); font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.fx-vendor-sub { font-size: var(--fx-fs-xs); color: var(--fx-text-muted); margin-top: 2px; }
.fx-vendor-body { border-top: 1px solid var(--fx-border); padding: 4px 16px 12px; }
.fx-cat-title { font-size: var(--fx-fs-xs); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fx-text-muted); margin: 14px 0 4px; }
.fx-items { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 24px; }
@media (min-width: 720px) { .fx-items { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fx-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--fx-border); min-width: 0; }
.fx-item-img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--fx-surface-raised); }
.fx-item-name { flex: 1; min-width: 0; font-size: var(--fx-fs-md); font-weight: 600; color: var(--fx-text); line-height: 1.3; overflow-wrap: break-word; hyphens: auto; }
.fx-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.fx-item-side .like-button { margin: 0; }
@media (max-width: 420px) { .fx-item-img-ph { display: none !important; } .fx-vendor-head { padding-inline: 12px; } .fx-vendor-body { padding-inline: 12px; } }
.fx-item-desc { display: block; font-size: var(--fx-fs-xs); color: var(--fx-text-muted); font-weight: 400; margin-top: 2px; }
.fx-item-price { font-size: var(--fx-fs-md); font-weight: 800; color: var(--fx-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fx-item-unavail { font-size: var(--fx-fs-xs); color: var(--fx-text-muted); font-weight: 600; }
.fx-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--fx-radius-control); background: var(--fx-surface); border: 1px solid var(--fx-border); color: var(--fx-text-muted); font-size: var(--fx-fs-sm); line-height: 1.45; }

/* --------------------------------------------------------------------------
   Lineup
   -------------------------------------------------------------------------- */
.fx-lineup-row { display: grid; grid-template-columns: 5.6em minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.fx-time { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Chat composer anchoring
   -------------------------------------------------------------------------- */
.fx-chat-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; }
.fx-chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.fx-chat-composer { flex-shrink: 0; padding-bottom: calc(10px + var(--fx-safe-bottom)) !important; }

/* --------------------------------------------------------------------------
   Short-height / landscape phones
   -------------------------------------------------------------------------- */
@media (max-height: 480px) and (orientation: landscape) {
    :root { --fx-tabbar-h: 52px; --fx-header-h: 48px; }
    nav.fluus-tabbar > button span { display: none; }
    nav.fluus-tabbar > button > div { width: 38px !important; height: 38px !important; margin-top: 0 !important; }
}

.fx-hub .actions-section { padding: 0 !important; margin: 0 !important; max-width: none !important; width: 100% !important; text-align: left !important; background: none !important; box-shadow: none !important; }
.fx-hub .actions-section h2 { text-align: left !important; }
.fx-hub .actions-section { display: block !important; flex: none !important; }
.fx-hub-main > .fx-card-pad .fx-section-head { margin-bottom: 10px; }

/* Full-viewport fixed page roots (feed, chat...) start right of the desktop rail */
@media (min-width: 1024px) { body:has(nav.fluus-tabbar) .fx-fixed-page { left: var(--fx-rail-w) !important; } }
.fx-header .fx-evctx-meta { text-align: center; }
@media (min-width: 1024px) { .fx-header .fx-evctx-meta { text-align: left; } }

/* Tall sheets (settings): full height on phone, bounded dialog on desktop */
.fx-sheet.fx-sheet-tall { height: calc(100vh - 12px); height: calc(100dvh - 12px); }
@media (min-width: 600px) { .fx-sheet.fx-sheet-tall { height: auto; max-height: min(820px, calc(100vh - 48px)); } }
.profile-page.fx-bounded { padding-inline: 0; }

@media (max-width: 420px) { .fx-hide-sm { display: none; } }

.fx-drawer { outline: none; }
@media (min-width: 1024px) { .fx-drawer { bottom: 0 !important; } }

@media (min-width: 1024px) { .fx-hide-desktop { display: none !important; } .fx-meet { padding-bottom: 0 !important; } }
.fx-meet .fx-chat-shell { height: auto; }

/* Refund flow: bounded form column inside its scroller */
.fx-refund > header ~ div { width: 100%; max-width: calc(var(--fx-form-max) + 2 * var(--fx-gutter)); margin-inline: auto; box-sizing: border-box; }
.fx-refund > header ~ div { padding-bottom: var(--fx-nav-clearance) !important; }

/* Branded (logged-out) event page: full poster, details beside the login on desktop */
.branded-login .branded-hero-image { max-height: min(62vh, 560px) !important; object-fit: contain !important; background: #000; }
.branded-login .branded-auth-section { max-width: var(--fx-form-max); margin-inline: auto; width: 100%; box-sizing: border-box; }
@media (min-width: 1024px) {
    .login-page.branded-login { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(380px, 460px); column-gap: 40px; align-items: start;
        max-width: calc(var(--fx-page-max) + 2 * var(--fx-gutter)); margin: 0 auto; padding: 24px var(--fx-gutter) 32px; box-sizing: border-box; }
    .login-page.branded-login > * { grid-column: 1 / -1; }
    .login-page.branded-login > .login-header.branded-header { grid-column: 1; }
    .login-page.branded-login > .branded-auth-section { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: 24px; padding: 0 !important; margin-top: 8px; }
    .branded-login .branded-hero-image { max-height: 72vh !important; }
}
@media (min-width: 1024px) {
    body:has(nav.fluus-tabbar) .organizer-landing .back-btn { left: calc(var(--fx-rail-w) + 16px) !important; }
    .login-page.branded-login > .branded-auth-section { margin-top: 64px; }
}
