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

:root {
    --sidebar-width: 400px;
    --header-height: 96px;
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* White theme - all surfaces use white/light gray backgrounds with dark text */
    --floating-bg: #ffffff;
    --floating-border: #e0e0e0;
    --floating-text: #1a1a1a;
    --floating-text-muted: #666666;
    /* Brand palette - White theme (replaces blues with neutrals) */
    --brand-blue: #1a1a1a;
    --brand-pink: #EF5BA1;
    --brand-green: #00A651;
    --brand-lightblue: #888888;
    --brand-yellow: #FFEA00;
    --brand-orange: #F36C21;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f0;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent: #1a1a1a;
    --accent-light: #888888;
    --border-color: #e0e0e0;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --text-heading: #1a1a1a;
    --bg-section: rgba(0, 0, 0, 0.04);
    --bg-section-hover: rgba(0, 0, 0, 0.06);
    --bg-amenity: rgba(0, 0, 0, 0.04);
    --table-row-hover: rgba(0, 0, 0, 0.03);
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --carousel-bg: #f5f5f5;
    --modal-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f0;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --text-heading: #1a1a1a;
    --bg-section: rgba(0, 0, 0, 0.04);
    --bg-section-hover: rgba(0, 0, 0, 0.06);
    --bg-amenity: rgba(0, 0, 0, 0.04);
    --table-row-hover: rgba(0, 0, 0, 0.03);
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --carousel-bg: #f5f5f5;
    --modal-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* Header — oval floating bar on top of the map (white theme) */
#app-header {
    position: absolute;
    top: 10px;
    left: 16px;
    right: 16px;
    height: var(--header-height);
    background: var(--floating-bg);
    border: 1px solid var(--floating-border);
    border-radius: 999px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
    color: var(--floating-text);
    overflow: hidden;
}

#app-header .header-title h1 {
    color: var(--floating-text);
}

#app-header .header-title p {
    color: var(--floating-text-muted);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: calc(var(--header-height) - 12px);
    width: auto;
    max-width: 320px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.header-title i.fa-tree {
    font-size: 28px;
    color: var(--accent);
}

.header-title h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: 0.5px;
}

.header-title p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

#mobile-toggle {
    display: none;
    background: none;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-size: 20px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

/* Desktop sidebar toggle button */
.sidebar-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-section-hover);
}

.sidebar-toggle-btn.active {
    border-color: var(--accent);
    color: var(--accent);
}

/* Desktop collapsed sidebar */
#sidebar.desktop-collapsed {
    width: 0;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    border-right: none;
    overflow: hidden;
    opacity: 0;
}

#sidebar {
    transition: width 0.3s ease, padding 0.3s ease, opacity 0.25s ease;
}

/* Main Container — map fills the full viewport; header floats on top */
#app-container {
    display: flex;
    flex-direction: row-reverse;
    height: 100vh;
    position: relative;
}

/* Sidebar floats over the map on the right side.
   The aside itself lets clicks pass through empty areas;
   only its direct children (cards) capture pointer events. */
#sidebar {
    position: absolute;
    top: calc(var(--header-height) + 22px);
    right: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: transparent;
    overflow-y: auto;
    border-left: none;
    padding: 10px 20px 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
    pointer-events: none;
    z-index: 500;
}

#sidebar>* {
    pointer-events: auto;
}

#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

/* ==========================================================
   Floating top bar: search + Opciones + Filtrar por amenidad
   Layout goals: three pills with equal widths, same height,
   consistent rounded corners and proper spacing away from the
   right-docked "Rutas Temáticas" sidebar.
   ========================================================== */
:root {
    --topbar-pill-height: 48px;
    --topbar-pill-radius: 999px;
    --topbar-dropdown-radius: 20px;
}

#top-float-bar {
    position: absolute;
    top: calc(var(--header-height) + 22px);
    left: 20px;
    right: calc(var(--sidebar-width) + 20px);
    z-index: 600;
    display: flex;
    gap: 12px;
    align-items: stretch;
    pointer-events: none;
}

#top-float-bar>* {
    pointer-events: auto;
}

/* Shared pill styling for all three items so they look like a family */
#top-float-bar #search-container,
#top-float-bar .top-bar-section {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    height: var(--topbar-pill-height);
    background: var(--floating-bg);
    border: 1px solid var(--floating-border);
    border-radius: var(--topbar-pill-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
    box-sizing: border-box;
    color: var(--floating-text);
    /* Smoothly animate proportion changes when the search gets focus */
    transition: flex-grow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.3s ease,
        box-shadow 0.2s ease;
}

#top-float-bar #search-input {
    color: var(--floating-text);
}

#top-float-bar #search-input::placeholder {
    color: var(--floating-text-muted);
}

#top-float-bar .search-icon,
#top-float-bar #search-clear {
    color: var(--floating-text-muted);
}

#top-float-bar .top-bar-section .sidebar-section-header h2 {
    color: var(--floating-text);
}

#top-float-bar .top-bar-section .sidebar-section-header h2 i {
    color: var(--floating-text);
}

#top-float-bar .top-bar-section .sidebar-section-arrow {
    border-color: var(--floating-border);
}

#top-float-bar .top-bar-section .sidebar-section-arrow::before,
#top-float-bar .top-bar-section .sidebar-section-arrow::after {
    background: var(--floating-text);
}

#top-float-bar.searching #search-container {
    flex-grow: 2;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

#top-float-bar.searching .top-bar-section {
    flex-grow: 0.85;
}

/* ---------- Search ---------- */
#top-float-bar #search-container {
    position: relative;
    padding: 0;
    display: flex;
    align-items: center;
}

#top-float-bar .search-box {
    width: 100%;
    height: 100%;
}

#top-float-bar #search-input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    padding: 0 44px;
    font-size: 14px;
    line-height: var(--topbar-pill-height);
    border-radius: var(--topbar-pill-radius);
}

#top-float-bar #search-input:focus {
    border: none;
    outline: none;
}

#top-float-bar .search-icon {
    left: 18px;
}

#top-float-bar #search-clear {
    right: 14px;
}

/* Search results as a floating dropdown under the input */
#top-float-bar #search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    margin: 0;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--floating-bg);
    border: 1px solid var(--floating-border);
    border-radius: var(--topbar-dropdown-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 610;
    color: var(--floating-text);
}

/* ---------- Opciones / Filtrar por amenidad ---------- */
#top-float-bar .top-bar-section {
    position: relative;
    /* Required so the absolutely-positioned dropdown body is NOT clipped
       by the "overflow: hidden" that .sidebar-section uses by default. */
    overflow: visible;
}

#top-float-bar .top-bar-section .sidebar-section-header {
    height: 100%;
    padding: 0 20px;
    gap: 10px;
}

#top-float-bar .top-bar-section .sidebar-section-header h2 {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Expanded body becomes a floating dropdown instead of pushing the bar */
#top-float-bar .top-bar-section .sidebar-section-body {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 14px;
    background: var(--floating-bg);
    border: 1px solid var(--floating-border);
    border-radius: var(--topbar-dropdown-radius);
    max-height: 60vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 610;
    color: var(--floating-text);
}

#top-float-bar .top-bar-section.collapsed .sidebar-section-body {
    display: none;
}

/* ==========================================================
   Leaflet zoom control — restyled to match the floating UI
   Stacked below the top floating bar so it doesn't overlap the search.
   ========================================================== */
.leaflet-top.leaflet-left {
    top: calc(var(--header-height) + var(--topbar-pill-height) + 34px);
    left: 16px;
    transition: top 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        bottom 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s ease;
}

/* Only once the user starts typing, gently slide the zoom control to
   the bottom so it doesn't overlap the search results dropdown. */
#top-float-bar.typing~#map-container .leaflet-top.leaflet-left {
    top: auto !important;
    bottom: 24px;
}

.leaflet-touch .leaflet-bar,
.leaflet-control-zoom.leaflet-bar {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}


.leaflet-bar a,
.leaflet-bar a:hover,
.leaflet-touch .leaflet-bar a {
    width: 40px;
    height: 40px;
    line-height: 40px;
    font-size: 18px;
    font-weight: 600;
    background: transparent;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease, color 0.15s ease;
}

.leaflet-bar a:last-child {
    border-bottom: none;
}

.leaflet-bar a:hover {
    background: var(--bg-section-hover);
    color: var(--accent);
}

.leaflet-bar a.leaflet-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    color: var(--text-secondary);
}

.leaflet-bar a:first-child {
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.leaflet-bar a:last-child {
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

@media (max-width: 768px) {
    .leaflet-top.leaflet-left {
        top: 10px;
        left: 10px;
    }

    .leaflet-bar a,
    .leaflet-touch .leaflet-bar a {
        width: 36px;
        height: 36px;
        line-height: 36px;
        font-size: 16px;
    }
}

/* Search */
#search-container {
    margin-bottom: 16px;
}

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

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    pointer-events: none;
}

#search-input {
    width: 100%;
    padding: 12px 36px 12px 38px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-primary);
    outline: none;
    transition: border-color 0.2s;
}

#search-input::placeholder {
    color: var(--text-secondary);
    font-size: 13px;
}

#search-input:focus {
    border-color: var(--accent);
}

#search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
}

#search-clear:hover {
    color: var(--accent);
}

#search-results {
    margin-top: 6px;
    max-height: 350px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-radius: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-secondary);
}

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-card-hover);
}

.search-result-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
}

.search-result-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    display: flex;
    gap: 10px;
}

.search-no-results {
    padding: 14px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.search-result-count {
    padding: 8px 14px;
    font-size: 11px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

/* Park / Route Detail — floating dark-blue card inside the sidebar */
#park-detail,
#route-details {
    padding: 16px 16px 14px;
    background: var(--floating-bg);
    border: 1px solid var(--floating-border);
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.32);
    margin-bottom: 14px;
    color: var(--floating-text);
}

#route-details h2,
#route-details h3,
#route-details p,
#route-details ol,
#route-details li {
    color: var(--floating-text);
}

#route-details p {
    color: var(--floating-text-muted);
}

#back-from-detail {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

#back-from-detail:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.park-detail-header {
    margin-bottom: 14px;
}

.park-detail-header h2 {
    font-size: 18px;
    color: var(--text-heading);
    margin-bottom: 6px;
}

.park-detail-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.park-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.park-detail-row i {
    color: var(--accent);
    width: 16px;
    text-align: center;
    margin-top: 2px;
    flex-shrink: 0;
}

.park-detail-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

/* Park Image Gallery */
.park-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin: 8px 0 14px;
}

.park-gallery-item {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}

.park-gallery-item:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

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

.park-detail-gmaps {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    transition: background 0.2s;
}

.park-detail-gmaps:hover {
    background: var(--accent-light);
}

#sidebar h2 {
    font-size: 16px;
    margin: 0;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

#sidebar h2 i {
    color: var(--accent);
}

/* Collapsible Sidebar Sections (card style) */
.sidebar-section {
    margin-bottom: 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-section:hover {
    border-color: var(--accent-light);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.sidebar-section-header:hover {
    background: var(--bg-section-hover);
}

.sidebar-section-header h2 {
    flex: 1;
    min-width: 0;
    letter-spacing: 0.1px;
}

/* +/- toggle pill on the right of each section header */
.sidebar-section-arrow {
    position: relative;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: transparent;
    font-size: 0;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.sidebar-section-arrow::before,
.sidebar-section-arrow::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: var(--text-secondary);
    border-radius: 1px;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease, background 0.2s ease;
}

.sidebar-section-arrow::before {
    width: 12px;
    height: 2px;
}

.sidebar-section-arrow::after {
    width: 2px;
    height: 12px;
    opacity: 0;
}

.sidebar-section.collapsed .sidebar-section-arrow::after {
    opacity: 1;
}

.sidebar-section-header:hover .sidebar-section-arrow {
    border-color: var(--accent);
}

.sidebar-section-header:hover .sidebar-section-arrow::before,
.sidebar-section-header:hover .sidebar-section-arrow::after {
    background: var(--accent);
}

.sidebar-section-body {
    padding: 4px 16px 16px;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.3s ease;
    max-height: 800px;
    opacity: 1;
    overflow: hidden;
}

.sidebar-section.collapsed .sidebar-section-body {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Route Cards (white theme like the rest of the floating UI) */
.route-card {
    background: var(--floating-bg);
    color: var(--floating-text);
    border: 1px solid var(--floating-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    border-left: 4px solid transparent;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.route-card:hover {
    background: #ffffff;
    transform: translateX(4px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.route-card-info h3 {
    color: var(--floating-text);
}

.route-card-info p {
    color: var(--floating-text-muted);
}

.route-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.route-card-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 3px;
}

.route-card-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Toggle */
.toggle-container {
    margin: 18px 0;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 10px;
}

#show-all-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

#show-all-toggle input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-around;
    background: var(--bg-card);
    border-radius: 10px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.stat i {
    color: var(--accent);
    font-size: 14px;
}

/* Route Details */
#back-to-routes {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

#back-to-routes:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.route-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

#route-icon-large {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

#route-details h2 {
    margin-bottom: 0;
}

#route-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.route-stats-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.route-stat-pill {
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.route-stat-pill i {
    font-size: 11px;
}

#route-details h3 {
    font-size: 15px;
    color: var(--text-heading);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#route-details h3 i {
    color: var(--accent);
}

/* Stops List */
#stops-list {
    list-style: none;
    padding: 0;
}

.stop-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.stop-item:hover {
    background: var(--bg-card-hover);
    transform: translateX(3px);
}

.stop-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.stop-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.stop-info {
    flex: 1;
}

.stop-info strong {
    font-size: 13px;
    color: var(--text-heading);
    display: block;
    margin-bottom: 3px;
    line-height: 1.3;
}

.stop-info small {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
    display: block;
}

.stop-type-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--accent-light);
    display: inline-block;
    margin-top: 4px;
}

.stop-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
    padding-left: 42px;
}

.amenity-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-amenity);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.stop-links {
    padding-left: 42px;
    margin-top: 8px;
}

.gmaps-link-small {
    font-size: 11px;
    color: var(--accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.gmaps-link-small:hover {
    color: var(--accent-light);
}

/* Map */
#map-container {
    flex: 1;
    position: relative;
}

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

/* Leaflet Popup Custom Styles */
.leaflet-popup-content-wrapper {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-radius: 12px !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow) !important;
}

.leaflet-popup-tip {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

.leaflet-popup-content {
    margin: 14px !important;
    font-family: var(--font-primary) !important;
}

.park-popup {
    min-width: 200px;
    max-width: 340px;
}

.park-popup h3 {
    font-size: 15px;
    color: var(--text-heading);
    margin-bottom: 8px;
    padding-right: 10px;
    line-height: 1.3;
}

.park-popup .popup-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.park-popup .popup-info i {
    color: var(--accent);
    width: 14px;
    text-align: center;
    margin-top: 2px;
    flex-shrink: 0;
}

.popup-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 8px 0;
}

.popup-stop-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
}

/* Popup Carousel */
.popup-carousel {
    margin-top: 6px;
}

.popup-carousel-main {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16 / 10;
    background: var(--carousel-bg);
}

.popup-carousel-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}

.popup-carousel-main:hover img {
    transform: scale(1.03);
}

.popup-carousel-count {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    pointer-events: none;
}

.popup-thumbs {
    display: flex;
    gap: 4px;
    margin-top: 5px;
    overflow-x: auto;
}

.popup-thumb {
    width: 44px;
    height: 44px;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.15s;
}

.popup-thumb.active,
.popup-thumb:hover {
    border-color: var(--accent);
    opacity: 1;
}

.popup-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox Overlay */
#lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#lightbox-overlay.lb-open {
    display: flex;
}

.lb-img-wrap {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-img-wrap img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    user-select: none;
}

.lb-close {
    position: absolute;
    top: 16px;
    right: 20px;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    transition: background 0.2s;
    z-index: 10001;
}

.lb-close:hover {
    background: rgba(0, 0, 0, 0.6);
}

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    transition: background 0.2s;
    z-index: 10001;
}

.lb-nav:hover {
    background: rgba(0, 0, 0, 0.6);
}

.lb-prev {
    left: 16px;
}

.lb-next {
    right: 16px;
}

.lb-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 16px;
    font-weight: 600;
    letter-spacing: 2px;
}

.gmaps-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    transition: background 0.2s;
}

.gmaps-btn:hover {
    background: var(--accent-light);
}

.popup-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.popup-visit-btn,
.popup-detail-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: all 0.2s;
    width: 100%;
}

.popup-visit-btn {
    background: linear-gradient(135deg, #1a1a1a, #1a1a1a);
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.popup-visit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.45);
}

.popup-detail-btn {
    background: var(--bg-card);
    color: var(--text-heading);
    border: 1px solid var(--border-color);
}

.popup-detail-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.popup-gmaps-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}

.popup-gmaps-btn:hover {
    background: #333333;
}

/* Numbered marker on map */
.numbered-marker {
    background: none !important;
    border: none !important;
}

.marker-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

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

.marker-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2E7D32;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    opacity: 0.85;
}

/* Tree marker: each park is shown as a green tree on the map */
.marker-tree {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(180deg, #43A047, #1B5E20);
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.marker-tree:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

.marker-tree-alert {
    background: linear-gradient(180deg, #FFB300, #EF6C00);
    border-color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 108, 0, 0.55);
}

.marker-alert-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.marker-alert-star {
    font-size: 12px;
    color: #ffc107;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
    animation: pulse-star 2s ease-in-out infinite;
}

@keyframes pulse-star {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.marker-dot-alert {
    background: #ffc107;
    border-color: #fff;
    box-shadow: 0 1px 6px rgba(255, 193, 7, 0.5);
    opacity: 1;
}

/* Cotejo & Admin Buttons */
.cotejo-btn,
.admin-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    transition: all 0.2s;
}

.cotejo-btn {
    background: rgba(0, 0, 0, 0.15);
    color: #64B5F6;
}

.cotejo-btn:hover {
    background: rgba(0, 0, 0, 0.3);
}

.admin-btn {
    background: rgba(0, 0, 0, 0.1);
    color: var(--accent-light);
}

.admin-btn:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--modal-shadow);
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-secondary);
}

.modal-small {
    width: 380px;
    padding: 24px;
}

.modal-medium {
    width: 600px;
    padding: 24px;
}

.modal-large {
    width: 95vw;
    max-width: 1100px;
    padding: 24px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.modal-header h2 {
    font-size: 18px;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: var(--accent);
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header-actions span {
    font-size: 12px;
    color: var(--text-secondary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover {
    color: var(--accent);
}

/* Forms */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-primary);
    outline: none;
}

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

.form-group textarea {
    resize: vertical;
}

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

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

.form-row-3 .form-group {
    flex: 1;
    min-width: 0;
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-primary);
}

.btn-primary:hover {
    background: var(--accent-light);
}

.btn-secondary {
    background: none;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font-primary);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-tiny {
    padding: 2px 6px;
    font-size: 11px;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.btn-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    color: #ef5350;
}

.btn-danger:hover {
    border-color: #ef5350;
    color: #ef5350;
}

/* Park active toggle */
.park-toggle {
    font-size: 22px;
    cursor: pointer;
    transition: color 0.15s;
}

.toggle-active {
    color: #4CAF50;
}

.toggle-inactive {
    color: #666;
}

.park-toggle:hover {
    opacity: 0.8;
}

.row-disabled td {
    opacity: 0.4;
}

.row-disabled td:first-child {
    opacity: 1;
}

/* Cotejo Table */
.cotejo-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.cotejo-filters input,
.cotejo-filters select {
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-primary);
    outline: none;
}

.cotejo-filters input {
    flex: 1;
    min-width: 200px;
}

.cotejo-filters input:focus,
.cotejo-filters select:focus {
    border-color: var(--accent);
}

.cotejo-summary {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.cotejo-table-wrap,
.admin-table-wrap {
    overflow-x: auto;
    max-height: 55vh;
    overflow-y: auto;
}

#cotejo-table,
#admin-parks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

#cotejo-table th,
#admin-parks-table th {
    background: var(--bg-card);
    padding: 8px 10px;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

#cotejo-table td,
#admin-parks-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

#cotejo-table tr:hover,
#admin-parks-table tr:hover {
    background: var(--table-row-hover);
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.admin-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font-primary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.admin-tab:hover {
    color: var(--text-primary);
}

.admin-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.admin-tab-content {
    min-height: 200px;
}

.admin-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-toolbar input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-primary);
    outline: none;
}

.admin-toolbar input:focus {
    border-color: var(--accent);
}

/* Admin Route Cards */
.admin-route-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.admin-route-info strong {
    color: var(--text-heading);
    font-size: 13px;
    display: block;
}

.admin-route-info span {
    color: var(--text-secondary);
    font-size: 11px;
}

.admin-route-actions {
    display: flex;
    gap: 6px;
}

/* Route stop editor */
.re-stops-list {
    margin-top: 8px;
}

.re-stop-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-card);
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 12px;
}

.re-stop-num {
    background: var(--accent);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.re-stop-drag {
    cursor: grab;
    color: var(--text-secondary);
    padding: 2px 4px;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.re-stop-drag:hover {
    opacity: 1;
    color: var(--accent);
}

.re-stop-drag:active {
    cursor: grabbing;
}

.re-stop-name {
    flex: 1;
    color: var(--text-primary);
}

.re-stop-ghost {
    opacity: 0.3;
    background: var(--accent) !important;
    border-radius: 6px;
}

.re-stop-chosen {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    background: var(--bg-card-hover) !important;
}

.re-stop-dragging {
    opacity: 0.9;
}

#re-stops-suggestions {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 150px;
    overflow-y: auto;
}

.re-suggestion {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.re-suggestion:hover {
    background: var(--bg-card-hover);
}

.re-suggestion small {
    color: var(--text-secondary);
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--accent);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Export buttons */
.admin-export-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.export-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-export {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-export-excel {
    background: #217346;
    color: #fff;
}

.btn-export-excel:hover {
    background: #1a5c38;
}

.btn-export-pdf {
    background: #c40606;
    color: #fff;
}

.btn-export-pdf:hover {
    background: #a00505;
}

/* Drive Config Section */
.drive-config-section {
    padding: 16px;
}

.drive-config-section h3 {
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text-heading);
}

/* Edit coords mode toggle */
.edit-coords-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-size: 12px;
    cursor: pointer;
}

.edit-coords-toggle input {
    accent-color: var(--accent);
}

.edit-coords-toggle.active {
    background: rgba(0, 0, 0, 0.3);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: rotate(20deg);
}

.theme-toggle .fa-sun {
    display: none;
}

.theme-toggle .fa-moon {
    display: inline-block;
}

[data-theme="light"] .theme-toggle .fa-sun {
    display: inline-block;
}

[data-theme="light"] .theme-toggle .fa-moon {
    display: none;
}

/* Light theme specific overrides */
[data-theme="light"] .header-logo {
    filter: none;
}

[data-theme="light"] .leaflet-popup-content-wrapper {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .cotejo-btn {
    background: rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
}

[data-theme="light"] .cotejo-btn:hover {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .admin-btn {
    background: rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
}

[data-theme="light"] .admin-btn:hover {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .stop-type-badge {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

[data-theme="light"] .edit-coords-toggle {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .edit-coords-toggle.active {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .form-group select {
    background-image: none;
}

/* Photo Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
    background: var(--bg-card);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.06);
}

.upload-zone i.fa-cloud-arrow-up {
    font-size: 28px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

.upload-zone p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.upload-zone small {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.upload-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin: 10px 0;
}

.upload-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

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

.upload-preview-item .upload-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.upload-preview-item .upload-item-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 10px;
    text-align: center;
    padding: 2px 0;
}

.upload-preview-item .upload-item-status.success {
    background: rgba(76, 175, 80, 0.8);
}

.upload-preview-item .upload-item-status.error {
    background: rgba(239, 83, 80, 0.8);
}

.upload-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.upload-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-card);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-status {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Alert Banner Image - Park Removal */
.alert-banner-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(243, 108, 33, 0.3);
    animation: alert-pulse 2.5s ease-in-out infinite;
}

@keyframes alert-pulse {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(243, 108, 33, 0.3);
    }

    50% {
        box-shadow: 0 4px 16px rgba(243, 108, 33, 0.55);
    }
}

/* Alert Banner - Park Removal (legacy text banner, kept for compatibility) */
.alert-banner-removal {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.4);
    color: #ffc107;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.alert-banner-removal i {
    color: #ffc107;
    flex-shrink: 0;
}

[data-theme="light"] .alert-banner-removal {
    background: rgba(255, 152, 0, 0.1);
    border-color: rgba(255, 152, 0, 0.4);
    color: #e65100;
}

[data-theme="light"] .alert-banner-removal i {
    color: #e65100;
}

.alert-badge-removal {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

[data-theme="light"] .alert-badge-removal {
    background: rgba(255, 152, 0, 0.1);
    color: #e65100;
}

.park-alert-toggle {
    font-size: 18px;
    cursor: pointer;
    transition: color 0.15s;
}

.toggle-alert-on {
    color: #ffc107;
}

.toggle-alert-off {
    color: #555;
}

.park-alert-toggle:hover {
    opacity: 0.8;
}

.row-alert td {
    border-left: 3px solid #ffc107;
}

/* Pick Coordinates Mode */
#pick-coords-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1500;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.pick-coords-message {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 0 12px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    pointer-events: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.pick-coords-message i {
    color: var(--accent);
    font-size: 18px;
}

.pick-coords-message .btn-secondary {
    margin-left: 8px;
    padding: 4px 12px;
    font-size: 11px;
}

#map.pick-mode,
#map.pick-mode .leaflet-grab,
#map.pick-mode .leaflet-interactive {
    cursor: crosshair !important;
}

.btn-pick-coords {
    width: 100%;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    color: #64B5F6;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-primary);
    transition: all 0.2s;
}

.btn-pick-coords:hover {
    background: rgba(0, 0, 0, 0.25);
    border-color: #64B5F6;
}

[data-theme="light"] .btn-pick-coords {
    background: rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
}

[data-theme="light"] .btn-pick-coords:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* Route Drag Handle (admin route reordering) */
.route-drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    padding: 4px 6px;
    font-size: 16px;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
    flex-shrink: 0;
}

.route-drag-handle:hover {
    opacity: 1;
    color: var(--accent);
}

.route-drag-handle:active {
    cursor: grabbing;
}

.route-order-num {
    background: var(--accent);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.route-drag-ghost {
    opacity: 0.3;
    background: var(--accent) !important;
    border-radius: 10px;
}

.route-drag-chosen {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    background: var(--bg-card-hover) !important;
}

/* Export Grid (Datos tab) */
.export-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color 0.2s;
}

.export-card:hover {
    border-color: var(--accent);
}

.export-card-icon {
    font-size: 24px;
    color: var(--accent);
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.export-card-info {
    flex: 1;
    min-width: 0;
}

.export-card-info strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}

.export-card-info small {
    color: var(--text-secondary);
    font-size: 11px;
}

.export-card-compact {
    padding: 10px 14px;
}

.export-card-compact .export-card-info strong {
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Import Drop Zone */
.import-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.import-drop-zone i {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
    opacity: 0.5;
}

.import-drop-zone p {
    font-size: 13px;
    margin: 4px 0;
}

.import-drop-zone small {
    font-size: 11px;
    opacity: 0.7;
}

.import-drop-zone:hover,
.import-drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.05);
}

/* Drive File Manager Grid */
.drive-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding: 4px;
}

.drive-file-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.drive-file-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.drive-file-thumb {
    width: 100%;
    height: 120px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-card);
    position: relative;
}

.drive-file-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.drive-file-card:hover .drive-file-delete {
    opacity: 1;
}

.drive-file-delete:hover {
    background: #e94560;
}

.drive-file-info {
    padding: 8px 10px;
}

.drive-file-name {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.drive-file-park {
    font-size: 10px;
    color: #4CAF50;
}

.drive-file-park i {
    margin-right: 3px;
}

.drive-file-unmatched {
    color: #ff9800;
}

/* Light theme overrides for new components */
[data-theme="light"] .export-card {
    background: #f5f5f5;
}

[data-theme="light"] .drive-file-card {
    background: #f5f5f5;
}

[data-theme="light"] .drive-file-thumb {
    background-color: #e0e0e0;
}

[data-theme="light"] .import-drop-zone:hover,
[data-theme="light"] .import-drop-zone.drag-over {
    background: rgba(0, 0, 0, 0.03);
}

/* ===== Routing Admin Tab ===== */
.routing-status {
    margin-bottom: 14px;
}

.routing-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
}

.routing-status-chip.is-prod {
    background: rgba(0, 166, 81, 0.12);
    color: #00A651;
    border: 1px solid rgba(0, 166, 81, 0.3);
}

.routing-status-chip.is-dev {
    background: rgba(243, 108, 33, 0.12);
    color: #F36C21;
    border: 1px solid rgba(243, 108, 33, 0.3);
}

.routing-providers-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.routing-provider-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 10px 12px;
}

.routing-provider-card strong {
    display: block;
    color: var(--text-heading);
    font-size: 13px;
    margin-bottom: 4px;
}

.routing-provider-card p {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.35;
    margin: 0 0 6px;
}

.routing-provider-card small {
    font-size: 10px;
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== Analytics Dashboard ===== */
.analytics-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.analytics-kpi {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.analytics-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

.analytics-kpi-info {
    min-width: 0;
}

.analytics-kpi-info strong {
    display: block;
    font-size: 18px;
    color: var(--text-heading);
    font-weight: 700;
    line-height: 1.1;
}

.analytics-kpi-info small {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.analytics-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    min-height: 300px;
}

.analytics-card-wide {
    grid-column: span 2;
}

.analytics-card h4 {
    font-size: 13px;
    color: var(--text-heading);
    margin-bottom: 12px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .analytics-card-wide {
        grid-column: span 1;
    }
}

/* ===== Navigation dropdown (Google Maps / Waze / Uber) ===== */
.nav-dropdown-wrap {
    position: relative;
    display: inline-block;
    margin-top: 8px;
}

.nav-dropdown-toggle {
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: var(--font-primary);
}

.nav-dropdown-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    min-width: 180px;
    overflow: hidden;
    animation: nav-menu-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes nav-menu-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-color);
}

.nav-dropdown-item:last-child {
    border-bottom: none;
}

.nav-dropdown-item:hover {
    background: var(--bg-section-hover);
}

.nav-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
}

.nav-dot-gmaps {
    background: #1a1a1a;
}

.nav-dot-waze {
    background: #888888;
}

.nav-dot-uber {
    background: #000000;
}

.nav-dot-apple {
    background: #555;
}

/* Hide Apple Maps on Android */
@supports not (-webkit-touch-callout: default) {
    .nav-apple-only {
        display: none;
    }
}

/* ===== QR code modal ===== */
.qr-park-name {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 10px;
    word-break: break-word;
}

.qr-canvas-wrap {
    display: flex;
    justify-content: center;
    padding: 10px 0 6px;
}

.qr-canvas-wrap canvas {
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: #fff;
    padding: 12px;
    max-width: 100%;
    height: auto;
}

.qr-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin: 8px 0;
}

.qr-url-display {
    background: var(--bg-card);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    word-break: break-all;
    text-align: center;
    margin: 8px 0 16px;
    font-family: Consolas, monospace;
}

/* ===== Park detail: favorite + share buttons ===== */
.park-detail-title-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.park-detail-title-row h2 {
    flex: 1;
    min-width: 0;
}

.park-fav-btn,
.park-share-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.park-fav-btn:hover,
.park-share-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.08);
}

.park-fav-btn.is-fav {
    color: #FFEA00;
    border-color: #FFEA00;
    background: rgba(255, 234, 0, 0.08);
}

.park-fav-btn.pop {
    animation: fav-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fav-pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3) rotate(15deg);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== Favorites sidebar section ===== */
.sidebar-section-count {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: 10px;
}

.fav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: var(--bg-card);
    border-radius: 10px;
    cursor: pointer;
    border-left: 3px solid #FFEA00;
    transition: all 0.2s;
}

.fav-item:hover {
    background: var(--bg-card-hover);
    transform: translateX(2px);
}

.fav-item-star {
    color: #FFEA00;
    font-size: 14px;
    flex-shrink: 0;
}

.fav-item-body {
    flex: 1;
    min-width: 0;
}

.fav-item-body strong {
    display: block;
    font-size: 13px;
    color: var(--text-heading);
    line-height: 1.2;
}

.fav-item-body small {
    font-size: 11px;
    color: var(--text-secondary);
}

.fav-item-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.fav-item-remove:hover {
    color: #e94560;
    background: rgba(233, 69, 96, 0.1);
}

/* ===== Amenity filter chips ===== */
.amenity-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 180px;
    overflow-y: auto;
    padding: 4px 2px;
    scrollbar-width: thin;
}

.amenity-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 14px;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.amenity-chip i {
    font-size: 10px;
}

.amenity-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.amenity-chip.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.amenity-filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    min-height: 22px;
}

.amenity-filter-count {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

.amenity-clear-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-primary);
}

.amenity-clear-btn:hover {
    border-color: #e94560;
    color: #e94560;
}

/* ===== User-facing Notification Permission Prompt ===== */
.notif-perm-prompt {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: #fff;
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    transform: translateY(150%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
    flex-wrap: wrap;
}

.notif-perm-prompt.show {
    transform: translateY(0);
    opacity: 1;
}

.notif-perm-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    animation: bell-shake 2s ease-in-out infinite;
}

.notif-perm-body {
    flex: 1;
    min-width: 0;
}

.notif-perm-body strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.notif-perm-body p {
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
    opacity: 0.92;
}

.notif-perm-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
    justify-content: flex-end;
}

.notif-perm-skip,
.notif-perm-ok {
    border: none;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: all 0.18s;
}

.notif-perm-skip {
    background: rgba(0, 0, 0, 0.08);
    color: #fff;
}

.notif-perm-skip:hover {
    background: rgba(0, 0, 0, 0.15);
}

.notif-perm-ok {
    background: #fff;
    color: var(--accent);
}

.notif-perm-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .notif-perm-prompt {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
}

/* ===== Route Planner modal ===== */
.route-planner-intro {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.route-planner-intro p {
    margin: 0 0 8px;
    line-height: 1.45;
}

.route-planner-tips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 8px 10px;
    border-radius: 8px;
}

.route-planner-tips i {
    color: var(--accent);
    margin-right: 4px;
}

.route-planner-stops {
    max-height: 50vh;
    overflow-y: auto;
    padding: 4px 2px;
    margin-bottom: 14px;
    scrollbar-width: thin;
}

.planner-stop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    transition: opacity 0.15s, transform 0.15s;
}

.planner-stop-item.is-skipped {
    opacity: 0.45;
    background: var(--bg-secondary);
}

.planner-stop-item.is-skipped .planner-stop-info strong {
    text-decoration: line-through;
}

.planner-stop-handle {
    color: var(--text-secondary);
    cursor: grab;
    padding: 4px 6px;
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s, color 0.15s;
}

.planner-stop-handle:hover {
    opacity: 1;
    color: var(--accent);
}

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

.planner-stop-num {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.planner-stop-info {
    flex: 1;
    min-width: 0;
}

.planner-stop-info strong {
    display: block;
    font-size: 13px;
    color: var(--text-heading);
    line-height: 1.2;
}

.planner-stop-info small {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

.planner-stop-dist {
    background: rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.planner-stop-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.planner-stop-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.planner-stop-check {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.15s;
}

.planner-stop-toggle input:checked+.planner-stop-check {
    background: #00A651;
    border-color: #00A651;
    color: #fff;
}

.planner-stop-ghost {
    opacity: 0.4;
    background: var(--bg-section-hover) !important;
}

.planner-stop-chosen {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

.route-planner-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 10px 14px;
    background: var(--bg-card);
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 12px;
}

.route-planner-summary i {
    color: var(--accent);
    margin-right: 4px;
}

/* ===== Route proximity chips & tracking ===== */
.route-card-distance {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.route-card-distance.is-near {
    background: #00A651;
    color: #fff;
}

.route-card-distance i {
    font-size: 9px;
}

.route-stat-pill-near {
    background: rgba(0, 166, 81, 0.15) !important;
    color: #00A651 !important;
    font-weight: 600;
}

.route-stat-pill-near i {
    color: #00A651 !important;
}

.route-track-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.route-track-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    opacity: 0.92;
}

/* Stop cards — distance chip + per-stop track button */
.stop-distance {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    margin-top: 4px;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.stop-distance i {
    font-size: 9px;
    color: #1a1a1a;
}

.stop-track-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    margin-left: auto;
    align-self: flex-start;
}

.stop-track-btn:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.stop-header {
    align-items: flex-start !important;
}

/* Route-wide tracking progress banner (bottom of screen, full-width) */
.route-progress-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    max-width: calc(100vw - 20px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 9400;
}

.route-progress-label {
    font-size: 13px;
    color: var(--text-heading);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.route-progress-label i.fa-route {
    color: var(--accent);
}

.route-progress-stop {
    margin-left: auto;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.route-progress-stop:hover {
    border-color: #e94560;
    color: #e94560;
}

.route-progress-bar {
    height: 6px;
    background: var(--bg-card);
    border-radius: 3px;
    overflow: hidden;
}

.route-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00A651, #888888);
    border-radius: 3px;
    transition: width 0.5s ease;
}

@media (max-width: 768px) {
    .route-progress-banner {
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        transform: none;
    }
}

/* ===== Real-time tracking ===== */
.tracking-user-marker {
    background: transparent !important;
    border: none !important;
    pointer-events: none;
}

.tracking-user-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    z-index: 2;
}

.tracking-user-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    transform: translate(-50%, -50%);
    animation: tracking-pulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes tracking-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.8);
        opacity: 0;
    }
}

.tracking-target-circle {
    animation: tracking-target-pulse 2s ease-in-out infinite;
}

@keyframes tracking-target-pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.9;
    }
}

/* Floating tracking card — docked at the bottom, Waze-style */
.tracking-card {
    position: fixed;
    bottom: 24px;
    left: 50%;
    width: 520px;
    max-width: calc(100vw - 32px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 0;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42);
    z-index: 9500;
    /* Hidden: slide off below the viewport */
    transform: translate(-50%, calc(100% + 40px));
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.25s ease;
    opacity: 0;
    overflow: hidden;
    backdrop-filter: blur(6px);
}

.tracking-card.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

[data-theme="light"] .tracking-card {
    background: #ffffff;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

/* Top: big turn indicator (Waze-like) */
.tracking-turn-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #1a1a1a, #1a1a1a);
    color: #fff;
}

.tracking-turn-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    flex-shrink: 0;
}

.tracking-turn-body {
    flex: 1;
    min-width: 0;
}

.tracking-turn-dist {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.tracking-turn-dist:empty::before {
    content: "\200b";
}

.tracking-turn-text {
    font-size: 13px;
    margin-top: 4px;
    opacity: 0.95;
    line-height: 1.3;
}

.tracking-card-divider {
    height: 1px;
    background: var(--border-color);
}

.tracking-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
}

.tracking-card-row:first-of-type {
    padding-top: 12px;
}

.tracking-card-park {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tracking-card-meta {
    flex: 1;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
    align-items: center;
    font-variant-numeric: tabular-nums;
}

.tracking-card-meta i {
    color: #1a1a1a;
    font-size: 11px;
    margin-right: 3px;
}

.tracking-card-modes {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.tracking-card-bottom {
    padding-bottom: 14px;
    gap: 8px;
}

.tracking-voice-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tracking-voice-btn:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.tracking-voice-btn.is-muted {
    background: rgba(233, 69, 96, 0.15);
    color: #e94560;
    border-color: rgba(233, 69, 96, 0.4);
}

.tracking-nav-btn {
    flex: 1;
    background: #00A651;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto !important;
    height: auto !important;
}

.tracking-nav-btn:hover {
    background: #008a43;
    transform: none !important;
}

.tracking-stop-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto !important;
    height: auto !important;
}

.tracking-stop-btn:hover {
    background: rgba(233, 69, 96, 0.12);
    color: #e94560;
    border-color: rgba(233, 69, 96, 0.4);
    transform: none !important;
}

.tracking-mode {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.tracking-mode:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.tracking-mode.is-active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

@media (max-width: 768px) {
    .tracking-card {
        bottom: 12px;
        left: 50%;
        width: calc(100vw - 16px);
        max-width: none;
        transform: translate(-50%, calc(100% + 20px));
        border-radius: 20px;
    }

    .tracking-card.show {
        transform: translate(-50%, 0);
    }

    .tracking-turn-panel {
        padding: 14px 14px;
    }

    .tracking-turn-icon-wrap {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .tracking-turn-dist {
        font-size: 18px;
    }
}

/* "Track nearest" button inside the nearby panel */
.nearby-track-nearest-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 20px);
    margin: 10px;
    padding: 12px;
    background: linear-gradient(135deg, #1a1a1a, #1a1a1a);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    font-family: var(--font-primary);
}

.nearby-track-nearest-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.nearby-item-track {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.nearby-item-track:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

/* "Rastrear" button inside park detail */
.park-track-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    margin-left: 6px;
    font-family: var(--font-primary);
    transition: all 0.2s;
}

.park-track-btn:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
}

/* ===== Nearby (proximity) button + panel ===== */
.nearby-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nearby-btn:hover {
    border-color: #00A651;
    color: #00A651;
    transform: scale(1.05);
}

.nearby-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #00A651;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 6px rgba(0, 166, 81, 0.5);
}

#nearby-panel .notif-bell-panel-header strong i,
#nearby-panel .notif-bell-panel-header strong {
    color: var(--text-heading);
}

#nearby-panel .notif-bell-panel-header strong i {
    color: #00A651;
}

.nearby-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

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

.nearby-item:hover {
    background: var(--bg-section-hover);
}

.nearby-item.has-event {
    background: rgba(243, 108, 33, 0.06);
    border-left: 3px solid #F36C21;
}

.nearby-item.has-event:hover {
    background: rgba(243, 108, 33, 0.12);
}

.nearby-item-dist {
    background: var(--bg-card);
    color: var(--text-heading);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 10px;
    min-width: 60px;
    text-align: center;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.nearby-item.has-event .nearby-item-dist {
    background: #F36C21;
    color: #fff;
}

.nearby-item-body {
    flex: 1;
    min-width: 0;
}

.nearby-item-body strong {
    display: block;
    font-size: 13px;
    color: var(--text-heading);
    line-height: 1.3;
    margin-bottom: 2px;
}

.nearby-item-body small {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
}

.nearby-item-event {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #F36C21;
    font-weight: 700;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hide nearby button when admin is hidden on native? No — keep visible on native too */

/* ===== Header Notification Bell ===== */
.notif-bell-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notif-bell-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.05);
}

.notif-bell-btn.has-new i {
    animation: bell-shake 1.8s ease-in-out infinite;
    color: var(--accent);
}

@keyframes bell-shake {

    0%,
    92%,
    100% {
        transform: rotate(0);
    }

    94% {
        transform: rotate(14deg);
    }

    96% {
        transform: rotate(-12deg);
    }

    98% {
        transform: rotate(6deg);
    }
}

.notif-bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #F36C21;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 6px rgba(243, 108, 33, 0.5);
}

.notif-bell-panel {
    position: absolute;
    top: calc(var(--header-height) + 4px);
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 20px);
    max-height: 60vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    z-index: 1500;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: notif-panel-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes notif-panel-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notif-bell-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.notif-bell-panel-header strong {
    font-size: 14px;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-bell-panel-header strong i {
    color: var(--accent);
}

.notif-bell-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
}

.notif-bell-close:hover {
    color: var(--accent);
    background: var(--bg-section-hover);
}

.notif-bell-list {
    overflow-y: auto;
    padding: 6px 0;
    scrollbar-width: thin;
}

.notif-bell-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notif-bell-item:last-child {
    border-bottom: none;
}

.notif-bell-item:hover {
    background: var(--bg-section-hover);
}

.notif-bell-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.notif-bell-item.is-today .notif-bell-item-icon {
    background: #F36C21;
    box-shadow: 0 0 0 3px rgba(243, 108, 33, 0.2);
}

.notif-bell-item.is-past .notif-bell-item-icon {
    background: var(--text-secondary);
    opacity: 0.6;
}

.notif-bell-item-body {
    flex: 1;
    min-width: 0;
}

.notif-bell-item-body strong {
    display: block;
    font-size: 13px;
    color: var(--text-heading);
    margin-bottom: 2px;
    line-height: 1.3;
}

.notif-bell-item-body p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 2px 0 4px;
    line-height: 1.4;
}

.notif-bell-item-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.notif-bell-item-meta i {
    color: var(--accent);
    margin-right: 3px;
}

.notif-bell-item-park {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-card);
    color: var(--accent-light);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
}

.notif-bell-tag-today {
    background: #F36C21;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notif-bell-tag-upcoming {
    background: rgba(0, 0, 0, 0.3);
    color: var(--accent-light);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.notif-bell-tag-past {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notif-bell-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.notif-bell-empty i {
    font-size: 28px;
    display: block;
    margin-bottom: 10px;
    opacity: 0.4;
}

@media (max-width: 768px) {
    .notif-bell-panel {
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        top: calc(var(--header-height) + 2px);
    }
}

/* ===== Searchable Park Picker (Notif Form) ===== */
.notif-park-picker {
    position: relative;
}

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

.notif-park-search-wrap i.fa-search {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    font-size: 13px;
    pointer-events: none;
}

.notif-park-search-wrap input {
    width: 100%;
    padding: 9px 32px 9px 34px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-primary);
    outline: none;
}

.notif-park-search-wrap input:focus {
    border-color: var(--accent);
}

#notif-park-clear {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 12px;
}

#notif-park-clear:hover {
    color: var(--accent);
}

.notif-park-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 100;
    scrollbar-width: thin;
}

.notif-park-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.notif-park-item:last-child {
    border-bottom: none;
}

.notif-park-item:hover {
    background: var(--bg-card-hover);
}

.notif-park-item strong {
    display: block;
    font-size: 13px;
    color: var(--text-heading);
}

.notif-park-item small {
    font-size: 11px;
    color: var(--text-secondary);
}

.notif-park-no-results {
    padding: 14px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
}

/* ===== Notification Hours Picker ===== */
.notif-hours-picker {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    transition: border-color 0.2s;
}

.notif-hours-picker:focus-within {
    border-color: var(--accent);
}

.notif-hours-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 32px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 10px;
}

.notif-hours-chips:empty::before {
    content: "Aún no has agregado horas";
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
    padding: 4px 0;
}

.notif-hour-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 6px 6px 12px;
    border-radius: 18px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    animation: chip-pop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chip-pop {
    from {
        transform: scale(0.6);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.notif-hour-chip i.fa-clock {
    font-size: 11px;
    opacity: 0.85;
}

.notif-hour-chip-remove {
    background: rgba(0, 0, 0, 0.12);
    border: none;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: background 0.15s;
    margin-left: 2px;
}

.notif-hour-chip-remove:hover {
    background: rgba(0, 0, 0, 0.2);
}

.notif-hours-add {
    display: flex;
    gap: 8px;
    align-items: center;
}

.notif-hours-add input[type="time"] {
    flex: 1;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-primary);
    outline: none;
    color-scheme: dark;
}

[data-theme="light"] .notif-hours-add input[type="time"] {
    color-scheme: light;
}

.notif-hours-add input[type="time"]:focus {
    border-color: var(--accent);
}

.notif-hour-add-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.notif-hour-add-btn:hover {
    background: var(--accent-light);
    transform: scale(1.08);
}

.notif-hour-add-btn:active {
    transform: scale(0.95);
}

.notif-hours-presets {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
}

.notif-preset-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-right: 4px;
}

.notif-preset-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-primary);
}

.notif-preset-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-section-hover);
}

.notif-preset-btn.is-added {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== Notification Recurrence ===== */
.notif-weekdays {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.notif-weekdays button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-primary);
}

.notif-weekdays button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.notif-weekdays button.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: scale(1.05);
}

/* ===== Notification Image Upload ===== */
.notif-image-zone {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    overflow: hidden;
    min-height: 120px;
}

.notif-image-zone.drag-over {
    border-color: var(--accent);
    background: var(--bg-section-hover);
}

.notif-image-placeholder {
    padding: 24px 18px;
    text-align: center;
    cursor: pointer;
    color: var(--text-secondary);
}

.notif-image-placeholder i {
    font-size: 26px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.55;
}

.notif-image-placeholder p {
    font-size: 13px;
    margin: 4px 0 2px;
}

.notif-image-placeholder small {
    font-size: 11px;
    opacity: 0.75;
}

.notif-image-preview-wrap {
    position: relative;
    padding: 6px;
}

.notif-image-preview-wrap img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.notif-image-remove {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.notif-image-remove:hover {
    background: #e94560;
}

/* ===== Scheduled Notifications ===== */
.notif-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notif-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color 0.2s, opacity 0.2s;
}

.notif-card.notif-paused {
    border-left-color: #ff9800;
    opacity: 0.75;
}

.notif-card.notif-paused .notif-card-body strong {
    text-decoration: line-through;
    text-decoration-color: rgba(255, 152, 0, 0.6);
    text-decoration-thickness: 2px;
}

.notif-paused-tag {
    display: inline-block;
    background: #ff9800;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.notif-stats {
    display: flex;
    gap: 14px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    align-items: center;
}

.notif-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.notif-stats i {
    color: var(--accent);
    font-size: 10px;
}

.notif-card-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.notif-card-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.notif-card.notif-past {
    opacity: 0.55;
    border-left-color: var(--text-secondary);
}

.notif-card-body {
    flex: 1;
    min-width: 0;
}

.notif-card-body strong {
    font-size: 13px;
    color: var(--text-heading);
}

.notif-card-body p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0;
    line-height: 1.4;
}

.notif-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.notif-meta i {
    color: var(--accent);
    margin-right: 4px;
}

.notif-park-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-card);
    color: var(--accent-light);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}

.notif-past-tag {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
    font-size: 10px;
    padding: 1px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notif-recurrence-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 166, 81, 0.15);
    color: #00A651;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

/* In-app notification banner (user-facing) */
.inapp-notif-banner {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border: 1px solid var(--accent);
    border-left: 5px solid var(--accent);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    z-index: 9998;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.inapp-notif-banner .inapp-notif-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
}

.inapp-notif-image-wrap {
    position: relative;
    cursor: zoom-in;
    overflow: hidden;
}

.inapp-notif-image {
    display: block;
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.inapp-notif-image-wrap:hover .inapp-notif-image {
    transform: scale(1.04);
}

.notif-bell-item-image-wrap {
    position: relative;
    cursor: zoom-in;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 8px;
}

.notif-bell-item-image-wrap:hover .notif-bell-item-image {
    transform: scale(1.04);
}

.notif-bell-item-image {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.notif-image-zoom-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
    opacity: 0.85;
}

.notif-image-zoom-btn:hover {
    background: var(--accent);
    opacity: 1;
    transform: scale(1.08);
}

.notif-card-thumb-wrap {
    position: relative;
    cursor: zoom-in;
    flex-shrink: 0;
}

.notif-card-thumb-wrap:hover .notif-card-thumb {
    opacity: 0.85;
}

.notif-card-thumb-wrap .notif-image-zoom-btn {
    width: 24px;
    height: 24px;
    font-size: 10px;
    bottom: 4px;
    right: 4px;
    opacity: 0;
}

.notif-card-thumb-wrap:hover .notif-image-zoom-btn {
    opacity: 1;
}

.notif-bell-item.has-image {
    flex-direction: column;
    align-items: stretch;
}

.notif-bell-item-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    width: 100%;
}

.inapp-notif-banner.show {
    transform: translateX(0);
}

.inapp-notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    animation: notif-bell 1.5s ease-in-out 2;
}

@keyframes notif-bell {

    0%,
    100% {
        transform: rotate(0);
    }

    20% {
        transform: rotate(12deg);
    }

    40% {
        transform: rotate(-10deg);
    }

    60% {
        transform: rotate(6deg);
    }

    80% {
        transform: rotate(-4deg);
    }
}

.inapp-notif-body {
    flex: 1;
    min-width: 0;
}

.inapp-notif-body strong {
    display: block;
    font-size: 14px;
    color: var(--text-heading);
    margin-bottom: 3px;
}

.inapp-notif-body p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0 0;
    line-height: 1.45;
}

.inapp-notif-park {
    font-size: 11px;
    color: var(--accent-light);
    margin-bottom: 4px;
}

.inapp-notif-park i {
    margin-right: 3px;
}

.inapp-notif-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 6px;
    flex-shrink: 0;
}

.inapp-notif-close:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .inapp-notif-banner {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* ============================================================
   Navigation mode — takes over the screen like Waze / Google Maps
   ============================================================ */
body.is-tracking {
    /* Hide everything except the map and the tracking card */
}

body.is-tracking #app-header,
body.is-tracking #sidebar,
body.is-tracking #top-float-bar,
body.is-tracking #search-container,
body.is-tracking #park-detail,
body.is-tracking .modal,
body.is-tracking #nearby-panel,
body.is-tracking #notif-bell-panel,
body.is-tracking #lightbox-overlay,
body.is-tracking .inapp-notif-banner,
body.is-tracking .notif-perm-prompt,
body.is-tracking .leaflet-control-zoom {
    display: none !important;
}

/* Map expands to the full viewport */
body.is-tracking #app-container {
    height: 100vh !important;
}

body.is-tracking #map-container {
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
}

body.is-tracking #map {
    height: 100vh !important;
    width: 100vw !important;
}

/* In full tracking mode the card stays docked at the bottom */
body.is-tracking .tracking-card {
    bottom: 20px !important;
    top: auto !important;
    width: min(560px, calc(100vw - 24px)) !important;
}

/* Floating "back to app" button appears bottom-right when tracking
   is active, as a small escape hatch different from "Detener". */
body.is-tracking::after {
    /* Visual hint: dark gradient at bottom for the progress banner area */
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.18));
    z-index: 9;
}

/* Mobile: docked at the bottom, full width */
@media (max-width: 768px) {
    body.is-tracking .tracking-card {
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-width: none !important;
        border-radius: 20px 20px 0 0 !important;
        transform: translateY(100%);
    }

    body.is-tracking .tracking-card.show {
        transform: translateY(0) !important;
    }
}

/* Native app (Capacitor Android/iOS): hide admin UI — management is web-only */
body.is-native #btn-admin,
body.is-native #btn-cotejo,
body.is-native #admin-login-modal,
body.is-native #admin-panel-modal,
body.is-native #park-edit-modal,
body.is-native #route-edit-modal,
body.is-native #edit-coords-toggle {
    display: none !important;
}

/* Responsive — móvil conserva el mismo layout flotante del escritorio
   (header ovalado + top bar + sidebar como overlay sobre el mapa). */
@media (max-width: 768px) {
    :root {
        --header-height: 78px;
        --sidebar-width: min(92vw, 360px);
        --topbar-pill-height: 44px;
    }

    .header-title h1 {
        font-size: 15px;
    }

    .header-title p {
        display: none;
    }

    /* Hide the old desktop-oriented buttons in the header */
    #mobile-toggle,
    #nearby-btn,
    #nearby-panel,
    #theme-toggle,
    #sidebar-toggle {
        display: none !important;
    }

    /* Show the new left-aligned hamburger that opens the drawer.
       !important needed because the base rule (display:none) lives later
       in the file and would otherwise win the cascade. */
    .mobile-menu-btn {
        display: flex !important;
    }

    /* Only the notification bell stays in the header actions on mobile */
    #notif-bell-btn {
        display: flex;
    }

    /* Hide desktop toggle on mobile — the mobile button handles sidebar */
    .sidebar-toggle-btn {
        display: none;
    }

    /* App container fills the screen; map goes underneath everything */
    #app-container {
        flex-direction: row;
        height: 100vh;
    }

    /* Header stays as the oval floating pill, narrower padding */
    #app-header {
        top: 8px;
        left: 8px;
        right: 8px;
        padding: 0 16px;
    }

    /* Top bar: search + Opciones + Filtrar en la MISMA fila, los dos
       últimos como botones redondos icon-only para ahorrar espacio. */
    #top-float-bar {
        position: absolute;
        top: calc(var(--header-height) + 12px);
        left: 8px;
        right: 8px;
        flex-direction: row;
        gap: 8px;
        align-items: center;
        pointer-events: none;
    }

    #top-float-bar>* {
        pointer-events: auto;
    }

    /* Search pill takes all remaining space */
    #top-float-bar #search-container {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Opciones / Filtrar: shrink to a circular icon-only button */
    #top-float-bar .top-bar-section {
        flex: 0 0 var(--topbar-pill-height);
        width: var(--topbar-pill-height);
        min-width: var(--topbar-pill-height);
        border-radius: 50%;
    }

    #top-float-bar .top-bar-section .sidebar-section-header {
        padding: 0;
        justify-content: center;
    }

    /* Hide label and +/- arrow: leave only the icon */
    #top-float-bar .top-bar-section .sidebar-section-header h2 span,
    #top-float-bar .top-bar-section .sidebar-section-arrow {
        display: none;
    }

    #top-float-bar .top-bar-section .sidebar-section-header h2 {
        gap: 0;
        font-size: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    #top-float-bar .top-bar-section .sidebar-section-header h2 i {
        font-size: 15px;
        margin: 0 auto;
    }

    /* Disable the expand-on-focus animation on mobile */
    #top-float-bar.searching #search-container,
    #top-float-bar.searching .top-bar-section {
        flex-grow: 0;
    }

    /* Dropdowns: anchor the search dropdown to the full bar width and
       the icon dropdowns right-aligned under their button. */
    #top-float-bar #search-results {
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + 6px);
        width: auto;
    }

    #top-float-bar .top-bar-section .sidebar-section-body {
        position: absolute;
        left: auto;
        right: 0;
        top: calc(100% + 6px);
        width: min(80vw, 300px);
    }

    /* Sidebar on mobile only displays when a detail is open (park / route).
       Routes list is in the carousel, so the main panel is hidden. */
    #sidebar {
        position: fixed;
        top: calc(var(--header-height) + 68px);
        left: 8px;
        right: 8px;
        bottom: 120px;
        width: auto;
        max-height: none;
        padding: 0;
        border: none;
        background: transparent;
        pointer-events: none;
        z-index: 700;
        display: none;
    }

    #sidebar>* {
        pointer-events: auto;
    }

    /* When a park detail is open, show the sidebar overlay (park-detail
       lives there). Route details on mobile are shown in the bottom
       carousel — the sidebar stays hidden for routes. */
    body.park-open #sidebar {
        display: block;
        /* Full-screen overlay on mobile */
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0;
        z-index: 2400;
        overflow-y: auto;
        background: var(--floating-bg);
    }

    body.park-open #park-detail {
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        min-height: 100vh;
        padding: 16px 16px 40px;
    }

    body.park-open #back-from-detail {
        position: sticky;
        top: 8px;
        z-index: 2;
        background: var(--floating-bg);
        border-color: var(--floating-border);
        color: var(--floating-text);
    }

    /* Hide the route list / stats / favoritos on mobile — those live in
       the bottom carousel now. */
    #route-selector {
        display: auto;
    }

    /* Map takes the full viewport underneath */
    #map-container {
        flex: 1;
        width: 100%;
        height: 100%;
    }

    /* Cards inside a narrower panel */
    .route-card {
        padding: 10px 12px;
    }

    .stats-bar {
        padding: 10px 12px;
    }

    .sidebar-section {
        margin-bottom: 10px;
    }

    /* Zoom control: keep it small and anchor it bottom-left by default
       so it doesn't fight with the floating panels. */
    .leaflet-top.leaflet-left {
        top: auto !important;
        bottom: 120px;
        left: 8px;
    }

    /* Mobile bottom carousel is visible only on mobile.
       Using !important because the base rule (`display: none`) lives
       later in the file and would otherwise win the cascade. */
    .mobile-route-carousel {
        display: block !important;
    }

    /* Hide the sidebar section with routes when we have the carousel,
       to avoid showing the same routes twice if the overlay is open. */
    #sidebar .sidebar-section:has(#route-buttons) {
        display: none;
    }

    /* Only hide the carousel for park-detail and tracking. When a route
       is open, the carousel stays visible and shows its stops instead. */
    body.is-tracking .mobile-route-carousel,
    body.park-open .mobile-route-carousel {
        display: none !important;
    }
}

/* ================================================
   Mobile bottom route carousel (hidden on desktop)
   ================================================ */
.mobile-route-carousel {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 8px;
    z-index: 650;
    padding: 4px 8px 0;
    pointer-events: none;
}

/* Right-edge gradient fade that hints more cards are off-screen */
.mobile-route-carousel::after {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 6px;
    right: 0;
    width: 40px;
    pointer-events: none;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.75) 60%,
            rgba(255, 255, 255, 0.95) 100%);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-route-carousel.has-overflow::after {
    opacity: 1;
}

/* Animated chevron hint in the right edge — a little pulse that says
   "swipe to see more". Hidden once the user scrolls. */
.mobile-route-carousel .scroll-hint {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    color: #ffffff;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.9;
    animation: mobile-scroll-hint-pulse 1.4s ease-in-out infinite;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

.mobile-route-carousel.scrolled .scroll-hint,
.mobile-route-carousel:not(.has-overflow) .scroll-hint {
    opacity: 0;
    animation: none;
}

@keyframes mobile-scroll-hint-pulse {

    0%,
    100% {
        transform: translate(0, -50%);
        opacity: 0.65;
    }

    50% {
        transform: translate(6px, -50%);
        opacity: 1;
    }
}

.mobile-route-carousel-inner {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 4px 4px 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    pointer-events: auto;
}

.mobile-route-carousel-inner::-webkit-scrollbar {
    display: none;
}

.mobile-route-card {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    background: var(--floating-bg);
    color: var(--floating-text);
    border: 1px solid var(--floating-border);
    border-left: 4px solid var(--floating-border);
    border-radius: 999px;
    font-family: var(--font-primary);
    font-size: 13px;
    cursor: pointer;
    scroll-snap-align: start;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-width: 200px;
    text-align: left;
}

.mobile-route-card:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.mobile-route-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.mobile-route-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.mobile-route-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--floating-text);
    white-space: nowrap;
}

.mobile-route-meta {
    font-size: 11px;
    color: var(--floating-text-muted);
    white-space: nowrap;
}

/* "Volver" pill shown at the start of the mobile stops carousel */
.mobile-stop-back {
    border-left-color: #ffffff !important;
    min-width: 140px;
}

/* Numbered circle for each parada in the mobile stops carousel */
.mobile-stop-card .mobile-route-icon {
    font-weight: 700;
    font-size: 14px;
}

/* ================================================
   Mobile header hamburger + left-side drawer
   Hidden on desktop, shown only on mobile.
   ================================================ */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--floating-text);
    font-size: 18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin-right: 4px;
    flex-shrink: 0;
}

.mobile-menu-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-menu-drawer {
    position: fixed;
    inset: 0;
    z-index: 2100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-menu-drawer.is-open {
    pointer-events: auto;
    opacity: 1;
}

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

.mobile-menu-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(80vw, 320px);
    background: var(--floating-bg);
    color: var(--floating-text);
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.4);
    padding: 18px 14px 20px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mobile-menu-drawer.is-open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--floating-border);
    color: var(--floating-text);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.mobile-menu-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--floating-text-muted);
    margin: 30px 6px 8px;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--floating-text);
    font-size: 15px;
    font-family: var(--font-primary);
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--floating-border);
}

.mobile-menu-item i {
    font-size: 16px;
    width: 24px;
    text-align: center;
    color: var(--accent-light);
}

/* Dark-mode item: show moon by default, sun when theme is light */
.mobile-menu-item .theme-icon-sun {
    display: none;
}

[data-theme="light"] .mobile-menu-item .theme-icon-moon {
    display: none;
}

[data-theme="light"] .mobile-menu-item .theme-icon-sun {
    display: inline-block;
}

/* Dark-mode toggle temporarily hidden (desktop + mobile drawer) */
#theme-toggle,
#mobile-menu-theme {
    display: none !important;
}

/* ================================================
   Mobile: notifications & nearby panels go fullscreen
   ================================================ */
@media (max-width: 768px) {

    #notif-bell-panel,
    #nearby-panel {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: none !important;
        max-height: none !important;
        height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
        background: var(--floating-bg) !important;
        z-index: 2500 !important;
        display: flex;
        flex-direction: column;
    }

    #notif-bell-panel.hidden,
    #nearby-panel.hidden {
        display: none !important;
    }

    .notif-bell-panel-header {
        padding: 18px 16px !important;
        background: var(--floating-bg) !important;
        border-bottom: 1px solid var(--floating-border) !important;
    }

    .notif-bell-panel-header strong {
        font-size: 17px !important;
        color: var(--floating-text) !important;
    }

    .notif-bell-close {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px !important;
        color: var(--floating-text) !important;
        border: 1px solid var(--floating-border);
    }

    .notif-bell-list {
        flex: 1;
        padding: 8px 4px 80px;
        max-height: none !important;
    }

    .notif-bell-item {
        padding: 14px 16px;
    }

    /* Hide floating map controls (zoom, carousel, map-style toggle) when
       a fullscreen panel is open so they don't show through. */
    body:has(#notif-bell-panel:not(.hidden)) .leaflet-top.leaflet-left,
    body:has(#notif-bell-panel:not(.hidden)) .mobile-route-carousel,
    body:has(#notif-bell-panel:not(.hidden)) .map-layer-btn,
    body:has(#nearby-panel:not(.hidden)) .leaflet-top.leaflet-left,
    body:has(#nearby-panel:not(.hidden)) .mobile-route-carousel,
    body:has(#nearby-panel:not(.hidden)) .map-layer-btn,
    body:has(.mobile-menu-drawer.is-open) .leaflet-top.leaflet-left,
    body:has(.mobile-menu-drawer.is-open) .mobile-route-carousel,
    body:has(.mobile-menu-drawer.is-open) .map-layer-btn,
    /* When a park detail is open on mobile, hide the floating controls */
    body.park-open .leaflet-top.leaflet-left,
    body.park-open .map-layer-btn,
    body.park-open .mobile-back-route-btn {
        display: none !important;
    }
}

/* ================================================
   Mobile floating "Volver" button (shown when a route is open)
   ================================================ */
.mobile-back-route-btn {
    display: none;
    position: absolute;
    bottom: 70px;
    right: 8px;
    z-index: 645;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 600;
    color: var(--floating-text);
    background: var(--floating-bg);
    border: 1px solid var(--floating-border);
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mobile-back-route-btn i {
    font-size: 13px;
    color: var(--accent-light);
}

.mobile-back-route-btn:active {
    transform: scale(0.96);
}

/* Show the floating back button only on mobile + when a route is open */
@media (max-width: 768px) {
    body.route-open .mobile-back-route-btn {
        display: inline-flex;
    }
}

/* ================================================
   Mobile floating "Iniciar recorrido" button
   ================================================ */
.mobile-start-route-btn {
    display: none;
    position: absolute;
    bottom: 70px;
    left: 8px;
    z-index: 645;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: var(--accent);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mobile-start-route-btn i {
    font-size: 12px;
}

.mobile-start-route-btn:active {
    transform: scale(0.96);
}

@media (max-width: 768px) {
    body.route-open .mobile-start-route-btn {
        display: inline-flex;
    }

    body.is-tracking .mobile-start-route-btn,
    body.park-open .mobile-start-route-btn {
        display: none !important;
    }
}

/* ================================================
   Map / Satellite toggle (floating pill bottom-right)
   ================================================ */
.map-layer-btn {
    position: absolute;
    bottom: 24px;
    right: 20px;
    z-index: 640;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 600;
    color: var(--floating-text);
    background: var(--floating-bg);
    border: 1px solid var(--floating-border);
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.map-layer-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

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

.map-layer-btn i {
    font-size: 14px;
    color: var(--accent-light);
}

.map-layer-btn.is-satellite i {
    color: #f4b942;
}

@media (max-width: 768px) {
    .map-layer-btn {
        bottom: 170px;
        right: 8px;
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Push the carousel a little higher so the "Volver" pill fits above it */
    body.route-open .mobile-route-carousel {
        bottom: 2px;
    }
}

@media (max-width: 480px) {
    .header-title i {
        font-size: 22px;
    }

    .route-card-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* Lightbox mobile */
@media (max-width: 768px) {
    .lb-nav {
        width: 42px;
        height: 42px;
        font-size: 20px;
        background: rgba(0, 0, 0, 0.5);
    }

    .lb-prev {
        left: 8px;
    }

    .lb-next {
        right: 8px;
    }

    .lb-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 22px;
        background: rgba(0, 0, 0, 0.5);
    }

    .lb-img-wrap {
        max-width: 96vw;
        max-height: 75vh;
    }

    .lb-img-wrap img {
        max-width: 96vw;
        max-height: 75vh;
        border-radius: 4px;
    }

    .lb-counter {
        font-size: 13px;
        margin-top: 10px;
    }

    #lightbox-overlay::after {
        content: "Desliza para navegar";
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        color: rgba(255, 255, 255, 0.3);
        font-size: 11px;
        pointer-events: none;
    }
}

/* ============================================================ */
/* AI Chat de voz (Ollama)                                      */
/* ============================================================ */

/* FAB (Floating Action Button) — micrófono institucional */
.ai-chat-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #1a1a1a, #666666);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45),
        0 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.ai-chat-fab:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}

.ai-chat-fab:active {
    transform: scale(0.96);
}

.ai-chat-fab .ai-chat-fab-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
}

.ai-chat-fab.listening {
    background: linear-gradient(135deg, #d62b2b, #ef5959);
    box-shadow: 0 6px 22px rgba(214, 43, 43, 0.55);
}

.ai-chat-fab.listening .ai-chat-fab-pulse {
    animation: aiPulse 1.4s ease-out infinite;
    opacity: 1;
}

@keyframes aiPulse {
    0% {
        transform: scale(0.9);
        opacity: 0.9;
    }

    80% {
        transform: scale(1.6);
        opacity: 0;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Hide FAB on small overlay states if necessary */
body.is-native .ai-chat-fab {
    bottom: max(18px, env(safe-area-inset-bottom));
    right: max(18px, env(safe-area-inset-right));
}

/* Modal overlay */
.ai-chat-modal {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(3px);
    z-index: 4000;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 16px;
    animation: aiOverlayIn .18s ease-out;
}

.ai-chat-modal.hidden {
    display: none;
}

@keyframes aiOverlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Panel principal */
.ai-chat-panel {
    width: min(420px, 100%);
    max-width: 420px;
    height: min(640px, 90vh);
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #e8e8e8);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: aiPanelIn .22s cubic-bezier(.2, .9, .3, 1);
}

@keyframes aiPanelIn {
    from {
        transform: translateY(20px) scale(.98);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

[data-theme="light"] .ai-chat-panel {
    background: #ffffff;
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.08);
}

/* Header del panel */
.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, #1a1a1a, #666666);
    color: #fff;
    flex: 0 0 auto;
}

.ai-chat-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ai-chat-title-wrap>i {
    font-size: 18px;
}

.ai-chat-title-wrap>strong {
    font-size: 15px;
    letter-spacing: .2px;
}

.ai-chat-subtitle {
    font-size: 11px;
    opacity: 0.85;
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 4px;
}

.ai-chat-header-actions {
    display: flex;
    gap: 4px;
}

.ai-chat-icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.06);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}

.ai-chat-icon-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.ai-chat-icon-btn.muted {
    opacity: .6;
}

/* Lista de mensajes */
.ai-chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.ai-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    animation: aiBubbleIn .18s ease-out;
}

@keyframes aiBubbleIn {
    from {
        transform: translateY(4px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ai-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex: 0 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    margin-top: 2px;
}

.ai-msg-user {
    flex-direction: row-reverse;
}

.ai-msg-user .ai-msg-avatar {
    background: #666666;
    color: #fff;
}

.ai-msg-assistant .ai-msg-avatar {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.ai-msg-system .ai-msg-avatar {
    background: rgba(0, 0, 0, 0.04);
    color: #a0a0b0;
}

[data-theme="light"] .ai-msg-system .ai-msg-avatar {
    background: #ececef;
    color: #555;
}

.ai-msg-bubble {
    max-width: 78%;
    padding: 9px 12px;
    border-radius: 14px;
    line-height: 1.45;
    font-size: 14px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.ai-msg-user .ai-msg-bubble {
    background: #666666;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-msg-assistant .ai-msg-bubble {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary, #e8e8e8);
    border-bottom-left-radius: 4px;
}

[data-theme="light"] .ai-msg-assistant .ai-msg-bubble {
    background: #f1f3f7;
    color: #1a1a1a;
}

.ai-msg-system .ai-msg-bubble {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary, #a0a0b0);
    font-size: 13px;
    border-radius: 10px;
}

[data-theme="light"] .ai-msg-system .ai-msg-bubble {
    background: #f7f7fa;
    color: #555;
}

.ai-msg-bubble.streaming::after {
    content: "▍";
    display: inline-block;
    margin-left: 2px;
    animation: aiCaret 1s steps(2) infinite;
    opacity: .7;
}

@keyframes aiCaret {

    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 0.9;
    }
}

/* Status row */
.ai-chat-status-row {
    padding: 0 14px;
    height: 18px;
    flex: 0 0 auto;
}

.ai-chat-status {
    font-size: 12px;
    color: var(--text-secondary, #a0a0b0);
}

/* Input row */
.ai-chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex: 0 0 auto;
    background: rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .ai-chat-input-row {
    background: #fafbfd;
    border-top-color: rgba(0, 0, 0, 0.06);
}

.ai-chat-mic-btn,
.ai-chat-send-btn {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform .12s ease, background .15s ease;
}

.ai-chat-mic-btn {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary, #e8e8e8);
}

.ai-chat-mic-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

.ai-chat-mic-btn.listening {
    background: #d62b2b;
    color: #fff;
    box-shadow: 0 0 0 0 rgba(214, 43, 43, 0.55);
    animation: aiMicPulse 1.2s infinite;
}

@keyframes aiMicPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(214, 43, 43, 0.55);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(214, 43, 43, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(214, 43, 43, 0);
    }
}

.ai-chat-send-btn {
    background: linear-gradient(135deg, #1a1a1a, #666666);
    color: #fff;
}

.ai-chat-send-btn:hover {
    transform: translateY(-1px);
}

.ai-chat-send-btn:disabled,
.ai-chat-send-btn.loading {
    opacity: .65;
    cursor: progress;
    transform: none;
}

.ai-chat-send-btn.loading i {
    animation: aiSpin 1s linear infinite;
}

@keyframes aiSpin {
    from {
        transform: rotate(0);
    }

    to {
        transform: rotate(360deg);
    }
}

.ai-chat-input {
    flex: 1 1 auto;
    min-height: 40px;
    max-height: 120px;
    resize: none;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary, #e8e8e8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    outline: none;
    line-height: 1.4;
}

.ai-chat-input::placeholder {
    color: var(--text-secondary, #a0a0b0);
    opacity: .8;
}

.ai-chat-input:focus {
    border-color: #666666;
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ai-chat-input {
    background: #fff;
    color: #1a1a1a;
    border-color: #d8dde5;
}

/* Mobile fullscreen */
@media (max-width: 600px) {
    .ai-chat-modal {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .ai-chat-panel {
        width: 100%;
        max-width: none;
        height: 100%;
        border-radius: 0;
    }

    .ai-chat-fab {
        right: 14px;
        bottom: 84px;
        /* sobre la barra inferior si existe */
    }
}

/* ============================================================ */
/* AI Actions - pills (chips bajo la respuesta) y toasts         */
/* ============================================================ */

.ai-actions-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    padding-left: 38px;
    /* alinea con burbuja del asistente */
}

.ai-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(40, 167, 69, 0.18);
    color: #28a745;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2px;
    border: 1px solid rgba(40, 167, 69, 0.28);
    animation: aiPillIn .25s ease-out;
}

.ai-action-pill i {
    font-size: 10px;
}

@keyframes aiPillIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

[data-theme="light"] .ai-action-pill {
    background: #e6f4ea;
    color: #1e7e34;
    border-color: #cce5d5;
}

/* Toast: notificación temporal cuando el agente ejecuta una acción */
.ai-toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%) translateY(8px);
    background: rgba(0, 0, 0, 0.96);
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 5000;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    max-width: 80vw;
    text-align: center;
    pointer-events: none;
}

.ai-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ai-toast-ok {
    background: linear-gradient(135deg, #28a745, #34c759);
}

.ai-toast-info {
    background: linear-gradient(135deg, #1a1a1a, #666666);
}

.ai-toast-error {
    background: linear-gradient(135deg, #d62b2b, #ef5959);
}

@media (max-width: 600px) {
    .ai-toast {
        bottom: 110px;
    }
}

/* ============================================================ */
/* AI Chat FAB - drag & drop                                    */
/* ============================================================ */
.ai-chat-fab {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.ai-chat-fab:active,
.ai-chat-fab.dragging {
    cursor: grabbing;
}

.ai-chat-fab.dragging {
    transform: scale(1.1);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.65),
        0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0.95;
    transition: none !important;
}

/* AI model chips (admin tab) */
.ai-model-chip {
    display: inline-block;
    padding: 3px 9px;
    margin: 3px 3px 0 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 11px;
    font-family: ui-monospace, monospace;
    cursor: pointer;
    transition: background .15s ease;
}

.ai-model-chip:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.5);
}

.ai-model-chip.is-current {
    background: rgba(40, 167, 69, 0.25);
    border-color: rgba(40, 167, 69, 0.6);
    color: #28a745;
    font-weight: 600;
}

[data-theme="light"] .ai-model-chip {
    background: #f1f3f7;
    border-color: #d8dde5;
    color: #1a1a1a;
}

[data-theme="light"] .ai-model-chip.is-current {
    background: #e6f4ea;
    border-color: #1e7e34;
    color: #1e7e34;
}