        :root {
            --sea-blue: #1E90FF;
                --muted-coral: #D95B43;
            --soft-peach: #FAD4C0;
            --sea-glass-blue: #85A4AF;
            --pale-sand: #F9F6F2;
            --deep-slate: #3C4858;
            --border-color-soft: #EAE6E1;
            --soft-blue: #A7C6ED;
            --primary-color: var(--muted-coral);
            --text-color: var(--deep-slate);
            --background-color: var(--pale-sand);
            --highlight-color: var(--soft-peach);
            --card-shadow: 0 4px 25px rgba(60, 72, 88, 0.07);
            --border-radius: 6px;
        }

        body {
            background-color: var(--background-color);
            font-family: 'Inter', sans-serif;
            color: var(--text-color);
            overflow-x: hidden;
        }

        .card {
            border: 1px solid var(--border-color-soft);
            border-radius: var(--border-radius);
            box-shadow: var(--card-shadow);
            background-color: #ffffff;
        }

        .spot-name {
            font-size: 1.75rem;
            font-weight: 700;
            color: var(--text-color);
        }

        .loading-spinner {
            display: none;
        }

        .forecast-section .loading-spinner-small {
            display: none;
        }

        .table-container {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }

        .table-container::-webkit-scrollbar {
            display: none;
        }

        .hourly-breakdown-table {
            width: 100%;
            min-width: 600px;
            font-size: 0.9rem;
        }

        .hourly-breakdown-table th,
        .hourly-breakdown-table td {
            text-align: left;
            vertical-align: middle;
            padding: 0;
            white-space: nowrap;
            user-select: none;
        }

        .hourly-breakdown-table th {
            color: var(--primary-color);
            font-size: 0.8rem;
            padding: 0;
            font-weight: 500;
            border-bottom: 2px solid var(--border-color-soft);
            background-color: var(--background-color);
        }

        .hourly-breakdown-table tbody tr:nth-child(even) {
            background-color: #fdfcfa;
        }

        .hourly-score-inline {
            font-weight: 700;
            font-size: 0.75rem;
            padding: 1px 4px;
            border-radius: 5px;
            color: var(--text-color);
            background-color: rgba(60, 72, 88, 0.08);
        }

        .score-clickable {
            cursor: pointer;
        }

        .cell-flex-container {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 0.25rem;
        }

        .sticky-col {
            position: -webkit-sticky;
            position: sticky;
            left: 0;
            z-index: 2;
            background-color: var(--background-color);
        }

        .hourly-breakdown-table tbody tr:nth-child(even) .sticky-col {
            background-color: #fdfcfa;
        }

        .table-container .hourly-breakdown-table th {
            position: -webkit-sticky;
            position: sticky;
            top: 0;
            z-index: 3;
        }

        .table-container .hourly-breakdown-table th.sticky-col {
            z-index: 4;
        }

        .hourly-breakdown-table .current-hour-highlight {
            background-color: var(--highlight-color) !important;
            font-weight: 700;
        }

        .hourly-breakdown-table .current-hour-highlight .sticky-col {
            background-color: var(--highlight-color) !important;
        }

        .hourly-breakdown-table .top-hour-highlight {
            background-color: var(--highlight-color) !important;
            font-weight: 500;
        }

        .hourly-breakdown-table .top-hour-highlight .sticky-col {
            background-color: var(--highlight-color) !important;
        }

        .hourly-breakdown-table .top-hour-highlight td:first-child {
            border-left: 3px solid var(--primary-color);
        }

        .topbar {
            background-color: #ffffff;
            position: sticky;
            top: 0;
            z-index: 1030;
            border-bottom: 1px solid var(--border-color-soft);
            --bs-navbar-padding-y: 0.3rem;
        }

        .topbar .container-fluid {
            padding-left: 0.5rem;
            padding-right: 0.5rem;
        }

        .topbar .navbar-toggler {
            border: none;
            padding: 0.25rem 0;
            color: var(--text-primary);
            margin-right: 0.25rem;
        }

        .topbar .navbar-toggler:focus {
            box-shadow: none;
        }

        .topbar .navbar-toggler:hover {
            background-color: var(--hover-bg);
            border-radius: 0.375rem;
        }

        .mobile-nav-dropdown {
            display: none;
            position: relative;
        }

        .mobile-nav-toggle {
            background: var(--pale-sand);
            border: 1px solid var(--border-color-soft);
            color: var(--text-color);
            font-size: 1.1rem;
            padding: 0.4rem 0.5rem;
            cursor: pointer;
            transition: all 0.2s ease;
            flex-shrink: 0;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            height: 36px;
        }

        .mobile-nav-toggle:active {
            transform: scale(0.95);
        }

        .mobile-nav-toggle.active {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .mobile-nav-menu {
            display: none;
            position: absolute;
            top: calc(100% + 4px);
            right: 0;
            background: white;
            border: 1px solid var(--border-color-soft);
            border-radius: 6px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            z-index: 1050;
            min-width: 140px;
        }

        .mobile-nav-menu.show {
            display: block;
        }

        .mobile-nav-menu-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            width: 100%;
            padding: 0.6rem 1rem;
            background: white;
            border: none;
            color: var(--text-color);
            font-size: 0.95rem;
            cursor: pointer;
            transition: background-color 0.15s ease;
            text-align: left;
        }

        .mobile-nav-menu-item:first-child {
            border-radius: 6px 6px 0 0;
        }

        .mobile-nav-menu-item:last-child {
            border-radius: 0 0 6px 6px;
        }

        .mobile-nav-menu-item:hover {
            background-color: var(--pale-sand);
        }

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

        .mobile-nav-menu-item i {
            font-size: 1rem;
        }

        /* Show dropdown on mobile only in spot analysis */
        @media (max-width: 991.98px) {
            body.viewing-spot-analysis .mobile-nav-dropdown {
                display: block !important;
            }
        }

        .d3-chart-tooltip {
            position: absolute;
            text-align: left;
            padding: 8px;
            font: 12px Inter;
            background: rgba(25, 25, 25, 0.85);
            color: white;
            border: 0;
            border-radius: 8px;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s;
            z-index: 1050;
        }

        .domain, .tick line {
            stroke: #ccc;
            stroke-width: 0.5px;
        }

        .axis-text {
            font-family: 'Inter', sans-serif;
            font-size: 11px;
            fill: #555;
        }

        .grid .tick line {
            stroke: var(--deep-slate);
            stroke-opacity: 0.8;
            stroke-dasharray: 2, 4;
        }

        .grid .domain {
            stroke: none;
        }

        .d3-summary-chart-container {
            position: relative;
            min-height: 450px;
            height: 100%;
            cursor: crosshair;
        }

        .d3-summary-chart-container .axis-text {
            font-size: 9px;
        }

        .d3-summary-chart-container .axis-label {
            font-size: 10px;
        }

        .d3-summary-chart-container .domain {
            display: none;
        }

        /* Right y-axis styles */
        .d3-summary-chart-container .y-axis-swell-right,
        .d3-summary-chart-container .y-axis-wind-right,
        .d3-summary-chart-container .y-axis-tide-right {
            font-size: 8px;
            color: var(--text-muted);
        }

        .d3-summary-chart-container .y-axis-swell-right text,
        .d3-summary-chart-container .y-axis-wind-right text,
        .d3-summary-chart-container .y-axis-tide-right text {
            font-weight: 600;
        }
        .video-container-relative {
            position: relative;
        }

        .spot-name-overlay {
            position: absolute;
            top: 10px;
            right: 15px;
            color: white;
            background-color: rgba(0, 0, 0, 0.5);
            padding: 5px 10px;
            border-radius: 0.375rem;
            z-index: 10;
            pointer-events: none;
        }

        .zone-header {
            color: var(--text-primary);
            font-weight: 600;
            font-size: 1.5rem;
            margin-top: 2rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--border-color);
        }

        .zone-section {
            transition: opacity 0.3s ease;
        }

        #zone-selector {
            background-color: var(--bg-secondary);
            color: var(--text-primary);
            border: 2px solid var(--primary-color);
            font-size: 1.1rem;
            font-weight: 500;
            padding: 0.75rem 1rem;
        }

        #zone-selector:focus {
            background-color: var(--bg-secondary);
            color: var(--text-primary);
            border-color: var(--primary-color);
            box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
        }

        .zone-selector-container {
            background: var(--bg-secondary);
            padding: 1.5rem;
            border-radius: 0.5rem;
            margin-bottom: 2rem;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .zone-selector-label {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 0.75rem;
            color: var(--text-primary);
        }

        .webcam-controls-container {
            background: var(--bg-secondary);
            padding: 1.25rem;
            border-radius: 0.5rem;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        #webcam-count-display {
            font-style: italic;
            color: var(--text-secondary);
        }

        .favorite-btn {
            position: absolute;
            top: 5px;
            left: 10px;
            background: rgba(0, 0, 0, 0.6);
            border: none;
            color: #ffd700;
            padding: 0.25rem 0.5rem;
            border-radius: 0.25rem;
            pointer-events: auto;
            cursor: pointer;
            transition: all 0.2s ease;
            z-index: 11;
        }

        .favorite-btn:hover {
            background: rgba(0, 0, 0, 0.8);
            transform: scale(1.1);
        }

        .favorite-btn.active {
            color: #ffd700;
            background: rgba(255, 215, 0, 0.2);
        }

        .favorite-btn i {
            font-size: 0.9rem;
        }

        .time-col {
            width: 60px;
            min-width: 40px;
        }
        .forecast-icon-wrapper {
            display: inline-block;
            width: 40px;
            height: 40px;
            vertical-align: middle;
            line-height: 1;
        }
        .table-container.is-scrolling .sticky-col {
            box-shadow: 4px 0 8px -3px rgba(60, 72, 88, 0.15);
        }

        .table-container::after {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            width: 30px;
            background: linear-gradient(to left, var(--background-color) 30%, transparent 100%);
            pointer-events: none;
            transition: opacity 0.2s ease-in-out;
            opacity: 0;
        }

        .table-container.is-scrollable-end::after {
            opacity: 1;
        }

        #dashboard-sub-tab-content {
            margin-top: 1.5rem;
        }

        .ranked-result-card {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            padding: 1rem 1.5rem !important;
            background-color: #ffffff;
            box-shadow: var(--card-shadow);
            border-radius: var(--border-radius);
            margin-bottom: 1rem;
        }

        .ranked-result-card .conditions-and-score-wrapper {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            flex-shrink: 0;
        }

        .ranked-result-card .context {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .ranked-result-card .conditions {
            display: flex;
            align-items: center;
            gap: 1.25rem;
        }

        .ranked-result-card .spot-name-small {
            font-size: 1.2rem;
            font-weight: 500;
        }

        .ranked-result-card .score-badge {
            font-size: 1.2rem;
            font-weight: 700;
            min-width: 55px;
            text-align: center;
            padding: 0.3rem 0.5rem;
        }

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

        .spot-search-input {
            background-color: var(--background-color);
            border: 1px solid var(--border-color-soft);
            border-radius: var(--border-radius);
            padding-left: 2.25rem;
            height: 38px;
            transition: width 0.3s ease-in-out;
        }

        .nav-item .spot-search-input {
            width: 250px;
        }
        .nav-item .spot-search-input:focus {
            width: 350px;
        }

        .search-container .search-icon {
            position: absolute;
            left: 0.75rem;
            color: #6c757d;
            pointer-events: none;
        }

        .autocomplete-suggestions {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background-color: #ffffff;
            border: 1px solid var(--border-color-soft);
            border-top: none;
            border-radius: 0 0 var(--border-radius) var(--border-radius);
            z-index: 1050;
            max-height: 300px;
            overflow-y: auto;
            display: none;
            box-shadow: var(--card-shadow);
        }

        .suggestion-item {
            padding: 0.75rem 1.25rem;
            cursor: pointer;
        }

        .suggestion-item:hover {
            background-color: var(--background-color);
        }

        #tab-spot-analysis {
            display: none;
        }

        #spot-analysis {
            margin-top: 1.5rem;
        }

        #all-spots-map-container {
            height: 85vh;
            width: 100%;
            border-radius: var(--border-radius);
        }

        #dashboard-sub-tabs {
            border-bottom: 1px solid var(--border-color-soft);
        }

        #dashboard-sub-tabs .nav-link {
            background-color: transparent !important;
            border: none;
            color: var(--sea-glass-blue);
            font-weight: 500;
            padding-bottom: 0.75rem;
            position: relative;
            transition: color 0.3s ease;
        }

        #dashboard-sub-tabs .nav-link::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 0;
            width: 100%;
            height: 3px;
            background-color: var(--primary-color);
            transform: scaleX(0);
            transition: transform 0.3s ease;
        }

        #dashboard-sub-tabs .nav-link.active {
            color: var(--primary-color);
            font-weight: 700;
        }

        #dashboard-sub-tabs .nav-link.active::after {
            transform: scaleX(1);
        }

        #dashboard-sub-tabs .nav-link:not(.active):hover {
            color: var(--text-color);
        }

        .dashboard-card-clickable {
            cursor: pointer;
            transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
        }

        .dashboard-card-clickable:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 30px rgba(60, 72, 88, 0.1);
        }

        #view-content-map iframe,
        #view-content-webcam video {
            width: 100%;
            max-width: 100%;
            max-height: 500px;
            aspect-ratio: 16 / 9;
        }

        #view-content-webcam video {
            border-radius: var(--border-radius);
        }

        #view-content-map,
        #view-content-map .map-view-map-container {
            border-radius: 0 !important;
        }

        /* Mobile: ensure media fills the container properly */
        @media (max-width: 767.98px) {
            body.viewing-spot-analysis #view-content-webcam video {
                height: 100%;
                max-height: none;
                object-fit: cover;
            }
        }

        @media (max-width: 991.98px) {
            .forecast-icon-wrapper {
                width: 32px;
                height: 32px;
            }
            .nav-item .nav-link-text {
                display: inline-block !important;
            }
            .nav-item:has(.search-container) {
                padding-top: 0.5rem;
            }
            #spot-search-input, #spot-search-input:focus {
                width: 100%;
            }
            .ranked-result-card {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.5rem;
            }
            .ranked-result-card .conditions-and-score-wrapper {
                width: 100%;
                justify-content: space-between;
                margin-top: 0.75rem;
                gap: 1rem;
            }
            #dashboard-sub-tabs {
                display: flex;
                flex-wrap: nowrap;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
            }
            #dashboard-sub-tabs::-webkit-scrollbar {
                display: none;
            }
            #dashboard-sub-tabs .nav-link {
                padding-left: 0.75rem;
                padding-right: 0.75rem;
                padding-bottom: 0.5rem;
                font-size: 0.9rem;
                white-space: nowrap;
            }
        }

        @media (max-width: 767.98px) {
            #spot-analysis-results-container .table-container {
                border-top: 1px solid var(--border-color-soft);
                border-bottom: 1px solid var(--border-color-soft);
            }
            #webcams.tab-pane,
            #view-content-webcam {
                margin-left: -1rem;
                margin-right: -1rem;
            }
            .search-container {
                width: 100px;
            }
        }

        .ranked-result-card {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            width: 100%;
            padding: 0.75rem 1.25rem !important;
        }

        .context-and-score {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .spot-name-small {
            font-size: 1.2rem;
            font-weight: 500;
        }

        .conditions {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex-shrink: 0;
        }

        .score-badge {
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            font-weight: 700;
            height: 50px;
            width: 50px;
            border-radius: 50%;
            color: var(--primary-color);
            background-color: var(--highlight-color);
            flex-shrink: 0;
        }

        .leaflet-div-icon {
            background: transparent;
            border: none;
        }

        .map-label-container {
            overflow: visible !important; /* Allow labels to be visible */
        }

        .map-label {
            padding: 0px 6px 0px 0px;
            border-radius: 4px;
            color: #333;
            font-size: 13px;
            font-weight: 600;
            white-space: nowrap;
            background: rgba(255, 255, 255, 0.95);
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
            transform: translate(-50%, -50%);
            max-width: 250px;
            text-overflow: ellipsis;
        }

        .swell-label {
            border-bottom: 3px solid var(--sea-blue);
        }

        .wind-label {
            border-bottom: 3px solid var(--deep-slate);
        }

        #view-content-map {
            width: 100%;
            display: flex;
            flex-direction: column;
        }

        #view-content-map .map-view-map-container {
            flex: 0 0 85%;
            height: 85%;
            min-height: 0;
        }

        #view-content-map .map-info-overlay {
            flex: 0 0 15%;
            height: 15%;
            min-height: 50px;
            display: flex;
            align-items: center;
            font-size: 12px;
        }

        @media (max-width: 576px) {
            .ranked-result-card {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.75rem;
            }
            .conditions {
                width: 100%;
                justify-content: space-between;
            }
        }

        /* Mobile Transposed Table Styles */
        .mobile-forecast-wrapper {
            display: none; /* Hidden by default, shown on mobile */
            padding: 1rem;
            background-color: #fafafa;
            border-radius: var(--border-radius);
            margin-bottom: 1.5rem;
        }

        .mobile-forecast-day-header {
            margin-bottom: 0.75rem;
        }

        .mobile-forecast-day-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--primary-color);
            margin-bottom: 0.25rem;
        }

        .mobile-forecast-day-info {
            font-size: 0.85rem;
            color: #6c757d;
        }

        .mobile-chart-container {
            display: block;
            width: 100%;
            height: 180px;
            margin-bottom: 1rem;
            position: relative;
            background-color: #ffffff;
            border: 1px solid var(--border-color-soft);
            border-radius: var(--border-radius);
            padding: 0.5rem;
        }

        .mobile-chart-highlight {
            position: absolute;
            top: 0.5rem;
            bottom: 0.5rem;
            background-color: rgba(64, 123, 255, 0.08);
            border-left: 2px solid var(--primary-color);
            border-right: 2px solid var(--primary-color);
            pointer-events: none;
            z-index: 10;
            transition: left 0.3s ease, width 0.3s ease;
            border-radius: 4px;
        }

        .mobile-table-viewport {
            display: block;
            position: relative;
            width: 100%;
            overflow: hidden;
            border: 1px solid var(--border-color-soft);
            border-radius: var(--border-radius);
            margin-bottom: 0.5rem;
        }

        .mobile-table-scroll-container {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scroll-snap-type: x mandatory;
            scrollbar-width: none;
        }

        .mobile-table-scroll-container::-webkit-scrollbar {
            display: none;
        }

        .hourly-breakdown-table-transposed {
            width: auto;
            font-size: 0.8rem;
            border-collapse: collapse;
            background-color: #ffffff;
        }

        /* Mobile: Ensure table can be wider than viewport for scrolling */
        @media (max-width: 767.98px) {
            .hourly-breakdown-table-transposed {
                width: auto;
                min-width: 100%;
            }
        }

        .hourly-breakdown-table-transposed th,
        .hourly-breakdown-table-transposed td {
            padding: 0.6rem 0.4rem;
            text-align: center;
            border-right: 1px solid var(--border-color-soft);
            white-space: nowrap;
        }

        .hourly-breakdown-table-transposed th:last-child,
        .hourly-breakdown-table-transposed td:last-child {
            border-right: none;
        }

        .hourly-breakdown-table-transposed tbody tr {
            border-bottom: 1px solid var(--border-color-soft);
        }

        .hourly-breakdown-table-transposed tbody tr:last-child {
            border-bottom: none;
        }

        .mobile-nav-arrows {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 100%;
            pointer-events: none;
            z-index: 3;
            display: flex;
            justify-content: space-between;
            padding: 0 0.5rem;
        }

        .mobile-nav-arrow {
            pointer-events: auto;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.95);
            border: 1px solid var(--border-color-soft);
            box-shadow: 0 2px 8px rgba(60, 72, 88, 0.15);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            color: var(--primary-color);
        }

        .mobile-nav-arrow:active {
            background-color: var(--primary-color);
            color: white;
            transform: scale(0.95);
        }

        .mobile-nav-arrow.disabled {
            opacity: 0.3;
            pointer-events: none;
        }

        .mobile-time-indicator {
            display: block;
            text-align: center;
            font-size: 0.75rem;
            color: #6c757d;
            margin-top: 0.5rem;
            font-weight: 500;
        }

        /* Mobile tooltip */
        .mobile-tooltip {
            position: fixed;
            background-color: rgba(0, 0, 0, 0.9);
            color: white;
            padding: 0;
            border-radius: 8px;
            font-size: 0.875rem;
            line-height: 1.5;
            max-width: 280px;
            z-index: 10000;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s ease-in-out;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
        }

        .mobile-tooltip-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        }

        .mobile-tooltip-title {
            font-weight: 600;
            font-size: 0.875rem;
            color: white;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .mobile-tooltip-content {
            padding: 12px 16px;
            white-space: pre-line;
            word-wrap: break-word;
        }

        .mobile-tooltip-close {
            background: transparent;
            border: none;
            color: white;
            font-size: 1.25rem;
            line-height: 1;
            padding: 0;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            pointer-events: auto;
            opacity: 0.7;
            transition: opacity 0.2s ease;
            flex-shrink: 0;
        }

        .mobile-tooltip-close:hover,
        .mobile-tooltip-close:active {
            opacity: 1;
        }

        .mobile-tooltip::after {
            content: '';
            position: absolute;
            bottom: -8px;
            left: var(--arrow-position, 50%);
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-top: 8px solid rgba(0, 0, 0, 0.9);
        }

        .mobile-tooltip.below::after {
            bottom: auto;
            top: -8px;
            border-top: none;
            border-bottom: 8px solid rgba(0, 0, 0, 0.9);
        }

        .mobile-tooltip.show {
            opacity: 1;
        }

        .mobile-cell-tooltip {
            cursor: pointer;
            user-select: none;
            position: relative;
        }

        .mobile-cell-tooltip:active {
            opacity: 0.7;
        }

        @media (max-width: 767.98px) {
            .hourly-breakdown-table-transposed td.mobile-cell-tooltip {
                transition: background-color 0.1s ease;
            }

            .hourly-breakdown-table-transposed td.mobile-cell-tooltip:active {
                background-color: rgba(0, 123, 255, 0.1) !important;
            }
        }

        /* Mobile: Transpose table */
        @media (max-width: 767.98px) {
            /* Hide original table */
            .hourly-breakdown-table {
                display: none;
            }

            /* Show transposed table */
            .table-container .hourly-breakdown-table-transposed {
                display: table !important;
            }

            /* Add navigation to table container */
            /* Break out of Bootstrap grid - use full viewport width */
            .table-container {
                position: relative;
                width: 100vw;
                max-width: 100vw;
                /* Center align and account for Bootstrap column padding (typically 12-15px each side) */
                margin-left: calc(-50vw + 50%);
                margin-right: calc(-50vw + 50%);
                /* Also add negative margin for the parent column padding */
                box-sizing: border-box;
                border-top: 1px solid var(--border-color-soft);
                border-bottom: 1px solid var(--border-color-soft);
                z-index: 10;
                overflow-x: auto;
                overflow-y: hidden;
                scroll-snap-type: x mandatory;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
                padding: 0;
            }

            /* Force parent column to have no padding on mobile */
            .row.py-4 > .col-lg-9 {
                padding-left: 0 !important;
                padding-right: 0 !important;
            }

            /* Also ensure main content column has no padding on mobile */
            #main-content-col {
                padding-left: 0 !important;
                padding-right: 0 !important;
            }

            .table-container::-webkit-scrollbar {
                display: none;
            }

            /* Make first row (Time row) sticky on mobile */
            .hourly-breakdown-table-transposed tr:first-child {
                position: sticky;
                top: 0;
                z-index: 3;
            }

            .hourly-breakdown-table-transposed tr:first-child th,
            .hourly-breakdown-table-transposed tr:first-child td {
                background-color: #f8f9fa;
                font-weight: 500;
            }

            /* Single card view on mobile */
            .forecast-cards-container {
                position: relative;
                margin: 0;
                padding: 0;
            }

            .forecast-cards-container .row.py-4 {
                display: none; /* Hide all cards by default */
            }

            .forecast-cards-container .row.py-4.active-day-card {
                display: flex !important; /* Show only active card */
                flex-direction: column;
            }

            .row.py-4 {
                padding-top: 0 !important;
                padding-bottom: 0 !important;
                margin-top: 0 !important;
            }

            .row.py-4 > .col-lg-3 {
                order: 1; /* Chart first */
                width: 100%;
                max-width: 100%;
                padding: 0;
                display: block !important;
                flex: 0 0 auto;
                margin: 0;
            }

            /* Hide and remove spacing for water temp on mobile */
            .row.py-4 .col-lg-3 .small {
                display: none !important;
            }

            .row.py-4 > .col-lg-9 {
                order: 2; /* Table second */
                width: 100%;
                max-width: 100%;
                padding: 0;
                flex: 1 1 auto; /* Allow to grow and fill remaining space */
                display: flex;
                flex-direction: column;
                margin: 0;
            }

            /* Add chart highlight on mobile - dynamic height based on viewport */
            .d3-summary-chart-container {
                position: relative;
                margin-bottom: 0;
                /* Height set dynamically via JavaScript */
                overflow: visible;
            }

            /* In charts mode with viewing-spot-analysis, chart fills its container */
            body.viewing-spot-analysis .d3-summary-chart-container {
                /* Account for safe-area-inset-bottom on devices with notches/bottom bars */
                height: calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px) - env(safe-area-inset-bottom, 0px)) * 0.45) !important;
                min-height: calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px) - env(safe-area-inset-bottom, 0px)) * 0.45) !important;
                max-height: calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px) - env(safe-area-inset-bottom, 0px)) * 0.45) !important;
                overflow: hidden !important; /* Clip the chart to container bounds */
            }

            /* Chart in top content area (chart view mode) should fill 100% of its parent */
            body.viewing-spot-analysis #view-content-charts .d3-summary-chart-container {
                height: 100% !important;
                min-height: 100% !important;
                max-height: 100% !important;
            }

            body.viewing-spot-analysis .d3-summary-chart-container svg {
                overflow: hidden;
                display: block;
                width: 100%;
                height: 100% !important;
                max-height: 100%;
            }

            .chart-time-highlight {
                display: block !important;
                will-change: left, width;
            }

            /* Ensure chart text is visible on mobile */
            .d3-summary-chart-container .axis-text {
                font-size: 7px !important;
            }

            .d3-summary-chart-container text {
                pointer-events: none;
                font-size: 7px !important;
            }

            .d3-summary-chart-container .fw-bold {
                font-size: 8px !important;
            }

            /* Day navigation on mobile */
            .mobile-day-navigation {
                position: relative;
                padding: 0.5rem 0.75rem 0.3rem;
                background-color: var(--background-color);
                border-bottom: 1px solid var(--border-color-soft);
                margin: 0 !important;
                flex-shrink: 0;
                overflow: hidden;
                user-select: none;
            }

            .day-timeline {
                position: relative;
                width: 100%;
                display: flex;
                flex-direction: column;
                gap: 0.15rem;
                justify-content: center;
            }

            .day-labels {
                display: flex;
                justify-content: space-between;
                font-size: 0.65rem;
                font-weight: 600;
                color: #666;
                margin-bottom: 0.1rem;
            }

            .day-label {
                flex: 1;
                text-align: center;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                padding: 0.25rem 0.5rem;
                border-radius: 4px;
                transition: all 0.2s ease;
                cursor: pointer;
            }

            .day-label:hover:not(.active) {
                background-color: rgba(0, 0, 0, 0.05);
            }

            .day-label.active {
                color: white;
                background-color: var(--primary-color);
                font-weight: 700;
                font-size: 0.7rem;
                transform: scale(1.05);
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            }

            .timeline-track {
                position: relative;
                width: 100%;
                height: 10px;
                min-height: 10px;
                background-color: #e9ecef;
                border-radius: 5px;
                overflow: visible;
            }

            .timeline-score-bar {
                position: absolute;
                top: 0;
                left: 0;
                height: 100%;
                width: 100%;
                border-radius: 4px;
                display: flex;
            }

            .timeline-hour-segment {
                height: 100%;
                flex: 1;
                transition: opacity 0.2s;
            }

            .timeline-position-indicator {
                position: absolute;
                top: 50%;
                transform: translate(-50%, -50%);
                width: 3px;
                height: 16px;
                background-color: var(--primary-color);
                border-radius: 2px;
                box-shadow: 0 2px 4px rgba(0,0,0,0.3);
                transition: left 0.1s ease-out;
                z-index: 10;
                pointer-events: none;
            }

            .timeline-position-indicator::before {
                content: '';
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                width: 8px;
                height: 8px;
                background-color: var(--primary-color);
                border: 2px solid white;
                border-radius: 50%;
                box-shadow: 0 2px 4px rgba(0,0,0,0.2);
            }


            /* Hide day name header on mobile since it's in the pills */
            .day-name-header {
                display: none !important;
            }

            /* Hide spot name on mobile since it's in the search placeholder */
            #spot-analysis-title {
                display: none !important;
            }

            /* Remove all spacing from spot analysis header and content containers */
            #spot-analysis-header {
                padding: 0 !important;
                margin: 0 !important;
            }

            #spot-analysis-top-content {
                padding: 0 !important;
                margin: 0 !important;
            }

            #spot-analysis-view-switcher {
                display: none !important; /* Hide on mobile, only webcam needed */
            }

            /* Spot analysis forecast container */
            #spot-analysis-forecast-container {
                padding: 0 !important;
                margin: 0 !important;
            }

            /* Remove tab pane padding and margin */
            #spot-analysis {
                padding: 0 !important;
                margin: 0 !important;
                margin-bottom: 0 !important;
            }

            /* Ensure tab content container has no bottom margin */
            #myTabContent {
                margin-bottom: 0 !important;
                padding-bottom: 0 !important;
            }

            /* Remove margin/padding from all tab-pane elements on mobile */
            .tab-pane {
                margin: 0 !important;
                padding: 0 !important;
            }

            /* Main container also needs no bottom spacing - override pb-4 class */
            body.viewing-spot-analysis main.container-fluid {
                padding-bottom: 0 !important;
                margin-bottom: 0 !important;
            }

            /* Ensure col-12 has no bottom spacing */
            #main-content-col {
                padding-bottom: 0 !important;
                margin-bottom: 0 !important;
            }

            /* Block vertical scroll only on spot analysis page - content fits in viewport */
            body.viewing-spot-analysis {
                overflow: hidden !important;
            }

            /* Apply full height layout ONLY to spot analysis tab on mobile */
            body.viewing-spot-analysis main.container-fluid {
                height: calc(var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px));
                display: flex;
                flex-direction: column;
                padding: 0 !important;
            }

            body.viewing-spot-analysis .row {
                flex: 1;
                display: flex;
                flex-direction: column;
                margin: 0 !important;
            }

            body.viewing-spot-analysis #main-content-col {
                flex: 1;
                display: flex;
                flex-direction: column;
                padding: 0 !important;
            }

            body.viewing-spot-analysis .tab-content {
                padding: 0 !important;
                flex: 1;
                display: flex;
                flex-direction: column;
                overflow: hidden;
            }

            body.viewing-spot-analysis #spot-analysis {
                margin: 0 !important;
                padding: 0 !important;
                flex: 1;
                overflow: hidden;
                display: flex;
                flex-direction: column;
            }

            body.viewing-spot-analysis #spot-analysis-forecast-container {
                flex: 1;
                display: flex;
                flex-direction: column;
                overflow: hidden;
            }

            /* Top content area: Only takes space when a view is visible (webcam/map mode) */
            body.viewing-spot-analysis #spot-analysis-top-content {
                flex: 0 0 auto;
                display: flex;
                flex-direction: column;
                overflow: hidden;
                height: 0; /* Default to 0 height when no views are shown */
            }

            /* When a view is shown in top content, make it 45% of available height (minus navbar) */
            body.viewing-spot-analysis #spot-analysis-top-content:has(.spot-analysis-view[style*="display: block"]),
            body.viewing-spot-analysis #spot-analysis-top-content:has(.spot-analysis-view:not([style*="display: none"])) {
                height: calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px)) * 0.45);
                flex: 0 0 calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px)) * 0.45);
            }

            body.viewing-spot-analysis #spot-analysis-top-content .spot-analysis-view {
                height: 100%;
                display: flex;
                flex-direction: column;
            }

            /* Ensure content within each view fills the space */
            body.viewing-spot-analysis #view-content-charts .d3-summary-chart-container,
            body.viewing-spot-analysis #view-content-webcam,
            body.viewing-spot-analysis #view-content-map {
                flex: 1;
                height: 100%;
                overflow: hidden;
            }

            /* Day selector: 5% of available height (minus navbar) */
            body.viewing-spot-analysis .mobile-day-navigation,
            body.viewing-spot-analysis .mobile-weekly-chart-container {
                /* Account for safe-area-inset-bottom on devices with notches/bottom bars */
                flex: 0 0 calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px) - env(safe-area-inset-bottom, 0px)) * 0.05);
                height: auto;
                min-height: 45px;
                max-height: calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px) - env(safe-area-inset-bottom, 0px)) * 0.05);
                overflow-x: auto;
                overflow-y: hidden;
                padding: 0.25rem 0;
            }

            /* Table container: 50% of available height (minus navbar and safe areas) */
            body.viewing-spot-analysis .table-container {
                /* Account for safe-area-inset-bottom on devices with notches/bottom bars */
                flex: 0 0 calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px) - env(safe-area-inset-bottom, 0px)) * 0.50) !important;
                height: calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px) - env(safe-area-inset-bottom, 0px)) * 0.50) !important;
                min-height: calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px) - env(safe-area-inset-bottom, 0px)) * 0.50) !important;
                max-height: calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px) - env(safe-area-inset-bottom, 0px)) * 0.50) !important;
                overflow-y: auto !important;
                overflow-x: auto !important;
                display: block !important; /* Ensure table is always visible */
            }

            /* Make the transposed table fill the container height - 5 data rows total */
            /* Keep table constrained to container - scrolling handled by container's overflow-y */
            body.viewing-spot-analysis .table-container .hourly-breakdown-table-transposed {
                height: 100%;
            }

            /* Each row is 20% of table height (5 rows total: Time, Wave, Wind, Tide, Weather) */
            body.viewing-spot-analysis .hourly-breakdown-table-transposed tr {
                height: 20%;
            }

            /* Reduce cell padding for more compact table */
            body.viewing-spot-analysis .hourly-breakdown-table-transposed th,
            body.viewing-spot-analysis .hourly-breakdown-table-transposed td {
                padding: 0.05rem 0.2rem; /* Reduced from 0.1rem 0.3rem for tighter fit */
            }

            /* Further reduce padding for first column labels */
            body.viewing-spot-analysis .hourly-breakdown-table-transposed th:first-child,
            body.viewing-spot-analysis .hourly-breakdown-table-transposed td:first-child {
                padding: 0.03rem 0.03rem; /* Reduced from 0.05rem for tighter fit */
            }

            /* Reduce line-height and font size for more compact cells */
            body.viewing-spot-analysis .hourly-breakdown-table-transposed {
                line-height: 1.05; /* Reduced from 1.1 for tighter vertical spacing */
            }

            /* Compact the mobile time cell */
            body.viewing-spot-analysis .mobile-time-cell {
                line-height: 1.05; /* Reduced from 1.1 for tighter vertical spacing */
                padding: 0.05rem 0; /* Reduced from 0.1rem */
            }

            /* Reduce gap in cell-flex-container */
            body.viewing-spot-analysis .hourly-breakdown-table-transposed .cell-flex-container {
                gap: 0.05rem; /* Reduced from 0.1rem for even tighter spacing */
            }

            .forecast-cards-container {
                flex: 1;
                overflow: hidden;
                display: flex;
                flex-direction: column;
            }

            /* In charts mode, structure the layout with 45vh chart height */
            body.viewing-spot-analysis .forecast-cards-container {
                display: flex;
                flex-direction: column;
                flex: 1;
                overflow: hidden;
            }

            /* Active day card should use flex layout */
            body.viewing-spot-analysis .forecast-cards-container .row.py-4.active-day-card {
                display: flex !important;
                flex-direction: column;
                flex: 1;
                overflow: hidden;
            }

            /* Chart area: 45% of available height - hidden in webcam/map modes */
            body.viewing-spot-analysis .forecast-cards-container .row.py-4.active-day-card > .col-lg-3 {
                flex: 0 0 calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px)) * 0.45) !important;
                height: calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px)) * 0.45) !important;
                overflow: hidden;
            }

            /* When chart is hidden (webcam/map mode), collapse the chart column */
            body.viewing-spot-analysis .forecast-cards-container .row.py-4.active-day-card > .col-lg-3:has(.d3-summary-chart-container[style*="display: none"]) {
                flex: 0 0 0 !important;
                height: 0 !important;
                display: none !important;
            }

            /* Table area: contains BOTH day nav (5%) and table (50%) = 55% total */
            body.viewing-spot-analysis .forecast-cards-container .row.py-4.active-day-card > .col-lg-9 {
                flex: 0 0 calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px)) * 0.55) !important;
                height: calc((var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px)) * 0.55) !important;
                overflow: hidden;
                display: flex !important;
                flex-direction: column !important;
            }

            /* Ensure col-lg-9 is visible even when charts are hidden */
            body.viewing-spot-analysis .row.py-4.active-day-card > .col-lg-9 {
                display: flex !important;
                flex-direction: column !important;
            }

            .row.py-4 {
                display: none;
            }

            .row.py-4.active-day-card {
                display: flex !important;
                flex: 1;
                overflow: hidden;
                flex-direction: column;
            }

            /* Table container with dynamic height */
            .table-container {
                /* Height set dynamically via JavaScript */
                overflow-x: auto;
                overflow-y: auto;
                display: flex;
                align-items: stretch;
                width: 100%;
            }

            /* Make transposed table scrollable - don't force it to 100% height */
            .hourly-breakdown-table-transposed {
                display: table;
                width: 100%;
            }

            /* Let rows size based on content, but ensure minimum visibility */
            .hourly-breakdown-table-transposed tr {
                /* Remove fixed height to allow content to determine row height */
            }
        }

        /* Transposed table - hidden by default, shown on mobile */
        /* Hide mobile day navigation on desktop - only hide on wider screens */
        @media (min-width: 768px) {
            .mobile-day-navigation {
                display: none;
            }
        }

        .hourly-breakdown-table-transposed {
            display: none;
            width: auto;
            font-size: 0.8rem;
            border-collapse: collapse;
            background-color: #ffffff;
        }

        .hourly-breakdown-table-transposed th:first-child {
            position: sticky;
            left: 0;
            background-color: var(--background-color);
            z-index: 2;
            font-weight: 600;
            color: var(--primary-color);
            text-align: center !important;
            border-right: 2px solid var(--border-color-soft);
        }

        .hourly-breakdown-table-transposed th:first-child i {
            font-size: 4vw !important; /* Reduced from 4.5vw for more compact fit */
            display: inline-block;
            transition: transform 0.2s ease;
        }

        /* Hover effect for clickable time header */
        .hourly-breakdown-table-transposed th:first-child:hover i {
            transform: scale(1.2);
        }

        /* Hide text labels in first column, show only icons */
        .hourly-breakdown-table-transposed th:first-child span,
        .hourly-breakdown-table-transposed td:first-child span {
            display: none;
        }

        /* Ensure cell-flex-container and label-cell show only icon */
        .hourly-breakdown-table-transposed th:first-child .cell-flex-container,
        .hourly-breakdown-table-transposed td:first-child .cell-flex-container,
        .hourly-breakdown-table-transposed th:first-child .label-cell,
        .hourly-breakdown-table-transposed td:first-child .label-cell {
            justify-content: center;
            align-items: center;
        }

        /* Make icons in first column properly sized */
        .hourly-breakdown-table-transposed th:first-child .label-cell i,
        .hourly-breakdown-table-transposed td:first-child .label-cell i {
            font-size: 4vw !important; /* Reduced from 4.5vw for more compact fit */
        }

        .hourly-breakdown-table-transposed tbody tr th:first-child {
            background-color: #e8f0fe; /* Fallback */
            background-color: color-mix(in srgb, var(--primary-color) 8%, white);
        }

        .hourly-breakdown-table-transposed th,
        .hourly-breakdown-table-transposed td {
            padding: 0.2rem 0.1rem;
            text-align: center;
            border-right: 1px solid var(--border-color-soft);
            white-space: nowrap;
            vertical-align: middle;
        }

        /* Mobile-only: Set exact widths for visible hours (MOBILE_CONFIG.VISIBLE_HOURS_COUNT) */
        @media (max-width: 767.98px) {
            /* First column (sticky labels) - 15% of viewport */
            .hourly-breakdown-table-transposed th:first-child,
            .hourly-breakdown-table-transposed td:first-child {
                padding: 0.2rem 0.05rem;
                scroll-snap-align: none;
            }

            /* Hour columns - exactly 4 fit in viewport: (100vw - 15vw) / 4 = 21.25vw */
            .hourly-breakdown-table-transposed th:not(:first-child),
            .hourly-breakdown-table-transposed td:not(:first-child) {
                width: 21.25vw;
                min-width: 21.25vw;
                max-width: 21.25vw;
                line-height: 1.2; /* Reduced from 1.3 for tighter spacing */
                scroll-snap-align: start;
            }
        }

        .hourly-breakdown-table-transposed th:last-child,
        .hourly-breakdown-table-transposed td:last-child {
            border-right: none;
        }

        /* Make first row (Time row) sticky to keep it visible while scrolling */
        /* Make icons in data cells responsive and compact */
        .hourly-breakdown-table-transposed td i,
        .hourly-breakdown-table-transposed td svg,
        .hourly-breakdown-table-transposed th i,
        .hourly-breakdown-table-transposed th svg {
            font-size: 4vw !important; /* Reduced from 5vw for more compact fit */
            width: 5vw !important; /* Reduced from 7vw for more compact fit */
            height: 5vw !important; /* Reduced from 7vw for more compact fit */
        }

        .hourly-breakdown-table-transposed .forecast-icon-wrapper {
            width: 7vw !important; /* Reduced from 7vw for more compact fit */
            height: 7vw !important; /* Reduced from 7vw for more compact fit */
        }

        .hourly-breakdown-table-transposed .forecast-icon-wrapper svg {
            width: 100% !important;
            height: 100% !important;
        }

        .hourly-breakdown-table-transposed .cell-flex-container {
            gap: 0.1rem; /* Reduced from 0.2rem for tighter spacing */
            flex-wrap: wrap;
            justify-content: center;
        }

        /* Prevent weather row from wrapping */
        .hourly-breakdown-table-transposed tr:nth-child(5) .cell-flex-container {
            flex-wrap: nowrap;
        }

        /* Swell energy badge */
        .energy-badge {
            font-size: 2.3vw;
            padding: 1px 3px;
            border-radius: 3px;
            background-color: #e9ecef;
            color: #495057;
            font-weight: 600;
            margin-left: 2px;
            display: inline-block;
        }

        /* Make energy badge smaller on desktop/normal table */
        @media (min-width: 768px) {
            .energy-badge {
                font-size: 0.65rem;
                padding: 1px 4px;
            }
        }

        /* Ensure .small text in mobile table cells is appropriately sized */
        .hourly-breakdown-table-transposed .small {
            font-size: 2vw !important; /* Reduced from 3vw for more compact fit */
        }

        /* Ensure strong/bold text in cells maintains consistent size */
        .hourly-breakdown-table-transposed strong {
            font-size: inherit;
        }

        /* First row (Time header) with light background */
        .hourly-breakdown-table-transposed tr:first-child td {
            background-color: #f8f9fa;
            font-weight: 500;
        }

        /* Data rows with subtle primary color */
        .hourly-breakdown-table-transposed tbody tr td {
            background-color: #f5f8ff; /* Fallback */
            background-color: color-mix(in srgb, var(--primary-color) 3%, white);
        }

        /* First column should not snap (already defined above) */
        .hourly-breakdown-table-transposed th:first-child,
        .hourly-breakdown-table-transposed td:first-child {
            scroll-snap-align: none !important; /* Don't snap sticky column */
        }

        /* All data columns snap to start (already defined above, this ensures body cells also snap) */
        .hourly-breakdown-table-transposed td:not(:first-child) {
            scroll-snap-align: start;
        }

        .hourly-breakdown-table-transposed tbody tr {
            border-bottom: 1px solid var(--border-color-soft);
        }

        .hourly-breakdown-table-transposed tbody tr:last-child {
            border-bottom: none;
        }

        /* Add minimal extra padding to last row for visual breathing room */
        @media (max-width: 767.98px) {
            body.viewing-spot-analysis .hourly-breakdown-table-transposed tbody tr:last-child td,
            body.viewing-spot-analysis .hourly-breakdown-table-transposed tbody tr:last-child th {
                padding-bottom: 0.15rem !important; /* Reduced from 0.5rem - just enough to not feel cramped */
            }
        }

        /* Removed special smaller sizing for Tide and Weather icons - they now use default sizing */

        /* Tide and Weather rows now use same sizing as other rows - removed special smaller sizing */

        /* Chart dimming overlays - dim everything EXCEPT visible hours */
        .chart-time-dim-left,
        .chart-time-dim-right {
            display: none; /* Hidden by default, shown on mobile */
            position: absolute;
            top: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.15);
            pointer-events: none;
            z-index: 5;
            transition: left 0.2s ease, width 0.2s ease;
        }

        .chart-time-dim-left {
            left: 0;
        }

        .chart-time-dim-right {
            right: 0;
        }

        .chart-time-highlight-label {
            display: none; /* Hide label to match hover column style */
        }

        /* Score color bar for mobile time cells */
        .mobile-time-cell {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.25rem;
            padding: 0.1rem 0;
        }

        .mobile-day-marker {
            font-size: 9px;
            font-weight: 700;
            color: var(--primary-color);
            text-transform: uppercase;
            margin-bottom: 2px;
        }

        .mobile-score-bar-container {
            width: 70%;
            height: 4px;
            background-color: rgba(0, 0, 0, 0.1);
            border-radius: 2px;
            overflow: hidden;
        }

        .mobile-score-bar {
            height: 100%;
            border-radius: 2px;
            background-color: #28a745;
            transition: width 0.3s ease;
        }

        /* Mobile weekly score chart */
        .mobile-weekly-chart-container {
            position: relative;
            width: 100%;
            margin-bottom: 0.3rem;
            padding: 0 1.5rem;
        }

        .mobile-weekly-chart {
            width: 100%;
            height: 50px;
            background-color: #ffffff;
            border-radius: 4px;
            border: 1px solid var(--border-color-soft);
            overflow: visible;
        }

        .mobile-weekly-nav-arrow {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background-color: rgba(255, 255, 255, 0.9);
            border: 1px solid var(--border-color-soft);
            border-radius: 50%;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 10;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .mobile-weekly-nav-arrow:active {
            background-color: rgba(0, 0, 0, 0.05);
        }

        .mobile-weekly-nav-arrow.prev {
            left: 0;
        }

        .mobile-weekly-nav-arrow.next {
            right: 0;
        }

        .mobile-weekly-nav-arrow i {
            font-size: 1rem;
            color: var(--primary-color);
        }

        /* Highlight for active day in weekly chart */
        .weekly-chart-day-highlight {
            fill: none;
            stroke: var(--primary-color);
            stroke-width: 2;
            rx: 2;
            opacity: 0.5;
        }

        #spot-analysis-view-switcher .btn {
            border-radius: 30px;
        }

        #spot-analysis-view-switcher .btn.active {
            background-color: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        #view-content-map iframe,
        #view-content-webcam video {
            border-radius: var(--border-radius);
            max-width: 100%;
            height: auto;
            aspect-ratio: 16 / 9;
        }
        /* START: Styles for the new Map + Heatmap view */
        .map-view-wrapper {
            display: flex;
            flex-direction: column;
            height: 100%;
            gap: 1rem;
        }
        .map-view-map-container {
            flex-grow: 1;
            min-height: 400px; /* Ensure it has a minimum height */
            border-radius: var(--border-radius);
            position: relative; /* Establish positioning context */
        }
        .map-view-heatmap-container {
            flex-basis: 220px; /* Fixed height for the heatmap */
            flex-shrink: 0;
            width: 100%;
            overflow-x: auto;
            overflow-y: hidden;
            border: 1px solid var(--border-color-soft);
            border-radius: var(--border-radius);
            position: relative;
        }
        .forecast-heatmap {
            display: block;
        }
        .forecast-heatmap .axis-label {
            font-size: 10px;
            fill: #555;
        }
        .forecast-heatmap .day-separator {
            stroke: #ccc;
            stroke-width: 1px;
            shape-rendering: crispEdges;
        }
        .forecast-heatmap .y-axis .tick text {
            font-weight: 500;
        }
        .forecast-heatmap .hour-text {
            font-size: 9px;
            fill: black;
            pointer-events: none;
        }
        .forecast-heatmap .cursor-line {
            stroke: var(--primary-color);
            stroke-width: 1.5px;
        }
        .forecast-heatmap .cursor-box {
            fill: var(--primary-color);
            fill-opacity: 0.1;
        }

        /* Mobile map view adjustments */
        @media (max-width: 767.98px) {
            .map-view-wrapper {
                height: auto;
                min-height: 70vh;
            }
            .map-view-map-container {
                min-height: 300px;
                max-height: 400px;
            }
            .map-view-heatmap-container {
                flex-basis: 180px;
            }
        }
        /* END: Styles for the new Map + Heatmap view */

        /* ========================================
           ADVANCED SEARCH FILTER ACCORDION
           ======================================== */

        #filter-accordion {
            border: 1px solid var(--border-color-soft);
            border-radius: var(--border-radius);
            overflow: hidden;
        }

        #filter-accordion .accordion-item {
            border: none;
            border-bottom: 1px solid var(--border-color-soft);
        }

        #filter-accordion .accordion-item:last-child {
            border-bottom: none;
        }

        #filter-accordion .accordion-button {
            color: var(--text-color);
            padding: 0.5rem 0.75rem;
            font-weight: 600;
            font-size: 0.95rem;
            border: none;
            box-shadow: none;
        }

        #filter-accordion .accordion-button:not(.collapsed) {
            background: var(--highlight-color);
            color: var(--text-color);
            box-shadow: none;
        }

        #filter-accordion .accordion-button:focus {
            box-shadow: none;
            border-color: transparent;
        }

        #filter-accordion .accordion-button:hover {
            background: var(--highlight-color);
        }

        #filter-accordion .accordion-button::after {
            color: var(--muted-coral);
        }

        #filter-accordion .accordion-button i {
            color: var(--muted-coral);
        }

        #filter-accordion .accordion-body {
            padding: 1rem;
            background: white;
        }

        .filter-summary {
            color: var(--sea-glass-blue);
            font-weight: 400;
            font-size: 0.85rem;
            margin-left: auto;
            margin-right: 0.75rem;
        }

        /* Filter accordion controls styling */
        #filter-accordion .form-range::-webkit-slider-thumb {
            background: var(--muted-coral);
        }

        #filter-accordion .form-range::-moz-range-thumb {
            background: var(--muted-coral);
        }

        #filter-accordion .form-range::-webkit-slider-track {
            background: var(--border-color-soft);
        }

        #filter-accordion .form-range::-moz-range-track {
            background: var(--border-color-soft);
        }

        #filter-accordion .btn-check:checked + .btn-outline-primary {
            background-color: var(--muted-coral);
            border-color: var(--muted-coral);
            color: white;
        }

        #filter-accordion .btn-outline-primary {
            border-color: var(--border-color-soft);
            color: var(--text-color);
        }

        #filter-accordion .btn-outline-primary:hover {
            background-color: var(--highlight-color);
            border-color: var(--muted-coral);
            color: var(--text-color);
        }

        #filter-accordion .btn-check:checked + .btn-outline-success {
            background-color: var(--muted-coral);
            border-color: var(--muted-coral);
            color: white;
        }

        #filter-accordion .btn-outline-success {
            border-color: var(--border-color-soft);
            color: var(--text-color);
        }

        #filter-accordion .btn-outline-success:hover {
            background-color: var(--highlight-color);
            border-color: var(--muted-coral);
            color: var(--text-color);
        }

        #filter-accordion .btn-check:checked + .btn-outline-warning,
        #filter-accordion .btn-check:checked + .btn-outline-info,
        #filter-accordion .btn-check:checked + .btn-outline-secondary {
            background-color: var(--muted-coral);
            border-color: var(--muted-coral);
            color: white;
        }

        #filter-accordion .btn-outline-warning,
        #filter-accordion .btn-outline-info,
        #filter-accordion .btn-outline-secondary {
            border-color: var(--border-color-soft);
            color: var(--text-color);
        }

        #filter-accordion .btn-outline-warning:hover,
        #filter-accordion .btn-outline-info:hover,
        #filter-accordion .btn-outline-secondary:hover {
            background-color: var(--highlight-color);
            border-color: var(--muted-coral);
            color: var(--text-color);
        }

        #filter-accordion .form-label {
            color: var(--text-color);
            font-weight: 500;
        }

        #filter-accordion .form-select {
            border-color: var(--border-color-soft);
            color: var(--text-color);
        }

        #filter-accordion .form-select:focus {
            border-color: var(--muted-coral);
            box-shadow: 0 0 0 0.2rem rgba(217, 91, 67, 0.15);
        }

        #filter-accordion .form-control {
            border-color: var(--border-color-soft);
            color: var(--text-color);
        }

        #filter-accordion .form-control:focus {
            border-color: var(--muted-coral);
            box-shadow: 0 0 0 0.2rem rgba(217, 91, 67, 0.15);
        }

        .filter-value {
            font-weight: 600;
            color: var(--muted-coral);
            font-size: 0.9rem;
        }

        #location-banner {
            border-radius: var(--border-radius);
        }

        /* Range slider styling for disabled state */
        .form-range:disabled::-webkit-slider-thumb {
            background: #ccc;
        }

        .form-range:disabled::-moz-range-thumb {
            background: #ccc;
        }

        /* Search buttons styling */
        #search-waves-btn {
            background-color: var(--muted-coral);
            border-color: var(--muted-coral);
            color: white;
            font-weight: 600;
        }

        #search-waves-btn:hover {
            background-color: #c24d35;
            border-color: #c24d35;
        }

        #search-waves-btn:active {
            background-color: #b34530;
            border-color: #b34530;
        }

        #reset-filters-btn {
            border-color: var(--border-color-soft);
            color: var(--text-color);
            background-color: white;
        }

        #reset-filters-btn:hover {
            background-color: var(--pale-sand);
            border-color: var(--muted-coral);
            color: var(--text-color);
        }

        /* Search Results Styling */
        #search-results-container {
            min-height: 200px;
        }

        .search-result-card {
            background: white;
            border: 1px solid var(--border-color-soft);
            border-radius: var(--border-radius);
            padding: 1rem;
            margin-bottom: 1rem;
            box-shadow: var(--card-shadow);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            cursor: pointer;
        }

        .search-result-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 35px rgba(60, 72, 88, 0.15);
        }

        .search-result-score {
            font-size: 1.75rem;
            font-weight: 700;
            color: var(--sea-blue);
        }

        .search-result-spot-name {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--text-color);
            margin-bottom: 0.25rem;
        }

        .search-result-meta {
            color: #6c757d;
            font-size: 0.9rem;
        }

        .search-result-conditions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-top: 0.75rem;
        }

        .condition-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            padding: 0.25rem 0.75rem;
            background: var(--pale-sand);
            border-radius: 1rem;
            font-size: 0.85rem;
            color: var(--text-color);
        }

        /* Mobile Responsive Adjustments */
        @media (max-width: 767.98px) {
            .filter-card-header {
                padding: 0.6rem 0.85rem;
                font-size: 0.9rem;
            }

            .filter-card-body {
                padding: 0.85rem;
            }

            .filter-card .btn-sm {
                font-size: 0.8rem;
                padding: 0.4rem 0.6rem;
            }

            .search-result-score {
                font-size: 1.5rem;
            }

            .search-result-spot-name {
                font-size: 1.1rem;
            }

            .search-result-conditions {
                gap: 0.5rem;
            }

            .condition-badge {
                font-size: 0.8rem;
                padding: 0.2rem 0.6rem;
            }
        }

        /* Small mobile adjustments */
        @media (max-width: 575.98px) {

            #advanced-search-container .btn-group {
                flex-direction: column;
            }

            #advanced-search-container .btn-group .btn {
                border-radius: 0.375rem !important;
                margin-bottom: 0.25rem;
            }

            .time-mode-buttons .btn-group {
                flex-wrap: wrap;
            }

            .time-mode-buttons .btn-group label {
                flex: 1 1 100%;
            }
        }

        /* END: Advanced Search Filter Cards */

        /* Info View Styles */
        .info-view-full-container {
            width: 100%;
            min-height: 600px;
            background-color: var(--background-color);
            overflow-y: auto;
            overflow-x: hidden;
        }

        .info-view-scroll-wrapper {
            display: flex;
            flex-direction: column;
            gap: 2rem;
            padding: 1.5rem;
            max-width: 500px;
            margin: 0 auto;
            min-height: 100%;
        }

        .info-section {
            background: #ffffff;
            border: 1px solid var(--border-color-soft);
            border-radius: var(--border-radius);
            box-shadow: var(--card-shadow);
            padding: 1.5rem;
        }

        .info-section-title {
            font-size: 0.875rem;
            text-transform: uppercase;
            color: var(--muted-coral);
            margin-bottom: 1rem;
            text-align: center;
            font-weight: 600;
            letter-spacing: 0.05em;
        }

        .compass-container {
            width: 240px;
            height: 240px;
            margin: 0 auto;
        }

        .direction-label {
            text-align: center;
            margin-top: 1rem;
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--muted-coral);
        }

        .tide-container {
            width: 100%;
            height: 200px;
            margin: 0 auto;
        }

        .tide-label {
            text-align: center;
            margin-top: 0.75rem;
            font-size: 0.875rem;
            color: var(--text-color);
        }

        .tide-range {
            color: var(--muted-coral);
            font-weight: 600;
        }

        /* D3 Visualization Styles */
        .tide-curve {
            fill: none;
            stroke: var(--muted-coral);
            stroke-width: 2;
        }

        .tide-area {
            fill: color-mix(in srgb, var(--muted-coral) 25%, transparent);
        }

        .segment-line {
            stroke: var(--sea-glass-blue);
            stroke-width: 1;
            opacity: 0.3;
            stroke-dasharray: 2,2;
        }

        .label-optimal {
            fill: var(--muted-coral);
            font-size: 10px;
            font-weight: 600;
        }

        .label-normal {
            fill: var(--sea-glass-blue);
            font-size: 10px;
        }

        .compass-bg {
            fill: none;
            stroke: var(--sea-glass-blue);
            stroke-width: 2;
            opacity: 0.5;
        }

        .compass-wedge {
            fill: color-mix(in srgb, var(--muted-coral) 25%, transparent);
            stroke: var(--muted-coral);
            stroke-width: 2;
            opacity: 0.7;
        }

        .compass-label {
            fill: var(--sea-glass-blue);
            font-size: 14px;
            text-anchor: middle;
            font-weight: 500;
        }

        .compass-window-label {
            fill: var(--muted-coral);
            font-size: 16px;
            font-weight: 700;
            text-anchor: middle;
        }

        .compass-center {
            fill: var(--muted-coral);
        }

        @media (max-width: 767.98px) {
            .info-view-scroll-wrapper {
                padding: 1rem;
                gap: 1.5rem;
            }

            .info-section {
                padding: 1rem;
            }

            /* Full-screen info mode on mobile */
            body.viewing-spot-analysis .info-view-full-container {
                position: fixed;
                top: var(--navbar-height, 56px);
                left: 0;
                right: 0;
                bottom: 0;
                height: calc(var(--real-vh, 1vh) * 100 - var(--navbar-height, 56px));
                z-index: 1000;
            }
        }

        /* Reasoning Summary Styles */
        .reasoning-summary {
            background-color: #f8f9fa;
            border: 2px solid #dee2e6;
            border-radius: 8px;
            padding: 1.5rem;
            margin: 0;
            font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
            font-size: 0.9rem;
            line-height: 1.6;
            color: #2c3e50;
            white-space: pre-wrap;
            word-wrap: break-word;
        }

        .reasoning-details {
            background-color: #ffffff;
            border: 1px solid #dee2e6;
            border-radius: 6px;
            padding: 1rem;
            margin: 0;
            font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
            font-size: 0.85rem;
            line-height: 1.5;
            color: #495057;
            white-space: pre-wrap;
            word-wrap: break-word;
            max-height: 500px;
            overflow-y: auto;
        }

        .reasoning-summary::first-line {
            font-weight: bold;
            font-size: 1rem;
        }
