* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-hover: #242836;
    --border: #2a2e3a;
    --text: #e4e4e7;
    --text-muted: #9ca3af;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

[data-theme="light"] {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-hover: #e5e7eb;
    --border: #d1d5db;
    --text: #1f2937;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--bg);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    z-index: 1000;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.3s;
}
.skip-link:focus { top: 0.5rem; }

/* Global Focus Visible */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Header */
header {
    background: var(--surface);
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.03) 1px, transparent 0);
    background-size: 20px 20px;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    position: relative;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    width: 42px;
    height: 42px;
}

.branding h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
}

.tagline {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.header-widgets {
    display: flex;
    gap: 1.5rem;
}

.widget {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    min-width: 160px;
}

.widget-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.widget-value {
    font-size: 0.95rem;
    font-weight: 600;
}

.widget-clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.widget-clickable:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
}

/* Weather Icons */
.wx-icon {
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    display: inline-block;
    color: var(--accent);
}

.wx-icon-lg {
    width: 3rem;
    height: 3rem;
    margin-right: 0.5rem;
}

.wx-icon-lg .wx-icon {
    width: 3rem;
    height: 3rem;
}

.wx-icon-sm {
    width: 1.25em;
    height: 1.25em;
}

.sidebar-weather-current-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.sidebar-weather-icon {
    color: var(--accent);
}

.sidebar-weather-icon .wx-icon {
    width: 2.5rem;
    height: 2.5rem;
}

.weather-hour-icon {
    margin: 0.2rem 0;
    color: var(--accent);
}

.weather-hour-icon .wx-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.weather-day-icon {
    width: 30px;
    margin-right: 0.5rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-day-icon .wx-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.sidebar-forecast-icon {
    width: 24px;
    margin-right: 0.25rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-forecast-icon .wx-icon {
    width: 1rem;
    height: 1rem;
}

.header-wx-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.header-wx-icon .wx-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.river-normal { color: var(--success); }
.river-action { color: var(--warning); }
.river-flood { color: var(--danger); }

/* Navigation */
nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: auto;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text);
}

.nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

#view-toggle {
    margin-left: auto;
}

/* Header action buttons (mobile only) */
.header-actions {
    display: none;
    gap: 0.25rem;
}

.header-action-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
    text-decoration: none;
    padding: 0;
    font-size: 0;
    line-height: 1;
    box-sizing: border-box;
}

.header-action-btn:hover {
    color: var(--text);
    background: var(--surface-hover);
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.6rem 0.75rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: var(--text);
}

/* Dark mode (default): show sun icon to switch to light */
.theme-icon-moon { display: none; }
.theme-icon-sun { display: block; }

/* Light mode: show moon icon to switch to dark */
[data-theme="light"] .theme-icon-moon { display: block; }
[data-theme="light"] .theme-icon-sun { display: none; }

/* Light mode overrides for hardcoded dark backgrounds */
[data-theme="light"] .fake-ad {
    background: linear-gradient(135deg, #e8edf5, #dfe4ee);
}
[data-theme="light"] .fake-ad:hover {
    background: linear-gradient(135deg, #dce3f0, #d3daea);
}
[data-theme="light"] .fake-ad-logo {
    background: rgba(37, 99, 235, 0.1);
}
[data-theme="light"] .sidebar-advertise {
    background: linear-gradient(135deg, #e8edf5, #dfe4ee);
}
[data-theme="light"] .sidebar-card {
    background: var(--surface);
}
[data-theme="light"] .modal-content {
    background: var(--surface);
}
[data-theme="light"] .modal-header {
    border-bottom: 1px solid var(--border);
}
[data-theme="light"] .modal-ad {
    background: var(--bg);
}
[data-theme="light"] .camera-card {
    background: var(--surface);
}
[data-theme="light"] .section-divider path {
    fill: var(--surface);
}
[data-theme="light"] footer {
    background: var(--surface);
}

/* Camera Map View */
.camera-map-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

#camera-map {
    height: 600px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.camera-map-popup {
    text-align: center;
}

.camera-map-popup img {
    width: 240px;
    height: auto;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.camera-map-popup-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.camera-map-popup-link {
    font-size: 0.75rem;
    color: #3b82f6;
    cursor: pointer;
    text-decoration: underline;
}

/* Leaflet popup dark theme */
.leaflet-popup-content-wrapper {
    background: #1a1d27 !important;
    color: #e4e4e7 !important;
    border-radius: 8px !important;
    border: 1px solid #2a2e3a !important;
}

.leaflet-popup-tip {
    background: #1a1d27 !important;
}

.leaflet-popup-close-button {
    color: #9ca3af !important;
}

@media (max-width: 768px) {
    #camera-map {
        height: 450px;
    }
}

/* Ad Banners */
.ad-banner {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 1.5rem;
}

.ad-placeholder {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Dynamic Ad Slots */
.ad-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Fake Ads */
.fake-ad {
    background: linear-gradient(135deg, #1e2230, #252a3a);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.fake-ad:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, #222838, #2a3040);
}

.fake-ad-logo {
    font-size: 1.75rem;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fake-ad-text {
    flex: 1;
    min-width: 0;
}

.fake-ad-text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.15rem;
}

.fake-ad-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.fake-ad-cta {
    flex-shrink: 0;
    background: var(--accent);
    color: white;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.fake-ad:hover .fake-ad-cta {
    background: var(--accent-hover);
}

.fake-ad-small .fake-ad-logo {
    font-size: 1.4rem;
    width: 36px;
    height: 36px;
}

.fake-ad-small .fake-ad-text strong {
    font-size: 0.8rem;
}

.fake-ad-small .fake-ad-text span {
    font-size: 0.75rem;
}

.fake-ad-small .fake-ad-cta {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

@media (max-width: 480px) {
    .fake-ad {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .fake-ad-cta {
        width: 100%;
        text-align: center;
    }
}

/* Page Layout - Two Column */
.page-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.5rem;
    overflow: hidden;
}

/* Main Content */
main {
    padding: 1rem 0;
    min-width: 0;
}

.ad-banner-inline {
    padding: 0;
    margin: 0 0 1.5rem 0;
}

/* Sidebar */
.sidebar {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.sidebar-card h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.sidebar-weather-temp {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.sidebar-weather-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.sidebar-weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.sidebar-weather-detail {
    background: var(--bg);
    border-radius: 5px;
    padding: 0.4rem 0.6rem;
}

.sidebar-weather-detail-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sidebar-weather-detail-value {
    font-size: 0.8rem;
    font-weight: 600;
}

.sidebar-forecast-mini {
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.sidebar-forecast-day {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.8rem;
}

.sidebar-forecast-day-name {
    font-weight: 600;
    width: 70px;
}

.sidebar-forecast-day-desc {
    flex: 1;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
}

.sidebar-forecast-day-temp {
    font-weight: 600;
    text-align: right;
    width: 60px;
}

.sidebar-river-level {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.sidebar-river-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.sidebar-river-gauge {
    margin-top: 0.75rem;
    background: var(--bg);
    border-radius: 5px;
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Closings */
.closing-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.closing-item:last-child {
    border-bottom: none;
}

.closing-org {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
}

.closing-status {
    font-size: 0.75rem;
    color: var(--warning);
    line-height: 1.3;
}

.closing-status-closed {
    color: var(--danger);
}

.closing-status-delay {
    color: var(--warning);
}

.closing-status-other {
    color: var(--text-muted);
}

.closings-none {
    font-size: 0.8rem;
    color: var(--success);
    padding: 0.5rem 0;
}

.closings-source {
    margin-top: 0.5rem;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.closings-source a {
    color: var(--accent);
    text-decoration: none;
}

/* Closings Tab */
.closings-tab-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.closings-tab-section .page-layout {
    padding: 0;
}

.closings-tab-content {
    padding: 1rem 0;
}

.closings-tab-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.closings-tab-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.closings-search {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.closings-search:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--accent);
}

.closings-search::placeholder {
    color: #555;
}

.closing-item.closing-hidden {
    display: none;
}

.closings-tab-list-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.closings-tab-list-inner .closing-item {
    padding: 0.75rem 0;
}

.closings-tab-list-inner .closing-org {
    font-size: 0.9rem;
}

.closings-tab-list-inner .closing-status {
    font-size: 0.8rem;
}

.closings-error {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-links a:last-child {
    border-bottom: none;
}

.sidebar-links a:hover {
    text-decoration: underline;
}

.sidebar-ad {
    padding: 0;
    background: none;
    border: none;
}

.fake-ad-vertical {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
}

.fake-ad-vertical .fake-ad-text {
    text-align: center;
}

.sidebar-contact {
    text-align: center;
}

.sidebar-contact p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.contact-btn {
    background: var(--surface-hover);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.contact-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.footer-contact-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.footer-contact-btn {
    width: 100%;
}

.sidebar-advertise {
    text-align: center;
    background: linear-gradient(135deg, #1e2230, #252a3a);
}

.sidebar-advertise p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

section {
    margin-bottom: 2rem;
}

section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    -webkit-user-select: none;
}

section h2:hover {
    color: var(--text);
}

section h2 .section-chevron {
    width: 18px;
    height: 18px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
    opacity: 0.6;
}

section h2:hover .section-chevron {
    opacity: 1;
}

section.collapsed h2 .section-chevron {
    transform: rotate(-90deg);
}

section.collapsed .camera-grid,
section.collapsed .rwis-subtitle {
    display: none !important;
}

/* Camera search bar */
.camera-search-bar {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
}

.camera-search-bar input {
    width: 100%;
    max-width: 400px;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.camera-search-bar input:focus {
    border-color: var(--accent);
}

.camera-search-bar input::placeholder {
    color: var(--text-muted);
}

.camera-search-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 400px;
}

.camera-search-wrap .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.camera-search-no-results {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    display: none;
}

@media (max-width: 768px) {
    .camera-search-bar {
        position: sticky;
        top: 0;
        z-index: 90;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 0.5rem 1rem;
    }

    .camera-search-bar input {
        max-width: 100%;
    }

    .camera-search-wrap {
        max-width: 100%;
    }
}

/* Camera Grid */
.camera-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.camera-grid.list-view {
    grid-template-columns: 1fr;
}

.camera-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.camera-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.camera-thumb-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
    overflow: hidden;
}

.camera-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-thumb-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.camera-live-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fav-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #666;
    font-size: 1.2rem;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 5;
    transition: color 0.2s, background 0.2s;
}

.fav-btn:hover {
    color: #fbbf24;
    background: rgba(0, 0, 0, 0.7);
}

.fav-btn.fav-active {
    color: #fbbf24;
}

#favorites h2 {
    color: #fbbf24;
}

.camera-info {
    padding: 0.75rem;
}

.camera-name {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
}

.camera-route {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* RWIS */
.rwis-badge {
    background: var(--accent) !important;
}

.rwis-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: -0.5rem 0 1rem;
}

.camera-station {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.rwis-modal-image {
    width: 100%;
    display: block;
}

/* Road Conditions Sidebar */
.road-sensor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border, #2a2d3a);
}

.road-sensor:last-child {
    border-bottom: none;
}

.road-sensor-route {
    font-size: 0.8rem;
    font-weight: 500;
}

.road-sensor-data {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.road-temp {
    font-size: 0.85rem;
    font-weight: 600;
}

.road-condition-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.road-dry { background: #166534; color: #bbf7d0; }
.road-wet { background: #1e40af; color: #bfdbfe; }
.road-ice { background: #b45309; color: #fde68a; }
.road-snow { background: #b91c1c; color: #fecaca; }
.road-unknown { background: #374151; color: #9ca3af; }

.camera-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.condition-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.condition-green  { background: #16a34a22; color: #16a34a; border: 1px solid #16a34a44; }
.condition-yellow { background: #ca8a0422; color: #eab308; border: 1px solid #eab30844; }
.condition-orange { background: #ea580c22; color: #f97316; border: 1px solid #f9731644; }
.condition-red    { background: #dc262622; color: #ef4444; border: 1px solid #ef444444; }
.condition-blue   { background: #2563eb22; color: #60a5fa; border: 1px solid #60a5fa44; }
.condition-gray   { background: #6b728022; color: #9ca3af; border: 1px solid #9ca3af44; }

/* List View */
.list-view .camera-card {
    display: flex;
    flex-direction: row;
}

.list-view .camera-thumb-container {
    width: 200px;
    min-width: 200px;
    padding-top: 0;
    height: 112px;
}

.list-view .camera-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    overflow: hidden;
}

/* Video controls overlay */
.video-controls-overlay {
    position: absolute;
    inset: 0;
    z-index: 12;
    pointer-events: none;
}

.video-nav-btn {
    pointer-events: auto;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.55);
    border: none;
    color: #fff;
    width: 40px;
    height: 56px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.video-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

#modal-prev { left: 8px; }
#modal-next { right: 8px; }

.video-top-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#modal-video-container:hover .video-top-controls,
.video-top-controls:focus-within {
    opacity: 1;
}

.video-ctrl-btn {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.video-ctrl-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    gap: 1rem;
}

#modal-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.modal-header-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
    flex-shrink: 0;
    transition: color 0.2s;
}

.modal-header-close:hover {
    color: var(--text);
}

.modal-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.status-live {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #ef4444;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.status-time {
    color: var(--text-muted, #9ca3af);
    font-size: 0.8rem;
}

.status-timer {
    color: var(--text-muted, #9ca3af);
    font-size: 0.75rem;
    font-family: monospace;
    transition: color 0.3s;
}

.status-timer-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted, #9ca3af);
}

.status-timer-icon {
    color: var(--text-muted, #6b7280);
    flex-shrink: 0;
}

.status-timer-label {
    color: var(--text-muted, #6b7280);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-timer-reset {
    background: none;
    border: none;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.status-timer-reset:hover {
    color: var(--text, #fff);
    background: rgba(255, 255, 255, 0.1);
}

.status-timer.timer-warning {
    background: rgba(220, 38, 38, 0.85);
    color: #fff;
}

.modal-ad {
    padding: 0.75rem 1.25rem;
}

.modal-ad .ad-placeholder {
    padding: 0.6rem;
    font-size: 0.75rem;
}

#modal-video-container {
    width: 100%;
    background: #000;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

#modal-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

/* Stream loading state */
.stream-loader {
    position: absolute;
    inset: 0;
    z-index: 8;
    overflow: hidden;
}

.stream-loader-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(4px) brightness(0.4);
}

.stream-loader-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.stream-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--accent, #3b82f6);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.stream-loader-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.stream-loader-fade {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Weather overlay on video */
.stream-weather-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.7), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 0.4rem 0.75rem 1.25rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    z-index: 9;
    pointer-events: none;
    flex-wrap: wrap;
}

.weather-bar-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.weather-bar-icon {
    font-size: 1rem;
    line-height: 1;
}

.weather-bar-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.weather-bar-dim {
    color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 600px) {
    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.6rem 1rem;
        padding-right: 1rem;
    }

    #modal-title {
        font-size: 0.9rem;
    }

    .modal-status {
        gap: 0.5rem;
        font-size: 0.7rem;
    }

    .status-timer-label {
        display: none;
    }

    .stream-weather-bar {
        gap: 0.75rem;
        font-size: 0.65rem;
    }

    .video-nav-btn {
        width: 32px;
        height: 44px;
    }

    .video-ctrl-btn {
        width: 28px;
        height: 28px;
    }
}

/* Legacy info bar classes (keep for compat) */
.stream-info-bar { display: none; }
.info-bar-left, .info-bar-right, .info-bar-item, .info-bar-live, .info-bar-dot,
.info-bar-icon, .info-bar-label, .info-bar-dim { display: none; }

/* Legacy timer badge — replaced by header status */
.stream-timer-badge { display: none; }

.stream-attribution {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #fff;
    font-size: 0.8rem;
    padding: 1.5rem 1rem 0.75rem;
    z-index: 10;
    pointer-events: none;
    transition: opacity 1s ease;
}

.stream-attribution strong {
    color: var(--accent, #3b82f6);
}

.stream-attribution-fade {
    opacity: 0;
}

/* Legacy warning class */
.stream-timer-badge.stream-timer-warning { display: none; }

.stream-expired {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--text-muted);
    gap: 1rem;
    z-index: 11;
}

.stream-expired p {
    font-size: 1.1rem;
    margin: 0;
}

.stream-restart-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.stream-restart-btn:hover {
    background: var(--accent-hover, #2563eb);
}

.stream-prompt-buttons {
    display: flex;
    gap: 0.75rem;
}

.stream-close-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border, #333);
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.stream-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Weather Tab Section (inline) */
.weather-tab-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    overflow: hidden;
}

.weather-tab-section .page-layout,
.weather-tab-content {
    min-width: 0;
    max-width: 100%;
}

.weather-tab-section .page-layout {
    padding: 0;
}

.weather-tab-content {
    padding: 1rem 0;
}

.weather-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    min-width: 0;
}

.weather-tab-content .weather-top-row {
    grid-template-columns: 1fr;
}

.weather-current-detail {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
}

.weather-current-temp {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.weather-current-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.weather-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.weather-detail-item {
    background: var(--bg);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
}

.weather-detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.weather-detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 0.15rem;
}

.weather-radar-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.weather-radar-container h3,
.weather-forecast-section h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

#radar-map {
    flex: 1;
    min-height: 300px;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1d27;
}

.radar-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.radar-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.radar-btn:hover {
    background: var(--accent-hover);
}

.radar-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.weather-forecast-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.weather-hourly-scroll {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.weather-hour-item {
    flex: 0 0 80px;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-right: 1px solid var(--border);
}

.weather-hour-item:last-child {
    border-right: none;
}

.weather-hour-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.weather-hour-temp {
    font-size: 1.1rem;
    font-weight: 700;
}

.weather-hour-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    line-height: 1.2;
}

.weather-hour-precip {
    font-size: 0.65rem;
    color: var(--accent);
    margin-top: 0.15rem;
}

.weather-daily {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.weather-day-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.weather-day-item:last-child {
    border-bottom: none;
}

.weather-day-name {
    width: 120px;
    font-weight: 600;
    font-size: 0.9rem;
}

.weather-day-desc {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.weather-day-temps {
    text-align: right;
    font-size: 0.9rem;
}

.weather-day-high {
    font-weight: 700;
}

.weather-day-low {
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.weather-alerts-section {
    background: var(--surface);
    border: 1px solid var(--danger);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.weather-alerts-section h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--danger);
    margin-bottom: 0.75rem;
}

.weather-alert-item {
    background: var(--bg);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.weather-alert-item:last-child {
    margin-bottom: 0;
}

.weather-alert-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--warning);
    margin-bottom: 0.25rem;
}

.weather-alert-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.weather-loading {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 1rem;
    text-align: center;
}

@media (max-width: 768px) {
    .weather-top-row {
        grid-template-columns: 1fr;
    }

    #radar-map {
        min-height: 250px;
    }

    .weather-day-item {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .weather-day-name {
        width: 100px;
    }
}

/* Footer */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2.5rem 1.5rem 1.5rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.footer-logo {
    width: 32px;
    height: 32px;
}

.footer-brand strong {
    display: block;
    font-size: 1rem;
    color: var(--text);
}

.footer-brand span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-about {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-resources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.footer-resources a {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-resources a:hover {
    color: var(--accent);
}

.footer-col h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.25rem 0;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-advertise-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.footer-advertise-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.footer-disclaimer {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 800px;
    opacity: 0.7;
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.advertise-btn {
    background: none;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.35rem 0.75rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.advertise-btn:hover {
    background: var(--accent);
    color: white;
}

.copyright {
    margin-top: 0.5rem;
}

/* Advertise Modal */
.advertise-modal-content {
    max-width: 600px;
    padding: 2rem;
}

.advertise-header {
    margin-bottom: 1.5rem;
}

.advertise-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.advertise-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.advertise-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #555;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group select {
    cursor: pointer;
}

.form-actions {
    margin-top: 0.5rem;
}

.form-submit {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.form-submit:hover {
    background: var(--accent-hover);
}

.form-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
    color: var(--success);
    font-weight: 600;
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .advertise-modal-content {
        padding: 1.25rem;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .page-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }

    .branding {
        flex: 1;
    }

    .header-widgets {
        width: 100%;
        order: 3;
        gap: 0.75rem;
    }

    .widget {
        flex: 1;
        min-width: 0;
        background: none;
        border: none;
        padding: 0;
        border-radius: 0;
    }

    .widget-label {
        display: none;
    }

    .widget-value {
        font-size: 0.7rem;
        font-weight: 500;
    }

    .camera-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .list-view .camera-card {
        flex-direction: column;
    }

    .list-view .camera-thumb-container {
        width: 100%;
        padding-top: 56.25%;
        height: auto;
    }

    .modal {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.6rem 1rem;
    }

    .header-content {
        gap: 0.5rem;
    }

    .branding h1 {
        font-size: 1.1rem;
    }

    .branding p {
        font-size: 0.65rem;
    }

    .camera-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .camera-card .camera-info {
        padding: 0.4rem 0.5rem;
    }

    .camera-card .camera-name {
        font-size: 0.7rem;
        line-height: 1.2;
    }

    .camera-card .camera-conditions {
        font-size: 0.6rem;
    }

    .camera-card .camera-live-badge {
        font-size: 0.55rem;
        padding: 0.15rem 0.35rem;
    }

    nav {
        padding: 0 0.75rem;
        position: relative;
    }

    .nav-link {
        padding: 0.75rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Move view toggle and theme toggle to header on mobile */
    .header-actions {
        display: flex;
    }

    #view-toggle,
    #theme-toggle {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .footer-bottom {
        flex-direction: column;
    }
}

/* Live Feeds Tab */
.feeds-tab-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.feeds-tab-section .page-layout {
    padding: 0;
}

.feeds-tab-content {
    padding: 1rem 0;
}

.feeds-tab-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.feeds-tab-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.feeds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.25rem;
}

.feed-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.feed-card:hover {
    border-color: var(--accent, #4a9eff);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.feed-embed-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

.feed-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.feed-info {
    padding: 0.75rem 1rem;
}

.feed-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.feed-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.feed-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

@media (max-width: 500px) {
    .feeds-grid {
        grid-template-columns: 1fr;
    }
}

/* Scores Tab */
.scores-tab-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.scores-tab-section .page-layout {
    padding: 0;
}

.scores-tab-content {
    padding: 1rem 0;
}

.scores-tab-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.scores-tab-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.scores-filter-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.scores-filter-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.scores-filter-btn.active {
    background: var(--accent, #4a9eff);
    color: white;
    border-color: var(--accent, #4a9eff);
}

.scores-school-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.scores-school-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg);
}

.scores-school-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.scores-school-mascot {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.scores-schedule-link {
    color: var(--accent, #4a9eff);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.scores-schedule-link:hover {
    text-decoration: underline;
}

.scores-games {
    padding: 0.5rem 1rem;
}

.score-game-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.score-game-row:last-child {
    border-bottom: none;
}

.score-result {
    font-weight: 700;
    font-size: 0.8rem;
    width: 28px;
    text-align: center;
    padding: 2px 0;
    border-radius: 3px;
    flex-shrink: 0;
}

.score-result-W { background: #16a34a22; color: #22c55e; }
.score-result-L { background: #dc262622; color: #ef4444; }
.score-result-T { background: #6b728022; color: #9ca3af; }
.score-result-upcoming { background: var(--bg); color: var(--text-muted); }

.score-opponent { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-final { font-weight: 600; min-width: 50px; text-align: right; flex-shrink: 0; }
.score-date { color: var(--text-muted); font-size: 0.75rem; min-width: 50px; text-align: right; flex-shrink: 0; }

.score-upcoming { opacity: 0.7; }

.scores-no-data {
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* Sidebar closings link */
.sidebar-closings-shortcut {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.sidebar-closings-shortcut:hover {
    opacity: 0.8;
}

.sidebar-closings-shortcut h3 {
    margin: 0;
}

.closings-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 2px 8px;
    background: var(--bg);
    border-radius: 10px;
}

/* Section Divider */
.section-divider {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    margin: 0;
}

.section-divider svg {
    display: block;
    width: 100%;
    height: 40px;
}

/* Minimum touch target sizes */
button,
.nav-link,
.advertise-btn,
.form-submit,
.radar-btn,
.scores-filter-btn,
.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--border);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 90;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Peak Traffic Indicators */
.camera-card.traffic-moderate {
    border-left: 3px solid #eab308;
}
.camera-card.traffic-heavy {
    border-left: 3px solid #f97316;
}
.camera-card.traffic-standstill {
    border-left: 3px solid #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
}
.traffic-density-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.traffic-density-badge.density-heavy {
    background: #ea580c22;
    color: #f97316;
    border: 1px solid #f9731644;
}
.traffic-density-badge.density-standstill {
    background: #dc262622;
    color: #ef4444;
    border: 1px solid #ef444444;
    animation: pulse-badge 1.5s ease-in-out infinite;
}
@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Incident Alerts Banner */
.incident-banner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.incident-banner-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #78350f;
    border: 1px solid #92400e;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: #fef3c7;
}
[data-theme="light"] .incident-banner-content {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #78350f;
}
.incident-banner-icon {
    display: flex;
    align-items: center;
    color: #fbbf24;
    flex-shrink: 0;
}
[data-theme="light"] .incident-banner-icon {
    color: #d97706;
}
#incident-banner-text {
    flex: 1;
    font-weight: 600;
}
.incident-banner-view {
    background: #fbbf2433;
    color: #fef3c7;
    border: 1px solid #fbbf2466;
    border-radius: 4px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.incident-banner-view:hover {
    background: #fbbf2455;
}
[data-theme="light"] .incident-banner-view {
    background: #f59e0b33;
    color: #78350f;
    border-color: #f59e0b66;
}
[data-theme="light"] .incident-banner-view:hover {
    background: #f59e0b55;
}
.incident-banner-dismiss {
    background: none;
    border: none;
    color: #fef3c7;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.incident-banner-dismiss:hover {
    opacity: 1;
}
[data-theme="light"] .incident-banner-dismiss {
    color: #78350f;
}
.camera-card.incident-highlight {
    animation: highlight-card 2s ease-out;
}
@keyframes highlight-card {
    0% { box-shadow: 0 0 0 3px #f59e0b; }
    100% { box-shadow: none; }
}

/* Closings Filter Row */
.closings-filter-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.closings-filter-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.closings-filter-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}
.closings-filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
