/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2196F3;
    --danger-color: #f44336;
    --success-color: #4CAF50;
    --warning-color: #ff9800;
    --text-primary: #212121;
    --text-secondary: #757575;
    --bg-white: #ffffff;
    --bg-gray: #f5f5f5;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.15);
    --shadow-large: 0 4px 16px rgba(0,0,0,0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-primary);
    overflow: hidden;
}

/* Map Container */
#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

/* Custom SFParkMap Canvas */
.sfpark-map-canvas {
    touch-action: none; /* Prevent browser gestures interfering */
}

/* Custom map popup container */
.sfpark-popup-container {
    z-index: 1000;
}

/* Custom map popup styling */
.sfpark-popup {
    animation: popup-fade-in 0.15s ease-out;
}

@keyframes popup-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Move Leaflet zoom controls to bottom right */
.leaflet-top.leaflet-left {
    top: auto;
    left: auto;
    bottom: 16px;
    right: 16px;
}

/* With Canvas renderer, Leaflet handles hit detection internally.
   Streets (lines) have small hit tolerance, so clicks in empty space
   naturally fall through to zones below via z-index ordering. */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-gray);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* Search Container */
#search-container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 400px;
    max-width: calc(100vw - 20px);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#search-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    box-shadow: var(--shadow);
    outline: none;
    transition: box-shadow 0.2s;
}

#search-input:focus {
    box-shadow: var(--shadow-large);
}

.gps-search-btn {
    width: 48px;
    height: 48px;
    background: var(--bg-white);
    border: none;
    border-radius: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: all 0.2s;
    flex-shrink: 0;
}

.gps-search-btn:hover {
    box-shadow: var(--shadow-large);
    transform: scale(1.05);
}

.gps-search-btn:active {
    transform: scale(0.95);
}

.search-results {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-large);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    width: 100%;
}

.search-results.hidden {
    display: none;
}

.search-result {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

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

.search-result:hover {
    background-color: var(--bg-gray);
}

.search-result-name {
    font-weight: 500;
    color: var(--text-primary);
}

.search-result-address {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Layer Controls Panel */
.control-panel {
    position: fixed;
    background: var(--bg-white);
    box-shadow: var(--shadow-large);
    border-radius: 12px 12px 0 0;
    transition: transform 0.3s ease;
    z-index: 1000;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Mobile: Bottom sheet */
@media (max-width: 767px) {
    .control-panel {
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(calc(100% - 60px));
    }

    .control-panel.expanded {
        transform: translateY(0);
    }
}

/* Desktop: Sidebar */
@media (min-width: 768px) {
    .control-panel {
        top: 180px;
        right: 10px;
        bottom: auto;
        width: 320px;
        max-height: calc(100vh - 196px);
        border-radius: 12px;
        transform: none;
    }

    .panel-toggle {
        display: none !important;
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.panel-toggle {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.control-panel.expanded .panel-toggle {
    transform: rotate(180deg);
}

.panel-content {
    overflow-y: auto;
    flex: 1;
}

/* Layer Toggles */
.layer-section {
    padding: 16px;
}

.layer-toggle {
    margin-bottom: 12px;
}

.layer-toggle label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.layer-toggle label:hover {
    background-color: var(--bg-gray);
}

.layer-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
}

.layer-toggle input[type="checkbox"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.layer-toggle input[type="checkbox"]:disabled ~ span {
    opacity: 0.5;
    color: var(--text-secondary);
}

.layer-toggle label:has(input:disabled) {
    cursor: not-allowed;
}

.layer-toggle label:has(input:disabled):hover {
    background-color: transparent;
}

.layer-toggle span {
    flex: 1;
    font-size: 15px;
}

.feature-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 8px;
}

.feature-count:empty::before {
    content: '...';
}

/* Day Filter Dropdown */
.layer-toggle {
    position: relative;
}

.day-filter-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.day-filter-btn:hover:not(:disabled) {
    background: var(--bg-gray);
    border-color: var(--primary-color);
}

.day-filter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.day-filter-btn svg {
    transition: transform 0.2s;
}

.day-filter-btn.active svg {
    transform: rotate(180deg);
}

.day-filter-dropdown {
    display: none;
    /* position: fixed set via JS for proper viewport escape */
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 12px;
    min-width: 180px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 2000;
}

.day-filter-dropdown.show {
    display: block;
}

.day-filter-header {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.day-filter-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.day-filter-item:hover {
    background-color: var(--bg-gray);
}

.day-filter-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
}

.day-filter-item span {
    font-size: 14px;
    user-select: none;
}

.day-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.day-filter-action {
    flex: 1;
    padding: 4px 8px;
    font-size: 12px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.day-filter-action:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Filters Section */
.filters-section {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

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

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-checkboxes label {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

.filter-checkboxes input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
    padding: 4px 0;
}

.btn-link:hover {
    color: #1976D2;
}

/* Data Status */
.data-status {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.stale-warning {
    background: var(--warning-color);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stale-warning.hidden {
    display: none;
}

.update-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Recenter Button */
.recenter-btn {
    position: fixed;
    right: 16px;
    bottom: 100px;
    width: 48px;
    height: 48px;
    background: var(--bg-white);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: all 0.2s;
    z-index: 999;
}

.recenter-btn:hover {
    box-shadow: var(--shadow-large);
    transform: scale(1.05);
}

.recenter-btn:active {
    transform: scale(0.95);
}

.recenter-btn.hidden {
    display: none;
}

@media (max-width: 767px) {
    .recenter-btn {
        bottom: calc(70vh + 16px);
    }

    .control-panel:not(.expanded) ~ .recenter-btn {
        bottom: 76px;
    }
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: var(--shadow-large);
}

.leaflet-popup-content {
    margin: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.popup-content h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.popup-content p {
    margin: 6px 0;
}

.popup-content strong {
    color: var(--text-primary);
}

/* Zone Hover Popup - Compact styling */
.zone-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 6px;
}

.zone-popup .leaflet-popup-content {
    margin: 0;
}

.zone-hover-popup {
    padding: 8px 12px;
    border-left: 4px solid;
    font-size: 13px;
    line-height: 1.4;
}

.zone-hover-popup strong {
    font-size: 14px;
    display: block;
}

.zone-time-info {
    color: var(--text-secondary);
    margin-top: 2px;
    font-size: 12px;
}

/* Multi-zone popup styling - continuous left borders with separator lines */
.zone-hover-popup.zone-multi {
    border-bottom: 1px solid #ddd;
}

.zone-hover-popup.zone-multi.zone-last {
    border-bottom: none;
}

/* Zone popup positioned below cursor */
.zone-popup-below .leaflet-popup-content-wrapper {
    margin-top: 12px;
}

.zone-popup-below .leaflet-popup-tip-container {
    top: -12px;
    transform: rotate(180deg);
}

/* Street Popup - Compact styling with color bar */
.street-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 6px;
}

.street-popup .leaflet-popup-content {
    margin: 0;
}

.street-hover-popup {
    padding: 8px 12px;
    border-left: 4px solid;
    font-size: 13px;
    line-height: 1.4;
}

.street-hover-popup strong {
    font-size: 14px;
    display: block;
}

.street-time-info {
    color: var(--text-secondary);
    margin-top: 2px;
    font-size: 12px;
}

.street-rpp-info {
    color: var(--primary-color);
    margin-top: 4px;
    font-size: 11px;
    font-weight: 500;
}

.street-schedule-list {
    margin: 4px 0 0 0;
    padding: 0 0 0 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.street-schedule-list li {
    margin: 2px 0;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Touch targets for mobile - but NOT for compact smart controls */
@media (max-width: 767px) {
    button,
    a,
    input[type="checkbox"] {
        min-width: 44px;
        min-height: 44px;
    }

    /* Override for compact smart controls - these have their own sizing */
    .smart-controls button,
    .smart-controls input[type="checkbox"],
    .smart-controls input[type="date"],
    .smart-controls input[type="time"] {
        min-width: unset;
        min-height: unset;
    }
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smart Controls */
.smart-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    padding: 10px 14px;
    min-width: 300px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}

.smart-controls-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.control-row label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.control-row select,
.control-row input[type="time"] {
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.control-row select:focus,
.control-row input[type="time"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Base legend color swatch (used in legend row) */
.legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.15);
    flex-shrink: 0;
}

#rpp-zone-select {
    flex: 1;
    min-width: 150px;
}

/* Zone dropdown color styling */
#rpp-zone-select option {
    padding: 4px 8px;
}

/* Note: Browser support for styling <option> elements is limited.
   Colors are applied via inline styles in the HTML for better compatibility. */
#rpp-zone-select option[data-color] {
    font-weight: 600;
}

/* Custom Select Dropdown */
.custom-select-wrapper {
    position: relative;
    flex: 1;
    min-width: 150px;
}

.custom-select-button {
    width: 100%;
    padding: 6px 12px;
    font-size: 14px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
    text-align: left;
}

.custom-select-button:hover {
    border-color: var(--primary-color);
}

.custom-select-button:focus {
    outline: none;
    border-color: var(--primary-color);
}

.custom-select-button svg {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.custom-select-button:hover svg {
    transform: translateY(1px);
}

#rpp-zone-display {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-dropdown {
    /* Position set dynamically via JS for fixed positioning */
    position: fixed;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: min(300px, 50vh);
    overflow-y: auto;
    z-index: 2000;
}

.custom-select-dropdown.hidden {
    display: none;
}

.custom-select-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.custom-select-option:hover {
    background-color: var(--bg-gray);
}

.custom-select-option:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.custom-select-option:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.view-toggle-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    width: 100%;
}

.view-toggle-btn:hover {
    background: #2563eb;
}

.view-toggle-btn:active {
    transform: translateY(1px);
}

/* Compact legend row with settings toggle */
.legend-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.legend-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.legend-row .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-right: 4px;
}

.legend-row.hidden {
    display: none;
}

.settings-toggle-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.settings-toggle-btn:hover {
    background: var(--bg-gray);
    color: var(--text-primary);
}

.settings-toggle-btn.active {
    background: var(--bg-gray);
    color: var(--primary-color);
}

/* Collapsible simple settings */
.simple-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
}

.simple-settings.hidden {
    display: none;
}

/* Time Controls */
.time-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.time-controls .time-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Date navigation group with prev/today/next buttons */
.date-nav-group {
    display: flex;
    align-items: center;
    gap: 0;
}

.date-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.date-nav-btn:first-child {
    border-radius: 4px 0 0 4px;
    border-right: none;
}

.date-nav-btn:last-child {
    border-radius: 0 4px 4px 0;
    border-left: none;
}

.date-nav-btn:hover {
    background: #e5e7eb;
    color: var(--text-primary);
}

.date-nav-btn:active {
    transform: scale(0.95);
}

/* Reset button - pushed to far right */
.reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    margin-left: auto;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.reset-btn:hover {
    background: #e5e7eb;
    color: var(--primary-color);
}

.reset-btn:active {
    transform: scale(0.95);
}

.date-picker {
    width: 120px;
    height: 26px;
    padding: 0 6px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 0;
    border-left: none;
    border-right: none;
    color: var(--text-primary);
    cursor: pointer;
}

.date-picker:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.date-picker.hidden {
    display: none;
}

/* Holiday indicator - replaces date picker on holidays, bonds with nav buttons */
.holiday-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 26px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-left: none;
    border-right: none;
    border-radius: 0;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s;
}

.holiday-indicator:hover {
    background: #fde68a;
}

.holiday-indicator.hidden {
    display: none;
}

/* When holiday is active, nav buttons get matching border */
.date-nav-group.holiday-active .date-nav-btn {
    border-color: #f59e0b;
}

#predict-time {
    min-width: 80px;
    height: 26px;
    padding: 0 6px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Detailed Layers Section - Compact */
.detailed-layers {
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
}

.detailed-layers.hidden {
    display: none;
}

.layers-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.detailed-layers .layer-toggle {
    margin-bottom: 4px;
    position: relative;
}

.detailed-layers .layer-toggle label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.detailed-layers .layer-toggle label:hover {
    background-color: var(--bg-gray);
}

.detailed-layers .layer-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
}

.detailed-layers .layer-toggle input[type="checkbox"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.detailed-layers .layer-toggle input[type="checkbox"]:disabled ~ span {
    opacity: 0.5;
    color: var(--text-secondary);
}

.detailed-layers .layer-toggle label:has(input:disabled) {
    cursor: not-allowed;
}

.detailed-layers .layer-toggle label:has(input:disabled):hover {
    background-color: transparent;
}

.detailed-layers .layer-toggle span {
    flex: 1;
    font-size: 13px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #search-container {
        top: 5px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 10px);
        max-width: 400px;
    }

    .smart-controls {
        top: 65px;
        left: 5px;
        right: 5px;
        padding: 8px 12px;
        min-width: 0;
        max-height: calc(100vh - 75px);
    }

    .smart-controls-inner {
        gap: 8px;
    }

    .leaflet-top.leaflet-left {
        bottom: 80px;
        right: 10px;
    }

    /* Permit zone on single line */
    .control-row:first-child {
        flex-direction: row;
        align-items: center;
    }

    .control-row:first-child label {
        flex-shrink: 0;
        margin-right: 8px;
        font-size: 13px;
    }

    #rpp-zone-select {
        flex: 1;
        min-width: 0;
        font-size: 13px;
        padding: 4px 8px;
    }

    /* View toggle button */
    .view-toggle-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* Legend row compact on mobile */
    .legend-row {
        gap: 4px;
    }

    .legend-label {
        font-size: 11px;
    }

    .legend-row .legend-color {
        width: 10px;
        height: 10px;
    }

    .legend-text {
        font-size: 10px;
        margin-right: 2px;
    }

    .settings-toggle-btn {
        width: 24px;
        height: 24px;
    }

    .simple-settings {
        padding-top: 8px;
        margin-top: 8px;
    }

    /* Time controls more compact */
    .time-controls {
        gap: 6px;
    }

    .time-controls .time-label {
        font-size: 12px;
    }

    .date-nav-group {
        gap: 0;
    }

    .date-nav-btn {
        width: 22px;
        height: 22px;
    }

    .date-nav-btn svg {
        width: 10px;
        height: 10px;
    }

    .date-picker {
        width: 100px;
        height: 22px;
        font-size: 12px;
        padding: 0 4px;
    }

    .holiday-indicator {
        min-width: 90px;
        height: 22px;
        padding: 0 6px;
        font-size: 11px;
    }

    #predict-time {
        min-width: 65px;
        height: 22px;
        font-size: 12px;
        padding: 0 4px;
    }

    .reset-btn {
        width: 22px;
        height: 22px;
    }

    .reset-btn svg {
        width: 12px;
        height: 12px;
    }

    /* Detailed layers even more compact on mobile */
    .detailed-layers {
        padding-top: 6px;
        margin-top: 6px;
    }

    .layers-header {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .detailed-layers .layer-toggle {
        margin-bottom: 2px;
    }

    .detailed-layers .layer-toggle label {
        padding: 3px 4px;
    }

    .detailed-layers .layer-toggle input[type="checkbox"] {
        width: 14px;
        height: 14px;
        min-width: 14px;
        min-height: 14px;
        margin-right: 6px;
    }

    .detailed-layers .layer-toggle span {
        font-size: 12px;
    }

    .feature-count {
        font-size: 10px;
    }
}

/* Renderer indicator */
.renderer-indicator {
    position: fixed;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1000;
    user-select: none;
    transition: background-color 0.2s;
}

.renderer-indicator:hover {
    background: rgba(0, 0, 0, 0.8);
}

.renderer-indicator .renderer-name {
    font-weight: 500;
}

.renderer-indicator .renderer-switch {
    opacity: 0.7;
    margin-left: 4px;
    font-size: 10px;
}

/* Print styles */
@media print {
    .control-panel,
    .recenter-btn,
    .smart-controls,
    #search-container,
    .renderer-indicator {
        display: none !important;
    }

    #map {
        position: relative;
        width: 100%;
        height: 100vh;
    }
}
