@import url('/shared/fbcfi-design-system.css');

:root {
    /* Brightscout palette */
    --color-mint: #C1F6ED;
    --color-teal-deep: #02353C;
    --color-forest: #449342;
    --color-emerald: #2EAF7D;
    --color-cyan: #3FD0C9;
    --color-heart-red: #ef4444;

    --dark-950: #02353C;
    --dark-900: #034a52;
    --dark-800: #056068;
    --dark-700: #2EAF7D;
    --dark-600: #3FD0C9;
    --dark-border: rgba(2, 53, 60, 0.12);
    --dark-text: #02353C;
    --dark-text-muted: rgba(2, 53, 60, 0.72);
    --text-on-green: #02353C;
    --text-on-dark: #ffffff;
    --text-on-dark-muted: rgba(255, 255, 255, 0.78);

    --light-bg: #eef6f5;
    --light-surface: #ffffff;
    --light-elevated: #f4fbf9;
    --light-border: #c5e8e4;
    --light-border-subtle: #d8f0ee;

    --green-900: var(--color-teal-deep);
    --green-800: var(--color-forest);
    --green-700: var(--color-emerald);
    --green-600: var(--color-emerald);
    --green-500: var(--color-cyan);
    --green-400: var(--color-cyan);
    --green-100: var(--color-mint);
    --green-50: #e8faf8;

    --navy-900: var(--color-teal-deep);
    --navy-800: var(--color-forest);
    --navy-700: var(--color-emerald);
    --blue-600: var(--color-emerald);
    --blue-500: var(--color-cyan);
    --blue-100: var(--color-mint);

    --slate-50: var(--light-elevated);
    --slate-100: #eef6f5;
    --slate-200: var(--light-border);
    --slate-400: #7a9a96;
    --slate-600: #4a6b67;
    --slate-800: #02353C;
    --white: #ffffff;

    --shadow-sm: 0 1px 3px rgba(2, 53, 60, 0.06);
    --shadow-md: 0 4px 20px rgba(2, 53, 60, 0.1);
    --shadow-lg: 0 16px 48px rgba(2, 53, 60, 0.14);
    --shadow-dark: 0 8px 32px rgba(2, 53, 60, 0.22);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 0.2s ease;
    --sidebar-width: 260px;
    --directory-width: 380px;
}

/* Blue theme */
html[data-theme="blue"] {
    --color-mint: #CFE8FC;
    --color-teal-deep: #0D47A1;
    --color-forest: #1565C0;
    --color-emerald: #42A5F5;
    --color-cyan: #64B5F6;

    --dark-950: #0D47A1;
    --dark-900: #1565C0;
    --dark-800: #1976D2;
    --dark-700: #42A5F5;
    --dark-600: #64B5F6;
    --dark-border: rgba(13, 71, 161, 0.12);
    --dark-text: #0D47A1;
    --dark-text-muted: rgba(13, 71, 161, 0.72);
    --text-on-green: #0D47A1;

    --light-bg: #eef4fc;
    --light-elevated: #f3f8ff;
    --light-border: #c5daf4;
    --light-border-subtle: #dce8fa;

    --green-50: #e8f4ff;

    --slate-100: #eef4fc;
    --slate-400: #7a96b8;
    --slate-600: #4a6b8f;
    --slate-800: #0D47A1;

    --shadow-sm: 0 1px 3px rgba(13, 71, 161, 0.06);
    --shadow-md: 0 4px 20px rgba(13, 71, 161, 0.1);
    --shadow-lg: 0 16px 48px rgba(13, 71, 161, 0.14);
    --shadow-dark: 0 8px 32px rgba(13, 71, 161, 0.22);
}

html {
    -webkit-text-size-adjust: 100%;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--fbcfi-bg-gradient, var(--light-bg));
    color: var(--slate-800);
    overflow: hidden;
    line-height: 1.5;
    font-size: max(16px, var(--fbcfi-body-min, 16px));
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--fbcfi-bg-noise);
    pointer-events: none;
    z-index: 0;
    opacity: 0.85;
}

.dashboard {
    position: relative;
    z-index: 1;
}

/* MAIN LAYOUT */

.dashboard {
    display: flex;
    height: 100vh;
    height: 100dvh;
    min-width: 0;
    overflow: hidden;
}

/* SIDEBAR */

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--color-teal-deep) 0%, var(--color-emerald) 55%, var(--color-cyan) 100%);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 4px 0 24px rgba(2, 53, 60, 0.18);
}

.logo-mark {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    display: block;
    max-width: 100%;
    height: auto;
}

.logo-img-circle {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.menu-item-platform {
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    font-size: 1rem;
    min-height: 48px;
}

.menu-item-platform:hover,
.menu-item-platform:focus-visible {
    background: rgba(255, 255, 255, 0.12);
}

.logo-text h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--white);
}

.logo-text span {
    color: var(--text-on-dark-muted);
    font-size: 12px;
    font-weight: 500;
}

.sidebar-nav {
    margin-top: 32px;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-on-dark-muted);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    font-size: 15px;
    font-weight: 500;
    border: 1px solid transparent;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.15);
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.28);
    color: var(--white);
    box-shadow: 0 2px 12px rgba(2, 53, 60, 0.15);
    font-weight: 600;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(27, 67, 47, 0.12);
}

.sidebar-footer p {
    font-size: 11px;
    color: var(--text-on-dark-muted);
    line-height: 1.4;
}

.menu-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
    opacity: 0.85;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

.menu-item[hidden] {
    display: none !important;
}

/* CENTER CONTENT */

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 24px;
    min-width: 0;
    min-height: 0;
    position: relative;
    background: linear-gradient(165deg, var(--light-bg) 0%, #e8eceb 45%, var(--light-elevated) 100%);
}

.map-search-tools {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.map-search-tools .search-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.map-search-tools .search-box {
    min-height: 40px;
    padding: 8px 12px 8px 36px;
    font-size: 14px;
    border-radius: var(--radius-md);
}

.map-search-tools .search-icon {
    left: 12px;
    font-size: 13px;
}

.map-top-toolbar-btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.map-top-toolbar {
    position: relative;
    flex: 0 0 auto;
    z-index: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.96);
    border: none;
    border-bottom: 1px solid var(--light-border);
    box-shadow: none;
    backdrop-filter: blur(12px);
    min-width: 0;
    pointer-events: auto;
}

.map-top-toolbar-left {
    flex: 0 0 auto;
}

.map-top-toolbar-center {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
}

.map-top-toolbar .map-search-tools {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
}

.map-top-toolbar .search-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.map-top-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.content:not(.view-directory):not(.view-events) #pageContext {
    display: none !important;
}

.content.view-directory .map-top-toolbar,
.content.view-events .map-top-toolbar {
    display: none !important;
}

.map-top-toolbar .map-view-mode-toggle {
    flex-shrink: 0;
}

.directory-full-tools {
    flex-shrink: 0;
    padding: 14px 16px;
    border-top: 1px solid var(--light-border);
    background: var(--light-surface);
}

.directory-full-tools .map-search-tools {
    max-width: none;
}

.directory-full-tools .map-top-toolbar-actions {
    display: flex;
    gap: 8px;
}

.directory-full-tools[hidden] {
    display: none !important;
}

.search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    font-size: 14px;
    opacity: 0.45;
    pointer-events: none;
}

.search-box {
    width: 100%;
    min-height: 48px;
    padding: 13px 16px 13px 42px;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-md);
    background: var(--light-surface);
    font-size: 18px;
    color: var(--slate-800);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box:focus {
    outline: none;
    border-color: var(--green-600);
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15), var(--shadow-sm);
}

.top-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--light-border);
    background: var(--light-surface);
    padding: 13px 18px;
    min-height: 48px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-800);
    box-shadow: var(--shadow-sm);
    transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}

.top-btn:hover {
    background: var(--light-elevated);
    border-color: var(--green-600);
    box-shadow: var(--shadow-md);
}

.top-btn.active {
    background: var(--dark-800);
    border-color: var(--dark-700);
    color: var(--text-on-green);
}

/* FILTER PANEL */

.filter-panel-backdrop {
    display: none;
}

.filter-panel-header {
    display: none;
}

.filter-panel-hint {
    width: 100%;
    margin: 0 0 4px;
    font-size: 1rem;
    color: var(--slate-600);
    line-height: 1.45;
}

.filter-panel {
    margin-bottom: 16px;
    animation: slideDown 0.2s ease;
}

.filter-panel-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    padding: 16px 20px;
    background: var(--light-surface);
    border: 1px solid var(--light-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.filter-field label {
    font-size: 14px;
    font-weight: 600;
    color: var(--slate-600);
    text-transform: none;
    letter-spacing: 0;
}

html.easy-mode .filter-field label {
    font-size: 1rem;
}

.filter-field select,
.filter-field input {
    padding: 12px 14px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-size: 18px;
    min-height: 48px;
    background: var(--white);
}

.filter-field select:focus,
.filter-field input:focus {
    outline: none;
    border-color: var(--blue-600);
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* BUTTONS */

.btn-primary,
.btn-secondary {
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background var(--transition), transform var(--transition);
}

.btn-primary {
    background: linear-gradient(145deg, var(--green-700), var(--green-600));
    color: var(--white);
    box-shadow: 0 2px 8px rgba(21, 128, 61, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(145deg, var(--green-800), var(--green-700));
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.3);
}

.btn-secondary {
    background: var(--light-elevated);
    color: var(--slate-800);
    border: 1px solid var(--light-border);
}

.btn-secondary:hover {
    background: var(--light-surface);
    border-color: var(--slate-400);
}

.btn-danger {
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    margin-top: 8px;
    transition: background var(--transition);
}

.btn-danger:hover {
    background: #fee2e2;
}

.btn-block {
    width: 100%;
}

.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.98);
}

/* MAP */

.map-container {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--light-surface);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--light-border);
    min-height: 0;
}

.map-viewport-stage {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.map-viewport-stage > #globeViewRoot,
.map-viewport-stage > #map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.map-status-banner {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 650;
    max-width: calc(100% - 24px);
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(2, 53, 60, 0.92);
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    box-shadow: var(--shadow-md);
    pointer-events: none;
}

.map-status-offline {
    top: auto;
    bottom: calc(72px + env(safe-area-inset-bottom, 0));
    background: rgba(46, 175, 125, 0.95);
    color: var(--color-teal-deep);
}

html.mobile-layout .map-status-offline {
    bottom: calc(64px + env(safe-area-inset-bottom, 0));
}

.map-markers-toggle {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--light-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--color-teal-deep);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.map-markers-toggle:hover {
    background: var(--light-elevated);
    border-color: var(--color-teal-mid);
}

.map-markers-toggle:active {
    transform: scale(0.97);
}

.map-markers-toggle[aria-pressed="true"] {
    background: var(--green-100);
    border-color: var(--green-600);
    color: var(--green-800);
}

.map-world-view-btn {
    position: absolute;
    right: 12px;
    bottom: 58px;
    z-index: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--light-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--color-teal-deep);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.map-world-view-btn:hover {
    background: var(--light-elevated);
    border-color: var(--color-teal-mid);
}

.map-world-view-btn:active {
    transform: scale(0.97);
}

.map-world-view-btn[aria-pressed="true"] {
    background: var(--green-100);
    border-color: var(--green-600);
    color: var(--green-800);
}

.map-markers-toggle-icon {
    font-size: 16px;
    line-height: 1;
}

#map {
    width: 100%;
    height: 100%;
}

#map.leaflet-container,
.leaflet-container {
    width: 100%;
    height: 100%;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-x pan-y pinch-zoom;
}

.leaflet-tile-container img.leaflet-tile {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.church-map-marker-icon {
    image-rendering: -webkit-optimize-contrast;
}

.leaflet-control-zoom a {
    min-width: 32px;
    min-height: 32px;
    line-height: 32px;
}

.leaflet-control-attribution {
    font-size: 11px;
}

.content.view-directory .map-container {
    display: none;
}

.content.view-directory .directory-full {
    display: flex;
}

/* DIRECTORY FULL VIEW */

.directory-full {
    flex: 1;
    display: none;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    min-height: 0;
}

.directory-full-header {
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--slate-200);
}

.directory-full-header h2 {
    font-size: 22px;
    color: var(--navy-900);
    margin-bottom: 4px;
}

.directory-full-header p {
    color: var(--slate-600);
    font-size: 14px;
}

.directory-full-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 28px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.directory-full-tools {
    border-top: 1px solid var(--slate-200);
}

/* RIGHT PANEL */

.directory-panel {
    width: var(--directory-width);
    max-width: var(--directory-width);
    background: var(--light-elevated);
    border-left: 1px solid var(--light-border);
    overflow: hidden;
    padding: 0;
    flex-shrink: 0;
    transition: opacity var(--transition), transform var(--transition), background var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.directory-panel-head {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    background: #012a30;
    position: relative;
}

.directory-panel-tabs {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
}

.directory-panel-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding: 16px 14px 18px;
    border: none;
    background: #010f11;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    min-width: 0;
    transition: background var(--transition), color var(--transition);
}

.directory-panel-tab:hover {
    color: rgba(255, 255, 255, 0.92);
}

.directory-panel-tab.active,
.directory-panel-tab[aria-selected="true"] {
    background: linear-gradient(135deg, var(--color-teal-deep) 0%, var(--color-emerald) 55%, var(--color-cyan) 100%);
    color: var(--white);
}

.directory-panel-tab.active::after,
.directory-panel-tab[aria-selected="true"]::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid var(--light-elevated);
}

.directory-panel.is-events-tab .directory-panel-tab[data-directory-tab="events"].active::after,
.directory-panel.is-events-tab .directory-panel-tab[data-directory-tab="events"][aria-selected="true"]::after {
    border-bottom-color: #2EAF7D;
}

.directory-panel-tab-label {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

.directory-panel-tab-meta {
    font-size: 12px;
    line-height: 1.35;
    opacity: 0.88;
}

.directory-panel-head .directory-header-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.directory-churches-pane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.directory-churches-pane[hidden],
.directory-events-pane[hidden] {
    display: none !important;
}

.directory-churches-pane.is-active-pane,
.directory-events-pane.is-active-pane {
    display: flex;
    flex: 1;
    min-height: 0;
}

.directory-churches-pane .directory-admin-hint {
    margin: 12px 16px 0;
    color: var(--slate-600);
    background: var(--light-surface);
    border: 1px solid var(--light-border);
}

.directory-events-pane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #2EAF7D 0%, #034a52 28%, #02353C 100%);
}

.directory-panel.is-events-tab {
    background: linear-gradient(180deg, #2EAF7D 0%, #02353C 100%);
}

.directory-panel.is-events-tab .directory-panel-head {
    background: #010f11;
}

.directory-events-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.directory-events-empty {
    text-align: center;
    padding: 36px 20px;
    color: rgba(255, 255, 255, 0.92);
}

.directory-events-empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.directory-events-empty p {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--white);
}

.directory-events-empty-sub {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
}

.directory-event-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: linear-gradient(155deg, rgba(1, 52, 58, 0.98) 0%, rgba(1, 36, 42, 0.98) 55%, rgba(2, 53, 60, 0.94) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 36px rgba(2, 53, 60, 0.38);
}

.directory-event-hero-balloons {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 3;
    width: 72px;
    height: 56px;
    pointer-events: none;
}

.directory-event-balloon {
    position: absolute;
    display: block;
    width: 24px;
    height: 28px;
    border-radius: 50% 50% 46% 46%;
    box-shadow: inset -4px -6px 10px rgba(0, 0, 0, 0.12);
}

.directory-event-balloon::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 1px;
    height: 8px;
    background: rgba(255, 255, 255, 0.45);
    transform: translateX(-50%);
}

.directory-event-balloon-green {
    top: 6px;
    left: 4px;
    background: radial-gradient(circle at 35% 28%, #6ee7b7, #059669 72%);
}

.directory-event-balloon-gold {
    top: 0;
    left: 26px;
    width: 28px;
    height: 32px;
    background: radial-gradient(circle at 35% 28%, #fde68a, #d97706 72%);
}

.directory-event-balloon-sm {
    top: 18px;
    right: 0;
    width: 20px;
    height: 24px;
    background: radial-gradient(circle at 35% 28%, #6ee7b7, #047857 72%);
}

.directory-event-hero-decor {
    display: none;
}

.directory-event-hero-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.35;
    background:
        radial-gradient(circle at 12% 18%, #fbbf24 0 3px, transparent 4px),
        radial-gradient(circle at 88% 22%, #34d399 0 3px, transparent 4px),
        radial-gradient(circle at 76% 78%, #f472b6 0 2px, transparent 3px),
        radial-gradient(circle at 18% 82%, #60a5fa 0 2px, transparent 3px);
}

.directory-event-hero-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    padding: 7px 18px 7px 12px;
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
    color: #111827;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
    clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
}

.directory-event-hero-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 10px;
    padding: 38px 14px 10px;
    position: relative;
    z-index: 1;
}

.directory-event-hero.is-live .directory-event-hero-main {
    padding-top: 42px;
}

.directory-event-hero-copy {
    min-width: 0;
}

.directory-event-hero-media {
    width: 96px;
    height: 96px;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 2px solid rgba(255, 255, 255, 0.2);
    align-self: start;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.directory-event-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.directory-event-hero-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--white);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.directory-event-hero-ordinal {
    font-family: 'Segoe Script', 'Brush Script MT', 'Snell Roundhand', cursive;
    font-size: 28px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1;
    color: #fff;
}

.directory-event-hero-title-rest {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
}

.directory-event-hero-church {
    font-size: 14px;
    font-weight: 800;
    color: #fde047;
    margin-bottom: 4px;
    line-height: 1.25;
}

.directory-event-hero-theme {
    font-size: 13px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    line-height: 1.35;
}

.directory-event-hero-meta {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.92);
}

.directory-event-hero-meta li {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    line-height: 1.4;
}

.directory-event-meta-svg {
    color: #fbbf24;
    flex-shrink: 0;
    margin-top: 1px;
}

.directory-event-hero-meta-location span {
    line-height: 1.35;
}

.directory-event-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 14px 14px;
    position: relative;
    z-index: 1;
}

.directory-event-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.directory-event-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.directory-event-btn:active {
    transform: scale(0.98);
}

.directory-event-btn-primary {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #111827;
    border: none;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
    justify-content: space-between;
    width: 100%;
}

.directory-event-btn-secondary {
    width: 100%;
}

.directory-event-btn-pin {
    display: inline-flex;
    color: #fbbf24;
}

.directory-event-btn-pin .directory-event-meta-svg {
    width: 14px;
    height: 14px;
}

.directory-event-btn-chevron {
    font-size: 18px;
    line-height: 1;
}

.directory-event-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.directory-event-btn-sm {
    min-height: 40px;
    font-size: 13px;
    padding: 8px 12px;
}

.directory-events-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.directory-events-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
}

.directory-events-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.directory-event-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 24px;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: rgba(1, 42, 48, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 14px rgba(2, 53, 60, 0.18);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, transform 0.15s ease;
}

.directory-event-row:hover {
    background: rgba(1, 42, 48, 0.72);
}

.directory-event-row:active {
    transform: scale(0.99);
}

.directory-event-row-thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    display: block;
}

.directory-event-row-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.25;
    margin-bottom: 2px;
}

.directory-event-row-church {
    font-size: 12px;
    font-weight: 600;
    color: #fde68a;
    margin-bottom: 3px;
}

.directory-event-row-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.35;
}

.directory-event-row-chevron {
    font-size: 22px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.directory-header {
    background: linear-gradient(135deg, var(--color-teal-deep) 0%, var(--color-emerald) 70%, var(--color-cyan) 100%);
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.directory-header h2 {
    font-size: 20px;
    color: var(--white);
    margin-bottom: 4px;
    font-weight: 700;
}

.directory-header p {
    color: var(--text-on-dark-muted);
    font-size: 14px;
    margin-bottom: 0;
}

.directory-admin-hint {
    font-size: 12px;
    color: var(--text-on-dark-muted);
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.18);
    line-height: 1.4;
}

.admin-ui {
    display: none !important;
}

body.is-admin .admin-ui {
    display: flex !important;
}

body.is-admin .admin-ui.btn-block,
body.is-admin .admin-ui.btn-danger {
    display: block !important;
}

/* Events sidebar — uses the same active-event list as the map overview. */
.directory-events-scroll.has-single-event {
    justify-content: center;
}

.directory-events-scroll.has-single-event .directory-events-section {
    width: 100%;
}

.directory-event-row {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: hidden;
    text-decoration: none;
}

.directory-event-row.is-selected {
    border-color: rgba(253, 224, 71, 0.9);
    box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.2), 0 6px 18px rgba(2, 53, 60, 0.25);
}

.directory-event-row-select {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.directory-event-row-select:focus-visible,
.directory-event-details-link:focus-visible {
    outline: 2px solid #fde047;
    outline-offset: -2px;
}

.directory-event-row-media {
    position: relative;
    width: 68px;
    height: 68px;
}

.directory-event-row-thumb {
    width: 68px;
    height: 68px;
}

.directory-event-row-logo {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 25px;
    height: 25px;
    border: 2px solid #02353c;
    border-radius: 50%;
    background: var(--white);
    object-fit: cover;
}

.directory-event-row-body {
    min-width: 0;
}

.directory-event-row-badge {
    display: inline-flex;
    margin-bottom: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.directory-event-row-badge.tone-green { background: #15803d; }
.directory-event-row-badge.tone-purple { background: #7c3aed; }
.directory-event-row-badge.tone-orange { background: #ea580c; }
.directory-event-row-badge.tone-blue { background: #2563eb; }
.directory-event-row-badge.tone-teal { background: #0f766e; }
.directory-event-row-badge.tone-slate { background: #475569; }

.directory-event-row-meta {
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.directory-event-row-meta .directory-event-meta-svg {
    width: 13px;
    height: 13px;
    margin-top: 1px;
}

.directory-event-row-countdown {
    display: inline-flex;
    width: fit-content;
    margin: 4px 0;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(110, 231, 183, 0.2);
    color: #bbf7d0;
    font-size: 10px;
    font-weight: 800;
}

.directory-event-row-countdown.is-live {
    background: #15803d;
    color: #fff;
}

.directory-event-details-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
    padding: 7px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #fde68a;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.directory-admin-hint.admin-ui {
    display: none !important;
}

body.is-admin .directory-admin-hint.admin-ui {
    display: block !important;
}

.dashboard.view-directory-only .directory-panel {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.directory-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.directory-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.directory-panel-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform var(--transition), background var(--transition);
}

.directory-panel-toggle:hover,
.directory-panel-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.32);
    outline: 2px solid rgba(255, 255, 255, 0.45);
    outline-offset: 2px;
}

html:not(.mobile-layout) .dashboard.directory-panel-collapsed .directory-panel {
    width: 0;
    max-width: 0;
    min-width: 0;
    opacity: 0;
    pointer-events: none;
    border-left: none;
    overflow: hidden;
}

html:not(.mobile-layout) .dashboard.directory-panel-collapsed .directory-panel-toggle span {
    transform: rotate(180deg);
    display: inline-block;
}

.directory-panel-reopen {
    display: none;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1200;
    min-height: 48px;
    padding: 12px 10px 12px 14px;
    border: none;
    border-radius: 12px 0 0 12px;
    background: linear-gradient(135deg, var(--color-teal-deep), var(--color-emerald));
    color: var(--white);
    font-size: 18px;
    font-weight: 600;
    box-shadow: -4px 0 20px rgba(2, 53, 60, 0.25);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

html:not(.mobile-layout) .directory-panel-reopen:not([hidden]) {
    display: flex;
}

.directory-panel-reopen-label {
    font-size: 11px;
    letter-spacing: 0.02em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.directory-sheet-handle {
    display: none;
}

.directory-full-list--rows {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.directory-full-list--rows .directory-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 1fr) 72px auto;
    gap: 12px 16px;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--slate-200);
    background: var(--white);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 18px;
}

.directory-full-list--rows .directory-row:hover,
.directory-full-list--rows .directory-row:focus-visible {
    background: var(--green-50);
    outline: none;
}

.directory-full-list--rows .directory-row-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--slate-800);
    margin: 0;
}

.directory-full-list--rows .directory-row-meta {
    font-size: 15px;
    color: var(--slate-600);
    margin: 4px 0 0;
}

.directory-full-list--rows .directory-row-pastor {
    font-size: 16px;
    color: var(--slate-600);
    line-height: 1.35;
}

.directory-full-list--rows .directory-row-attendance {
    font-size: 18px;
    font-weight: 700;
    color: var(--slate-800);
    text-align: center;
}

.directory-full-list--rows .directory-row-btn {
    min-height: 48px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--light-border);
    background: var(--white);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
}

.directory-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--light-elevated);
}

.church-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.church-card {
    background: var(--light-surface);
    border: 1px solid var(--light-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.church-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--green-600);
    transform: translateY(-2px);
}

.church-card h3 {
    color: var(--slate-800);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

.church-card-district {
    font-size: 1rem;
    color: var(--slate-600);
    margin-bottom: 8px;
}

.church-card-district strong {
    color: var(--slate-800);
}

.church-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.church-card-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border: 1px solid var(--light-border);
}

.church-badge {
    background: var(--color-mint);
    color: var(--color-teal-deep);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
    border: 1px solid var(--light-border);
}

/* Heart button */
.heart-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: var(--color-teal-deep);
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
    flex-shrink: 0;
}

.heart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(2, 53, 60, 0.25);
}

.heart-btn.active {
    background: var(--color-teal-deep);
    border-color: var(--color-heart-red);
}

.heart-icon {
    width: 20px;
    height: 20px;
    fill: #ffffff;
    transition: fill var(--transition);
}

.heart-btn.active .heart-icon {
    fill: var(--color-heart-red);
}

.heart-count {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    min-width: 14px;
    line-height: 1;
}

.detail-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.detail-title-text h2 {
    margin-top: 4px;
}

/* Reviews */
.reviews-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--light-border);
}

.reviews-heading {
    font-size: 16px;
    color: var(--color-teal-deep);
    margin-bottom: 12px;
    font-weight: 700;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.review-item {
    padding: 12px;
    background: var(--light-elevated);
    border: 1px solid var(--light-border);
    border-radius: var(--radius-sm);
}

.review-item-author {
    font-weight: 700;
    font-size: 13px;
    color: var(--color-teal-deep);
    margin-bottom: 4px;
}

.review-item-text {
    font-size: 14px;
    color: var(--slate-600);
    margin-bottom: 6px;
}

.review-item-date {
    font-size: 11px;
    color: var(--slate-400);
}

.reviews-empty,
.reviews-loading {
    font-size: 13px;
    color: var(--slate-600);
    padding: 12px;
    text-align: center;
    background: var(--light-elevated);
    border-radius: var(--radius-sm);
}

.review-form textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.review-form textarea:focus {
    outline: none;
    border-color: var(--color-emerald);
    box-shadow: 0 0 0 3px rgba(46, 175, 125, 0.15);
}

/* Admin comments modal */
.comments-admin-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.comments-admin-summary {
    font-size: 13px;
    color: var(--slate-600);
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--color-mint);
    border-radius: var(--radius-sm);
    border: 1px solid var(--light-border);
}

.comments-admin-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.church-comments-group {
    border: 1px solid var(--light-border);
    border-radius: var(--radius-md);
    background: var(--light-surface);
    overflow: hidden;
}

.church-comments-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: none;
    background: linear-gradient(135deg, rgba(193, 246, 237, 0.5), rgba(255, 255, 255, 0.9));
    cursor: pointer;
    text-align: left;
    transition: background var(--transition);
}

.church-comments-toggle:hover {
    background: var(--color-mint);
}

.church-comments-toggle .toggle-icon {
    font-size: 11px;
    color: var(--color-teal-deep);
    width: 14px;
    flex-shrink: 0;
}

.group-church-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--color-teal-deep);
    flex: 1;
    min-width: 0;
}

.group-district {
    font-size: 12px;
    color: var(--slate-600);
    padding: 2px 8px;
    background: rgba(2, 53, 60, 0.06);
    border-radius: 20px;
    white-space: nowrap;
}

.comment-count-badge {
    font-size: 12px;
    font-weight: 700;
    color: var(--white);
    background: var(--color-emerald);
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.comment-count-badge.is-unread {
    background: #dc2626;
    min-width: 22px;
    height: 22px;
    font-size: 11px;
}

.church-comments-panel {
    padding: 12px;
    background: var(--light-elevated);
    border-top: 1px solid var(--light-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.church-comments-panel[hidden] {
    display: none;
}

.admin-review-card.is-important {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.review-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-important {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 20px;
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fcd34d;
}

.tag-checklist {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--color-cyan);
    color: var(--color-teal-deep);
}

.tag-done {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--color-forest);
    color: var(--white);
}

.admin-note-field {
    margin-top: 10px;
    margin-bottom: 0;
}

.admin-note-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 56px;
}

.admin-note-input:focus {
    outline: none;
    border-color: var(--color-emerald);
    box-shadow: 0 0 0 3px rgba(46, 175, 125, 0.15);
}

.comments-admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 8px;
    padding-bottom: 24px;
}

.admin-review-card {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--light-border);
    background: var(--light-elevated);
}

.admin-review-card.status-todo {
    border-color: var(--color-cyan);
    background: rgba(193, 246, 237, 0.35);
}

.admin-review-card.status-done {
    border-color: var(--color-forest);
    opacity: 0.85;
}

.admin-review-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.review-church-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--color-teal-deep);
}

.review-status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-open {
    background: var(--color-mint);
    color: var(--color-teal-deep);
}

.badge-todo {
    background: var(--color-cyan);
    color: var(--color-teal-deep);
}

.badge-done {
    background: var(--color-forest);
    color: var(--white);
}

.review-author-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
}

.review-body {
    font-size: 14px;
    color: var(--slate-600);
    margin-bottom: 8px;
    line-height: 1.5;
}

.review-date {
    font-size: 11px;
    color: var(--slate-400);
    display: block;
    margin-bottom: 12px;
}

.admin-review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

.church-card-meta {
    font-size: 13px;
    color: var(--slate-600);
    margin-bottom: 4px;
}

.church-card-meta strong {
    color: var(--slate-800);
    font-weight: 600;
}

.church-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.church-history-view {
    margin-top: 8px;
    color: var(--slate-800);
    line-height: 1.6;
}

.church-history-view p {
    margin: 0 0 12px;
}

.church-history-view p:last-child {
    margin-bottom: 0;
}

.church-history-empty {
    margin: 16px 0 0;
    padding: 20px 16px;
    text-align: center;
    color: var(--slate-600);
    background: var(--light-border-subtle);
    border-radius: var(--radius-sm);
    font-size: 15px;
}

.church-history-form {
    margin-top: 8px;
}

.church-history-form textarea {
    min-height: 220px;
    resize: vertical;
}

.card-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--light-border);
    background: var(--light-elevated);
    color: var(--slate-800);
    transition: background var(--transition), border-color var(--transition);
}

.card-btn:hover {
    background: var(--light-border-subtle);
    border-color: var(--slate-400);
}

.card-btn.primary {
    background: var(--color-teal-deep);
    color: var(--white);
    border-color: var(--color-teal-deep);
}

.card-btn.primary:hover {
    background: var(--color-forest);
    border-color: var(--color-forest);
}

.card-btn.map-focus-active {
    background: var(--color-emerald);
    color: var(--white);
    border-color: var(--color-emerald);
    box-shadow: 0 0 0 2px rgba(46, 175, 125, 0.35);
}

.card-btn.map-focus-active:hover {
    background: var(--color-forest);
    border-color: var(--color-forest);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--slate-600);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 16px;
}

/* FORM (modals) */

.form-field {
    margin-bottom: 14px;
}

.form-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--slate-600);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color var(--transition);
}

.form-field input:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.1);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-field {
    flex: 1;
}

#saveBtn {
    margin-top: 4px;
}

.search-box::placeholder {
    color: var(--slate-400);
}

.top-btn:active {
    transform: scale(0.98);
}

.form-error {
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 12px;
}

/* MODALS */

.modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(45, 106, 79, 0.35);
    backdrop-filter: blur(6px);
}

.modal-dialog {
    position: relative;
    background: var(--light-surface);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 16px 48px rgba(45, 106, 79, 0.18);
    animation: modalIn 0.25s ease;
    border: 1px solid var(--dark-border);
    overflow: hidden;
}

.modal-dialog > h2,
.modal-dialog > .modal-subtitle,
.modal-dialog > form,
.modal-dialog > .about-content,
.modal-dialog > .profile-modal-body,
.modal-dialog > #churchDetailContent,
.modal-dialog > .comments-admin-body {
    padding-left: 32px;
    padding-right: 32px;
}

.modal-dialog > .comments-admin-body {
    padding-top: 20px;
    padding-bottom: 32px;
}

.modal-dialog > h2 {
    padding-top: 28px;
    padding-bottom: 0;
    background: linear-gradient(135deg, var(--color-teal-deep), var(--color-emerald));
    color: var(--white);
    margin: 0;
    padding-bottom: 8px;
    margin-bottom: 0;
}

.modal-dialog > .modal-subtitle {
    background: linear-gradient(135deg, var(--color-emerald), var(--color-cyan));
    color: var(--text-on-dark-muted);
    margin-bottom: 0;
    padding-bottom: 20px;
    padding-top: 4px;
}

.modal-dialog > form {
    padding-top: 24px;
    padding-bottom: 32px;
}

.modal-dialog > .about-content,
.modal-dialog > .profile-modal-body {
    padding-top: 24px;
    padding-bottom: 32px;
}

.modal-dialog > .settings-modal-body {
    padding-left: 32px;
    padding-right: 32px;
    padding-top: 24px;
    padding-bottom: 32px;
}

/* Settings — almost full-screen modal */

.modal-settings {
    padding: 2vh 2vw;
    align-items: center;
    justify-content: center;
}

.modal-dialog-settings {
    width: min(920px, 96vw);
    max-width: 96vw;
    height: min(92vh, 92dvh);
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--color-teal-deep), var(--color-emerald));
    color: var(--white);
    flex-shrink: 0;
}

.settings-modal-header-text {
    min-width: 0;
}

.settings-modal-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--white);
}

.settings-modal-header-sub {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--text-on-dark-muted);
}

.settings-modal-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: background var(--transition), border-color var(--transition), transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.settings-modal-close-btn:hover {
    background: var(--white);
    color: var(--color-teal-deep);
    border-color: var(--white);
}

.settings-modal-close-btn:active {
    transform: scale(0.97);
}

.settings-modal-close-icon {
    font-size: 18px;
    line-height: 1;
    font-weight: 400;
}

.modal-dialog-settings .settings-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 20px;
    padding-bottom: 28px;
}

.modal-dialog > #churchDetailContent {
    padding-top: 24px;
    padding-bottom: 32px;
}

.modal-dialog > .modal-close {
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.65);
    color: var(--text-on-green);
    z-index: 2;
}

.modal-dialog > .modal-close:hover {
    background: rgba(255, 255, 255, 0.9);
}

#churchDetailContent > h2 {
    color: var(--slate-800);
    font-size: 22px;
    margin-bottom: 4px;
}

#churchDetailContent > .church-badge {
    margin-bottom: 8px;
}

.modal-dialog h2 {
    font-size: 22px;
    margin-bottom: 4px;
}

.modal-dialog-lg {
    max-width: 640px;
}

.modal-dialog-scroll {
    max-height: 90vh;
    overflow-y: auto;
}

.modal-subtitle {
    color: var(--slate-600);
    font-size: 14px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--dark-700);
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-on-green);
    transition: background var(--transition);
}

.modal-close:hover {
    background: var(--dark-600);
}

.about-content {
    color: var(--slate-600);
    font-size: 15px;
}

.about-content ul {
    margin: 16px 0;
    padding-left: 20px;
}

.about-content li {
    margin-bottom: 8px;
}

.about-note {
    font-size: 13px;
    color: var(--slate-400);
    margin-top: 16px;
}

.profile-modal-body {
    padding-top: 8px;
}

.profile-info-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--slate-200);
}

.profile-info-item:last-child {
    border-bottom: none;
}

.profile-info-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-info-value {
    font-size: 15px;
    color: var(--slate-800);
    margin-top: 4px;
}

/* Settings & theme */

.settings-section {
    margin-bottom: 20px;
}

.settings-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--slate-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.theme-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    border: 2px solid var(--light-border);
    border-radius: var(--radius-md);
    background: var(--light-elevated);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--slate-800);
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
}

.theme-option:hover {
    border-color: var(--color-emerald);
}

.theme-option.active {
    border-color: var(--color-emerald);
    box-shadow: 0 0 0 3px rgba(46, 175, 125, 0.2);
    background: var(--light-surface);
}

html[data-theme="blue"] .theme-option.active {
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.25);
}

.settings-toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid var(--light-border);
    border-radius: var(--radius-md);
    background: var(--light-elevated);
    cursor: pointer;
    min-height: 56px;
    user-select: none;
}

.settings-toggle input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.settings-toggle-track {
    flex-shrink: 0;
    width: 52px;
    height: 30px;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    transition: background var(--transition);
}

.settings-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
    transition: transform var(--transition);
}

.settings-toggle input:checked + .settings-toggle-track {
    background: #16a34a;
}

.settings-toggle input:checked + .settings-toggle-track::after {
    transform: translateX(22px);
}

.settings-toggle-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--slate-800);
    line-height: 1.35;
}

html.easy-mode .settings-section h3 {
    font-size: 1rem;
    text-transform: none;
    letter-spacing: 0;
}

.theme-swatch {
    width: 100%;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--light-border);
}

.theme-swatch-green {
    background: linear-gradient(135deg, #02353C 0%, #2EAF7D 55%, #3FD0C9 100%);
}

.theme-swatch-blue {
    background: linear-gradient(135deg, #0D47A1 0%, #42A5F5 55%, #64B5F6 100%);
}

.settings-divider {
    border: none;
    border-top: 1px solid var(--light-border);
    margin: 20px 0;
}

.settings-hint {
    font-size: 13px;
    color: var(--slate-600);
    margin-bottom: 12px;
    line-height: 1.45;
}

.settings-section.admin-ui[hidden] {
    display: none !important;
}

.backup-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.backup-loading,
.backup-empty,
.backup-error {
    font-size: 13px;
    color: var(--slate-600);
    padding: 12px;
    background: var(--light-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--light-border);
}

.backup-error {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.backup-card {
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--light-border);
    background: var(--light-elevated);
}

.backup-card.ok {
    border-color: var(--color-emerald);
}

.backup-card.failed {
    border-color: #fecaca;
    background: #fef2f2;
}

.backup-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.backup-card-top strong {
    font-size: 14px;
    color: var(--slate-800);
}

.backup-status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--color-mint);
    color: var(--color-teal-deep);
}

.backup-card.failed .backup-status {
    background: #fee2e2;
    color: #b91c1c;
}

.backup-meta {
    font-size: 12px;
    color: var(--slate-600);
    margin-bottom: 10px;
}

.backup-card.backup-master {
    border-width: 2px;
}

.backup-master-hint {
    margin-top: 0.35rem;
}

.backup-master-hint code {
    font-size: 0.85em;
}

.master-backup-status {
    margin-top: 0.75rem;
}

.master-backup-restore-btn,
.backup-restore-btn {
    width: 100%;
}

/* Visitor reports (admin) — compact */

.settings-section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.settings-section-heading-row h3 {
    margin: 0;
}

.settings-hint-compact {
    margin-bottom: 8px;
    font-size: 11px;
}

.visitor-refresh-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    min-height: 32px;
    font-size: 12px;
}

.visitor-reports-panel {
    margin-top: 4px;
    font-size: 11px;
}

.visitor-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}

.visitor-summary-card {
    background: var(--light-elevated);
    border: 1px solid var(--light-border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    text-align: center;
}

.visitor-summary-card-overall {
    border-color: var(--color-emerald);
    background: rgba(46, 175, 125, 0.08);
}

.visitor-summary-label {
    display: block;
    font-size: 9px;
    font-weight: 600;
    color: var(--slate-600);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.visitor-summary-value {
    font-size: 15px;
    line-height: 1.1;
    color: var(--color-teal-deep);
    font-weight: 700;
}

.visitor-breakdown-line {
    margin: 0 0 4px;
    font-size: 10px;
    color: var(--slate-600);
    line-height: 1.35;
}

.visitor-section-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--slate-700);
    margin-bottom: 4px;
}

.visitor-trend-wrap {
    margin-bottom: 8px;
}

.visitor-trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 48px;
    padding: 4px 2px 0;
    background: var(--light-elevated);
    border: 1px solid var(--light-border);
    border-radius: var(--radius-sm);
}

.visitor-trend-bar {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.visitor-trend-bar-fill {
    width: 100%;
    max-width: 8px;
    margin: 0 auto;
    background: linear-gradient(180deg, var(--color-emerald), var(--color-teal-deep));
    border-radius: 2px 2px 1px 1px;
    min-height: 3px;
}

.visitor-country-details {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
}

.visitor-details {
    border: 1px solid var(--light-border);
    border-radius: var(--radius-sm);
    background: var(--light-elevated);
    overflow: hidden;
}

.visitor-details summary {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--slate-800);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.visitor-details summary::-webkit-details-marker {
    display: none;
}

.visitor-details summary::after {
    content: '+';
    font-size: 12px;
    color: var(--slate-600);
    font-weight: 400;
}

.visitor-details[open] summary::after {
    content: '−';
}

.visitor-details-count {
    font-size: 10px;
    font-weight: 600;
    color: var(--slate-600);
    background: var(--light-border-subtle);
    padding: 1px 6px;
    border-radius: 10px;
}

.visitor-details .visitor-reports-table {
    border-top: 1px solid var(--light-border-subtle);
}

.visitor-reports-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.visitor-reports-table th,
.visitor-reports-table td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--light-border-subtle);
    text-align: left;
}

.visitor-reports-table th {
    font-size: 9px;
    color: var(--slate-600);
    font-weight: 600;
}

.visitor-reports-num {
    text-align: right;
    font-weight: 700;
    width: 48px;
}

.visitor-reports-empty {
    color: var(--slate-600);
    font-size: 10px;
    padding: 6px 8px;
}

.visitor-recent-wrap {
    margin-bottom: 4px;
}

.visitor-recent-scroll {
    max-height: 140px;
    overflow: auto;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-sm);
    background: var(--light-elevated);
    -webkit-overflow-scrolling: touch;
}

.visitor-reports-updated {
    margin: 6px 0 0;
    font-size: 9px;
    color: var(--slate-600);
}

@media (max-width: 520px) {
    .visitor-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Admin console tabs */
.admin-console-tabs {
    display: flex;
    gap: 8px;
    padding: 0 20px 12px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--light-surface);
}

.admin-console-tab {
    border: 1px solid var(--border-subtle);
    background: var(--light-elevated);
    color: var(--slate-700);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-console-tab.active {
    background: linear-gradient(145deg, var(--color-emerald), var(--color-teal-deep));
    color: var(--white);
    border-color: transparent;
}

.admin-console-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.admin-console-tab.active .admin-console-tab-badge {
    background: rgba(255, 255, 255, 0.92);
    color: #b91c1c;
}

.admin-console-body {
    padding-top: 16px;
}

.admin-console-panel[hidden] {
    display: none !important;
}

.support-requests-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: min(58vh, 520px);
    overflow-y: auto;
    padding-right: 4px;
}

.support-request-card {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: var(--light-elevated);
}

.support-request-card.support-status-new {
    border-color: rgba(46, 175, 125, 0.45);
    background: rgba(46, 175, 125, 0.06);
}

.support-request-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.support-request-top strong {
    font-size: 14px;
    line-height: 1.35;
}

.support-request-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--slate-600);
}

.support-request-meta {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--slate-600);
}

.support-request-meta a {
    color: var(--color-emerald);
}

.support-request-message {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.support-request-path {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--slate-600);
}

.support-request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

/* TOAST */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, var(--color-emerald), var(--color-teal-deep));
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(45, 106, 79, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.25);
    z-index: 30000;
    animation: toastIn 0.3s ease;
}

.toast[hidden] {
    display: none;
}

/* MAP MARKER HIGHLIGHT */

.church-marker-highlighted {
    filter: drop-shadow(0 0 8px rgba(46, 175, 125, 0.95));
}

.church-marker-focus-overlay {
    pointer-events: none;
}

.church-marker-highlight-pulse {
    animation: church-marker-pulse 1.5s ease-in-out infinite;
}

@keyframes church-marker-pulse {
    0%, 100% {
        opacity: 0.35;
        stroke-width: 2;
    }

    50% {
        opacity: 0.7;
        stroke-width: 4;
    }
}

/* POPUPS */

.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

html.mobile-layout .leaflet-popup-content-wrapper {
    max-width: calc(100vw - 40px);
}

html.mobile-layout .leaflet-popup-content {
    margin: 12px 14px;
    font-size: 14px;
    line-height: 1.45;
}

.church-popup h3 {
    color: var(--blue-600);
    margin-bottom: 8px;
    font-size: 16px;
}

.church-popup p {
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--slate-600);
}

.details-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 18px;
    background: var(--white);
    color: var(--green-800);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: 2px solid var(--green-600);
    transition: background var(--transition), color var(--transition);
}

.details-btn:hover {
    background: var(--green-50);
    color: var(--green-900);
}

.detail-meta {
    margin: 16px 0;
    font-size: 14px;
    color: var(--slate-600);
}

.detail-meta p {
    margin-bottom: 6px;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.church-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.gallery-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 1px solid var(--slate-200);
    display: block;
    width: 100%;
    padding: 0;
    cursor: pointer;
    background: var(--light-elevated);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
    border-color: var(--color-emerald);
}

.gallery-item:active {
    transform: scale(0.98);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* Photo lightbox */

body.photo-lightbox-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

body.photo-lightbox-open .modal,
body.photo-lightbox-open .mobile-bottom-nav,
body.photo-lightbox-open .mobile-menu-panel,
body.photo-lightbox-open .mobile-sheet-backdrop,
body.photo-lightbox-open .directory-panel {
    visibility: hidden !important;
    pointer-events: none !important;
}

.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.photo-lightbox:not([hidden]) {
    display: flex !important;
}

.photo-lightbox[hidden] {
    display: none !important;
}

.photo-lightbox-close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0));
    right: calc(12px + env(safe-area-inset-right, 0));
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.photo-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.photo-lightbox-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    padding: 56px 12px 48px;
    touch-action: pan-y pinch-zoom;
}

.photo-lightbox-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    user-select: none;
    -webkit-user-drag: none;
}

.photo-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 56px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.photo-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.22);
}

.photo-lightbox-nav[hidden] {
    display: none !important;
}

.photo-lightbox-prev {
    left: calc(8px + env(safe-area-inset-left, 0));
}

.photo-lightbox-next {
    right: calc(8px + env(safe-area-inset-right, 0));
}

.photo-lightbox-counter {
    position: absolute;
    bottom: calc(16px + env(safe-area-inset-bottom, 0));
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 999px;
    pointer-events: none;
}

.detail-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, var(--color-teal-deep), var(--color-emerald));
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.detail-actions-bar .details-btn {
    background: var(--white);
    color: var(--text-on-green);
    border-color: var(--white);
    margin-top: 0;
}

.detail-actions-bar .details-btn-alt {
    display: inline-block;
    padding: 10px 18px;
    background: transparent;
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    font-family: inherit;
}

.detail-actions-bar .details-btn-alt:hover,
.detail-actions-bar .details-btn-alt.active {
    background: var(--white);
    color: var(--text-on-green);
    border-color: var(--white);
}

.user-review-panel {
    margin-top: 16px;
    padding: 16px;
    background: var(--light-elevated);
    border: 1px solid var(--light-border);
    border-radius: var(--radius-md);
}

.user-review-panel[hidden] {
    display: none;
}

.user-review-heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-teal-deep);
    margin-bottom: 12px;
}

/* User review modal */
.review-modal-dialog {
    max-width: 640px;
}

.review-modal-subtitle {
    margin-bottom: 18px;
}

.review-modal-form .label-optional {
    font-weight: 500;
    color: var(--text-muted, #64748B);
    font-size: 0.92em;
}

.review-modal-form .label-required {
    color: #DC2626;
}

.review-modal-form .form-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-teal-deep, #02353C);
    margin-bottom: 8px;
}

.review-church-picker {
    position: relative;
}

.review-church-picker input[type="text"] {
    width: 100%;
    padding-right: 36px;
    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='%2364748B' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.review-church-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    max-height: 220px;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid var(--light-border, #CBD5E1);
    border-radius: var(--radius-md, 10px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}

.review-church-results[hidden] {
    display: none !important;
}

.review-church-results li {
    margin: 0;
}

.review-church-option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 14px;
    color: var(--color-teal-deep, #02353C);
    cursor: pointer;
}

.review-church-option:hover,
.review-church-option:focus-visible {
    background: #ECFDF5;
    outline: none;
}

.review-church-option-meta {
    display: block;
    font-size: 12px;
    color: #64748B;
    margin-top: 2px;
}

.review-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.review-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 78px;
    padding: 10px 8px;
    border: 1px solid #CBD5E1;
    border-radius: 12px;
    background: #fff;
    color: var(--color-teal-deep, #02353C);
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.review-type-card:hover {
    border-color: #86EFAC;
}

.review-type-card.is-selected {
    border-color: #16A34A;
    background: #F0FDF4;
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.25);
}

.review-type-card:focus-visible {
    outline: 2px solid #16A34A;
    outline-offset: 2px;
}

.review-type-icon {
    font-size: 22px;
    line-height: 1;
}

.review-type-label {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.review-rating {
    display: flex;
    gap: 8px;
}

.review-star {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #CBD5E1;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease, transform 0.15s ease;
}

.review-star.is-filled {
    color: #F59E0B;
}

.review-star:hover,
.review-star:focus-visible {
    transform: scale(1.08);
    outline: none;
}

.review-text-wrap {
    position: relative;
}

.review-text-wrap textarea {
    width: 100%;
    min-height: 140px;
    padding-bottom: 28px;
}

.review-char-count {
    position: absolute;
    right: 12px;
    bottom: 10px;
    font-size: 12px;
    color: #94A3B8;
    pointer-events: none;
}

.review-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.review-info-row .form-field {
    margin: 0;
}

.review-privacy-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 0;
    font-size: 13px;
    color: #16A34A;
    font-weight: 600;
}

.review-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
}

.review-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 560px) {
    .review-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .review-info-row {
        grid-template-columns: 1fr;
    }

    .review-modal-actions {
        flex-direction: column-reverse;
    }

    .review-modal-actions .btn-primary,
    .review-modal-actions .btn-secondary {
        width: 100%;
    }
}

.review-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.review-meta-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #F1F5F9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
}

.review-meta-tag.is-rating {
    background: #FEF3C7;
    color: #92400E;
}

.detail-actions-bar .details-btn:hover {
    background: var(--green-50);
    color: #2d6a4f;
    border-color: #b7e4c7;
}

.detail-actions-bar .btn-secondary {
    background: rgba(255, 255, 255, 0.45);
    color: var(--text-on-green);
    border-color: rgba(27, 67, 47, 0.15);
}

.detail-actions-bar .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(27, 67, 47, 0.25);
}

.church-gallery-empty {
    padding: 24px;
    text-align: center;
    background: var(--light-elevated);
    border-radius: var(--radius-md);
    color: var(--slate-600);
    font-size: 14px;
    margin: 16px 0;
    border: 1px dashed var(--light-border);
}

.image-upload-section {
    margin-top: 8px;
}

.field-hint {
    font-size: 12px;
    color: var(--slate-600);
    margin-bottom: 10px;
}

.pastor-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.pastor-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pastor-field-row input {
    flex: 1;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--slate-800);
    background: var(--light-surface);
}

.pastor-field-row input:focus {
    outline: none;
    border-color: var(--color-emerald);
    box-shadow: 0 0 0 3px rgba(63, 208, 201, 0.2);
}

.pastor-field-remove {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-sm);
    background: var(--light-elevated);
    color: var(--slate-600);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.pastor-field-remove:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.pastor-field-remove[hidden] {
    display: none;
}

#addPastorBtn {
    margin-top: 4px;
}

.location-pending-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(234, 179, 8, 0.18);
    color: #a16207;
    margin: 4px 0 8px;
}

.pending-locations-wrap {
    margin-top: 8px;
    max-height: 360px;
    overflow: auto;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-md);
    background: var(--light-surface);
}

.pending-locations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.pending-locations-table th,
.pending-locations-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--light-border-subtle);
    text-align: left;
    vertical-align: middle;
}

.pending-locations-table th {
    background: var(--light-elevated);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.pending-locations-table input {
    width: 100%;
    min-width: 72px;
    padding: 6px 8px;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.church-status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 4px;
}

.church-status-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
}

.church-status-closed {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.church-status-careof {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    text-transform: none;
    font-weight: 600;
}

.church-card.is-closed {
    border-left: 3px solid #dc2626;
}

.church-card.is-closed h3 {
    color: #b91c1c;
}

.detail-title-closed h2 {
    color: #b91c1c;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--slate-200);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item.pending {
    border-color: var(--green-500);
}

.image-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-btn {
    display: inline-block;
    padding: 10px 16px;
    background: var(--green-50);
    color: var(--green-800);
    border: 1px dashed var(--green-600);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.upload-btn:hover {
    background: var(--green-100);
}

/* CLUSTERS */

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background: rgba(21, 128, 61, 0.35) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background: var(--blue-600) !important;
    color: var(--white) !important;
    font-weight: 600;
}

/* PROFILE DROPDOWN */

.profile-menu {
    position: relative;
    width: 100%;
    z-index: 10000;
    margin-bottom: 8px;
}

.profile-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    color: var(--white);
    font-size: 15px;
    font-weight: 500;
}

.profile-name-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.admin-comment-badge {
    position: absolute;
    top: -8px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: var(--white);
    background: #dc2626;
    border: 2px solid var(--color-teal-deep);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.admin-comment-badge[hidden] {
    display: none !important;
}

.profile-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.arrow {
    margin-left: auto;
    font-size: 10px;
    opacity: 0.6;
    transition: transform var(--transition);
}

.profile-btn[aria-expanded="true"] .arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    position: absolute;
    left: 0;
    width: 100%;
    background: var(--color-teal-deep);
    border-radius: var(--radius-sm);
    margin-top: 6px;
    z-index: 10001;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-dark);
    overflow: hidden;
}

.submenu.show {
    display: block;
}

.submenu a {
    display: block;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    padding: 11px 16px;
    font-size: 14px;
    transition: background var(--transition);
}

.submenu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.submenu a#logoutBtn {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #fca5a5;
}

/* SCROLLBAR */

.directory-panel::-webkit-scrollbar,
.directory-full-list::-webkit-scrollbar,
.modal-dialog-scroll::-webkit-scrollbar {
    width: 6px;
}

.directory-panel::-webkit-scrollbar-thumb,
.directory-full-list::-webkit-scrollbar-thumb,
.modal-dialog-scroll::-webkit-scrollbar-thumb {
    background: var(--slate-200);
    border-radius: 3px;
}

/* ANIMATIONS */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* RESPONSIVE */

@media (max-width: 1200px) {
    :root {
        --sidebar-width: 228px;
        --directory-width: 300px;
    }

    .logo-text h2 {
        font-size: 22px;
    }

    .sidebar {
        padding: 20px 16px;
    }

    .content {
        padding: 16px 18px;
    }
}

@media (max-width: 1100px) {
    .directory-panel {
        width: 320px;
        max-width: 320px;
    }
}

/* Desktop: never show mobile chrome when layout class is off */
@media (min-width: 901px) {
    html:not(.mobile-layout) .mobile-bottom-nav,
    html:not(.mobile-layout) .mobile-sheet-backdrop,
    html:not(.mobile-layout) .mobile-menu-panel,
    html:not(.mobile-layout) .directory-sheet-close {
        display: none !important;
    }

    html:not(.mobile-layout) .directory-panel-toggle {
        display: flex;
    }

    html:not(.mobile-layout) .directory-panel {
        position: relative;
        transform: none !important;
        height: auto;
        border-radius: 0;
    }

    html:not(.mobile-layout) body {
        overflow: hidden;
    }
}

/* Mobile layout */

.mobile-bottom-nav,
.mobile-sheet-backdrop,
.mobile-menu-panel,
.directory-sheet-close {
    display: none;
}

@media (max-width: 900px), (max-width: 1024px) and (max-height: 950px) {
    :root {
        --mobile-nav-height: 64px;
    }

    body {
        overflow: auto;
    }

    button,
    input,
    select,
    textarea {
        font-size: 16px;
    }

    .dashboard {
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        min-height: 100dvh;
    }

    .sidebar {
        display: none;
    }

    .content {
        flex: 1;
        padding: 12px 12px 0;
        min-height: 0;
        padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0));
    }

    .map-search-tools {
        gap: 8px;
    }

    .map-top-toolbar-btn {
        padding: 8px 10px;
    }

    .search-box {
        padding: 12px 14px 12px 38px;
        font-size: 16px;
    }

    .top-btn {
        flex: 1;
        justify-content: center;
        padding: 12px 10px;
        min-height: 44px;
    }

    .top-btn span:not([aria-hidden]) {
        display: none;
    }

    .top-btn {
        min-height: 48px;
        min-width: 48px;
        touch-action: manipulation;
    }

    #filterBtn {
        order: 2;
    }

    #myLocationBtn {
        order: 3;
    }

    #filterPanel[hidden] {
        display: none !important;
        pointer-events: none !important;
    }

    .filter-panel-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 3500;
        backdrop-filter: blur(2px);
    }

    .filter-panel-backdrop[hidden] {
        display: none !important;
    }

    .filter-panel:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 3600;
        margin: 0;
        display: flex;
        align-items: flex-end;
        animation: none;
        pointer-events: none;
    }

    .filter-panel-sheet {
        pointer-events: auto;
        width: 100%;
        max-height: 92vh;
        background: var(--light-surface);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
        overflow: auto;
        padding-bottom: env(safe-area-inset-bottom, 12px);
        animation: filterSheetUp 0.28s ease;
    }

    @keyframes filterSheetUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .filter-panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 18px 18px 8px;
        border-bottom: 1px solid var(--light-border-subtle);
        position: sticky;
        top: 0;
        background: var(--light-surface);
        z-index: 1;
    }

    .filter-panel-header h2 {
        margin: 0;
        font-size: 1.35rem;
        font-weight: 700;
        color: var(--slate-800);
    }

    .filter-panel-close {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 48px;
        padding: 8px 14px;
        border: 1px solid var(--light-border);
        border-radius: var(--radius-md);
        background: var(--light-elevated);
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        color: var(--slate-800);
    }

    .filter-panel-close span:first-child {
        font-size: 1.4rem;
        line-height: 1;
    }

    body.filter-sheet-open {
        overflow: hidden;
    }

    .filter-panel-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 18px 24px;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .filter-field {
        min-width: 0;
        width: 100%;
    }

    .filter-actions {
        margin-left: 0;
        width: 100%;
    }

    .filter-actions .btn-primary,
    .filter-actions .btn-secondary {
        flex: 1;
        min-height: 48px;
        font-size: 1rem;
    }

    .map-container {
        border-radius: var(--radius-lg);
        min-height: 0;
        flex: 1;
    }

    .content.view-directory .map-container {
        display: none;
    }

    .directory-full {
        border-radius: var(--radius-lg);
        min-height: 0;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .directory-full-header {
        padding: 18px 16px 14px;
    }

    .directory-full-header h2 {
        font-size: 20px;
    }

    .directory-full-list {
        padding: 14px max(12px, env(safe-area-inset-right, 0)) 14px max(12px, env(safe-area-inset-left, 0));
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

  /* Church list sheet (map view on mobile) */

    .directory-sheet-handle {
        display: block;
        width: 40px;
        height: 5px;
        margin: 10px auto 0;
        border-radius: 999px;
        background: rgba(2, 53, 60, 0.22);
        flex-shrink: 0;
    }

    .directory-panel {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        height: min(82vh, calc(100dvh - var(--mobile-nav-height) - 8px));
        max-height: calc(100dvh - var(--mobile-nav-height) - 8px);
        z-index: 17500;
        border-left: none;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -16px 48px rgba(2, 53, 60, 0.28);
        transform: translateY(105%);
        transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
        padding-bottom: env(safe-area-inset-bottom, 0);
        background: var(--light-elevated);
        isolation: isolate;
        pointer-events: none;
    }

    body.directory-sheet-open .directory-panel {
        transform: translateY(0);
        pointer-events: auto;
    }

    .dashboard.view-directory-only .directory-panel {
        opacity: 0;
        pointer-events: none;
        width: 0;
        overflow: hidden;
    }

    .content.view-directory .directory-panel {
        display: none;
    }

    .directory-sheet-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: none;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        color: var(--white);
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
        flex-shrink: 0;
    }

    .directory-header {
        padding: 16px 16px 14px;
        border-radius: 20px 20px 0 0;
    }

    .directory-panel-head {
        border-radius: 20px 20px 0 0;
        overflow: hidden;
    }

    .directory-panel-tab {
        padding: 14px 12px 12px;
    }

    .directory-panel-tab-label {
        font-size: 14px;
    }

    .directory-panel-tab-meta {
        font-size: 11px;
    }

    .directory-panel-head .directory-header-actions {
        top: 8px;
        right: 8px;
    }

    .directory-event-hero-main {
        grid-template-columns: 1fr;
        padding-top: 36px;
    }

    .directory-event-hero.is-live .directory-event-hero-main {
        padding-top: 40px;
    }

    .directory-event-hero-media {
        width: 100%;
        height: 150px;
        order: -1;
    }

    .directory-event-hero-ordinal {
        font-size: 32px;
    }

    .directory-event-hero-title-rest {
        font-size: 16px;
    }

    .directory-event-hero-actions .directory-event-btn {
        width: 100%;
    }

    .directory-event-row {
        grid-template-columns: 52px minmax(0, 1fr) 20px;
    }

    .directory-events-scroll {
        padding: 12px 12px calc(16px + env(safe-area-inset-bottom, 0));
    }

    .directory-header-top h2 {
        font-size: 18px;
        flex: 1;
        min-width: 0;
    }

    .directory-body {
        padding: 14px max(12px, env(safe-area-inset-right, 0)) 14px max(12px, env(safe-area-inset-left, 0));
        min-width: 0;
        overflow-x: hidden;
    }

    .directory-body .church-list {
        min-width: 0;
        max-width: 100%;
    }

    .directory-header h2 {
        font-size: 20px;
    }

    .directory-header p {
        font-size: 16px;
    }

    .church-card h3 {
        font-size: 18px;
    }

    .church-card-meta {
        font-size: 16px;
        line-height: 1.45;
    }

    .card-btn {
        min-height: 48px;
        font-size: 16px;
        padding: 10px 14px;
        touch-action: manipulation;
        position: relative;
        z-index: 2;
    }

    .church-card-actions {
        position: relative;
        z-index: 2;
    }

    .directory-full-list--cards {
        grid-template-columns: 1fr;
    }

    .directory-full-list--rows {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
    }

    .directory-full-list--rows::before {
        display: none;
    }

    .directory-full-list--rows .directory-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 16px;
        border-radius: var(--radius-lg);
        border: 1px solid var(--light-border);
        box-shadow: var(--shadow-sm);
    }

    .directory-full-list--rows .directory-row-attendance {
        text-align: left;
    }

    .church-card {
        padding: 14px;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .church-card h3 {
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
    }

    .church-card-header {
        min-width: 0;
    }

    .church-card-header h3 {
        flex: 1;
        min-width: 0;
    }

    .church-card-actions {
        flex-direction: column;
    }

    .church-card-actions .card-btn {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .card-btn {
        min-height: 44px;
    }

  /* Bottom navigation */

    .mobile-bottom-nav {
        display: grid;
        grid-template-columns: 1fr 1fr 1.4fr 1fr 1fr;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 17200;
        background: var(--color-teal-deep);
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0));
        padding-left: max(4px, env(safe-area-inset-left, 0));
        padding-right: max(4px, env(safe-area-inset-right, 0));
        box-shadow: 0 -4px 20px rgba(2, 53, 60, 0.2);
    }

    .mobile-nav-item-favorites {
        grid-column: 1;
    }

    .mobile-nav-item-churches {
        grid-column: 2;
    }

    .mobile-nav-item-map {
        grid-column: 3;
    }

    .mobile-nav-item-review {
        grid-column: 4;
    }

    .mobile-nav-item[data-mobile-action="menu"] {
        grid-column: 5;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 52px;
        padding: 4px 2px;
        border: none;
        background: transparent;
        color: rgba(255, 255, 255, 0.72);
        cursor: pointer;
        border-radius: var(--radius-sm);
        font-family: inherit;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.12);
        touch-action: manipulation;
        position: relative;
        z-index: 1;
    }

    .mobile-nav-item.active {
        color: var(--white);
        background: rgba(255, 255, 255, 0.14);
        box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
        border-radius: var(--radius-sm);
    }

    .mobile-nav-item-churches.active,
    .mobile-nav-item-favorites.active {
        color: var(--white);
        background: rgba(255, 255, 255, 0.14);
        box-shadow: inset 0 0 0 2px rgba(46, 175, 125, 0.85);
        border-radius: 10px;
    }

    .mobile-nav-item-map {
        gap: 3px;
        color: rgba(255, 255, 255, 0.82);
    }

    .mobile-nav-item-map.active {
        background: transparent;
        color: var(--white);
    }

    .mobile-nav-map-logo-wrap {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 52px;
        margin-top: -14px;
        transform: scale(0.94);
        transition: transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1);
    }

    .mobile-nav-item-map.active .mobile-nav-map-logo-wrap {
        transform: scale(1.16);
    }

    .mobile-nav-item-map:active .mobile-nav-map-logo-wrap {
        transform: scale(1.06);
    }

    .mobile-nav-item-map.active:active .mobile-nav-map-logo-wrap {
        transform: scale(1.12);
    }

    .mobile-nav-map-glow {
        position: absolute;
        inset: -6px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(46, 175, 125, 0.65) 0%, rgba(46, 175, 125, 0.15) 45%, transparent 72%);
        opacity: 0;
        transform: scale(0.85);
        transition: opacity 0.35s ease, transform 0.35s ease;
        pointer-events: none;
    }

    .mobile-nav-map-ring,
    .mobile-nav-map-logo,
    .mobile-nav-map-logo img,
    .mobile-nav-icon,
    .mobile-nav-label {
        pointer-events: none;
    }

    .mobile-nav-item-map.active .mobile-nav-map-glow {
        opacity: 1;
        animation: mapNavGlowPulse 2.2s ease-in-out infinite;
    }

  @keyframes mapNavGlowPulse {
        0%, 100% {
            transform: scale(0.95);
            opacity: 0.7;
        }

        50% {
            transform: scale(1.08);
            opacity: 1;
        }
    }

    .mobile-nav-map-ring {
        position: absolute;
        inset: -2px;
        border-radius: 50%;
        border: 2px solid transparent;
        border-top-color: rgba(255, 255, 255, 0.95);
        border-right-color: rgba(46, 175, 125, 0.85);
        border-bottom-color: rgba(46, 175, 125, 0.35);
        border-left-color: rgba(255, 255, 255, 0.45);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .mobile-nav-item-map.active .mobile-nav-map-ring {
        opacity: 1;
        animation: mapNavRingSpin 4s linear infinite;
    }

  @keyframes mapNavRingSpin {
        to {
            transform: rotate(360deg);
        }
    }

    .mobile-nav-map-logo {
        position: relative;
        z-index: 1;
        width: 46px;
        height: 46px;
        border-radius: 50%;
        overflow: hidden;
        background: var(--white);
        border: 2px solid rgba(255, 255, 255, 0.75);
        box-shadow: 0 4px 14px rgba(2, 53, 60, 0.32);
        flex-shrink: 0;
        transition:
            border-color 0.35s ease,
            box-shadow 0.35s ease,
            width 0.38s cubic-bezier(0.34, 1.45, 0.64, 1),
            height 0.38s cubic-bezier(0.34, 1.45, 0.64, 1);
    }

    .mobile-nav-item-map.active .mobile-nav-map-logo {
        width: 52px;
        height: 52px;
        border-color: var(--color-emerald);
        box-shadow:
            0 0 0 3px rgba(46, 175, 125, 0.4),
            0 0 22px rgba(46, 175, 125, 0.55),
            0 8px 20px rgba(2, 53, 60, 0.38);
    }

    .mobile-nav-map-logo img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        padding: 3px;
    }

    .mobile-nav-item-map .mobile-nav-label {
        transition: color 0.3s ease, text-shadow 0.35s ease, font-weight 0.2s ease;
    }

    .mobile-nav-item-map.active .mobile-nav-label {
        font-weight: 700;
        color: var(--white);
        text-shadow: 0 0 14px rgba(46, 175, 125, 0.85);
    }

    @media (prefers-reduced-motion: reduce) {
        .mobile-nav-item-map.active .mobile-nav-map-glow,
        .mobile-nav-item-map.active .mobile-nav-map-ring {
            animation: none;
        }

        .mobile-nav-map-logo-wrap,
        .mobile-nav-map-logo {
            transition: none;
        }
    }

    .mobile-nav-icon {
        font-size: 18px;
        line-height: 1;
    }

    .mobile-nav-label {
        font-size: 10px;
        font-weight: 600;
        line-height: 1.2;
    }

  /* Mobile menu */

    .mobile-sheet-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 16800;
        background: rgba(2, 53, 60, 0.45);
        backdrop-filter: blur(3px);
        animation: fadeIn 0.2s ease;
    }

    .mobile-sheet-backdrop[hidden] {
        display: none !important;
    }

    .mobile-menu-panel {
        display: flex;
        flex-direction: column;
        position: fixed;
        left: 0;
        right: 0;
        bottom: var(--mobile-nav-height);
        bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0));
        z-index: 17100;
        max-height: 55vh;
        background: var(--light-surface);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px rgba(2, 53, 60, 0.2);
        animation: slideUpMenu 0.28s ease;
    }

    .mobile-menu-panel[hidden] {
        display: none !important;
    }

    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 16px 12px;
        border-bottom: 1px solid var(--light-border);
    }

    .mobile-menu-header h3 {
        font-size: 18px;
        color: var(--color-teal-deep);
    }

    .mobile-menu-close {
        width: 36px;
        height: 36px;
        border: none;
        border-radius: 50%;
        background: var(--light-elevated);
        color: var(--color-teal-deep);
        font-size: 22px;
        cursor: pointer;
    }

    .mobile-menu-links {
        display: flex;
        flex-direction: column;
        padding: 8px 12px 16px;
        overflow-y: auto;
    }

    .mobile-menu-link {
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 48px;
        padding: 12px 14px;
        border: none;
        background: transparent;
        color: var(--color-teal-deep);
        font-size: 16px;
        font-weight: 600;
        text-align: left;
        border-radius: var(--radius-sm);
        cursor: pointer;
        font-family: inherit;
    }

    .mobile-menu-link:hover,
    .mobile-menu-link:active {
        background: var(--light-elevated);
    }

    .mobile-menu-link-danger {
        color: #b91c1c;
        margin-top: 4px;
        border-top: 1px solid var(--light-border);
    }

    .mobile-menu-link[hidden] {
        display: none !important;
    }

    .mobile-menu-link.admin-only[hidden] {
        display: none !important;
    }

  /* Modals on mobile */

    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-dialog {
        max-width: none;
        width: 100%;
        max-height: 94dvh;
        border-radius: 20px 20px 0 0;
        animation: slideUpMenu 0.28s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #churchDetailModal .modal-dialog {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-settings {
        padding: 1.5vh 1.5vw;
        align-items: center;
    }

    .modal-dialog-settings {
        width: 100%;
        max-width: none;
        height: min(94dvh, 94vh);
        max-height: 94dvh;
        border-radius: 16px;
        animation: modalIn 0.28s ease;
    }

    .settings-modal-header {
        padding: 16px 18px;
    }

    .settings-modal-close-btn {
        min-height: 44px;
    }

    .modal-dialog-settings .settings-modal-body {
        padding-left: 20px;
        padding-right: 20px;
    }

    .modal-dialog-lg {
        max-width: none;
    }

    .modal-dialog > h2,
    .modal-dialog > .modal-subtitle,
    .modal-dialog > form,
    .modal-dialog > .about-content,
    .modal-dialog > .profile-modal-body,
    .modal-dialog > #churchDetailContent,
    .modal-dialog > .comments-admin-body {
        padding-left: 20px;
        padding-right: 20px;
    }

    .modal-dialog > h2 {
        padding-top: 22px;
        font-size: 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .comments-admin-filters {
        grid-template-columns: 1fr;
    }

    .church-comments-toggle {
        flex-wrap: wrap;
        padding: 12px 14px;
    }

    .group-district {
        display: none;
    }

    .admin-review-actions {
        flex-direction: column;
    }

    .admin-review-actions .btn-sm {
        width: 100%;
        min-height: 44px;
    }

    .detail-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .detail-actions-bar .details-btn,
    .detail-actions-bar .details-btn-alt {
        width: 100%;
        text-align: center;
        min-height: 44px;
    }

    .detail-title-row {
        flex-direction: column;
        gap: 10px;
    }

    .heart-btn {
        align-self: flex-start;
    }

    .toast {
        bottom: calc(var(--mobile-nav-height) + 12px + env(safe-area-inset-bottom, 0));
        left: 16px;
        right: 16px;
        transform: none;
        text-align: center;
        max-width: none;
    }

    @keyframes toastIn {
        from {
            opacity: 0;
            transform: translateY(12px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (max-width: 480px) {
    .map-top-toolbar-btn span[aria-hidden="true"] {
        font-size: 18px;
    }

    .church-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .mobile-nav-label {
        font-size: 9px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpMenu {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* In-app browsers (Messenger / Facebook) — JS adds html.mobile-layout when viewport is misleading */

html.mobile-layout {
    --mobile-nav-height: 64px;
    --mobile-map-float-base: calc(var(--mobile-nav-height) + 10px + env(safe-area-inset-bottom, 0));
    --mobile-map-float-step: 44px;
}

html.mobile-layout body {
    overflow-x: hidden;
    overflow-y: auto;
}

html.mobile-layout .dashboard {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 100dvh;
    max-width: 100%;
    overflow-x: hidden;
}

html.mobile-layout .content {
    flex: 1;
    padding: 12px max(12px, env(safe-area-inset-right, 0)) 0 max(12px, env(safe-area-inset-left, 0));
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0));
}

html.mobile-layout .content.view-directory {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

html.mobile-layout .content.view-directory .directory-full {
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg);
}

html.mobile-layout .content.view-directory ~ .directory-panel {
    display: none !important;
}

html.mobile-layout .content.view-directory .map-container {
    display: none !important;
}

html.mobile-layout .map-container {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    touch-action: manipulation;
}

html.mobile-layout .content.intro-panel-minimized:not(.view-directory) .map-container {
    flex: 1 1 auto;
    min-height: 0;
}

html.mobile-layout .map-viewport-stage {
    min-height: 0;
    height: 100%;
}

html.mobile-layout .content.intro-panel-minimized:not(.view-directory) .map-viewport-stage {
    min-height: 0;
}

html.mobile-layout #map.leaflet-container {
    height: 100%;
    width: 100%;
}

html.mobile-layout .leaflet-control-zoom {
    margin-top: calc(8px + env(safe-area-inset-top, 0));
    margin-left: calc(8px + env(safe-area-inset-left, 0));
    border: none;
    box-shadow: var(--shadow-md);
}

html.mobile-layout .leaflet-control-zoom a {
    width: 44px;
    height: 44px;
    line-height: 44px;
    font-size: 22px;
}

html.mobile-layout .leaflet-control-attribution {
    font-size: 10px;
    max-width: 55%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html.mobile-layout .map-markers-toggle {
    bottom: var(--mobile-map-float-base);
    right: max(10px, env(safe-area-inset-right, 0));
    padding: 9px 12px;
    font-size: 12px;
    min-height: 36px;
    min-width: 36px;
    z-index: 17100;
    touch-action: manipulation;
}

html.mobile-layout .map-world-view-btn {
    bottom: calc(var(--mobile-map-float-base) + var(--mobile-map-float-step));
    right: max(10px, env(safe-area-inset-right, 0));
    min-height: 36px;
    min-width: 36px;
    padding: 9px 12px;
    font-size: 12px;
    z-index: 17100;
    touch-action: manipulation;
}

html.mobile-layout .marker-cluster-small div,
html.mobile-layout .marker-cluster-medium div,
html.mobile-layout .marker-cluster-large div {
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -20px;
    line-height: 40px;
    font-size: 14px;
}

html.mobile-layout .sidebar {
    display: none !important;
}

html.mobile-layout .mobile-bottom-nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1.4fr 1fr 1fr;
}

html.mobile-layout .mobile-nav-item-favorites {
    grid-column: 1;
}

html.mobile-layout .mobile-nav-item-churches {
    grid-column: 2;
}

html.mobile-layout .mobile-nav-item-map {
    grid-column: 3;
}

html.mobile-layout .mobile-nav-item-review {
    grid-column: 4;
}

html.mobile-layout .mobile-nav-item[data-mobile-action="menu"] {
    grid-column: 5;
}

html.mobile-layout .directory-sheet-close {
    display: flex !important;
}

html.mobile-layout .directory-panel {
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: min(78vh, calc(100dvh - var(--mobile-nav-height) - 12px));
    z-index: 17500;
    border-left: none;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 40px rgba(2, 53, 60, 0.22);
    transform: translateY(105%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--light-elevated);
    isolation: isolate;
    pointer-events: none;
}

html.mobile-layout.directory-sheet-open .directory-panel,
html.mobile-layout body.directory-sheet-open .directory-panel {
    transform: translateY(0);
    pointer-events: auto;
}

html.mobile-layout .mobile-sheet-backdrop {
    display: block;
}

html.mobile-layout .mobile-sheet-backdrop[hidden] {
    display: none !important;
}

html.mobile-layout .mobile-menu-panel {
    display: flex;
}

html.mobile-layout .mobile-menu-panel[hidden] {
    display: none !important;
}

html.mobile-layout .fbcfi-page-context {
    max-width: 100%;
    box-sizing: border-box;
}

.map-mode-short {
    display: none;
}

html.mobile-layout .map-top-toolbar {
    position: absolute;
    top: max(4px, env(safe-area-inset-top, 0));
    left: 6px;
    right: 6px;
    z-index: 720;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px 36px;
    grid-template-rows: auto auto;
    gap: 5px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(197, 232, 228, 0.92);
    box-shadow: 0 6px 18px rgba(2, 53, 60, 0.14);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: none;
    align-items: center;
}

html.mobile-layout .map-top-toolbar-center {
    grid-column: 1 / -1;
    grid-row: 1;
    display: block;
    width: 100%;
    min-width: 0;
}

html.mobile-layout .map-top-toolbar .map-search-tools {
    display: block;
    width: 100%;
}

html.mobile-layout .map-top-toolbar-left {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    width: 100%;
}

html.mobile-layout .map-top-toolbar-actions {
    grid-column: 2 / -1;
    grid-row: 2;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    width: auto;
}

html.mobile-layout .map-top-toolbar .top-btn,
html.mobile-layout .map-top-toolbar-actions .map-top-toolbar-btn {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
}

html.mobile-layout .map-toolbar-btn-label,
html.mobile-layout .map-mode-long {
    display: none;
}

html.mobile-layout .map-mode-short {
    display: inline;
}

html.mobile-layout .map-search-tools .search-box {
    min-height: 38px;
    height: 38px;
    padding: 0 10px 0 34px;
    font-size: 15px;
    border-radius: 10px;
    box-sizing: border-box;
}

html.mobile-layout .map-top-toolbar .search-wrap {
    width: 100%;
}

html.mobile-layout .map-top-toolbar .map-view-mode-btn {
    min-height: 36px;
    height: 36px;
    flex: 1;
    font-size: 12px;
    padding: 0 8px;
    white-space: nowrap;
}

html.mobile-layout .map-top-toolbar .map-view-mode-toggle {
    display: flex;
    width: 100%;
    gap: 4px;
}

html.mobile-layout .map-container {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
}

html.mobile-layout .map-viewport-stage {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}

html.mobile-layout .content:not(.view-directory):not(.view-events) {
    padding: 0 0 calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0));
}

html.mobile-layout .content-intro-anchor {
    display: none !important;
}

html.mobile-layout .mobile-map-happening-chip,
html.mobile-layout .mobile-map-events-btn {
    display: inline-flex;
    position: absolute;
    z-index: 17150;
    touch-action: manipulation;
}

.mobile-map-happening-chip,
.mobile-map-events-btn {
    display: none;
}

html.mobile-layout .mobile-map-events-btn {
    left: max(10px, env(safe-area-inset-left, 0));
    right: auto;
    bottom: var(--mobile-map-float-base);
    align-items: center;
    gap: 4px;
    padding: 7px 11px;
    min-height: 36px;
    border: 1px solid rgba(197, 232, 228, 0.95);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 14px rgba(2, 53, 60, 0.14);
    color: var(--color-teal-deep);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

html.mobile-layout .mobile-map-happening-chip {
    right: max(10px, env(safe-area-inset-right, 0));
    left: auto;
    bottom: calc(var(--mobile-map-float-base) + var(--mobile-map-float-step) * 2);
    transform: none;
    align-items: center;
    gap: 5px;
    max-width: min(180px, calc(100% - 120px));
    padding: 7px 11px 7px 9px;
    min-height: 36px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 14px rgba(2, 53, 60, 0.14);
    color: var(--color-teal-deep);
    font-size: 11px;
    font-weight: 700;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
}

html.mobile-layout .mobile-map-happening-chip.is-custom-position {
    right: auto;
    bottom: auto;
}

html.mobile-layout .mobile-map-happening-chip.is-dragging {
    cursor: grabbing;
    touch-action: none;
    box-shadow: 0 8px 22px rgba(2, 53, 60, 0.22);
    z-index: 17160;
}

html.mobile-layout .mobile-map-happening-chip-icon {
    font-size: 15px;
}

html.mobile-layout .mobile-map-happening-chip-arrow {
    font-size: 16px;
    line-height: 1;
    opacity: 0.7;
}

html.mobile-layout .mobile-events-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: min(88vh, calc(100dvh - var(--mobile-nav-height) - 8px));
    z-index: 17600;
    border-radius: 20px 20px 0 0;
    background: var(--light-elevated);
    box-shadow: 0 -12px 40px rgba(2, 53, 60, 0.22);
    transform: translateY(105%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

html.mobile-layout body.mobile-events-sheet-open .mobile-events-sheet {
    transform: translateY(0);
}

html.mobile-layout .mobile-events-sheet[hidden] {
    display: none !important;
}

html.mobile-layout .mobile-events-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--light-border);
}

html.mobile-layout .mobile-events-sheet-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--color-teal-deep);
}

html.mobile-layout .mobile-events-sheet-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--light-surface);
    color: var(--slate-600);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

html.mobile-layout .mobile-events-sheet-body {
    flex: 1;
    overflow: auto;
    padding: 12px 12px 16px;
    -webkit-overflow-scrolling: touch;
}

html.mobile-layout .mobile-events-group + .mobile-events-group {
    margin-top: 14px;
}

html.mobile-layout .mobile-events-group-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 800;
    color: #7c3aed;
}

html.mobile-layout .mobile-events-group-title.is-live {
    color: #15803d;
}

html.mobile-layout .mobile-events-group-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

html.mobile-layout .mobile-event-card {
    border-radius: 14px;
    overflow: hidden;
    background: var(--light-surface);
    border: 1px solid var(--light-border);
    box-shadow: var(--shadow-sm);
}

html.mobile-layout .mobile-event-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0f172a;
}

html.mobile-layout .mobile-event-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

html.mobile-layout .mobile-event-card-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

html.mobile-layout .mobile-event-card-type {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
    background: rgba(2, 53, 60, 0.82);
}

html.mobile-layout .mobile-event-card.tone-green .mobile-event-card-type { background: linear-gradient(135deg, #15803d, #16a34a); }
html.mobile-layout .mobile-event-card.tone-purple .mobile-event-card-type { background: linear-gradient(135deg, #7c3aed, #9333ea); }
html.mobile-layout .mobile-event-card.tone-orange .mobile-event-card-type { background: linear-gradient(135deg, #ea580c, #f97316); }
html.mobile-layout .mobile-event-card.tone-blue .mobile-event-card-type { background: linear-gradient(135deg, #2563eb, #3b82f6); }
html.mobile-layout .mobile-event-card.tone-teal .mobile-event-card-type { background: linear-gradient(135deg, #0f766e, #14b8a6); }

html.mobile-layout .mobile-event-card-status.is-live {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background: #15803d;
}

html.mobile-layout .mobile-event-card-body {
    padding: 12px;
}

html.mobile-layout .mobile-event-card-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--color-teal-deep);
    text-transform: uppercase;
}

html.mobile-layout .mobile-event-card-ordinal {
    font-family: 'Segoe Script', 'Brush Script MT', cursive;
    font-size: 22px;
    font-weight: 400;
    text-transform: none;
    color: #15803d;
}

html.mobile-layout .mobile-event-card-church {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--slate-700);
}

html.mobile-layout .mobile-event-card-when {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--slate-600);
}

html.mobile-layout .mobile-event-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

html.mobile-layout .mobile-event-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
}

html.mobile-layout .mobile-event-btn-primary {
    color: #fff;
    border: none;
}

html.mobile-layout .mobile-event-card.tone-green .mobile-event-btn-primary { background: linear-gradient(135deg, #15803d, #16a34a); }
html.mobile-layout .mobile-event-card.tone-purple .mobile-event-btn-primary { background: linear-gradient(135deg, #7c3aed, #9333ea); }
html.mobile-layout .mobile-event-card.tone-orange .mobile-event-btn-primary { background: linear-gradient(135deg, #ea580c, #f97316); }
html.mobile-layout .mobile-event-card.tone-blue .mobile-event-btn-primary { background: linear-gradient(135deg, #2563eb, #3b82f6); }
html.mobile-layout .mobile-event-card.tone-teal .mobile-event-btn-primary { background: linear-gradient(135deg, #0f766e, #14b8a6); }
html.mobile-layout .mobile-event-card:not([class*="tone-"]) .mobile-event-btn-primary,
html.mobile-layout .mobile-event-card.tone-slate .mobile-event-btn-primary { background: linear-gradient(135deg, #475569, #64748b); }

html.mobile-layout .mobile-event-btn-secondary {
    background: var(--light-surface);
    color: var(--color-teal-deep);
    border: 1px solid var(--light-border);
}

html.mobile-layout .mobile-events-empty {
    text-align: center;
    padding: 24px 12px;
}

html.mobile-layout .mobile-events-empty-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--color-teal-deep);
    margin-bottom: 6px;
}

html.mobile-layout .mobile-events-empty-text {
    font-size: 14px;
    color: var(--slate-600);
    margin-bottom: 12px;
}

html.mobile-layout .modal {
    padding: 0;
    align-items: flex-end;
}

html.mobile-layout .modal-settings {
    padding: 1vh 1vw 0;
    align-items: flex-end;
}

html.mobile-layout .modal-dialog {
    max-width: none;
    width: 100%;
    max-height: 94dvh;
    border-radius: 20px 20px 0 0;
}

html.mobile-layout .modal-dialog-settings {
    max-height: 96dvh;
    height: 96dvh;
    border-radius: 18px 18px 0 0;
}

/* ─── Global Presence (compact stats) ─── */

.content-intro-anchor {
    position: relative;
    margin-bottom: 12px;
}

.map-container .content-intro-anchor {
    margin-bottom: 0;
    flex-shrink: 0;
    z-index: 620;
}

.map-container .content-intro-anchor:not(.is-minimized) {
    border-bottom: 1px solid var(--light-border);
    background: transparent;
}

.map-container .content-intro-anchor.is-minimized {
    border-bottom: none;
    background: transparent;
}

.map-container .content-intro-anchor.is-minimized .content-intro-rail {
    top: 0;
}

.content.view-directory .content-intro-anchor {
    display: none !important;
}

.content-intro-frame {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-width: 0;
}

.content-intro-shell[hidden] {
    display: none !important;
}

.content-intro-shell {
    flex: 1;
    min-width: 0;
}

.content-intro-rail {
    flex: 0 0 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    padding: 0;
    border: 1px solid var(--light-border);
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    background: var(--light-surface);
    color: var(--slate-500);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-family: inherit;
    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        box-shadow var(--transition);
}

.content-intro-anchor.is-minimized {
    margin-bottom: 0;
    height: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 620;
}

.content-intro-anchor.is-minimized .content-intro-frame {
    height: 0;
    overflow: visible;
}

.content-intro-anchor.is-minimized .content-intro-rail {
    position: absolute;
    left: 0;
    top: 10px;
    flex: none;
    align-self: auto;
    width: 30px;
    min-height: 88px;
    height: auto;
    padding: 10px 5px;
    border: 1px solid var(--light-border);
    border-left: none;
    border-radius: 0 10px 10px 0;
    box-shadow: 2px 1px 8px rgba(2, 53, 60, 0.1);
    pointer-events: auto;
    color: var(--color-teal-deep);
}

.content-intro-anchor.is-minimized .edge-tab-expand {
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    height: auto;
}

.content-intro-anchor.is-minimized .edge-tab-label {
    display: block;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.15;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: inherit;
}

.content-intro-rail:hover {
    background: var(--green-50);
    border-color: rgba(2, 53, 60, 0.12);
    color: var(--color-teal-deep);
}

.content-intro-rail:active {
    background: var(--green-100, #ecfdf5);
}

.content-intro-rail:focus-visible {
    outline: 2px solid var(--color-teal-deep);
    outline-offset: 2px;
    z-index: 1;
}

.edge-tab-minimize {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    transition: background var(--transition);
}

.content-intro-rail:hover .edge-tab-minimize {
    background: rgba(2, 53, 60, 0.06);
}

.edge-tab-minimize[hidden] {
    display: none !important;
}

.edge-tab-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.edge-tab-expand[hidden] {
    display: none !important;
}

.edge-tab-icon {
    display: block;
    flex-shrink: 0;
}

.edge-tab-icon-chevron {
    opacity: 0.9;
}

.edge-tab-label {
    display: none;
}

.content-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
}

#contentIntro .global-presence {
    display: none !important;
}

.map-global-presence {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 610;
    pointer-events: none;
    max-width: min(520px, calc(100% - 24px));
}

.map-global-presence-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border-radius: var(--radius-lg);
    background: rgba(2, 53, 60, 0.92);
    border: 2px solid rgba(46, 175, 125, 0.42);
    box-shadow: 0 10px 28px rgba(2, 53, 60, 0.35);
    backdrop-filter: blur(8px);
}

.map-global-presence .map-global-presence-stat.presence-stat-card {
    background: linear-gradient(165deg, #f4fbf9 0%, #e8faf8 100%);
    border: 1px solid rgba(197, 232, 228, 0.85);
    border-radius: var(--radius-sm);
    min-height: 68px;
    padding: 8px 4px;
    gap: 4px;
}

.map-global-presence-stat:not(:last-child) {
    border-right: none;
}

.map-global-presence .presence-stat-icon {
    font-size: 15px;
    filter: none;
}

.map-global-presence .presence-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-teal-deep);
}

.map-global-presence .presence-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--slate-600);
}

.content.view-directory .map-global-presence,
.content.view-events .map-global-presence {
    display: none !important;
}

html.mobile-layout .map-global-presence {
    left: max(8px, env(safe-area-inset-left, 0));
    bottom: calc(8px + env(safe-area-inset-bottom, 0));
    max-width: calc(100% - 16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease;
}

html.mobile-layout .map-global-presence.is-flash-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    left: 50%;
    right: auto;
    bottom: calc(var(--mobile-map-float-base) + 42px);
    max-width: calc(100% - 20px);
    pointer-events: auto;
}

html.mobile-layout .map-global-presence-track {
    padding: 8px 4px;
}

html.mobile-layout .map-global-presence .presence-stat-value {
    font-size: 18px;
}

html.mobile-layout .map-global-presence .presence-stat-label {
    font-size: 9px;
}

html.mobile-layout .map-global-presence .presence-stat-icon {
    font-size: 13px;
}

.content-intro-frame .fbcfi-intro {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.content.view-directory .content-intro {
    display: none;
}

.fbcfi-intro {
    background: var(--light-surface);
    border: 1px solid var(--light-border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.fbcfi-intro-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-teal-deep);
    line-height: 1.35;
    margin-bottom: 6px;
}

.fbcfi-intro-text {
    font-size: 13px;
    color: var(--slate-600);
    line-height: 1.5;
    margin-bottom: 12px;
}

.fbcfi-intro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.global-presence {
    padding: 10px 12px 12px;
    background: var(--light-surface);
    border: 1px solid var(--light-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.global-presence-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.global-presence-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-600);
    margin: 0;
    line-height: 1.2;
}

.global-presence-body {
    min-width: 0;
}

.global-presence-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    flex: 1;
}

.presence-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    background: linear-gradient(165deg, var(--light-elevated) 0%, var(--green-50) 100%);
    border: 1px solid var(--light-border-subtle);
    text-align: center;
    min-height: 72px;
}

.presence-stat-icon {
    font-size: 16px;
    line-height: 1;
}

.presence-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-teal-deep);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.presence-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--slate-600);
    line-height: 1.2;
}

html.mobile-layout .content-intro-anchor:not(.is-minimized) .content-intro-shell {
    max-height: min(38vh, 280px);
    overflow: auto;
}

html.mobile-layout .content-intro {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

html.mobile-layout .fbcfi-intro {
    padding: 12px;
}

html.mobile-layout .fbcfi-intro-title {
    font-size: 13px;
}

html.mobile-layout .fbcfi-intro-text {
    font-size: 11px;
    margin-bottom: 10px;
    line-height: 1.4;
}

html.mobile-layout .fbcfi-intro-actions .btn-sm {
    padding: 8px 10px;
    font-size: 11px;
}

html.mobile-layout .global-presence {
    padding: 10px 8px;
}

html.mobile-layout .content-intro-rail {
    flex-basis: 32px;
}

html.mobile-layout .map-container .content-intro-anchor.is-minimized .content-intro-rail {
    width: 28px;
    min-height: 72px;
    padding: 8px 4px;
    top: 0;
}

html.mobile-layout .edge-tab-minimize {
    width: 24px;
    height: 24px;
}

html.mobile-layout .global-presence-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

html.mobile-layout .presence-stat-card {
    min-height: 64px;
    padding: 6px 4px;
}

html.mobile-layout .presence-stat-value {
    font-size: 17px;
}

html.mobile-layout .presence-stat-label {
    font-size: 9px;
}

/* ─── Globe View (3D) ─────────────────────────────────────────────────────── */

.map-view-mode-toggle {
    display: inline-flex;
    gap: 4px;
    flex-shrink: 0;
    padding: 4px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
}

.map-view-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #94A3B8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.map-view-mode-btn:hover {
    color: #F8FAFC;
}

.map-view-mode-btn.active,
.map-view-mode-btn[aria-selected="true"] {
    background: linear-gradient(135deg, #15803D, #10B981);
    color: #F8FAFC;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

.map-view-mode-btn:focus-visible {
    outline: 2px solid #10B981;
    outline-offset: 2px;
}

.map-container.is-globe-mode {
    background: #020617;
    border-color: rgba(16, 185, 129, 0.2);
}

.map-container.is-view-transitioning #globeViewRoot,
.map-container.is-view-transitioning .leaflet-map-layer {
    transition: opacity 0.32s ease;
}

.map-container.is-view-transitioning.is-globe-mode .leaflet-map-layer {
    opacity: 0;
}

.map-container.is-view-transitioning:not(.is-globe-mode) #globeViewRoot {
    opacity: 0;
}

.map-container:not(.is-globe-mode) #globeViewRoot {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.map-container.is-globe-mode .leaflet-map-layer {
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: 0;
}

.map-container:not(.is-globe-mode) .leaflet-map-layer {
    visibility: visible !important;
    pointer-events: auto !important;
    opacity: 1 !important;
}

.map-container.is-globe-mode .map-layer-control {
    opacity: 0;
    pointer-events: none;
}

.globe-view-root {
    z-index: 5;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.45), transparent),
        radial-gradient(1px 1px at 80% 30%, rgba(255, 255, 255, 0.35), transparent),
        radial-gradient(1px 1px at 40% 70%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 65% 85%, rgba(255, 255, 255, 0.25), transparent),
        #020617;
}

.globe-view-root[hidden] {
    display: none !important;
}

.globe-view-mount {
    flex: 1;
    min-height: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
    touch-action: none;
    z-index: 2;
}

.globe-view-root.is-church-card-open .globe-view-mount {
    z-index: 1;
}

.globe-view-root.is-church-card-open::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 18;
    background: rgba(2, 6, 23, 0.45);
    pointer-events: none;
}

.globe-church-pin-selected {
    filter:
        drop-shadow(0 0 10px rgba(250, 204, 21, 0.7))
        drop-shadow(0 3px 8px rgba(0, 0, 0, 0.55));
    z-index: 10;
}

.globe-view-mount canvas {
    display: block;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
}

.globe-toolbar {
    position: absolute;
    top: 56px;
    right: 12px;
    z-index: 11;
    display: flex;
    gap: 8px;
}

.globe-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(15, 23, 42, 0.92);
    color: #F8FAFC;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
}

.globe-tool-btn:hover {
    border-color: rgba(16, 185, 129, 0.65);
    background: rgba(21, 128, 61, 0.25);
}

.globe-tool-btn[aria-pressed="true"] {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.22);
}

.globe-tool-btn:focus-visible {
    outline: 2px solid #10B981;
    outline-offset: 2px;
}

.globe-church-pin {
    width: 28px;
    height: 28px;
    transform: translate(-50%, -100%) scale(var(--globe-pin-scale, 1));
    pointer-events: auto;
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
    transition: opacity 0.18s ease, transform 0.18s ease, filter 0.15s ease;
    z-index: 8;
}

.globe-church-pin img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.globe-church-pin:hover {
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55));
    transform: translate(-50%, -100%) scale(calc(var(--globe-pin-scale, 1) * 1.12));
}

.globe-country-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 6px 10px;
    border: none;
    background: transparent;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    text-align: center;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    z-index: 24;
    transition: opacity 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.globe-country-label:focus-visible {
    outline: 2px solid #10B981;
    outline-offset: 4px;
    border-radius: 8px;
}

.globe-country-label:hover .globe-country-label-name {
    color: #ECFDF5;
}

.globe-country-label-name {
    display: block;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.1;
    color: #FFFFFF;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow:
        0 0 4px rgba(0, 0, 0, 0.95),
        0 1px 2px rgba(0, 0, 0, 0.92),
        0 2px 10px rgba(0, 0, 0, 0.72),
        0 0 18px rgba(0, 0, 0, 0.45);
}

.globe-country-label-count {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    color: #F1F5F9;
    white-space: nowrap;
    text-shadow:
        0 0 3px rgba(0, 0, 0, 0.95),
        0 1px 3px rgba(0, 0, 0, 0.88),
        0 2px 8px rgba(0, 0, 0, 0.65);
}

.globe-country-label.tier-xl .globe-country-label-name {
    font-size: clamp(22px, 2.8vw, 32px);
}

.globe-country-label.tier-xl .globe-country-label-count {
    font-size: clamp(16px, 2vw, 22px);
}

.globe-country-label.tier-lg .globe-country-label-name {
    font-size: clamp(19px, 2.4vw, 26px);
}

.globe-country-label.tier-lg .globe-country-label-count {
    font-size: clamp(15px, 1.8vw, 20px);
}

.globe-country-label.tier-md .globe-country-label-name {
    font-size: clamp(17px, 2.1vw, 22px);
}

.globe-country-label.tier-md .globe-country-label-count {
    font-size: clamp(14px, 1.6vw, 18px);
}

.globe-country-label.tier-sm .globe-country-label-name {
    font-size: clamp(15px, 1.8vw, 19px);
}

.globe-country-label.tier-sm .globe-country-label-count {
    font-size: clamp(13px, 1.4vw, 16px);
}

html.mobile-layout .globe-country-label-name {
    letter-spacing: 0.05em;
}

html.mobile-layout .globe-country-label.tier-xl .globe-country-label-name {
    font-size: 20px;
}

html.mobile-layout .globe-country-label.tier-xl .globe-country-label-count {
    font-size: 15px;
}

/* Globe overview callouts (leader lines + external labels) */
.globe-callout-overlay {
    position: absolute;
    inset: 0;
    z-index: 14;
    pointer-events: none;
    overflow: hidden;
}

.globe-callout-overlay[hidden] {
    display: none !important;
}

.globe-callout-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.globe-callout-lines line {
    stroke: rgba(255, 255, 255, 0.82);
    stroke-width: 1.25;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.35));
    transition: opacity 0.25s ease;
}

.globe-callout-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.globe-callout-label {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    text-align: left;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    transform-origin: center center;
    transition: opacity 0.28s ease, transform 0.28s ease;
    -webkit-tap-highlight-color: transparent;
}

.globe-callout-label:focus-visible {
    outline: 2px solid #10B981;
    outline-offset: 4px;
    border-radius: 6px;
}

.globe-callout-label-name {
    display: block;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.1;
    color: #FFFFFF;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow:
        0 0 6px rgba(0, 0, 0, 0.95),
        0 2px 8px rgba(0, 0, 0, 0.75),
        0 0 20px rgba(0, 0, 0, 0.5);
}

.globe-callout-label-count {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    color: #E2E8F0;
    white-space: nowrap;
    text-shadow:
        0 0 4px rgba(0, 0, 0, 0.92),
        0 1px 6px rgba(0, 0, 0, 0.7);
}

.globe-callout-label.tier-xl .globe-callout-label-name {
    font-size: clamp(24px, 3.2vw, 36px);
    letter-spacing: 0.12em;
    text-shadow:
        0 0 8px rgba(0, 0, 0, 0.95),
        0 0 16px rgba(16, 185, 129, 0.45),
        0 2px 12px rgba(0, 0, 0, 0.8);
}

.globe-callout-label.tier-xl .globe-callout-label-count {
    font-size: clamp(17px, 2.2vw, 24px);
    font-weight: 700;
}

.globe-callout-label.tier-lg .globe-callout-label-name {
    font-size: clamp(20px, 2.6vw, 28px);
}

.globe-callout-label.tier-lg .globe-callout-label-count {
    font-size: clamp(15px, 1.9vw, 20px);
}

.globe-callout-label.tier-md .globe-callout-label-name {
    font-size: clamp(17px, 2.1vw, 22px);
}

.globe-callout-label.tier-md .globe-callout-label-count {
    font-size: clamp(14px, 1.6vw, 18px);
}

.globe-callout-label.tier-sm .globe-callout-label-name {
    font-size: clamp(14px, 1.7vw, 18px);
}

.globe-callout-label.tier-sm .globe-callout-label-count {
    font-size: clamp(12px, 1.4vw, 15px);
}

.globe-country-anchor {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #34D399;
    box-shadow:
        0 0 6px rgba(52, 211, 153, 0.95),
        0 0 14px rgba(16, 185, 129, 0.65),
        0 0 24px rgba(16, 185, 129, 0.35);
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

html.mobile-layout .globe-callout-label.tier-xl .globe-callout-label-name {
    font-size: 22px;
}

html.mobile-layout .globe-callout-label.tier-xl .globe-callout-label-count {
    font-size: 16px;
}

.globe-zoom-hint {
    position: absolute;
    left: 50%;
    bottom: 72px;
    z-index: 12;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(520px, calc(100% - 24px));
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(16, 185, 129, 0.35);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
}

.globe-zoom-hint[hidden] {
    display: none !important;
}

.globe-zoom-hint.is-limit {
    border-color: rgba(251, 191, 36, 0.55);
}

.globe-zoom-hint-text {
    margin: 0;
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #E2E8F0;
    line-height: 1.35;
}

.globe-zoom-hint-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    border: none;
    border-radius: 999px;
    background: #10B981;
    color: #022C22;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.globe-zoom-hint-btn:hover {
    background: #34D399;
}

.globe-zoom-hint-dismiss {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.15);
    color: #CBD5E1;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.globe-zoom-hint-dismiss:hover {
    background: rgba(148, 163, 184, 0.28);
}

.globe-church-card {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 30;
    width: min(92%, 360px);
    max-height: min(70vh, 420px);
    overflow-y: auto;
    padding: 18px 18px 16px;
    border-radius: 18px;
    background: #0F172A;
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    color: #F8FAFC;
    animation: globeCardIn 0.28s ease;
    pointer-events: auto;
    isolation: isolate;
}

@keyframes globeCardIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .globe-church-card {
        animation: none;
    }
}

.globe-card-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #F8FAFC;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.globe-card-title {
    margin: 0 32px 12px 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.globe-card-meta {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: grid;
    gap: 8px;
}

.globe-card-meta li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 13px;
    color: #CBD5E1;
    line-height: 1.4;
}

.globe-card-actions {
    display: flex;
    gap: 8px;
}

.globe-card-btn {
    flex: 1;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: transparent;
    color: #10B981;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.globe-card-btn-primary {
    background: linear-gradient(135deg, #15803D, #10B981);
    border-color: transparent;
    color: #F8FAFC;
}

.globe-card-btn:focus-visible,
.globe-card-close:focus-visible {
    outline: 2px solid #10B981;
    outline-offset: 2px;
}

html.mobile-layout .globe-toolbar {
    top: auto;
    bottom: var(--mobile-map-float-base);
    right: max(10px, env(safe-area-inset-right, 0));
    z-index: 17150;
}

html.mobile-layout .globe-zoom-hint {
    bottom: calc(var(--mobile-map-float-base) + var(--mobile-map-float-step) * 2 + 8px);
    flex-wrap: wrap;
}

html.mobile-layout .globe-church-card {
    bottom: calc(12px + env(safe-area-inset-bottom, 0));
}

html.mobile-layout .globe-view-root.is-church-card-open .globe-church-card {
    bottom: auto;
    top: calc(56px + env(safe-area-inset-top, 0));
    width: min(calc(100% - 24px), 360px);
}

.map-viewport-stage > .leaflet-map-layer {
    z-index: 1;
}

#map.leaflet-container {
    width: 100%;
    height: 100%;
}

/* Event sidebar spotlight and no-event state. */
.directory-events-spotlight {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.directory-events-spotlight-kicker {
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.directory-event-spotlight {
    overflow: hidden;
    border: 1px solid rgba(253, 224, 71, 0.48);
    border-radius: 12px;
    background: linear-gradient(150deg, #02353c, #012b32);
    box-shadow: 0 8px 22px rgba(1, 31, 36, 0.26);
}

.directory-event-spotlight.is-selected {
    border-color: #fde047;
    box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.18), 0 8px 22px rgba(1, 31, 36, 0.26);
}

.directory-event-spotlight-select {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 8px;
    width: 100%;
    padding: 13px 12px 10px;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.directory-event-spotlight-select:focus-visible,
.directory-event-spotlight-actions a:focus-visible,
.directory-events-empty-action:focus-visible {
    outline: 2px solid #fde047;
    outline-offset: -2px;
}

.directory-event-spotlight-copy h3 {
    margin: 5px 0 3px;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.18;
    text-transform: uppercase;
}

.directory-event-spotlight-church {
    margin: 0 0 8px;
    color: #fde047;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
}

.directory-event-spotlight-meta,
.directory-event-spotlight-meta p {
    display: grid;
    gap: 5px;
    margin: 0;
}

.directory-event-spotlight-meta p {
    grid-template-columns: 14px minmax(0, 1fr);
    color: rgba(255, 255, 255, 0.88);
    font-size: 10px;
    line-height: 1.35;
}

.directory-event-spotlight-image {
    width: 88px;
    height: 88px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 10px;
    background: #fff;
    object-fit: cover;
}

.directory-event-spotlight-actions {
    display: grid;
    gap: 7px;
    padding: 0 12px 12px;
}

.directory-event-spotlight-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.directory-event-spotlight-primary {
    justify-content: space-between !important;
    padding: 0 12px;
    color: #152025;
    background: linear-gradient(135deg, #fcd34d, #f59e0b);
}

.directory-event-spotlight-secondary {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.06);
}

.directory-event-spotlight-secondary .directory-event-meta-svg {
    width: 13px;
    color: #fde047;
}

.directory-events-empty {
    text-align: center;
}

.directory-events-empty-card {
    padding: 22px 16px 17px;
    border-radius: 10px;
    color: #17323a;
    background: #fff;
    box-shadow: 0 7px 18px rgba(1, 31, 36, 0.2);
}

.directory-events-empty-card h3 {
    margin: 4px 0 7px;
    color: #102f36;
    font-size: 17px;
    font-weight: 900;
}

.directory-events-empty-card p {
    margin: 0 0 13px;
    color: #35545a;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.directory-events-empty-icon {
    margin: 0;
    font-size: 38px;
}

.directory-events-empty-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    color: #fff;
    background: #148f76;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-decoration: none;
    text-transform: uppercase;
}

@media (max-width: 719px) {
    .directory-event-spotlight-select { grid-template-columns: minmax(0, 1fr) 76px; }
    .directory-event-spotlight-image { width: 76px; height: 76px; }
}
