@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;600;700&display=swap');
@import url('seshlist.css?v=3.5');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b35;
    --secondary-color: #0b0b0b;
    --dark-bg: #1a1a1a;
    --header-sticky-offset: 92px;
    --light-bg: #f2f2f2; /* cooler off-white/grey */
    --text-dark: #333;
    --text-light: #666;
    --border-color: #ddd;
    --success-color: #28a745;
    --error-color: #dc3545;
    --control-min-height: 44px;
    --input-placeholder-on-light: #4d4d4d;
    --input-placeholder-on-dark: #9ca3af;
    --surface-on-light-text: #333333;
    --surface-on-light-muted: #4a4a4a;
}

/* Global style switcher tokens */
html[data-ui-style="classic"] {
    --primary-color: #ff6b35;
    --secondary-color: #0b0b0b;
    --dark-bg: #1a1a1a;
    --light-bg: #f2f2f2;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #ddd;
}

html[data-ui-style="dark"] {
    --primary-color: #ff7d4f;
    --secondary-color: #f4f5f7;
    --dark-bg: #07080b;
    --light-bg: #0f1115;
    --text-dark: #f3f4f6;
    --text-light: #a6adbb;
    --border-color: #2a2f3a;
}

/* Surfline-inspired: cleaner ocean palette + soft depth */
html[data-ui-style="surfline"] {
    --primary-color: #00b4d8;
    --secondary-color: #023e8a;
    --dark-bg: #012138;
    --light-bg: #eff8ff;
    --text-dark: #0b2942;
    --text-light: #4c708f;
    --border-color: #c7ddf1;
}

/* Confuzine-inspired: editorial contrast + modern magenta accent */
html[data-ui-style="confuzine"] {
    --primary-color: #ff2e63;
    --secondary-color: #111111;
    --dark-bg: #0a0a0a;
    --light-bg: #f6f6f7;
    --text-dark: #161618;
    --text-light: #6a6a74;
    --border-color: #dadade;
}

/* New timeless editorial preset */
html[data-ui-style="editorial"] {
    --primary-color: #2563eb;
    --secondary-color: #0f172a;
    --dark-bg: #0f172a;
    --light-bg: #f7f8fa;
    --text-dark: #111827;
    --text-light: #6b7280;
    --border-color: #d9dee6;
}

/* Iteration 1: softer light neutral */
html[data-ui-style="editorial-soft"] {
    --primary-color: #3366cc;
    --secondary-color: #131a2a;
    --dark-bg: #131a2a;
    --light-bg: #f8f9fb;
    --text-dark: #121826;
    --text-light: #667085;
    --border-color: #dfe4ec;
}

/* Iteration 2: warm modern light */
html[data-ui-style="editorial-warm"] {
    --primary-color: #2f6fdf;
    --secondary-color: #1d1b19;
    --dark-bg: #1d1b19;
    --light-bg: #faf7f2;
    --text-dark: #1f1a16;
    --text-light: #72665a;
    --border-color: #e7ddd1;
}

/* Iteration 3: cool airy light */
html[data-ui-style="editorial-cool"] {
    --primary-color: #2b73c8;
    --secondary-color: #102333;
    --dark-bg: #102333;
    --light-bg: #f3f8fb;
    --text-dark: #102331;
    --text-light: #5f7384;
    --border-color: #d7e4ee;
}

/* Theme (default = light) */
html {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --light-bg: #0f1115;
    --dark-bg: #07080b;
    --text-dark: #f3f4f6;
    --text-light: #a6adbb;
    --border-color: #2a2f3a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

/* Dark mode surfaces (keep accent orange) */
html[data-theme="dark"] .submit-section,
html[data-theme="dark"] .events-table,
html[data-theme="dark"] .event-card,
html[data-theme="dark"] .sidebar-panel,
html[data-theme="dark"] .feed-panel,
html[data-theme="dark"] .page-sidebar,
html[data-theme="dark"] .auth-modal-card,
html[data-theme="dark"] .feed-tile,
html[data-theme="dark"] .event-type-dropdown-menu,
html[data-theme="dark"] #userMenuDropdown {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.10) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* Keep dark-mode popups fully readable (no transparent card effect). */
html[data-theme="dark"] .auth-modal-card {
    background: #171a22;
    border: 1px solid rgba(255,255,255,0.16);
    color: var(--text-dark);
}

html[data-theme="dark"] .auth-modal-backdrop {
    background: rgba(0, 0, 0, 0.62);
}

html[data-theme="dark"] .submit-section,
html[data-theme="dark"] .events-table,
html[data-theme="dark"] .event-card,
html[data-theme="dark"] .sidebar-panel,
html[data-theme="dark"] .page-sidebar {
    color: var(--text-dark);
}

html[data-theme="dark"] .feed-panel-title,
html[data-theme="dark"] .feed-tile-meta {
    color: var(--text-light);
}

html[data-theme="dark"] .feed-panel {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.12);
}

html[data-theme="dark"] .feed-link,
html[data-theme="dark"] .feed-tile {
    color: var(--text-dark);
}

html[data-theme="dark"] #homeNewsSection .feed-link {
    background: rgba(255,255,255,0.04);
}

html[data-theme="dark"] .section-header h2,
html[data-theme="dark"] .event-header h2,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3 {
    color: var(--text-dark);
}

html[data-theme="dark"] .form-group input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea {
    background: rgba(0,0,0,0.25);
    color: var(--text-dark);
    border-color: rgba(255,255,255,0.14);
}

html[data-theme="dark"] .event-types-group label {
    background: rgba(0,0,0,0.18);
    border-color: rgba(255,255,255,0.16);
    color: var(--text-dark);
}

html[data-theme="dark"] .event-types-group label:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.22);
}

html[data-theme="dark"] .event-types-group label:has(input:checked) {
    background: rgba(255,107,53,0.14);
    border-color: rgba(255,107,53,0.70);
    box-shadow: 0 0 0 2px rgba(255,107,53,0.18);
}

html[data-theme="dark"] .newest-event-card {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.14);
    color: var(--text-dark);
}

html[data-theme="dark"] .event-type-dropdown-item:hover {
    background: rgba(255,255,255,0.06);
}

html[data-theme="dark"] footer {
    background: #0b0c10;
}

/* Shared style switcher menu section */
.style-switcher-group {
    border-top: 1px solid rgba(0,0,0,0.22);
    margin-top: 0.2rem;
    padding: 0.45rem 0.45rem 0.25rem;
}

.style-nav-group {
    border-top: 1px solid rgba(0,0,0,0.22);
    padding: 0.2rem 0 0.3rem;
    display: none;
}

.style-nav-group a {
    display: block;
    width: 100%;
    text-decoration: none;
    text-align: left;
    padding: 0.62rem 0.82rem;
    color: #000;
    font-weight: 800;
}

.style-nav-group a:hover {
    background: rgba(255,255,255,0.35);
}

.style-switcher-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 900;
    color: rgba(0,0,0,0.72);
    margin: 0 0 0.3rem;
    padding: 0 0.3rem;
}

.style-switcher-btn {
    display: block;
    width: 100%;
    border: 1px solid rgba(0,0,0,0.25);
    background: #fff;
    color: #000;
    border-radius: 8px;
    text-align: left;
    padding: 0.46rem 0.6rem;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.style-switcher-btn:hover {
    background: #f7f7f8;
}

.style-switcher-btn.is-active {
    border-color: #000;
    background: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: #0b0b0b;
    color: #fff;
    padding: 2rem 0;
    text-align: center;
    box-shadow: none;
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 20060;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 20060;
}

html[data-ui-style="surfline"] header {
    background: #045a8d;
    border-bottom: 2px solid rgba(255,255,255,0.35);
}

html[data-ui-style="surfline"] .style-nav-group {
    display: block;
}

html[data-ui-style="surfline"] #homeEventsSection {
    display: none !important;
}

html[data-ui-style="surfline"] .home-layout-shell {
    grid-template-areas:
        "newest"
        "map"
        "news";
}

@media (min-width: 1100px) {
    html[data-ui-style="surfline"] .home-layout-shell {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "newest map"
            "news map";
    }
}

html[data-ui-style="surfline"] #homeNewsSection {
    display: block !important;
}

html[data-ui-style="surfline"] .submit-section,
html[data-ui-style="surfline"] .event-card,
html[data-ui-style="surfline"] .events-table {
    border-radius: 16px;
    border: 1px solid #d4e8f7;
    box-shadow: 0 10px 28px rgba(3,52,94,0.08);
}

html[data-ui-style="surfline"] .submit-btn,
html[data-ui-style="surfline"] .clear-dates-btn,
html[data-ui-style="surfline"] .location-btn {
    border-radius: 999px;
    background: #0077b6;
    color: #fff;
    border: 1px solid #00507a;
}

html[data-ui-style="confuzine"] header {
    background: #1a1a20;
    border-bottom: 3px solid #ff2e63;
}

html[data-ui-style="confuzine"] .site-brand {
    border-color: #ff2e63;
    background: #121216;
}

html[data-ui-style="confuzine"] .submit-section,
html[data-ui-style="confuzine"] .event-card {
    border: 1px solid #dcdce1;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(20,20,30,0.08);
}

html[data-ui-style="confuzine"] .section-header h2,
html[data-ui-style="confuzine"] .feed-panel-title {
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

html[data-ui-style="confuzine"] .submit-btn,
html[data-ui-style="confuzine"] .clear-dates-btn {
    background: #d61c7d;
    color: #fff;
    border: 1px solid #941244;
}

html[data-ui-style="confuzine"] .header-map-quick-btn {
    display: flex !important;
}

html[data-ui-style="confuzine"] .confuzine-map-cta {
    display: inline-flex !important;
    align-items: center;
}

html[data-ui-style="confuzine"] #homeNewsSection {
    display: block !important;
}

/*
 * Stage 1 — Grind & Seek redesign preset (matches Vite/React design tokens).
 * Select via hamburger ▶ Visual style ▶ Grind & Seek redesign.
 */
html[data-ui-style="grind-seek"] {
    color-scheme: dark;
    --primary-color: #ff544a;
    --secondary-color: #edf0f5;
    --dark-bg: #08080a;
    --light-bg: #050508;
    --text-dark: #f5f5f5;
    --text-light: #999999;
    --border-color: #363842;
    --header-sticky-offset: 96px;
    --grind-seek-surface: #111111;
    --grind-seek-surface-muted: rgba(26, 28, 33, 0.95);
    --grind-seek-border-subtle: #212121;
}

html[data-ui-style="grind-seek"] body {
    font-family: Inter, 'Segoe UI', system-ui, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
}

html[data-ui-style="grind-seek"] header {
    background: rgba(20, 20, 20, 0.72);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--secondary-color);
    padding: 1.35rem 0;
    margin-bottom: 0;
    text-align: left;
    box-shadow: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-ui-style="grind-seek"] .container {
    max-width: 1226px;
}

html[data-ui-style="grind-seek"] .site-brand {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

html[data-ui-style="grind-seek"] .site-brand-text p {
    color: var(--text-light);
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.guest-event-cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.feedback-test-cta-btn {
    width: auto;
    display: inline-block;
    margin-top: 0;
    padding: 0.7rem 1.1rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(255, 84, 74, 0.35);
}

.feedback-test-cta-link {
    color: var(--primary-color, #ff6b35);
    font-weight: 600;
    text-decoration: underline;
}

html[data-ui-style="grind-seek"] .grind-seek-wordmark {
    font-family: 'Bebas Neue', Impact, system-ui, sans-serif;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1;
    margin: 0 0 0.2rem 0;
    font-size: clamp(2rem, 4.5vw, 2.75rem);
}

html[data-ui-style="grind-seek"] .grind-seek-word--grind {
    color: #ff544a;
}

html[data-ui-style="grind-seek"] .grind-seek-word--amp {
    color: #999999;
    margin: 0 0.02em;
}

html[data-ui-style="grind-seek"] .grind-seek-word--seek {
    color: #f5f5f5;
}

html[data-ui-style="grind-seek"] .site-logo {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
}

html[data-ui-style="grind-seek"] .user-menu-stack .user-menu-btn,
html[data-ui-style="grind-seek"] .user-menu-stack .header-map-quick-btn,
html[data-ui-style="grind-seek"] .user-menu-stack .user-chip {
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: #1a1c21 !important;
    color: var(--secondary-color) !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

html[data-ui-style="grind-seek"] .user-menu-stack .user-menu-btn:hover,
html[data-ui-style="grind-seek"] .user-menu-stack .header-map-quick-btn:hover {
    background: #242830 !important;
}

html[data-ui-style="grind-seek"] .user-menu-stack .user-chip {
    background: rgba(255, 84, 74, 0.18) !important;
    color: #ffb4ae !important;
    border-color: rgba(255, 84, 74, 0.45) !important;
}

html[data-ui-style="grind-seek"] #userMenuDropdown.user-menu-dropdown {
    background: #14171a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55) !important;
    color: var(--secondary-color) !important;
}

html[data-ui-style="grind-seek"] #userMenuDropdown button {
    color: var(--secondary-color) !important;
    font-weight: 600 !important;
}

html[data-ui-style="grind-seek"] #userMenuDropdown button:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

html[data-ui-style="grind-seek"] .hamburger-menu-group,
html[data-ui-style="grind-seek"] #userMenuDropdown.user-menu-dropdown > .style-switcher-group {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-ui-style="grind-seek"] .hamburger-menu-group--site {
    background: rgba(255, 255, 255, 0.03) !important;
}

html[data-ui-style="grind-seek"] .hamburger-menu-group-label {
    color: var(--text-light) !important;
    opacity: 1;
}

html[data-ui-style="grind-seek"] .hamburger-menu-account {
    border-bottom-color: var(--sl-border);
}

html[data-ui-style="grind-seek"] .hamburger-menu-account-greeting {
    color: var(--sl-fg);
}

html[data-ui-style="grind-seek"] .hamburger-menu-account-email,
html[data-ui-style="grind-seek"] .hamburger-menu-account-username {
    color: var(--sl-muted-fg);
}

/* Figma: dark panel #14171a, menu copy #edf0f5 / #f5f5f5, muted labels #999 */
html[data-ui-style="grind-seek"] #userMenuDropdown .hamburger-menu-item,
html[data-ui-style="grind-seek"] #userMenuDropdown.user-menu-dropdown a,
html[data-ui-style="grind-seek"] #userMenuDropdown.user-menu-dropdown .hamburger-menu-group-items > a,
html[data-ui-style="grind-seek"] #userMenuDropdown.user-menu-dropdown .hamburger-menu-group-items > button {
    color: #edf0f5 !important;
    font-weight: 600 !important;
}

html[data-ui-style="grind-seek"] #userMenuDropdown .hamburger-menu-item:hover,
html[data-ui-style="grind-seek"] #userMenuDropdown .hamburger-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f5f5f5 !important;
}

html[data-ui-style="grind-seek"] .user-menu-btn--hamburger {
    padding: 1.05rem 1.5rem !important;
    font-size: 1.7rem !important;
    line-height: 1 !important;
}

html[data-ui-style="grind-seek"] .user-chip--greeting {
    padding: 0.5rem 0.75rem !important;
    font-weight: 800 !important;
}

html[data-ui-style="grind-seek"] .header-bell-btn {
    padding: 0.65rem 1rem !important;
    font-size: 1.1rem !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
}

html[data-ui-style="grind-seek"] .style-switcher-btn {
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(0, 0, 0, 0.25) !important;
    color: var(--secondary-color) !important;
}

html[data-ui-style="grind-seek"] .style-switcher-btn.is-active {
    background: #383b45 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

html[data-ui-style="grind-seek"] .style-nav-group a {
    color: var(--secondary-color);
    border-radius: 8px;
}

html[data-ui-style="grind-seek"] .page-shell {
    padding-top: 1.5rem;
}

html[data-ui-style="grind-seek"] .submit-section,
html[data-ui-style="grind-seek"] .event-card,
html[data-ui-style="grind-seek"] .feed-panel,
html[data-ui-style="grind-seek"] .events-table,
html[data-ui-style="grind-seek"] .page-sidebar {
    background: var(--grind-seek-surface) !important;
    border: 1px solid var(--grind-seek-border-subtle) !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45) !important;
    color: var(--text-dark) !important;
}

html[data-ui-style="grind-seek"] .mobile-feed.feed-panel {
    border: 1px solid var(--grind-seek-border-subtle) !important;
}

html[data-ui-style="grind-seek"] .section-header h2,
html[data-ui-style="grind-seek"] .feed-panel-title,
html[data-ui-style="grind-seek"] h1,
html[data-ui-style="grind-seek"] h2,
html[data-ui-style="grind-seek"] h3 {
    color: var(--text-dark) !important;
}

html[data-ui-style="grind-seek"] .submit-btn,
html[data-ui-style="grind-seek"] .clear-dates-btn,
html[data-ui-style="grind-seek"] .location-btn {
    border-radius: 8px;
    background: var(--primary-color);
    color: #f5f5f5;
    border: 1px solid rgba(0, 0, 0, 0.2);
    font-weight: 700;
}

html[data-ui-style="grind-seek"] .clear-dates-btn:hover,
html[data-ui-style="grind-seek"] .location-btn:hover {
    filter: brightness(1.06);
}

html[data-ui-style="grind-seek"] .form-group input:not([type="checkbox"]):not([type="radio"]),
html[data-ui-style="grind-seek"] .form-group select,
html[data-ui-style="grind-seek"] .form-group textarea,
html[data-ui-style="grind-seek"] .search-container input,
html[data-ui-style="grind-seek"] .date-filter-group input {
    background: #0f0f14 !important;
    color: var(--text-dark) !important;
    border: 1px solid #33333d !important;
    border-radius: 8px !important;
}

html[data-ui-style="grind-seek"] .search-section label,
html[data-ui-style="grind-seek"] .date-filter-row label {
    color: var(--text-light);
}

html[data-ui-style="grind-seek"] .feed-tile {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-dark);
}

html[data-ui-style="grind-seek"] .feed-tile-meta,
html[data-ui-style="grind-seek"] .feed-tile-when {
    color: var(--text-light);
}

html[data-ui-style="grind-seek"] .event-type-dropdown-menu {
    background: #14171a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px;
}

html[data-ui-style="grind-seek"] .mobile-feed.feed-panel,
html[data-ui-style="grind-seek"] .page-sidebar .feed-panel {
    background: #111 !important;
    border: 1px solid #212121 !important;
}

html[data-ui-style="grind-seek"] .feed-panel-title {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: #d9e0ed !important;
    letter-spacing: 0.04em;
}

html[data-ui-style="grind-seek"] .feed-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-ui-style="grind-seek"] .feed-section-toggle {
    border: 1px solid #3b3d47;
    background: #1a1c21;
    color: #edf0f5;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.9rem;
    padding: 0.5rem 0.6rem;
}

html[data-ui-style="grind-seek"] .feed-section-toggle:hover {
    background: #262b35;
}

html[data-ui-style="grind-seek"] .feed-section-toggle .feed-section-chevron {
    color: #999;
}

@media (max-width: 760px) {
    html[data-ui-style="grind-seek"] header {
        padding: 1.1rem 0;
    }

    html[data-ui-style="grind-seek"] .site-brand-link {
        width: auto;
        max-width: 100%;
        margin: 0;
        flex: 1 1 auto;
        min-width: 0;
    }

    html[data-ui-style="grind-seek"] .user-menu-stack {
        gap: 0.45rem;
        flex: 0 0 auto;
        margin-left: auto;
    }

    html[data-ui-style="grind-seek"] .home-map-explorer-card .search-row {
        grid-template-columns: 1fr;
    }

    html[data-ui-style="grind-seek"] .home-map-explorer-card .date-quick-filters {
        gap: 0.35rem;
    }

    html[data-ui-style="grind-seek"] main.page-shell,
    html[data-ui-style="grind-seek"] .page-main.home-layout-shell {
        min-width: 0;
        overflow-x: clip;
    }

    html[data-ui-style="grind-seek"] .grind-seek-event-tile {
        min-width: min(250px, calc(100vw - 72px));
    }
}

html[data-ui-style="grind-seek"] .newest-event-card {
    background: var(--grind-seek-surface);
    border: 1px solid var(--grind-seek-border-subtle);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45);
}

html[data-ui-style="grind-seek"] .newest-events-carousel::-webkit-scrollbar-thumb {
    background: #3b3d47;
}

html[data-ui-style="grind-seek"] .submit-section h2 {
    color: var(--text-dark);
}

html[data-ui-style="grind-seek"] .controls select {
    background: #0f0f14;
    color: var(--text-dark);
    border: 1px solid #33333d;
    border-radius: 8px;
}

html[data-ui-style="grind-seek"] .home-map-explorer-card .search-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

html[data-ui-style="grind-seek"] .home-map-explorer-card #citySearch,
html[data-ui-style="grind-seek"] .home-map-explorer-card #countrySearch,
html[data-ui-style="grind-seek"] .home-map-explorer-card #eventNameSearch {
    min-height: 44px;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

html[data-ui-style="grind-seek"] .home-map-explorer-card .event-type-dropdown-trigger {
    min-height: 44px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    border: 1px solid #33333d;
    background: #0f0f14;
    color: #a6adbb;
}

html[data-ui-style="grind-seek"] .home-map-explorer-card .date-filter-row {
    margin-top: 0.65rem;
    gap: 0.65rem;
}

html[data-ui-style="grind-seek"] .home-map-explorer-card .date-filter-group input[type="date"] {
    min-height: 44px;
    border: 1px solid #33333d;
    border-radius: 8px;
    background: #0f0f14;
    color: var(--text-dark);
}

html[data-ui-style="grind-seek"] .home-map-explorer-card .date-quick-filters {
    width: 100%;
}

html[data-ui-style="grind-seek"] .home-map-explorer-card .date-quick-filter {
    min-height: 36px;
    border: 1px solid #363842;
    background: #14171a;
    color: #c2c7d1;
}

html[data-ui-style="grind-seek"] .home-map-explorer-card .date-quick-filter:hover {
    border-color: #4b5160;
    background: #20242d;
}

html[data-ui-style="grind-seek"] .home-map-explorer-card .date-quick-filter.is-active {
    background: #383b45;
    border-color: #4d5160;
    color: #fff;
}

html[data-ui-style="grind-seek"] .events-list {
    gap: 1rem;
}

html[data-ui-style="grind-seek"] .event-card.grind-seek-list-card {
    background: #111;
    border: 1px solid #212121;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
    overflow: hidden;
}

html[data-ui-style="grind-seek"] .event-card.grind-seek-list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.5);
}

html[data-ui-style="grind-seek"] .event-card.grind-seek-list-card .event-photo {
    height: 190px;
    border-bottom: 1px solid #252525;
}

html[data-ui-style="grind-seek"] .event-card.grind-seek-list-card .event-content {
    padding: 0.95rem 0.95rem 1rem;
}

html[data-ui-style="grind-seek"] .event-card.grind-seek-list-card .event-header {
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
}

html[data-ui-style="grind-seek"] .event-card.grind-seek-list-card .event-name {
    color: #f5f5f5;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

html[data-ui-style="grind-seek"] .event-card.grind-seek-list-card .event-type {
    background: #1a1c21;
    color: #d9e0ed;
    border: 1px solid #3b3d47;
    border-radius: 999px;
    font-size: 0.74rem;
    padding: 0.24rem 0.65rem;
    max-width: 52%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-ui-style="grind-seek"] .event-card.grind-seek-list-card .event-details {
    margin-bottom: 0.55rem;
}

html[data-ui-style="grind-seek"] .event-card.grind-seek-list-card .event-detail {
    color: #999;
    font-size: 0.84rem;
    margin-bottom: 0.28rem;
}

html[data-ui-style="grind-seek"] .event-card.grind-seek-list-card .event-detail strong {
    color: #d9e0ed;
}

html[data-ui-style="grind-seek"] .event-card.grind-seek-list-card .event-description {
    color: #b2bac7;
    font-size: 0.88rem;
    line-height: 1.45;
}

html[data-ui-style="grind-seek"] .event-card.grind-seek-list-card .event-actions {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.55rem;
}

html[data-ui-style="grind-seek"] .event-open-btn {
    min-height: 40px;
    border-radius: 8px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: #ff5245;
    color: #f5f5f5;
    font-weight: 700;
    padding: 0 0.75rem;
}

html[data-ui-style="grind-seek"] .like-btn {
    min-height: 40px;
    background: #1a1c21;
    color: #d9e0ed;
    border: 1px solid #3b3d47;
}

html[data-ui-style="grind-seek"] .like-btn:hover {
    background: #252932;
    border-color: #4b4e5a;
}

html[data-ui-style="grind-seek"] .grind-seek-hero-banner {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, rgba(255, 84, 74, 0.08), rgba(5, 5, 8, 0.9));
}

html[data-ui-style="grind-seek"] .grind-seek-hero-glow {
    position: absolute;
    width: 340px;
    height: 340px;
    right: -90px;
    top: -160px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 84, 74, 0.28), rgba(255, 84, 74, 0));
    pointer-events: none;
}

html[data-ui-style="grind-seek"] .grind-seek-hero-copy {
    position: relative;
    z-index: 1;
}

html[data-ui-style="grind-seek"] .grind-seek-hero-copy p {
    margin: 0;
    max-width: 620px;
    color: #d9e0ed;
    font-size: clamp(1rem, 1.35vw, 1.15rem);
    letter-spacing: -0.012em;
}

html[data-ui-style="grind-seek"] .home-map-explorer-intro {
    display: grid;
    gap: 0.55rem;
}

html[data-ui-style="grind-seek"] .grind-seek-open-map-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 44px;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    text-decoration: none;
    font-weight: 700;
    color: #f5f5f5;
    background: var(--primary-color);
}

html[data-ui-style="grind-seek"] .grind-seek-open-map-link:hover {
    filter: brightness(1.06);
}

html[data-ui-style="grind-seek"] .grind-seek-event-tile {
    display: grid;
    gap: 0.55rem;
    min-width: 300px;
    max-width: 340px;
    position: relative;
}

html[data-ui-style="grind-seek"] .grind-seek-event-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    position: relative;
    z-index: 3;
}

html[data-ui-style="grind-seek"] .grind-seek-event-type-pill {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    border-radius: 999px;
    padding: 0.1rem 0.65rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #d9e0ed;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

html[data-ui-style="grind-seek"] .grind-seek-event-cover {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.45rem;
    background: rgba(255, 255, 255, 0.06);
}

html[data-ui-style="grind-seek"] .grind-seek-event-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

html[data-ui-style="grind-seek"] .grind-seek-event-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #565656;
    background: rgba(255, 255, 255, 0.08);
    font-size: 1.1rem;
    position: relative;
    z-index: 4;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    color: inherit;
}

html[data-ui-style="grind-seek"] .grind-seek-event-save:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

html[data-ui-style="grind-seek"] .grind-seek-event-save.is-liked {
    border-color: #ff5245;
    background: rgba(255, 82, 69, 0.2);
}

html[data-ui-style="grind-seek"] .newest-event-title {
    color: #f5f5f5;
    font-size: 1.08rem;
    font-weight: 700;
    margin: 0;
}

html[data-ui-style="grind-seek"] .newest-event-meta,
html[data-ui-style="grind-seek"] .newest-event-when {
    color: #999;
    margin: 0;
}

html[data-ui-style="grind-seek"] .newest-event-card .event-tile-description {
    color: #b2bac7;
}

html[data-ui-style="grind-seek"] .newest-event-card .event-tile-divider {
    background: rgba(255, 255, 255, 0.1);
}

html[data-ui-style="grind-seek"] .grind-seek-event-detail-btn {
    margin-top: 0.4rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    width: 100%;
    border-radius: 8px;
    font-weight: 700;
    color: #f5f5f5;
    background: #ff5245;
}

@media (max-width: 760px) {
    html[data-ui-style="grind-seek"] .grind-seek-hero-banner {
        min-height: 108px;
    }

    html[data-ui-style="grind-seek"] .grind-seek-event-tile {
        min-width: 250px;
    }
}

/* Editorial family: timeless, readable, no gradients */
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) body {
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--light-bg);
    color: var(--text-dark);
}

:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) header {
    background: #fff;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
}

:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .site-brand,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .user-chip,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .user-menu-btn,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) #userMenuDropdown {
    border-radius: 10px;
}

:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .submit-section,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .event-card,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .feed-panel,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .page-sidebar,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .events-table {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16,24,40,0.06);
}

:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .submit-section h2,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .section-header h2,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .feed-panel-title {
    color: var(--secondary-color);
    font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .feed-section-toggle {
    background: #eef2f7;
    border: 1px solid var(--border-color);
    color: var(--text-dark);
}

:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .feed-tile {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #ffffff;
}

:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .submit-btn,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .clear-dates-btn,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .location-btn {
    background: var(--primary-color);
    color: #fff;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 8px;
    font-weight: 600;
}

:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .submit-btn:hover,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .clear-dates-btn:hover,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .location-btn:hover {
    filter: brightness(0.95);
}

:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .form-group input:not([type="checkbox"]):not([type="radio"]),
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .form-group select,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .form-group textarea {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-dark);
}

:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .form-group input:focus,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .form-group select:focus,
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(31,111,235,0.16);
}

:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .style-nav-group {
    display: block;
}

:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) #homeHeroSection {
    border: 1px solid var(--border-color);
}

/* Editorial family layout structure */
:is(
    html[data-ui-style="editorial"],
    html[data-ui-style="editorial-soft"],
    html[data-ui-style="editorial-warm"],
    html[data-ui-style="editorial-cool"]
) .home-layout-shell {
    grid-template-areas:
        "newest"
        "map"
        "events"
        "news";
    gap: 1rem;
}

@media (min-width: 1100px) {
    :is(
        html[data-ui-style="editorial"],
        html[data-ui-style="editorial-soft"],
        html[data-ui-style="editorial-warm"],
        html[data-ui-style="editorial-cool"]
    ) .home-layout-shell {
        grid-template-columns: 1.25fr 1fr;
        grid-template-areas:
            "newest map"
            "events events"
            "news news";
        gap: 1.25rem;
    }
}

/* Readability-first section sizing for Surfline/Confuzine */
html[data-ui-style="surfline"] .home-layout-shell,
html[data-ui-style="confuzine"] .home-layout-shell {
    gap: 1.25rem;
}

html[data-ui-style="surfline"] .home-layout-shell > section,
html[data-ui-style="confuzine"] .home-layout-shell > section {
    min-height: 320px;
    padding: 2rem 2rem 1.8rem;
    border-radius: 18px;
}

html[data-ui-style="surfline"] .home-layout-shell > section h2,
html[data-ui-style="confuzine"] .home-layout-shell > section h2 {
    font-size: clamp(1.55rem, 2.1vw, 2rem);
    margin-bottom: 1rem;
}

html[data-ui-style="surfline"] #homeHeroSection p,
html[data-ui-style="confuzine"] #homeHeroSection p {
    font-size: 1.03rem;
    line-height: 1.7;
    max-width: 70ch;
}

html[data-ui-style="surfline"] .newest-events-carousel,
html[data-ui-style="confuzine"] .newest-events-carousel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    overflow: visible;
}

html[data-ui-style="surfline"] .newest-event-card,
html[data-ui-style="confuzine"] .newest-event-card {
    min-width: 0;
    max-width: none;
    padding: 1rem 1.05rem;
    border-radius: 14px;
}

html[data-ui-style="surfline"] #homeNewsSection .feed-link,
html[data-ui-style="confuzine"] #homeNewsSection .feed-link {
    display: block;
    padding: 0.72rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    font-size: 0.98rem;
    line-height: 1.4;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    border: 3px solid var(--primary-color);
    padding: 0.35rem 0.6rem;
    border-radius: 16px;
    background: #0b0b0b; /* match header background */
    min-width: 0;
    max-width: 100%;
}

/* Ensure hamburger dropdown always sits above interactive layers (maps, overlays). */
#userMenuDropdown {
    z-index: 20050 !important;
}

#userMenuDropdown.user-menu-dropdown {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.hamburger-menu-group {
    border-radius: 12px;
    padding: 0.35rem 0.3rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.hamburger-menu-group--site {
    background: rgba(255, 255, 255, 0.03);
}

.hamburger-menu-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.65rem 0.35rem;
    color: var(--text-light, #999999);
    opacity: 1;
}

.hamburger-menu-account {
    padding: 0.75rem 0.85rem 0.65rem;
    border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.12));
    margin-bottom: 0.15rem;
}

.hamburger-menu-account-greeting {
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.25;
    word-break: break-word;
}

.hamburger-menu-account-email,
.hamburger-menu-account-username {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: var(--text-light, #999999);
    line-height: 1.3;
    word-break: break-word;
}

.hamburger-menu-group-items {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.hamburger-menu-group-items .style-nav-group {
    margin-top: 0.35rem;
}

.hamburger-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.85rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-dark, #f5f5f5);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 8px;
    line-height: 1.2;
    font-family: inherit;
}
.hamburger-menu-item:hover,
.hamburger-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}
.hamburger-menu-item--button {
    appearance: none;
    -webkit-appearance: none;
}
html[data-theme="dark"] .hamburger-menu-item {
    color: var(--text-dark, #f5f5f5);
}
html[data-theme="dark"] .hamburger-menu-item:hover,
html[data-theme="dark"] .hamburger-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

.site-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Visual style lives last on the dropdown (after Website + Account bubbles) */
#userMenuDropdown.user-menu-dropdown > .style-switcher-group {
    border-radius: 12px;
    padding: 0.35rem 0.3rem 0.5rem;
    border: 2px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.22);
}

/* Style switching removed: keep redesign as the only mode */
.style-switcher-group,
[data-theme-toggle] {
    display: none !important;
}

html[data-theme="dark"] #userMenuDropdown.user-menu-dropdown > .style-switcher-group {
    background: rgba(0, 0, 0, 0.22);
    border-color: rgba(255, 255, 255, 0.28);
}

html[data-theme="dark"] #userMenuDropdown.user-menu-dropdown {
    background: #14171a !important;
    color: #edf0f5 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55) !important;
}

html[data-theme="dark"] .hamburger-menu-group {
    background: rgba(0, 0, 0, 0.38);
    border-color: rgba(255, 255, 255, 0.28);
}

html[data-theme="dark"] .hamburger-menu-group--site {
    background: rgba(0, 0, 0, 0.22);
}

.site-brand-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.site-brand-text {
    border: none;
    padding: 0;
}

.site-brand-text h1 {
    margin-bottom: 0.15rem;
    line-height: 1.1;
    font-size: clamp(1.25rem, 3.2vw, 2.4rem);
}

.site-brand-text p {
    margin: 0;
}

.site-logo {
    width: clamp(152px, 21.6vw, 243px);
    height: clamp(152px, 21.6vw, 243px);
    object-fit: contain;
    border: none;
    border-radius: 0;
    flex-shrink: 0;
    background: transparent;
    box-shadow: none;
}

.site-logo--banner,
.site-logo--home-icon {
    width: auto;
    height: clamp(119px, 18.9vw, 195px);
    max-width: min(918px, 90vw);
    border-radius: 0;
    background: transparent;
}

.site-logo--home-icon {
    max-width: clamp(119px, 18.9vw, 195px);
}

main {
    padding: 2rem 0;
}

/* Two-column shell (main + sticky sidebar) */
.page-shell {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    padding: 2rem 20px;
    max-width: 1500px;
    margin: 0 auto;
}
.page-main {
    flex: 0 1 1200px;
    min-width: 0;
}
.page-sidebar {
    width: 340px;
    flex: 0 0 340px;
    position: sticky;
    top: var(--header-sticky-offset);
    align-self: flex-start;
    height: calc(100vh - var(--header-sticky-offset));
    overflow-y: auto;
    overflow-x: hidden;
    background: #ededed;
    border-radius: 12px;
    padding: 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mobile-feed.feed-panel {
    background: #ededed;
    border-radius: 12px;
    padding: 0.5rem;
    border: 1px solid #d7d7d7;
}
.page-sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}
@media (max-width: 1120px) {
    .page-shell {
        flex-direction: column;
        padding: 2rem 0;
    }
    .page-sidebar {
        display: none;
    }
    .mobile-feed { display: block; }
}

/* Header user menu sizing */
.user-menu-anchor {
    position: relative;
}

#userMenuDropdown.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    min-width: 220px;
    padding: 0.5rem;
    gap: 0.45rem;
    border-radius: 12px;
    box-sizing: border-box;
}

.user-menu-stack { display:flex; flex-direction:column; gap:0.45rem; align-items:flex-end; flex-shrink: 0; position: relative; z-index: 20070; }
.user-menu-stack .user-chip { width: clamp(88px, 13vw, 120px); display:block; text-align:center; white-space:normal; word-break:break-word; line-height:1.2; font-size: clamp(0.7rem, 0.95vw, 0.95rem); }
.user-menu-stack .user-menu-btn { width: clamp(88px, 13vw, 120px); }
.mobile-feed { display: none; }
.feed-panel {
    border: 1px solid #d7d7d7;
    background: #f3f3f3;
}
.feed-panel-title {
    margin: 0 0 0.65rem 0;
    padding: 0 0 0.35rem 0;
    border-bottom: 1px solid #d3d3d3;
    background: transparent;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.95rem;
    font-weight: 900;
}
.feed-panel-body {
    display: grid;
    gap: 0.9rem;
}
.feed-section {
    border-top: 1px solid #e5e5e5;
    padding-top: 0.7rem;
}
.feed-section:first-child {
    border-top: none;
    padding-top: 0;
}
.feed-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 700;
}
.feed-link:hover {
    color: var(--primary-color);
}
.feed-list {
    display: grid;
    gap: 0.5rem;
}
.feed-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 2px solid #000;
    background: var(--primary-color);
    color: #000;
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    font-weight: 900;
    cursor: pointer;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.feed-section-toggle:hover {
    background: #e55a2b;
}
.feed-section-toggle .feed-section-chevron {
    transition: transform 0.15s ease;
}
.feed-section-toggle[aria-expanded="false"] .feed-section-chevron {
    transform: rotate(-90deg);
}
.feed-section-content {
    margin-top: 0.45rem;
}
.feed-tile {
    display: block;
    text-decoration: none;
    color: var(--text-dark);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.feed-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
    border-color: #bdbdbd;
}

[data-event-tile] {
    cursor: pointer;
}
.feed-tile-title {
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 0.18rem;
}

.feed-tile-type,
.newest-event-type {
    display: inline-block;
    font-size: 0.74rem;
    line-height: 1.2;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-color);
    margin-bottom: 0.22rem;
}
.feed-tile-meta {
    color: var(--text-light);
    font-size: 0.82rem;
    line-height: 1.2;
}

.feed-tile-when,
.newest-event-when {
    color: var(--text-light);
    font-size: 0.8rem;
    line-height: 1.3;
    margin-top: 0.2rem;
}

.event-tile-description {
    margin-top: 0.35rem;
    font-size: 0.87rem;
    line-height: 1.35;
    color: var(--text-dark);
}

.event-tile-divider {
    height: 1px;
    width: 100%;
    margin-top: 0.42rem;
    margin-bottom: 0.1rem;
    background: rgba(0,0,0,0.15);
}

.event-tile-description.is-collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-tile-expand-btn {
    margin-top: 0.38rem;
    border: 1px solid #000;
    border-radius: 999px;
    background: transparent;
    color: var(--text-dark);
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-row {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.search-container {
    position: relative;
    width: 100%;
    margin: 0;
}

.date-filter-row {
    margin: 0.75rem auto 0;
    max-width: 1200px;
    display: flex;
    gap: 0.75rem;
    align-items: end;
    flex-wrap: wrap;
}

.date-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.date-quick-filter {
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-dark);
    border-radius: 999px;
    padding: 0.35rem 0.68rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.date-quick-filter:hover {
    border-color: var(--primary-color);
}

.date-quick-filter.is-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #000;
}

.date-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 180px;
    flex: 1;
}

.date-filter-group label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.date-filter-group input[type="date"] {
    padding: 0.6rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
}

.clear-dates-btn {
    border: none;
    background: var(--primary-color);
    color: #000;
    border: 2px solid #000;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
}

.clear-dates-btn:hover {
    background: #e55a2b;
}

.clear-dates-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.clear-dates-btn:disabled:hover {
    background: var(--primary-color);
}

#citySearch,
#countrySearch,
#eventNameSearch {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    outline: none;
    transition: all 0.3s;
    background: #fff;
}

#citySearch:focus,
#countrySearch:focus,
#eventNameSearch:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: #000;
    border: 2px solid #000;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.clear-btn:hover {
    background: #e55a2b;
}

.search-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    z-index: 40;
    max-height: 220px;
    overflow-y: auto;
    color: var(--surface-on-light-text);
    display: none;
}

.search-suggestions:empty {
    display: none !important;
    border: none;
    box-shadow: none;
}

.search-suggestion-item {
    padding: 0.55rem 0.85rem;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--surface-on-light-text);
}

.search-suggestion-item:hover {
    background: #f3f7fb;
}

/* Map Section */
.map-section {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0.75rem;
    margin-bottom: 3rem;
    border-radius: 10px;
    overflow: visible;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    clear: both;
    position: relative;
    z-index: 1;
}

.map-section.map-pick-expanded {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 72px; /* below the header */
    bottom: 12px;
    max-width: none;
    margin: 0;
    z-index: 9999;
}

.map-section.map-pick-expanded .map-container {
    aspect-ratio: auto;
    height: 100%;
    min-height: 0;
}

/* CKEditor image upload feedback */
.ckeditor-upload-hint {
    margin: 0.45rem 0 0;
    font-size: 0.88rem;
    color: var(--text-light);
}

.ckeditor-upload-error {
    display: none;
    margin: 0.45rem 0 0;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    background: rgba(220, 53, 69, 0.12);
    border: 1px solid rgba(220, 53, 69, 0.45);
    color: var(--error-color);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.4;
}

.ckeditor-upload-error.is-visible {
    display: block;
}

.ckeditor-upload-error-dismiss {
    margin-left: 0.5rem;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    border: 1px solid rgba(220, 53, 69, 0.55);
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    vertical-align: baseline;
}

.ckeditor-upload-error-dismiss:hover {
    filter: brightness(1.08);
}

html[data-ui-style="grind-seek"] .ckeditor-upload-error {
    background: rgba(255, 84, 74, 0.14);
    border-color: rgba(255, 84, 74, 0.55);
    color: #ffb4ae;
}

html[data-ui-style="grind-seek"] .ckeditor-upload-hint {
    color: var(--text-light);
}

/* Event pick map (separate from main events map) */
.pick-location-btn {
    border-radius: 999px;
    padding: 0.65rem 1rem;
    border: none;
    font-weight: 700;
    cursor: pointer;
    background: var(--primary-color);
    color: #fff;
}

.pick-location-btn:hover {
    filter: brightness(1.06);
}

.event-pick-map-panel {
    margin-top: 0.85rem;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.event-pick-map-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 2;
    background: inherit;
    color: var(--text-dark);
}

.event-pick-map-title {
    color: var(--text-dark);
}

.event-pick-map-status {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 0.15rem;
}

html[data-ui-style="grind-seek"] .event-pick-map-panel {
    background: var(--grind-seek-surface);
    border-color: var(--grind-seek-border-subtle);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

html[data-ui-style="grind-seek"] .event-pick-map-topbar {
    background: rgba(0, 0, 0, 0.22);
    border-bottom-color: var(--grind-seek-border-subtle);
}

html[data-theme="dark"] .event-pick-map-panel {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .event-pick-map-topbar {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.event-pick-map-canvas {
    width: 100%;
    height: 380px;
    background: #e0e0e0;
    position: relative;
}

.event-pick-map-canvas .loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-size: 1.05rem;
    color: var(--text-light);
    /* Ensure the loading overlay never blocks map interaction/click-to-pick. */
    pointer-events: none;
}

.map-container {
    width: 100%;
    aspect-ratio: 5 / 3;
    height: auto;
    min-height: 320px;
    background: #e0e0e0;
    position: relative;
    overflow: visible;
}

/* Map container styles */
#map {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.custom-marker {
    background: transparent !important;
    border: none !important;
}

/* Location filter section */
.location-section {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.location-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.location-btn {
    background: var(--primary-color);
    color: #000;
    padding: 0.6rem 1.4rem;
    border: 2px solid #000;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.25s, transform 0.1s;
}

.location-btn:hover {
    background: #e55a2b;
    transform: translateY(-1px);
}

.distance-control {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.distance-control label {
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
}

.distance-control input[type="range"] {
    width: 100%;
}

.location-status {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Demo user switcher */
.user-switcher {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 999px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.user-switcher-info {
    color: #f1f1f1;
}

.user-switcher-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.user-switcher-btn {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.user-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.user-switcher-btn-secondary {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.25);
}

/* Events Section */
.events-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--secondary-color);
}

.controls {
    display: flex;
    gap: 1rem;
}

.controls select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s;
}

.controls select:focus {
    border-color: var(--primary-color);
}

.events-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.event-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.event-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #e9e9e9;
}

.event-content {
    padding: 1.5rem;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.event-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.event-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 400;
}

.event-details {
    margin-bottom: 1rem;
}

.event-detail {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.event-detail strong {
    margin-right: 0.5rem;
    color: var(--text-dark);
}

.event-description {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-actions {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Preset-specific event card composition (layout/structure) */
html[data-ui-style="surfline"] .event-card {
    border-radius: 16px;
    overflow: hidden;
}

html[data-ui-style="surfline"] .event-content {
    padding: 1.1rem 1.2rem;
}

html[data-ui-style="surfline"] .event-header {
    align-items: center;
    gap: 0.75rem;
}

html[data-ui-style="surfline"] .event-name {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

html[data-ui-style="surfline"] .event-type {
    background: #0077b6;
    color: #fff;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid rgba(0,0,0,0.2);
}

html[data-ui-style="surfline"] .event-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    margin-bottom: 0.7rem;
}

html[data-ui-style="surfline"] .event-detail {
    margin-bottom: 0;
    font-size: 0.9rem;
}

html[data-ui-style="surfline"] .event-description {
    -webkit-line-clamp: 2;
    font-size: 0.87rem;
    color: #416887;
}

html[data-ui-style="confuzine"] .event-card {
    border-radius: 14px;
    border-left: 5px solid #ff2e63;
    box-shadow: 0 10px 24px rgba(20,20,30,0.08);
}

html[data-ui-style="confuzine"] .event-photo {
    height: 150px;
    filter: grayscale(0.12) contrast(1.03);
}

html[data-ui-style="confuzine"] .event-content {
    padding: 1.1rem 1.15rem 1rem;
}

html[data-ui-style="confuzine"] .event-header {
    align-items: flex-start;
}

html[data-ui-style="confuzine"] .event-name {
    font-size: 1.18rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

html[data-ui-style="confuzine"] .event-type {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.72rem;
    padding: 0.26rem 0.55rem;
    border-radius: 6px;
    background: #151515;
    color: #fff;
    border: 1px solid #ff2e63;
}

html[data-ui-style="confuzine"] .event-details {
    border-top: 1px solid #e6e6ea;
    border-bottom: 1px solid #e6e6ea;
    padding: 0.5rem 0;
}

html[data-ui-style="confuzine"] .event-detail {
    font-size: 0.88rem;
    margin-bottom: 0.38rem;
}

html[data-ui-style="confuzine"] .event-description {
    -webkit-line-clamp: 4;
    font-size: 0.9rem;
    color: #4f4f59;
}

html[data-ui-style="confuzine"] .event-actions {
    justify-content: flex-end;
}

html[data-ui-style="confuzine"] .like-btn {
    border-radius: 8px;
    font-size: 0.84rem;
    padding: 0.45rem 0.65rem;
}

@media (min-width: 980px) {
    html[data-ui-style="surfline"] .event-card {
        display: grid;
        grid-template-columns: 160px minmax(0, 1fr);
        align-items: stretch;
    }

    html[data-ui-style="surfline"] .event-photo {
        height: 100%;
        min-height: 160px;
    }

    html[data-ui-style="surfline"] .event-content {
        padding: 0.95rem 1rem 0.9rem;
    }

    html[data-ui-style="surfline"] .event-description {
        -webkit-line-clamp: 2;
    }
}

.like-btn {
    border: 2px solid #000;
    background: var(--primary-color);
    color: #000;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.like-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.10);
    background: #e55a2b;
}

.like-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.like-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
.no-events {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

.newest-events-carousel {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.25rem;
}

.newest-events-carousel::-webkit-scrollbar {
    height: 8px;
}

.newest-events-carousel::-webkit-scrollbar-thumb {
    background: #c7cbd3;
    border-radius: 999px;
}

.newest-event-card {
    min-width: 260px;
    max-width: 300px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.85rem 0.9rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.newest-event-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.newest-event-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.newest-event-meta {
    font-size: 0.92rem;
    color: var(--text-light);
    margin-bottom: 0.2rem;
}

.newest-event-date {
    font-size: 0.86rem;
    color: var(--text-light);
}

/* Submit Form */
.submit-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.submit-section h2 {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

/* Homepage layout presets (structure, not only colors) */
.home-layout-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    grid-template-areas:
        "newest"
        "map"
        "events";
}

.home-layout-shell > section {
    margin-bottom: 0 !important;
}

#homeHeroSection { grid-area: hero; }
#homeNewestSection { grid-area: newest; }
#homeNewsSection { grid-area: news; }
#homeMapExplorerSection { grid-area: map; }
#homeSearchSection { grid-area: search; }
#homeEventsSection { grid-area: events; }

html[data-ui-style="classic"] .home-layout-shell {
    grid-template-areas:
        "newest"
        "map"
        "events";
}

html[data-ui-style="dark"] .home-layout-shell {
    grid-template-areas:
        "newest"
        "map"
        "events";
}

html[data-ui-style="confuzine"] .home-layout-shell {
    grid-template-areas:
        "newest"
        "map"
        "events";
}

@media (min-width: 1100px) {
    html[data-ui-style="dark"] .home-layout-shell {
        grid-template-columns: 1.25fr 1fr;
        grid-template-areas:
            "newest map"
            "events events";
    }

    html[data-ui-style="confuzine"] .home-layout-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "newest"
            "map"
            "events";
    }

    html[data-ui-style="classic"] .home-layout-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "newest"
            "map"
            "events";
    }
}

/* Homepage: map explorer as one card (filters + map + location) */
.home-map-explorer-card {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.home-map-explorer-card .search-row,
.home-map-explorer-card .date-filter-row {
    max-width: 100%;
}

.home-map-explorer-card .search-section {
    margin-bottom: 1.25rem;
}

.home-map-explorer-card .map-section {
    max-width: 100%;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.home-map-explorer-card .map-container {
    max-width: 100%;
    box-sizing: border-box;
}

.home-map-explorer-card #map {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.home-map-explorer-card .location-section {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0.85rem 0 0;
    margin-top: 0.75rem;
    margin-bottom: 0;
    border-top: 1px solid var(--border-color);
}

.home-map-explorer-card.submit-section .home-map-explorer-intro h2 {
    margin-bottom: 0.65rem;
}

#homeEventsSection.home-upcoming-events-card {
    margin-bottom: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Ensure big checkbox grids always start on a new row (full width) */
.form-grid > .form-group:has(.event-types-group) {
    grid-column: 1 / -1;
}

.form-collapse {
    display: block;
}

.form-collapse-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin: 0;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    background: var(--light-bg, #f5f5f5);
    color: var(--text-dark, #111);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.form-collapse-toggle:hover {
    background: #ececec;
}

.form-collapse-hint {
    font-weight: 500;
    opacity: 0.72;
}

.form-collapse-chevron {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.15s ease;
}

.form-collapse-toggle[aria-expanded="false"] .form-collapse-chevron {
    transform: rotate(-90deg);
}

.form-collapse-panel {
    margin: 0;
    padding: 0;
    height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.form-collapse.is-open .form-collapse-panel,
.form-collapse-panel.is-expanded {
    display: grid !important;
    visibility: visible !important;
    opacity: 1;
    pointer-events: auto;
    height: auto;
    overflow: visible;
    margin-top: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 1.5rem;
}

.form-collapse-panel[hidden] {
    display: none !important;
    visibility: hidden !important;
}

.form-collapse-panel.is-collapsed .form-group,
.form-collapse-panel.is-collapsed input,
.form-collapse-panel.is-collapsed select,
.form-collapse-panel.is-collapsed textarea,
.form-collapse-panel.is-collapsed button,
.form-collapse-panel[hidden] .form-group,
.form-collapse-panel[hidden] input,
.form-collapse-panel[hidden] select,
.form-collapse-panel[hidden] textarea,
.form-collapse-panel[hidden] button {
    visibility: hidden !important;
}

.form-collapse.is-open .form-collapse-panel .form-group,
.form-collapse.is-open .form-collapse-panel input,
.form-collapse.is-open .form-collapse-panel select,
.form-collapse.is-open .form-collapse-panel textarea,
.form-collapse.is-open .form-collapse-panel button {
    visibility: visible;
}

.form-collapse-panel > .sponsors-rows,
.form-collapse-panel > #publicAddSponsorBtn {
    grid-column: 1 / -1;
}

html[data-ui-style="grind-seek"] .form-collapse-toggle {
    border-color: var(--sl-border, rgba(255, 255, 255, 0.12));
    background: var(--sl-secondary, #1f1f1f);
    color: var(--sl-fg, #f5f5f5);
}

html[data-ui-style="grind-seek"] .form-collapse-toggle:hover {
    background: var(--sl-accent, #2a2a2a);
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.2;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.65rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
    resize: none;
    min-height: var(--control-min-height);
    line-height: 1.25;
}

/* Never apply full-width input styling to checkbox/radio */
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    max-width: none;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
}

/* Prevent select shrinking/misalignment across browsers */
.form-group select {
    display: block;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    line-height: 1.25;
    min-height: var(--control-min-height);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23000' d='M1.4 1.1L6 5.7l4.6-4.6L12 2.5 6 8 0 2.5z'/%3E%3C/svg%3E");
    background-position: calc(100% - 12px) 50%;
    background-size: 12px 8px;
    background-repeat: no-repeat;
    padding-right: 2.2rem;
}

/* Textareas should be allowed to grow; don't force 44px height */
.form-group textarea {
    min-height: unset;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
}

.submit-btn {
    background: var(--primary-color);
    color: #000;
    padding: 1rem 2rem;
    border: 2px solid #000;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
}

.submit-btn:hover {
    background: #e55a2b;
}

.submit-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.48rem 0.85rem;
    border: 2px solid #000;
    border-radius: 999px;
    background: #fff;
    color: var(--secondary-color);
    font-weight: 800;
    font-size: 0.92rem;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, transform 0.12s;
}

.back-link:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.back-link:focus-visible {
    outline: 3px solid rgba(255, 107, 53, 0.45);
    outline-offset: 2px;
}

html[data-theme="dark"] .back-link {
    background: #171a22;
    border-color: rgba(255,255,255,0.24);
    color: var(--text-dark);
}

html[data-theme="dark"] .back-link:hover {
    background: #1f2430;
    border-color: var(--primary-color);
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 5px;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: var(--success-color);
    border: 1px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background: #f8d7da;
    color: var(--error-color);
    border: 1px solid #f5c6cb;
    display: block;
}

/* Auth modal — must stack above sticky header (z-index ~20060) and menu stack (~20070) */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 50000;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.auth-modal-card {
    position: relative;
    width: min(460px, calc(100% - 24px));
    margin: clamp(24px, 8vh, 72px) auto 0;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: 10px;
    padding: max(1.25rem, env(safe-area-inset-top, 0px)) 1.25rem max(1rem, env(safe-area-inset-bottom, 0px)) 1.25rem;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.auth-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 1rem;
    height: 1rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    color: var(--text-light);
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.12s ease;
}

.auth-close::before,
.auth-close::after {
    content: '';
    position: absolute;
    width: 0.55rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.auth-close::before {
    transform: rotate(45deg);
}

.auth-close::after {
    transform: rotate(-45deg);
}

.auth-close:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    transform: scale(1.04);
}

.auth-close:focus-visible {
    outline: 3px solid rgba(255, 107, 53, 0.45);
    outline-offset: 2px;
}

#howItWorksCloseBtn.auth-close {
    width: 2rem;
    height: 2rem;
}

#howItWorksCloseBtn.auth-close::before,
#howItWorksCloseBtn.auth-close::after {
    width: 0.95rem;
}

@media (max-width: 768px) {
    .auth-close {
        min-width: 44px;
        min-height: 44px;
        width: 2.75rem;
        height: 2.75rem;
        top: 8px;
        right: max(8px, env(safe-area-inset-right, 0px));
    }

    #howItWorksCloseBtn.auth-close::before,
    #howItWorksCloseBtn.auth-close::after {
        width: 1.05rem;
    }

    .user-menu-stack #userMenuBtn {
        width: auto !important;
        min-width: 48px;
        padding: 0.65rem 0.95rem !important;
    }

    .user-menu-stack .user-chip {
        width: auto !important;
        max-width: min(160px, 38vw);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.auth-form {
    display: grid;
    gap: 0.75rem;
}

.auth-form a {
    color: var(--primary-color);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-form a:hover {
    filter: brightness(0.92);
}

.event-types-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    align-items: start;
}

/* Medium screens: 2 columns */
@media (max-width: 686px) {
    .event-types-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Small screens: 1 column */
@media (max-width: 538px) {
    .event-types-group {
        grid-template-columns: 1fr;
    }
}

.event-types-group label {
    margin: 0;
    font-weight: 400;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.4rem;
    text-align: left;
    line-height: 1.2;
    min-height: 2.15em; /* prevent row height jitter across columns */
    padding: 0.2rem 0.3rem;
    border-radius: 8px;
    align-self: stretch;
    border: 1px solid #d9d9d9; /* outline per option */
    background: #fff;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.event-types-group input[type="checkbox"],
.event-types-group input[type="radio"] {
    margin-top: 0.15rem;
}

.event-types-group label:hover {
    border-color: #bdbdbd;
    background: #fafafa;
}

/* Selected state (modern browsers) */
.event-types-group label:has(input:checked) {
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.22);
    background: rgba(255, 107, 53, 0.10);
}

.filter-types-checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background: #fff;
}

.filter-types-checks label {
    margin: 0;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

/* Sponsor row: visually grouped + nicer delete button label */
.sponsors-rows .sponsor-row {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 0.65rem;
    background: #fff;
}

.sponsors-rows .sponsor-row .sponsor-remove {
    white-space: nowrap;
}

.event-type-filter-select-v1,
.event-type-filter-select-v2,
.event-type-filter-select-v3,
.event-type-filter-select-v4 {
    width: 100%;
    padding: 1rem 1.2rem;
    font-size: 1.05rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: #fff;
    outline: none;
    height: auto;
}

.event-type-dropdown-trigger {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    outline: none;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--surface-on-light-muted);
    font-weight: 400;
}

.event-type-dropdown-caret {
    color: var(--surface-on-light-muted);
    font-size: 1.1rem;
    margin-left: auto;
}

.event-type-dropdown-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    z-index: 45;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.4rem 0.75rem;
}

.event-type-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.25rem;
    cursor: pointer;
    user-select: none;
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 400;
}

.event-type-dropdown-item:hover {
    background: #f4f7fb;
}

.sponsors-rows .sponsor-row input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.sponsors-rows .sponsor-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.inline-link-btn {
    display: inline;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    color: var(--primary-color);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.inline-link-btn:hover {
    color: #e55a2b;
}

/* Hide CKEditor notification popups (incl. version/security warning). */
.cke_notifications_area,
.cke_notification,
.cke_notification_warning {
    display: none !important;
}

footer {
    background: var(--dark-bg);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}
.footer-version {
    margin-top: 0.45rem;
    color: #d7d7d7;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Admin nav responsiveness + safe overflow handling */
.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-nav-links {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    min-width: 0;
}

.admin-nav-links a {
    white-space: nowrap;
}

.admin-menu-wrap {
    position: relative;
    display: none;
}

.admin-menu-btn {
    border: 2px solid #000;
    background: var(--primary-color);
    color: #000;
    border-radius: 10px;
    padding: 0.55rem 0.8rem;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
}

.admin-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 210px;
    background: var(--primary-color);
    border: 2px solid #000;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.2);
    z-index: 21000;
    display: none;
    box-sizing: border-box;
}

.admin-menu-dropdown.is-viewport-fixed {
    position: fixed !important;
    right: auto !important;
    top: auto !important;
    min-width: 0;
    max-width: calc(100vw - 24px);
}

.admin-menu-dropdown a {
    display: block;
    width: 100%;
    padding: 0.62rem 0.82rem;
    color: #000;
    text-decoration: none;
    font-weight: 800;
}

.admin-menu-dropdown a:hover {
    background: rgba(255,255,255,0.35);
}

.events-table,
.users-wrap,
.form-container,
.submit-section {
    max-width: 100%;
    min-width: 0;
}

.events-table {
    overflow-x: auto !important;
}

.users-wrap {
    overflow-x: auto;
}

.users-table {
    min-width: 880px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 1rem 0;
    }
    header .container > div {
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.5rem;
    }
    /* Make brand block feel like full-height header pill */
    .site-brand {
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
        border-radius: 18px;
    }
    .site-brand {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
    }
    .site-brand-text p {
        display: none; /* preserve horizontal space for controls */
    }
    .user-menu-stack {
        gap: 0.35rem;
        flex: 0 0 auto;
        margin-left: auto;
        align-items: flex-end;
        max-width: 100%;
    }
    .user-menu-stack .user-menu-anchor {
        max-width: 100%;
        flex-shrink: 0;
    }
    .user-menu-stack .user-chip,
    .user-menu-stack .user-menu-btn:not(#userMenuBtn) {
        width: auto;
        max-width: min(120px, 32vw);
    }
    .search-row {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .map-container {
        min-height: 260px;
    }
    
    .events-list {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls {
        width: 100%;
    }
    
    .controls select {
        flex: 1;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }

    .sponsors-rows .sponsor-row {
        grid-template-columns: 1fr !important;
        gap: 0.45rem !important;
    }

    #userMenuDropdown {
        min-width: 170px !important;
        right: 0;
        z-index: 20050 !important; /* keep dropdown clickable above maps/overlays */
    }

    .admin-nav-links {
        display: none;
    }

    .admin-menu-wrap {
        display: block;
        flex: 0 0 auto;
        margin-left: auto;
    }

    .admin-nav {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    .admin-nav > h1,
    .admin-nav > h2 {
        font-size: clamp(0.95rem, 4.5vw, 1.25rem) !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .admin-header .container {
        overflow: visible;
        padding-left: 12px;
        padding-right: 12px;
    }

    .admin-menu-btn {
        padding: 0.5rem 0.65rem;
        font-size: 1rem;
    }

    html[data-ui-style="surfline"] .home-layout-shell > section,
    html[data-ui-style="confuzine"] .home-layout-shell > section {
        min-height: 0;
        padding: 1.25rem 1rem;
    }

    html[data-ui-style="surfline"] .newest-events-carousel,
    html[data-ui-style="confuzine"] .newest-events-carousel {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    .site-logo {
        width: 90px;
        height: 90px;
    }
    .site-brand-text h1 {
        font-size: 1.1rem;
    }
    .submit-section {
        padding: 1rem;
    }
    .user-menu-stack .user-chip,
    .user-menu-stack .user-menu-btn:not(#userMenuBtn) {
        width: auto;
        max-width: min(110px, 34vw);
        font-size: 0.78rem;
    }
}

/* Calendar page */
.calendar-page-shell {
    max-width: 1200px;
    margin: 0 auto;
}

.calendar-widget-shell {
    overflow: hidden;
}

.calendar-page-shell #calCitySearch,
.calendar-page-shell #calCountrySearch,
.calendar-page-shell #calEventNameSearch {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    outline: none;
    background: #fff;
    color: var(--text-light);
    font-weight: 400;
}

.calendar-page-shell #calCitySearch:focus,
.calendar-page-shell #calCountrySearch:focus,
.calendar-page-shell #calEventNameSearch:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.calendar-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.85rem;
}

.calendar-month-panel {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.55rem;
    background: #fff;
}

.calendar-month-title {
    margin: 0 0 0.45rem 0;
    padding: 0 .2rem;
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.45rem;
}

.calendar-cell {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    aspect-ratio: 1 / 1;
    min-height: 0;
    padding: 0.45rem;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, transform .12s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

.calendar-cell:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.calendar-cell--header {
    min-height: auto;
    aspect-ratio: auto;
    font-weight: 800;
    text-align: center;
    cursor: default;
    background: var(--light-bg);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-cell--blank {
    opacity: 0;
    aspect-ratio: 1 / 1;
    cursor: default;
    pointer-events: none;
}

.calendar-cell.is-selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.18) inset;
}

.calendar-cell.is-today .calendar-day-num {
    color: var(--primary-color);
}

.calendar-cell.has-events {
    border-color: rgba(255, 107, 53, 0.75);
    box-shadow: inset 0 0 0 1px rgba(255, 107, 53, 0.25);
    background: linear-gradient(180deg, rgba(255, 107, 53, 0.1) 0%, #fff 45%);
}

.calendar-cell.has-events::after {
    content: '';
    position: absolute;
    right: 0.42rem;
    top: 0.42rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
}

.calendar-day-num {
    font-weight: 900;
    margin-bottom: 0.22rem;
    line-height: 1;
    font-size: 1rem;
    max-width: 100%;
}

.calendar-day-meta {
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.2;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Grind & Seek: beat later generic dark dropdown rules */
html[data-ui-style="grind-seek"][data-theme="dark"] #userMenuDropdown.user-menu-dropdown {
    background: #14171a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55) !important;
}

/* Sticky header hardening (fallback block kept near end for cascade safety). */
html body > header,
.admin-header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 20060 !important;
}

/* ----------------------------------------------------------------------
 * Admin pages: align with Grind & Seek dark scheme.
 * Admin templates use inline <style> blocks that hardcode `background: white`
 * and rely on light-theme variables. These overrides use higher specificity
 * (html[data-ui-style="grind-seek"] …) so they win over those inline styles.
 * -------------------------------------------------------------------- */
html[data-ui-style="grind-seek"] body {
    background-color: var(--light-bg);
    color: var(--text-dark);
}

html[data-ui-style="grind-seek"] .admin-header {
    background: rgba(20, 20, 20, 0.92) !important;
    color: var(--text-dark) !important;
    border-bottom: 1px solid var(--grind-seek-border-subtle);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-ui-style="grind-seek"] .admin-header h1,
html[data-ui-style="grind-seek"] .admin-header h2,
html[data-ui-style="grind-seek"] .admin-header h3 {
    color: var(--text-dark) !important;
}

html[data-ui-style="grind-seek"] .admin-nav a,
html[data-ui-style="grind-seek"] .admin-menu-dropdown a {
    color: var(--text-dark) !important;
}

html[data-ui-style="grind-seek"] .admin-nav a:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

html[data-ui-style="grind-seek"] .stat-card,
html[data-ui-style="grind-seek"] .events-table,
html[data-ui-style="grind-seek"] .users-wrap,
html[data-ui-style="grind-seek"] .form-container,
html[data-ui-style="grind-seek"] .login-container {
    background: var(--grind-seek-surface) !important;
    color: var(--text-dark) !important;
    border: 1px solid var(--grind-seek-border-subtle) !important;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45) !important;
}

html[data-ui-style="grind-seek"] .stat-card h3,
html[data-ui-style="grind-seek"] .stat-card .number {
    color: var(--text-dark) !important;
}

html[data-ui-style="grind-seek"] .stat-card h3 {
    opacity: 0.72;
}

html[data-ui-style="grind-seek"] .events-table h2,
html[data-ui-style="grind-seek"] .events-table h3 {
    color: var(--text-dark) !important;
}

html[data-ui-style="grind-seek"] table {
    color: var(--text-dark);
    background: transparent;
}

html[data-ui-style="grind-seek"] table th,
html[data-ui-style="grind-seek"] table td {
    border-bottom: 1px solid var(--grind-seek-border-subtle) !important;
    color: var(--text-dark) !important;
    background: transparent !important;
}

html[data-ui-style="grind-seek"] table th {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--text-dark) !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8rem;
    opacity: 0.85;
}

html[data-ui-style="grind-seek"] table tr:hover td {
    background: rgba(255, 84, 74, 0.06) !important;
}

html[data-ui-style="grind-seek"] .status-badge {
    color: #f5f5f5;
}

html[data-ui-style="grind-seek"] .status-pending {
    background: #f5a524 !important;
    color: #111 !important;
}

html[data-ui-style="grind-seek"] .status-approved {
    background: #1f8a4c !important;
    color: #f5f5f5 !important;
}

html[data-ui-style="grind-seek"] .status-rejected {
    background: #c0392b !important;
    color: #f5f5f5 !important;
}

html[data-ui-style="grind-seek"] .action-btn {
    color: #f5f5f5;
    border: 1px solid var(--grind-seek-border-subtle);
}

html[data-ui-style="grind-seek"] .btn-approve {
    background: #1f8a4c !important;
    color: #f5f5f5 !important;
}

html[data-ui-style="grind-seek"] .btn-reject,
html[data-ui-style="grind-seek"] .btn-delete {
    background: #c0392b !important;
    color: #f5f5f5 !important;
}

html[data-ui-style="grind-seek"] .btn-edit {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-dark) !important;
}

html[data-ui-style="grind-seek"] .admin-menu-btn,
html[data-ui-style="grind-seek"] .admin-menu-dropdown {
    background: var(--grind-seek-surface) !important;
    border: 1px solid var(--grind-seek-border-subtle) !important;
    color: var(--text-dark) !important;
}

html[data-ui-style="grind-seek"] .admin-menu-dropdown a:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

html[data-ui-style="grind-seek"] .users-table {
    background: transparent;
}

html[data-ui-style="grind-seek"] .users-table tr {
    background: transparent !important;
}

html[data-ui-style="grind-seek"] input[type="text"],
html[data-ui-style="grind-seek"] input[type="email"],
html[data-ui-style="grind-seek"] input[type="password"],
html[data-ui-style="grind-seek"] input[type="url"],
html[data-ui-style="grind-seek"] input[type="number"],
html[data-ui-style="grind-seek"] input[type="date"],
html[data-ui-style="grind-seek"] input[type="time"],
html[data-ui-style="grind-seek"] input[type="search"],
html[data-ui-style="grind-seek"] select,
html[data-ui-style="grind-seek"] textarea {
    background: #0f0f14;
    color: var(--text-dark);
    border: 1px solid var(--grind-seek-border-subtle);
}

html[data-ui-style="grind-seek"] input::placeholder,
html[data-ui-style="grind-seek"] textarea::placeholder {
    color: var(--input-placeholder-on-dark);
    opacity: 1;
}

/* Readable placeholder text on light input surfaces (classic / fallback) */
input:not([type="checkbox"]):not([type="radio"])::placeholder,
textarea::placeholder {
    color: var(--input-placeholder-on-light);
    opacity: 1;
}

html[data-ui-style="grind-seek"] .event-type-dropdown-trigger {
    background: #1a1a1a !important;
    color: var(--text-dark) !important;
    border-color: var(--grind-seek-border-subtle) !important;
}

html[data-ui-style="grind-seek"] .event-type-dropdown-trigger span {
    color: var(--text-dark) !important;
}

html[data-ui-style="grind-seek"] .event-type-dropdown-caret {
    color: var(--input-placeholder-on-dark) !important;
}

html[data-ui-style="grind-seek"] .search-suggestions {
    background: #1a1a1a;
    border-color: var(--grind-seek-border-subtle);
    color: var(--text-dark);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

html[data-ui-style="grind-seek"] .search-suggestion-item {
    color: var(--text-dark);
}

html[data-ui-style="grind-seek"] .search-suggestion-item:hover {
    background: #2a2a2a;
}

html[data-ui-style="grind-seek"] .event-type-dropdown-menu {
    color: var(--text-dark);
}

html[data-ui-style="grind-seek"] .event-type-dropdown-item {
    color: var(--text-dark);
}

html[data-ui-style="grind-seek"] label {
    color: var(--text-dark);
}

/* Notification centre cards (theme-aware) */
.notif-list {
    display: grid;
    gap: 0.65rem;
}

.notif-card {
    display: block;
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--light-bg);
    color: var(--text-dark);
    text-decoration: none;
    transition: border-color 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.notif-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.notif-card-title {
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.3;
}

.notif-card-body {
    margin-top: 0.25rem;
    color: var(--text-dark);
    opacity: 0.88;
    line-height: 1.45;
}

.notif-card-meta {
    margin-top: 0.35rem;
    color: var(--text-light);
    font-size: 0.84rem;
}

html[data-ui-style="grind-seek"] .notif-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--grind-seek-border-subtle);
}

html[data-ui-style="grind-seek"] .notif-card:hover {
    background: rgba(255, 84, 74, 0.08);
    border-color: rgba(255, 84, 74, 0.45);
}

html[data-ui-style="grind-seek"] .notif-card-meta {
    color: var(--text-light);
}

/* Grind & Seek: keep stray inline-white cards inside dark surfaces readable.
   Defensive override for pages that still hardcode background:#fff on tiles. */
html[data-ui-style="grind-seek"] .submit-section [style*="background:#fff"],
html[data-ui-style="grind-seek"] .submit-section [style*="background: #fff"],
html[data-ui-style="grind-seek"] .submit-section [style*="background:white"],
html[data-ui-style="grind-seek"] .submit-section [style*="background: white"],
html[data-ui-style="grind-seek"] .page-shell [style*="background:#fff"],
html[data-ui-style="grind-seek"] .page-shell [style*="background: #fff"] {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--text-dark) !important;
    border-color: var(--grind-seek-border-subtle) !important;
}

html[data-ui-style="grind-seek"] .submit-section [style*="background:#fff"] strong,
html[data-ui-style="grind-seek"] .submit-section [style*="background: #fff"] strong,
html[data-ui-style="grind-seek"] .page-shell [style*="background:#fff"] strong {
    color: var(--text-dark) !important;
}

html[data-ui-style="grind-seek"] table[style*="background:#fff"],
html[data-ui-style="grind-seek"] table[style*="background: #fff"] {
    background: rgba(255, 255, 255, 0.03) !important;
    color: var(--text-dark) !important;
}

html[data-ui-style="grind-seek"] table[style*="background:#fff"] th,
html[data-ui-style="grind-seek"] table[style*="background:#fff"] td,
html[data-ui-style="grind-seek"] table[style*="background: #fff"] th,
html[data-ui-style="grind-seek"] table[style*="background: #fff"] td {
    color: var(--text-dark);
    border-color: var(--grind-seek-border-subtle);
}

/* Viewport containment: prevent horizontal bleed on small screens */
html,
body {
    max-width: 100%;
    overflow-x: clip;
}

.page-shell,
.page-main,
main,
.submit-section,
.form-grid,
.home-map-explorer-card,
.map-section,
.event-pick-map-panel,
.event-pick-map-canvas,
#eventPickMap,
#map {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.form-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea,
.search-container input,
.event-pick-map-topbar {
    max-width: 100%;
}

.event-pick-map-topbar {
    flex-wrap: wrap;
}

.event-pick-map-canvas {
    max-width: 100%;
    overflow: hidden;
}

.sponsors-rows {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sponsors-rows .sponsor-row {
    min-width: 0;
}

.site-brand,
.site-brand-text,
.grind-seek-wordmark {
    min-width: 0;
    max-width: 100%;
}

/* HERE map info bubbles */
.H_ui,
.H_l_bubble,
.H_ib,
.H_ib_body,
.H_ib_content {
    max-width: min(300px, calc(100vw - 32px)) !important;
    box-sizing: border-box !important;
}

.map-marker-bubble {
    min-width: 0;
    max-width: min(300px, calc(100vw - 32px));
    width: min(300px, calc(100vw - 32px));
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e7ecf3;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 22, 33, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    overflow-wrap: break-word;
    word-break: normal;
}

.map-marker-bubble__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.map-marker-bubble__title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: normal;
    color: #ff6b35;
    text-decoration: none;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
}

.map-marker-bubble__type {
    flex: 0 0 auto;
    max-width: 42%;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
    color: #000;
    background: #ff6b35;
    border-radius: 999px;
    padding: 3px 8px;
    border: 1px solid #000;
    word-break: normal;
    overflow-wrap: break-word;
    text-align: center;
}

.map-marker-bubble__meta {
    margin-top: 8px;
    font-size: 12px;
    color: #3c4a5b;
    line-height: 1.35;
    word-break: normal;
    overflow-wrap: break-word;
}

.map-marker-bubble__meta strong {
    color: #1f2d3d;
}

.map-marker-bubble__spot {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.map-marker-bubble__cta {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    color: #000 !important;
    background: #ff6b35;
    border: 2px solid #000;
    border-radius: 8px;
    padding: 6px 10px;
    line-height: 1.2;
    white-space: nowrap;
}

.H_ib {
    max-height: min(70vh, calc(100dvh - 48px)) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto !important;
}

.H_ib_body {
    max-height: none !important;
    overflow: visible !important;
    pointer-events: auto !important;
}

.H_ib_content {
    overflow: visible !important;
}

.map-marker-bubble a {
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
}

#userMenuDropdown.user-menu-dropdown {
    max-width: min(320px, calc(100vw - 24px));
    box-sizing: border-box;
}
