@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

/* Custom FA icon overrides (Pro icons missing from Free) */
.fa-elephant::before {
    content: "" !important;
    display: inline-block;
    width: 1em;
    height: 1em;
    background: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512'%3E%3Cpath d='M448 32C497.7 32 544 57.6 576 96c32 38.4 64 96 64 192 0 53-43 96-96 96h-32v64c0 17.7-14.3 32-32 32s-32-14.3-32-32v-64h-64v64c0 17.7-14.3 32-32 32s-32-14.3-32-32v-96c-35.3 0-64-28.7-64-64V224c0-17.7-14.3-32-32-32H160c-17.7 0-32 14.3-32 32v64c0 35.3-28.7 64-64 64H32c-17.7 0-32-14.3-32-32s14.3-32 32-32V224c0-70.7 57.3-128 128-128h16c0-35.3 28.7-64 64-64h208zM512 192a32 32 0 1 0 0-64 32 32 0 1 0 0 64z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512'%3E%3Cpath d='M448 32C497.7 32 544 57.6 576 96c32 38.4 64 96 64 192 0 53-43 96-96 96h-32v64c0 17.7-14.3 32-32 32s-32-14.3-32-32v-64h-64v64c0 17.7-14.3 32-32 32s-32-14.3-32-32v-96c-35.3 0-64-28.7-64-64V224c0-17.7-14.3-32-32-32H160c-17.7 0-32 14.3-32 32v64c0 35.3-28.7 64-64 64H32c-17.7 0-32-14.3-32-32s14.3-32 32-32V224c0-70.7 57.3-128 128-128h16c0-35.3 28.7-64 64-64h208zM512 192a32 32 0 1 0 0-64 32 32 0 1 0 0 64z'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    vertical-align: -0.125em;
}

:root {
    /* Brand palette */
    --cerulean: #236f92;
    --midnight: #163145;
    --yellow-green: #80b545;
    --sandy-brown: #e4ae4a;
    --silver: #bababb;
    --ink: #0f1f2f;
    --paper: #f7fafc;

    /* Semantic */
    --brand-primary: var(--cerulean);
    --brand-secondary: var(--midnight);
    --brand-accent: var(--yellow-green);
    --brand-warm: var(--sandy-brown);
    --brand-muted: var(--silver);

    /* Typography */
    --font-display: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    /* Radii & shadows */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-soft: 0 10px 30px rgba(22, 49, 69, 0.12);
    --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.08);
}

html, body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--brand-secondary);
}

a {
    color: var(--brand-primary);
}

.btn-primary {
    background: linear-gradient(120deg, var(--cerulean), var(--midnight));
    border-color: var(--midnight);
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.btn-outline-primary {
    border-color: var(--cerulean);
    color: var(--cerulean);
}

.badge-brand {
    background: var(--brand-accent);
    color: #0e1a0f;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-weight: 600;
}

.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.nav-link.active {
    background: linear-gradient(120deg, var(--cerulean), var(--midnight));
    color: #fff !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--cerulean);
    box-shadow: 0 0 0 0.2rem rgba(35, 111, 146, 0.2);
}

.glass-panel {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* ---------- App surfaces ---------- */
:root {
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: rgba(255, 255, 255, 0.98);
    --surface-muted: rgba(255, 255, 255, 0.70);
    --border-soft: rgba(22, 49, 69, 0.10);
    --shadow-elev: 0 18px 60px rgba(15, 31, 47, 0.10);
}

body {
    background: radial-gradient(1200px 700px at 10% 5%, rgba(35, 111, 146, 0.16), transparent 55%),
                radial-gradient(900px 600px at 85% 10%, rgba(128, 181, 69, 0.14), transparent 55%),
                var(--paper);
}

/* ---------- Top / filter bars ---------- */
.home-topbar {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elev);
}

.home-topbar .input-group-text {
    border: 0;
    background: transparent;
}

.home-topbar .form-control {
    border: 0;
    background: transparent;
}

.home-topbar .form-control:focus {
    box-shadow: none;
}

.home-chip-row {
    background: var(--surface-muted);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 0.35rem 0.5rem;
}

.home-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(35, 111, 146, 0.25);
    background: rgba(35, 111, 146, 0.06);
    color: var(--brand-secondary);
    font-weight: 600;
}

.home-chip:hover {
    background: rgba(35, 111, 146, 0.10);
}

.home-chip .material-icons {
    font-size: 16px;
    line-height: 1;
}

/* Venue tags (detail page) */
.venue-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.venue-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: rgba(22, 49, 69, 0.04);
    color: var(--brand-secondary);
    font-weight: 600;
}

.venue-tag-chip .tag-icon {
    font-size: 14px;
    line-height: 1;
}

.venue-tag-chip .tag-name {
    font-size: 0.85rem;
}

/* ---------- Map shell ---------- */
.map-shell {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-elev);
    border: 1px solid var(--border-soft);
    background: var(--surface-strong);
}


/* ---------- Venues card + list ---------- */
.venues-panel {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-elev);
}

.venues-panel .card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-soft);
}

.venue-list-item {
    padding: 0.85rem 0.9rem;
}

.venue-list-item:hover {
    background: rgba(35, 111, 146, 0.04);
}

.venue-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid rgba(22, 49, 69, 0.10);
    background: rgba(255, 255, 255, 0.7);
}

.venue-title {
    font-weight: 700;
    letter-spacing: 0.1px;
}

.venue-meta {
    color: rgba(15, 31, 47, 0.65);
}

/* Compact icon actions */
.venue-actions {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.venue-actions .btn {
    border-radius: 10px;
}

.venue-actions .btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.venue-actions .btn-icon .material-icons {
    font-size: 18px;
    line-height: 1;
}

.venue-actions .btn-focus {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    color: rgba(22, 49, 69, 0.70);
}

.venue-actions .btn-focus:hover {
    color: var(--brand-primary);
}

.venue-actions .btn-focus .material-icons {
    font-size: 20px;
    line-height: 1;
}

.refresh-button.is-loading .material-icons {
    animation: rc-spin 1s linear infinite;
}

@keyframes rc-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile filter modal */
.filter-modal.card {
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-elev);
    border-radius: var(--radius-lg);
}

/* Offcanvas / accordion refinement */
.offcanvas {
    border-left: 1px solid var(--border-soft);
}

.accordion-button {
    font-family: var(--font-display);
    font-weight: 600;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(35, 111, 146, 0.15);
}

/* Buttons */
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-soft);
    color: var(--brand-secondary);
}

.btn-ghost:hover {
    background: rgba(22, 49, 69, 0.04);
}


/* ---------- Mobile: compact filter bar + floating toggle ---------- */
.mobile-filter-bar {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 0.5rem 0.75rem;
    backdrop-filter: blur(10px);
}

.mobile-filter-bar .filter-input {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-elev);
    padding: 0.35rem 0.5rem;
}

.mobile-filter-bar .filter-trigger {
    width: 52px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}

.mobile-filter-bar .filter-trigger .material-icons {
    font-size: 22px;
    line-height: 1;
}

/* Floating map/list toggle (does not consume layout space) */
.mobile-toggle-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 1050;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 8px;
    box-shadow: var(--shadow-elev);
    display: inline-flex;
    gap: 8px;
}

.toggle-button {
    width: 52px;
    height: 44px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: rgba(22, 49, 69, 0.70);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toggle-button .material-icons {
    font-size: 22px;
    line-height: 1;
}

.toggle-button.active {
    background: rgba(35, 111, 146, 0.10);
    color: var(--brand-primary);
    box-shadow: inset 0 0 0 2px rgba(35, 111, 146, 0.25);
}


/* Ensure the main content doesn't add bottom padding for the floating toggle */
.row.g-4 {
    margin-bottom: 0;
}

/* Reduce venue list panel bottom gap */
.venues-panel .card-body {
    max-height: calc(100dvh - 200px) !important;
}

html, body, .container-fluid {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* ---------- Home layout: reduce bottom gap + restore top spacing ---------- */
/* ---------- Home layout: reduce bottom gap + restore top spacing ---------- */
.home-main {
    padding-top: 0.5rem;
    padding-bottom: 0;
    /* tighter to remove remaining gap */
    min-height: calc(100vh - 110px);
}

/* Ensure the grid itself also has a minimum height to stretch cards */
.home-grid {
    min-height: calc(100vh - 160px);
}

/* Make bootstrap columns stretch so children can be 100% height */
.home-grid > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

/* Only apply flex/height stretch on the Home grid */
.home-grid .map-shell,
.home-grid .venues-panel {
    flex: 1 1 auto;
    height: 100%;
}

/* Map fills its container instead of using a separate vh calc */
#adminMap {
    height: 100%;
    min-height: 520px;
}

@media (max-width: 768px) {
    .home-main {
        min-height: calc(100vh - 90px);
        padding-top: 0.4rem;
    }

    .home-grid {
        min-height: calc(100vh - 130px);
    }

    #adminMap {
        min-height: 380px;
    }
}

/* Let list scroll within the card body without forcing extra page height */
.venues-panel .card-body {
    overflow-y: auto;
    max-height: none !important;
}
/* Match main website navigation color */
.navbar, .navbar.bg-light, .navbar.bg-white {
    background-color: var(--cerulean) !important;
    position: sticky;
    top: 0;
    z-index: 1040;
}

.navbar .nav-link,
.navbar .navbar-brand {
    color: #fff !important;
}

.navbar .nav-link:hover {
    color: rgba(255,255,255,0.85) !important;
}

/* Navbar brand logo */
.navbar .navbar-brand img {
    height: 32px;
    width: auto;
}

/* Prevent nav items leaking out when collapsed on mobile */
@media (max-width: 991.98px) {
    .navbar .navbar-collapse {
        overflow: hidden;
    }

    .navbar .navbar-toggler {
        border-color: rgba(255, 255, 255, 0.4);
    }

    .navbar .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }

    .navbar .navbar-brand img {
        height: 28px;
    }
}
/* VenueDetails map fills the shell height */
.venue-detail-page .map-shell {
    height: clamp(280px, 42vh, 460px);
}

.venue-detail-page #venueDetailMap {
    height: 100%;
}

@media (max-width: 768px) {
    .venue-detail-page .map-shell {
        height: clamp(180px, 28vh, 260px);
    }
}

@media (max-width: 576px) {
    .venue-detail-page .map-shell {
        height: clamp(160px, 25vh, 220px);
    }
}

/* Popup tag icons for map popups */
.popup-tags {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.popup-tag-icon {
    font-size: 14px;
    line-height: 1;
    opacity: 0.9;
}

.popup-tag-icon:hover {
    opacity: 1;
}

.popup-tag-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(15, 31, 47, 0.80);
    background: rgba(22, 49, 69, 0.06);
    border: 1px solid rgba(22, 49, 69, 0.12);
    line-height: 1;
}

/* ---------- Auth layout ---------- */
.auth-layout {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(22, 49, 69, 0.08), rgba(35, 111, 146, 0.08));
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 15%, rgba(128, 181, 69, 0.18), transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(228, 174, 74, 0.18), transparent 40%),
        radial-gradient(circle at 70% 85%, rgba(35, 111, 146, 0.20), transparent 50%);
    pointer-events: none;
}

.auth-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1.5rem;
}

.auth-shell {
    width: min(520px, 92vw);
}

.auth-card {
    padding: 2.25rem;
    text-align: center;
    background: var(--surface-strong);
}

.auth-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: rgba(22, 49, 69, 0.08);
    color: var(--brand-secondary);
    font-weight: 700;
    margin-bottom: 1.2rem;
}

.auth-logo {
    font-family: var(--font-display);
    letter-spacing: 0.4px;
}

.auth-subtitle {
    font-size: 0.85rem;
    opacity: 0.75;
    text-transform: uppercase;
}

.auth-title {
    font-family: var(--font-display);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-copy {
    color: rgba(15, 31, 47, 0.65);
    margin-bottom: 1.5rem;
}

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

.auth-hint {
    margin-top: 1rem;
    color: rgba(15, 31, 47, 0.6);
    font-size: 0.85rem;
}

/* ---------- Planner ---------- */
.planner-layout {
    padding: 1.5rem 1.5rem 2rem;
}

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

.planner-kicker {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brand-primary);
    font-weight: 600;
}

.planner-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.planner-map-shell {
    background: var(--surface-strong);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elev);
    overflow: hidden;
    min-height: 560px;
}

#plannerMap,
#plannerMapShare {
    width: 100%;
    height: 100%;
    min-height: 560px;
}

.planner-list .card-header {
    background: var(--surface);
}

.planner-day-label {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-secondary);
    background: rgba(22, 49, 69, 0.05);
    border-top: 1px solid var(--border-soft);
}

.planner-day-toggle {
    width: 100%;
    border: none;
    background: rgba(22, 49, 69, 0.05);
    border-top: 1px solid var(--border-soft);
    padding: 0.5rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--brand-secondary);
    text-align: left;
}

.planner-day-toggle:hover {
    background: rgba(22, 49, 69, 0.08);
}

.planner-day-map-btn {
    padding: 0.1rem 0.4rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.planner-day-map-btn .material-icons {
    font-size: 16px;
    line-height: 1;
}

.planner-day-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.planner-day-meta .material-icons {
    font-size: 20px;
}

.planner-rest-day {
    padding: 1rem 0.85rem;
    text-align: center;
    color: var(--text-muted);
    background: rgba(22, 49, 69, 0.02);
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.planner-rest-day .material-icons {
    font-size: 24px;
    color: var(--brand-accent);
}

.planner-rest-day input {
    max-width: 400px;
}

.planner-rest-day .btn-link {
    padding: 0.25rem;
    color: var(--text-muted);
    text-decoration: none;
}

.planner-rest-day .btn-link:hover {
    color: var(--brand-primary);
}

.planner-item {
    border: none;
    border-bottom: 1px solid var(--border-soft);
    border-left: 3px solid transparent;
    font-size: 14px;
}

.planner-item .fw-semibold {
    font-size: 14px;
    line-height: 1.3;
}

.planner-item.is-event {
    background: linear-gradient(90deg, rgba(35, 111, 146, 0.08), rgba(35, 111, 146, 0.01));
    border-left-color: var(--brand-primary);
}

.planner-item.is-venue {
    background: var(--surface);
    border-left-color: rgba(22, 49, 69, 0.14);
}

.planner-item-top {
    display: flex;
    gap: 0.75rem;
}

.planner-item-clickable {
    cursor: pointer;
}

.planner-item-kind {
    margin-bottom: 0.15rem;
}

.planner-item-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.planner-item-type-badge .material-icons {
    font-size: 12px;
    line-height: 1;
}

.planner-item-type-badge.is-event {
    background: rgba(35, 111, 146, 0.14);
    color: var(--brand-primary);
}

.planner-item-type-badge.is-venue {
    background: rgba(22, 49, 69, 0.08);
    color: var(--brand-secondary);
}

.planner-item-subline {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    font-size: 13px;
    color: #51606f;
}

.planner-item-subline .material-icons {
    font-size: 14px;
    line-height: 1.1;
    margin-top: 1px;
}

.planner-event-window {
    color: rgba(22, 49, 69, 0.85);
    font-weight: 600;
}


.planner-item-actions {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.planner-item-thumb {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border-soft);
    background: rgba(22, 49, 69, 0.08);
}

.planner-item-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    border-radius: 10px;
    border: 1px dashed rgba(22, 49, 69, 0.25);
    color: rgba(22, 49, 69, 0.7);
    cursor: grab;
    touch-action: none;
}

.planner-item-handle:active {
    cursor: grabbing;
}

.planner-drag-ghost {
    opacity: 0.5;
    background: rgba(35, 111, 146, 0.08);
    border-radius: var(--radius-md);
}

.planner-drag-chosen {
    box-shadow: 0 12px 30px rgba(22, 49, 69, 0.18);
}

.planner-dragging {
    opacity: 0.85;
}

.planner-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.planner-note {
    margin-top: 0.5rem;
}

.planner-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.planner-reorder {
    display: flex;
    gap: 0.35rem;
}

.planner-empty {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--brand-secondary);
}

.planner-share {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: var(--surface);
    margin-bottom: 1rem;
}

.planner-share-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: min(520px, 100%);
}

.planner-share-actions input {
    flex: 1;
    min-width: 220px;
}

.planner-request-card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 1rem;
}

.planner-request-card .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(15, 31, 47, 0.7);
}

.planner-auth-card {
    max-width: 480px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
    background: var(--surface-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-soft);
}


@media (max-width: 991px) {
    .planner-map-shell {
        min-height: auto;
        height: max(380px, 55vh);
    }

    #plannerMap,
    #plannerMapShare {
        min-height: 0;
        height: 100%;
    }
}

/* =============================================
   Mobile optimisations (768px and below)
   ============================================= */
@media (max-width: 768px) {

    /* --- Global heading sizes --- */
    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* --- Planner page --- */
    .planner-layout {
        padding: 0.5rem 0.75rem 0.75rem;
    }

    .planner-header {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .planner-header > div:first-child {
        flex: 1;
        min-width: 0;
    }

    .planner-header h2 {
        font-size: 1.05rem;
        line-height: 1.2;
        margin-bottom: 0 !important;
    }

    .planner-header p {
        display: none;
    }

    .planner-kicker {
        font-size: 0.6rem;
        margin-bottom: 0.1rem;
    }

    .planner-actions {
        gap: 0.25rem;
        flex-wrap: nowrap;
    }

    .planner-actions .btn {
        font-size: 0;
        padding: 0.35rem;
        min-width: 0;
        white-space: nowrap;
    }

    .planner-actions .btn .material-icons {
        font-size: 18px;
    }

    /* Planner share link bar */
    .planner-share {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.6rem;
    }

    .planner-share-actions {
        width: 100%;
    }

    .planner-share-actions input {
        min-width: 0;
        font-size: 0.8rem;
    }

    /* Map height on mobile - shell owns height, map fills it */
    .planner-map-shell {
        min-height: auto;
        height: max(260px, 45vh);
        border-radius: 10px;
    }

    #plannerMap,
    #plannerMapShare {
        min-height: 0;
        height: 100%;
    }

    /* Itinerary list */
    .planner-list .card-header {
        padding: 0.5rem 0.75rem;
    }

    .planner-list .card-header strong {
        font-size: 0.85rem;
    }

    .planner-day-toggle {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .planner-rest-day {
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    .planner-rest-day .material-icons {
        font-size: 20px;
    }

    .planner-day-map-btn {
        padding: 0.05rem 0.3rem;
    }

    .planner-day-map-btn .material-icons {
        font-size: 14px;
    }

    .planner-item-top {
        gap: 0.5rem;
    }

    .planner-item-thumb {
        width: 44px;
        height: 44px;
        border-radius: 8px;
    }

    .planner-item .fw-semibold {
        font-size: 13px;
    }

    .planner-item-subline {
        font-size: 12px;
    }

    .planner-item-actions {
        gap: 0.2rem;
    }

    .planner-item-actions .btn {
        padding: 0.15rem 0.3rem;
    }

    .planner-item-actions .material-icons {
        font-size: 16px;
    }

    .planner-item-handle {
        padding: 0.2rem;
    }

    .planner-item-handle .material-icons {
        font-size: 18px;
    }

    .planner-item-type-badge {
        font-size: 0.6rem;
        padding: 0.04rem 0.35rem;
    }

    .planner-item-type-badge .material-icons {
        font-size: 10px;
    }

    .planner-empty {
        padding: 1.25rem 1rem;
    }

    .planner-empty .material-icons {
        font-size: 28px;
    }

    /* Auth card (sign-in prompt) */
    .planner-auth-card {
        margin: 1rem auto;
        padding: 1.25rem;
    }

    .planner-auth-card h3 {
        font-size: 1.1rem;
    }

    .planner-auth-card p {
        font-size: 0.85rem;
    }

    /* Trip start date row */
    .planner-list .p-3.border-bottom {
        padding: 0.5rem 0.75rem !important;
    }

    .planner-list .p-3.border-bottom .form-label {
        font-size: 0.75rem;
    }

    .planner-list .p-3.border-bottom .form-control-sm {
        font-size: 0.8rem;
    }

    /* Planner popup on map */
    .planner-popup {
        min-width: 180px;
    }

    .planner-popup-head strong {
        font-size: 0.85rem;
    }

    .planner-popup-sub,
    .planner-popup-date {
        font-size: 0.78rem;
    }
}

/* =============================================
   Mobile optimisations (576px and below)
   ============================================= */
@media (max-width: 576px) {

    h2 {
        font-size: 1.1rem;
    }

    h3 {
        font-size: 1rem;
    }

    .planner-layout {
        padding: 0.35rem 0.5rem 0.5rem;
    }

    .planner-header h2 {
        font-size: 0.95rem;
    }

    .planner-kicker {
        display: none;
    }

    .planner-actions .btn {
        padding: 0.3rem;
    }

    .planner-actions .btn .material-icons {
        font-size: 16px;
    }

    .planner-map-shell {
        height: max(220px, 40vh);
    }

    #plannerMap,
    #plannerMapShare {
        min-height: 0;
        height: 100%;
    }

    .planner-item-thumb {
        width: 38px;
        height: 38px;
    }
}
.planner-note-preview {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: rgba(15, 31, 47, 0.7);
}

.planner-note-preview.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.planner-note-toggle {
    padding: 0;
    font-size: 0.8rem;
    text-decoration: none;
}

.planner-popup {
    min-width: 220px;
}

.planner-popup-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}

.planner-popup-type {
    display: inline-flex;
    align-items: center;
    padding: 0.06rem 0.4rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.planner-popup-type.is-event {
    background: rgba(35, 111, 146, 0.14);
    color: var(--brand-primary);
}

.planner-popup-type.is-venue {
    background: rgba(22, 49, 69, 0.08);
    color: var(--brand-secondary);
}

.planner-popup-sub,
.planner-popup-date {
    display: flex;
    align-items: flex-start;
    gap: 0.28rem;
    color: rgba(15, 31, 47, 0.72);
    font-size: 0.82rem;
    line-height: 1.35;
}

.planner-popup-sub .material-icons,
.planner-popup-date .material-icons {
    font-size: 13px;
    line-height: 1.2;
    margin-top: 1px;
}

.rc-toast {
    position: fixed;
    right: 1.25rem;
    bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 12px 24px rgba(15, 33, 45, 0.25);
    z-index: 1055;
    background: #1f3d4f;
    color: #ffffff;
}

.rc-toast-info {
    background: #1f3d4f;
}

.rc-toast-success {
    background: #1b5e3c;
}

.rc-toast-error {
    background: #8c2b2f;
}

.rc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 33, 45, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1050;
}

.rc-modal {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(22, 49, 69, 0.1);
    box-shadow: 0 18px 40px rgba(15, 33, 45, 0.25);
    max-width: 420px;
    width: 100%;
}

.rc-modal-header {
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid #e6edf2;
}

.rc-modal-header h5 {
    font-weight: 600;
    color: #102836;
}

.rc-modal-body {
    padding: 1rem 1.25rem;
    color: #1c2b33;
}

.rc-modal-footer {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ==========================================================================
   DARK MODE
   Aligned with SEO generator (seo.css) dark theme values.
   Uses html[data-bs-theme="dark"] for Bootstrap 5.3 + html[data-theme="dark"]
   for cross-app localStorage parity with the SEO site.
   ========================================================================== */
html[data-bs-theme="dark"] {
    color-scheme: dark;

    /* Brand palette – aligned with SEO generator */
    --cerulean: #3ea8d4;
    --midnight: #b8d8e8;
    --yellow-green: #9ccc65;
    --sandy-brown: #f0c060;
    --silver: #556a7a;
    --ink: #e0e6ec;
    --paper: #0d1b26;

    /* Semantic */
    --brand-primary: #3ea8d4;
    --brand-secondary: #b8d8e8;
    --brand-accent: #9ccc65;
    --brand-warm: #f0c060;
    --brand-muted: #556a7a;

    /* Surfaces – aligned with SEO generator */
    --surface: rgba(20, 34, 48, 0.92);
    --surface-strong: rgba(20, 34, 48, 0.98);
    --surface-muted: rgba(20, 34, 48, 0.70);
    --border-soft: rgba(255, 255, 255, 0.08);

    /* Shadows */
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.20);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.30);
    --shadow-elev: 0 18px 60px rgba(0, 0, 0, 0.25);
}

html[data-bs-theme="dark"] body {
    background: radial-gradient(1200px 700px at 10% 5%, rgba(62, 168, 212, 0.08), transparent 55%),
                radial-gradient(900px 600px at 85% 10%, rgba(156, 204, 101, 0.06), transparent 55%),
                var(--paper);
    color: var(--ink);
}

html[data-bs-theme="dark"] h1,
html[data-bs-theme="dark"] h2,
html[data-bs-theme="dark"] h3,
html[data-bs-theme="dark"] h4,
html[data-bs-theme="dark"] h5,
html[data-bs-theme="dark"] h6 {
    color: #b8d8e8;
}

html[data-bs-theme="dark"] a {
    color: var(--brand-primary);
}

html[data-bs-theme="dark"] .btn-primary {
    background: linear-gradient(120deg, #3ea8d4, #1a6e8e);
    border-color: #1a6e8e;
}

html[data-bs-theme="dark"] .btn-outline-primary {
    border-color: #3ea8d4;
    color: #3ea8d4;
}

html[data-bs-theme="dark"] .glass-panel {
    background: rgba(20, 34, 48, 0.82);
}

html[data-bs-theme="dark"] .venue-thumb {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(20, 34, 48, 0.7);
}

html[data-bs-theme="dark"] .venue-meta {
    color: #8fa3b4;
}

html[data-bs-theme="dark"] .venue-actions .btn-focus {
    color: #8fa3b4;
}

html[data-bs-theme="dark"] .venue-actions .btn-focus:hover {
    color: var(--brand-primary);
}

html[data-bs-theme="dark"] .home-chip {
    border-color: rgba(62, 168, 212, 0.25);
    background: rgba(62, 168, 212, 0.10);
    color: var(--brand-secondary);
}

html[data-bs-theme="dark"] .home-chip:hover {
    background: rgba(62, 168, 212, 0.18);
}

html[data-bs-theme="dark"] .venue-tag-chip {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--brand-secondary);
}

html[data-bs-theme="dark"] .venue-list-item:hover {
    background: rgba(62, 168, 212, 0.08);
}

html[data-bs-theme="dark"] .btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--brand-secondary);
}

html[data-bs-theme="dark"] .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Auth layout dark */
html[data-bs-theme="dark"] .auth-layout {
    background: linear-gradient(135deg, #0a1520, #142230);
}

html[data-bs-theme="dark"] .auth-backdrop {
    background:
        radial-gradient(circle at 15% 15%, rgba(156, 204, 101, 0.08), transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(240, 192, 96, 0.08), transparent 40%),
        radial-gradient(circle at 70% 85%, rgba(62, 168, 212, 0.10), transparent 50%);
}

html[data-bs-theme="dark"] .auth-brand {
    background: rgba(255, 255, 255, 0.06);
    color: var(--brand-secondary);
}

html[data-bs-theme="dark"] .auth-copy {
    color: #8fa3b4;
}

html[data-bs-theme="dark"] .auth-hint {
    color: #8fa3b4;
}

/* Modal dark */
html[data-bs-theme="dark"] .rc-modal {
    background: #142230;
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .rc-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .rc-modal-header h5 {
    color: #b8d8e8;
}

html[data-bs-theme="dark"] .rc-modal-body {
    color: #8fa3b4;
}

/* Planner dark */
html[data-bs-theme="dark"] .planner-day-label,
html[data-bs-theme="dark"] .planner-day-toggle {
    background: rgba(255, 255, 255, 0.03);
    border-top-color: rgba(255, 255, 255, 0.08);
    color: var(--brand-secondary);
}

html[data-bs-theme="dark"] .planner-day-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

html[data-bs-theme="dark"] .planner-item.is-event {
    background: linear-gradient(90deg, rgba(62, 168, 212, 0.10), rgba(62, 168, 212, 0.02));
}

html[data-bs-theme="dark"] .planner-item.is-venue {
    background: var(--surface);
    border-left-color: rgba(255, 255, 255, 0.10);
}

html[data-bs-theme="dark"] .planner-item-subline {
    color: #8fa3b4;
}

html[data-bs-theme="dark"] .planner-event-window {
    color: rgba(224, 230, 236, 0.85);
}

html[data-bs-theme="dark"] .planner-item-thumb {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.06);
}

html[data-bs-theme="dark"] .planner-item-handle {
    border-color: rgba(255, 255, 255, 0.15);
    color: #8fa3b4;
}

html[data-bs-theme="dark"] .planner-drag-ghost {
    background: rgba(62, 168, 212, 0.10);
}

html[data-bs-theme="dark"] .planner-drag-chosen {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.40);
}

html[data-bs-theme="dark"] .planner-rest-day {
    background: rgba(255, 255, 255, 0.02);
}

html[data-bs-theme="dark"] .planner-note-preview {
    color: #8fa3b4;
}

html[data-bs-theme="dark"] .planner-popup-sub,
html[data-bs-theme="dark"] .planner-popup-date {
    color: #8fa3b4;
}

html[data-bs-theme="dark"] .planner-request-card .form-label {
    color: #8fa3b4;
}

html[data-bs-theme="dark"] .popup-tag-more {
    color: rgba(224, 230, 236, 0.80);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Offcanvas / accordion dark */
html[data-bs-theme="dark"] .offcanvas {
    border-left-color: rgba(255, 255, 255, 0.08);
    background: #0d1b26;
}

html[data-bs-theme="dark"] .accordion-button {
    background: var(--surface);
    color: var(--ink);
}

html[data-bs-theme="dark"] .accordion-button::after {
    filter: invert(1) brightness(0.8);
}

html[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    background: rgba(62, 168, 212, 0.08);
    color: var(--brand-primary);
}

html[data-bs-theme="dark"] .accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(62, 168, 212, 0.20);
}

html[data-bs-theme="dark"] .accordion-body {
    background: var(--surface);
    color: var(--ink);
}

/* Card dark */
html[data-bs-theme="dark"] .card {
    background: var(--surface);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Form controls dark */
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
    background-color: #142230;
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--ink);
}

html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-select:focus {
    background-color: #142230;
    border-color: #3ea8d4;
    color: var(--ink);
    box-shadow: 0 0 0 0.2rem rgba(62, 168, 212, 0.20);
}

html[data-bs-theme="dark"] .form-control::placeholder {
    color: #556a7a;
}

html[data-bs-theme="dark"] .input-group-text {
    background-color: #142230;
    border-color: rgba(255, 255, 255, 0.12);
    color: #8fa3b4;
}

/* List group dark */
html[data-bs-theme="dark"] .list-group-item {
    background-color: var(--surface);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--ink);
}

/* Badge dark */
html[data-bs-theme="dark"] .badge-brand {
    background: var(--brand-accent);
    color: #1a2400;
}

/* Text helpers */
html[data-bs-theme="dark"] .text-muted {
    color: #8fa3b4 !important;
}

html[data-bs-theme="dark"] .text-dark {
    color: #e0e6ec !important;
}

html[data-bs-theme="dark"] .border-bottom {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-bs-theme="dark"] .border {
    border-color: rgba(255, 255, 255, 0.08) !important;
}
