/* ============================================================
   BLUEWATER FORECAST — crisp terminal theme
   Loaded AFTER advanced_forecast.css; overrides the legacy
   glow-heavy skin with a flat, mono, near-black aesthetic.
   Palette (validated, dark surface #0e1419):
     teal   #2dd4bf  — series 1 / brand accent
     amber  #fbbf24  — series 2
     violet #a78bfa  — accent
     pink   #f472b6  — accent
   ============================================================ */

:root {
    --primary-color: #2dd4bf;
    --primary-glow: rgba(45, 212, 191, 0.25);
    --secondary-color: #fbbf24;
    --background-dark: #0b0e11;
    --background-medium: #0e1419;
    --background-light: #10161c;
    --text-primary: #d7e0e9;
    --text-secondary: #7d8b99;
    --text-muted: #5c6b78;
    --border-color: #1c2530;
    --border-light: #1c2530;

    --radius-sm: 3px;
    --radius-md: 5px;
    --radius-lg: 7px;

    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.6);

    --accent-teal: #2dd4bf;
    --accent-amber: #fbbf24;
    --accent-violet: #a78bfa;
    --accent-pink: #f472b6;
    --font-mono: "DM Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body,
button,
input,
select,
textarea {
    font-family: var(--font-mono);
}

body {
    background: var(--background-dark);
    color: var(--text-primary);
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
}

/* ---------- beta banner: slim strip, no gradient circus ---------- */
.beta-banner {
    background: var(--background-medium);
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
    animation: none;
    padding: 0.35rem 1rem;
}
.beta-banner .beta-text {
    color: var(--text-secondary);
    font-size: 11px;
    letter-spacing: 0.02em;
    text-shadow: none;
}
.beta-banner .beta-text strong {
    color: var(--accent-teal);
    font-weight: 600;
}
.beta-banner .beta-icon { display: none; }
.beta-features-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: lowercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.6rem;
    box-shadow: none;
}
.beta-features-btn:hover {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    background: transparent;
    transform: none;
    box-shadow: none;
}

/* ---------- header ---------- */
.header {
    background: var(--background-dark);
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
}
.brand-name {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--accent-teal);
    text-shadow: none;
    background: none;
    -webkit-text-fill-color: currentColor;
}
.tagline {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.35em;
    color: var(--text-muted);
    text-transform: uppercase;
}
.wave-container { opacity: 0.35; }

.location-display,
.time-display {
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: none;
    color: var(--text-secondary);
    font-size: 11px;
}
.time-label {
    color: var(--text-muted);
    font-size: 9px;
    letter-spacing: 0.15em;
}
.time-value {
    color: var(--text-primary);
    font-weight: 600;
    text-shadow: none;
}
.time-date { color: var(--text-muted); font-size: 9px; }
.camera-btn,
.fullscreen-btn {
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    box-shadow: none;
}
.camera-btn:hover,
.fullscreen-btn:hover {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    background: var(--background-medium);
    transform: none;
    box-shadow: none;
}

/* ---------- panels & map ---------- */
.main-content { background: var(--background-dark); }
.left-panel,
.right-panel {
    background: var(--background-dark);
    border: none;
}
.map-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: none;
}

/* ---------- buoy cards ---------- */
.buoy-card {
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: none;
    transition: border-color var(--transition-fast);
}
.buoy-card:hover {
    border-color: var(--accent-teal);
    transform: none;
    box-shadow: none;
}
.buoy-header h4 {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}
.buoy-distance {
    color: var(--text-muted);
    font-size: 9px;
    letter-spacing: 0.04em;
}
.buoy-label {
    color: var(--text-muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.buoy-value {
    font-family: var(--font-mono);
    color: var(--accent-teal);
    font-weight: 600;
    font-size: 12px;
    text-shadow: none;
}
.buoy-status {
    color: var(--text-muted);
    font-size: 9px;
    letter-spacing: 0.06em;
}

/* ---------- buoycam ---------- */
.buoycam-section {
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: none;
}
.buoycam-header h4 {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}
.buoycam-timestamp { color: var(--text-muted); font-size: 9px; }

/* ---------- timeline ---------- */
.timeline-controls {
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: none;
}
.timeline-slider {
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
}
.timeline-slider::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent-teal);
    border: 2px solid var(--background-dark);
    border-radius: 50%;
    box-shadow: none;
}
.timeline-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent-teal);
    border: 2px solid var(--background-dark);
    border-radius: 50%;
    box-shadow: none;
}
.timeline-labels span {
    color: var(--text-muted);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.current-time {
    font-family: var(--font-mono);
    color: var(--accent-teal);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-shadow: none;
    background: none;
    border: none;
}

/* ---------- condition cards: stat tiles ---------- */
/* content-sized so the stat cards never shrink below their real height and
   spill onto the charts at short desktop viewport heights (was flex:0.1) */
.current-conditions { gap: 0.5rem; flex: 0 0 auto; }
.condition-card {
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: none;
    padding: 0.6rem 0.5rem;
    transition: border-color var(--transition-fast);
}
.condition-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--text-muted);
}
.condition-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: none;
    color: var(--text-primary);
}
.condition-label {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-top: 2px;
}
/* per-metric accents, in DOM order: wind / swell / energy / sst */
.current-conditions .condition-card:nth-child(1) .condition-value { color: var(--accent-teal); }
.current-conditions .condition-card:nth-child(2) .condition-value { color: var(--accent-amber); }
.current-conditions .condition-card:nth-child(3) .condition-value { color: var(--accent-violet); }
.current-conditions .condition-card:nth-child(4) .condition-value { color: var(--accent-pink); }

/* ---------- chart panels ---------- */
.chart-panel {
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: none;
    transition: border-color var(--transition-fast);
}
.chart-panel:hover {
    transform: none;
    box-shadow: none;
}
.chart-header {
    background: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.45rem 0.75rem;
}
.chart-header h3 {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    text-shadow: none;
}

/* ---------- loading ---------- */
.loading-overlay {
    background: rgba(11, 14, 17, 0.92);
    backdrop-filter: blur(2px);
}
.loading-overlay p {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 11px;
    letter-spacing: 0.1em;
}
.loading-spinner {
    border-color: var(--border-color);
    border-top-color: var(--accent-teal);
    box-shadow: none;
}

/* ---------- beta features dropdown ---------- */
.beta-features-content {
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}
.features-header h4 {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-size: 12px;
    letter-spacing: 0.06em;
}
.features-header p { color: var(--text-muted); font-size: 10px; }
.feature-item {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.feature-name { color: var(--text-primary); font-size: 11px; }
.feature-description { color: var(--text-secondary); font-size: 10px; }
.feature-status {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 2px;
}
.feature-item.live .feature-status { background: rgba(45, 212, 191, 0.12); color: var(--accent-teal); }
.feature-item.coming-soon .feature-status { background: rgba(251, 191, 36, 0.12); color: var(--accent-amber); }
.feature-item.future .feature-status { background: rgba(167, 139, 250, 0.12); color: var(--accent-violet); }

/* ---------- camera modal ---------- */
.camera-modal-content {
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}
.camera-modal-header h3 {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}

/* ---------- leaflet chrome ---------- */
.leaflet-control-zoom a {
    background: var(--background-medium) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
}
.leaflet-control-zoom a:hover { color: var(--accent-teal) !important; }
.leaflet-control-attribution {
    background: rgba(14, 20, 25, 0.8) !important;
    color: var(--text-muted) !important;
    font-size: 8px !important;
    font-family: var(--font-mono) !important;
}
.leaflet-control-attribution a { color: var(--text-secondary) !important; }
/* Leaflet CSS loads AFTER this file on the dashboard, so its white popup
   default wins without !important. */
.leaflet-popup-content-wrapper {
    background: var(--background-medium) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
    font-family: var(--font-mono);
}
.leaflet-popup-content { margin: 10px 12px !important; }
.leaflet-popup-tip { background: var(--background-medium) !important; border: 1px solid var(--border-color); }
.leaflet-popup-close-button { color: var(--text-muted) !important; }

/* buoy marker popup content (dark hi-tech, spaced rows) */
.buoy-pop { font-family: var(--font-mono); min-width: 148px; }
.buoy-pop .bp-title { color: var(--text-primary); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 5px; }
.buoy-pop .bp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 2px 0; }
.buoy-pop .bp-row span { color: var(--text-muted); font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase; }
.buoy-pop .bp-row b { color: var(--primary-color); font-size: 11px; font-weight: 600; }
.buoy-pop .bp-status { margin-top: 6px; font-size: 7px; letter-spacing: 0.2em; font-weight: 700; }
.buoy-pop .bp-status.on { color: var(--primary-color); }
.buoy-pop .bp-status.off { color: #f472b6; }

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--background-dark); }
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- map layer chips (ocean engine embed) ---------- */
#mapLayerChips {
    position: absolute;
    top: 10px; left: 10px; right: auto;   /* top-LEFT so it clears the top-right zoom control */
    z-index: 1000;
    display: flex; gap: 6px; align-items: center;
}
.map-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(14, 20, 25, 0.92);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
    padding: 5px 8px;
    cursor: pointer; user-select: none;
    text-decoration: none;
}
.map-chip:hover { border-color: var(--text-muted); color: var(--text-primary); }
.map-chip input { display: none; }
.map-chip:has(input:checked) {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    background: rgba(45, 212, 191, 0.08);
}
.map-chip .layer-badge { display: none; }
.map-chip .layer-badge[data-state="loading"] { display: inline; color: var(--accent-amber); }
.map-chip .layer-badge[data-state="error"] { display: inline; color: var(--accent-pink); }
.map-chip.chip-link { border-style: dashed; }
.map-chip.chip-link:hover { border-color: var(--accent-teal); color: var(--accent-teal); }

/* ---------- dashboard LAYERS dropdown (full workbench menu in the map) ---------- */
.layers-dd-btn { cursor: pointer; }
.layers-dd-btn.open { border-color: var(--accent-teal); color: var(--accent-teal); }
.layers-dd {
    position: absolute; top: 44px; left: 10px; right: auto; z-index: 1001;   /* under the top-left LAYERS button */
    width: 252px; max-height: calc(100% - 80px); overflow-y: auto;
    background: rgba(14, 20, 25, 0.96); backdrop-filter: blur(6px);
    border: 1px solid var(--border-color); border-radius: 6px;
    padding: 4px 0 0;
}
.layers-dd::-webkit-scrollbar { width: 6px; }
.layers-dd::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.layers-dd .layer-category { padding: 8px 12px 4px; border-bottom: 1px solid var(--border-color); }
.layers-dd .cat-title {
    color: var(--text-muted); font-size: 8px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.18em; margin-bottom: 5px;
    font-family: var(--font-mono);
}
.layers-dd .layer-row {
    display: flex; align-items: center; gap: 7px;
    padding: 3px 1px; cursor: pointer; user-select: none;
    font-family: var(--font-mono);
}
.layers-dd .layer-row.soon { cursor: default; opacity: 0.5; }
.layers-dd .layer-row input { display: none; }
.layers-dd .layer-check {
    width: 11px; height: 11px; flex: 0 0 11px;
    border: 1px solid var(--text-muted); border-radius: 3px; transition: all 0.15s;
}
.layers-dd .layer-row input:checked + .layer-check {
    background: var(--accent-teal); border-color: var(--accent-teal);
}
.layers-dd .layer-text { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.layers-dd .layer-name { color: var(--text-secondary); font-size: 10px; font-weight: 500; }
.layers-dd .layer-row input:checked ~ .layer-text .layer-name { color: var(--text-primary); }
.layers-dd .layer-src { color: var(--text-muted); font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; }
.layers-dd .layer-badge { font-size: 7px; font-weight: 700; letter-spacing: 0.12em; padding: 1px 4px; border-radius: 2px; }
.layers-dd .layer-badge[data-state="live"] { color: var(--accent-teal); background: rgba(45, 212, 191, 0.1); }
.layers-dd .layer-badge[data-state="loading"] { color: var(--accent-amber); }
.layers-dd .layer-badge[data-state="error"] { color: var(--accent-pink); }
.layers-dd .layer-badge[data-state="faded"] { color: var(--accent-amber); background: rgba(251, 191, 36, 0.08); }
.layers-dd .layer-row.soon .layer-badge { color: var(--accent-violet); }
.layers-dd-foot {
    display: block; text-align: center; padding: 7px;
    color: var(--accent-teal); text-decoration: none;
    font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
}
.embed-panel-dock {
    position: absolute; left: 10px; bottom: 10px; z-index: 1000;
    display: flex; flex-direction: column; gap: 6px; width: 225px;
    font-family: var(--font-mono);
}
.embed-panel-dock .ocean-panel {
    background: rgba(14, 20, 25, 0.92); border: 1px solid var(--border-color);
    border-radius: 5px; padding: 8px 10px; font-size: 10px;
}
.embed-panel-dock .op-title { color: var(--text-primary); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; margin-bottom: 4px; display: flex; justify-content: space-between; }
.embed-panel-dock .op-src { color: var(--text-muted); font-size: 7px; }
.embed-panel-dock .bp-row { display: flex; justify-content: space-between; padding: 1px 0; }
.embed-panel-dock .bp-row span { color: var(--text-muted); font-size: 8px; letter-spacing: 0.1em; }
.embed-panel-dock .bp-row b { color: var(--accent-teal); font-size: 9px; }
/* interactive ocean-blue tide chart (matches the workbench; these classes live
   only in ocean.css which the dashboard doesn't load, so they're repeated here
   scoped to .embed-panel-dock — without them the SVG falls back to black fills) */
.embed-panel-dock .tide-chart-wrap { position: relative; width: 100%; margin-bottom: 6px; }
.embed-panel-dock .tide-chart { width: 100%; height: 40px; display: block; overflow: visible; }
.embed-panel-dock .tide-area { fill: url(#tideFill); stroke: none; }
.embed-panel-dock .tf-top { stop-color: rgba(56,189,248,0.34); }
.embed-panel-dock .tf-bot { stop-color: rgba(56,189,248,0.02); }
.embed-panel-dock .tide-line { fill: none; stroke: #38bdf8; stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.embed-panel-dock .tide-now { stroke: rgba(45,212,191,0.7); stroke-width: 1; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.embed-panel-dock .tide-cursor { stroke: rgba(215,224,233,0.55); stroke-width: 1; vector-effect: non-scaling-stroke; }
.embed-panel-dock .tide-cdot { fill: #38bdf8; stroke: #0b0e11; stroke-width: 1; }
.embed-panel-dock .tide-tip { position: absolute; top: -3px; transform: translateX(-50%); background: rgba(11,14,17,0.94); border: 1px solid var(--border-color); border-radius: 3px; color: #d7e0e9; font-family: var(--font-mono); font-size: 8.5px; padding: 2px 5px; white-space: nowrap; pointer-events: none; z-index: 5; }
.embed-panel-dock .tide-tip b { color: #7dd3fc; font-weight: 600; }
.embed-panel-dock .moon-row { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.embed-panel-dock .moon-svg { width: 28px; height: 28px; flex: 0 0 28px; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4)); }
.embed-panel-dock .moon-svg .moon-dark { fill: #1b2833; }
.embed-panel-dock .moon-svg .moon-lit { fill: #7fe3d5; }
.embed-panel-dock .moon-svg .moon-ring { fill: none; stroke: rgba(45,212,191,0.4); stroke-width: 2; }
.embed-panel-dock .moon-sub { color: var(--text-muted); font-size: 8px; }
/* light mode: the panel text uses theme vars already; just flip the dark bg */
:root[data-theme="light"] .embed-panel-dock .ocean-panel { background: rgba(255, 255, 255, 0.93); box-shadow: 0 6px 20px rgba(16, 33, 44, 0.12); }
:root[data-theme="light"] .embed-panel-dock .tide-line { stroke: #0284c7; }
:root[data-theme="light"] .embed-panel-dock .tf-top { stop-color: rgba(2,132,199,0.24); }
:root[data-theme="light"] .embed-panel-dock .tf-bot { stop-color: rgba(2,132,199,0.02); }
:root[data-theme="light"] .embed-panel-dock .tide-cdot { fill: #0284c7; stroke: #ffffff; }
:root[data-theme="light"] .embed-panel-dock .tide-tip { background: rgba(255,255,255,0.96); border-color: #dde4ec; color: #16212c; }
:root[data-theme="light"] .embed-panel-dock .tide-tip b { color: #0284c7; }
:root[data-theme="light"] .embed-panel-dock .moon-svg .moon-dark { fill: #d7dfe8; }
:root[data-theme="light"] .embed-panel-dock .moon-svg .moon-lit { fill: #0d9488; }
:root[data-theme="light"] .embed-panel-dock .moon-svg .moon-ring { stroke: rgba(13,148,136,0.35); }

/* ---------- ocean layers link ---------- */
.ocean-link {
    display: inline-flex; align-items: center;
    background: var(--background-medium);
    border: 1px solid var(--accent-teal);
    border-radius: var(--radius-sm);
    color: var(--accent-teal);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    padding: 0.4rem 0.7rem;
    text-decoration: none;
}
.ocean-link:hover {
    background: rgba(45, 212, 191, 0.1);
}

/* ---------- autoplay button ---------- */
.autoplay-btn {
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    box-shadow: none;
}
.autoplay-btn:hover {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    background: var(--background-medium);
    transform: none;
    box-shadow: none;
}
.autoplay-btn.playing {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    background: rgba(45, 212, 191, 0.08);
}

/* ---------- kill legacy glow animations ---------- */
.neon-pulse { animation: none; }

/* GOES GeoColor runs dark, especially the night side — lift it */
.bwf-goes { filter: brightness(1.12) contrast(1.03) saturate(1.08); }

/* surf spot labels on the Waves layer */
.surf-spot-tip {
    background: rgba(14, 20, 25, 0.92) !important;
    border: 1px solid #1c2530 !important;
    border-radius: 3px !important;
    color: #d7e0e9 !important;
    font-family: "DM Mono", "JetBrains Mono", monospace !important;
    font-size: 9px !important;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 5px !important;
    box-shadow: none !important;
}
.surf-spot-tip::before { display: none; }


/* ============================================================
   CONSISTENCY PASS (v49): one voice for labels, values, spacing
   — every label: 9px mono, uppercase, 0.16em tracking, muted
   — every value: mono, weight 600, no glow
   — cards share the same border, radius, and internal rhythm
   ============================================================ */

.condition-label,
.buoy-label,
.chart-header h4,
.buoycam-header h4 {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
}

.condition-card { padding: 0.7rem 0.5rem 0.6rem; }
.condition-value {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.25;
}
.condition-label { margin-top: 0.3rem; }

.buoy-card { padding: 0.7rem 0.85rem 0.55rem; }
.buoy-header { margin-bottom: 0.45rem; }
.buoy-header h4 {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: none;
}
.buoy-reading { padding: 1.5px 0; }
.buoy-value { font-size: 12px; letter-spacing: 0.02em; }
.buoy-status {
    margin-top: 0.45rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-color);
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.buoycam-header h4 { letter-spacing: 0.14em; color: var(--text-secondary); }

.ocean-link {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--accent-teal);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.7rem;
    text-decoration: none;
    transition: border-color 0.15s;
}
.ocean-link:hover { border-color: var(--accent-teal); }

.autoplay-btn {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* charts breathe the same: identical wrapper padding */
.chart-wrapper, .chart-container { border-radius: var(--radius-md); }


/* on-map legend for colored raster layers */
.ocean-legend {
    position: absolute; right: 10px; bottom: 30px; z-index: 700;
    display: flex; flex-direction: column; gap: 6px;
    max-width: 220px; pointer-events: none;
}
.ocean-legend .leg-item {
    background: rgba(14, 20, 25, 0.92); border: 1px solid #1c2530;
    border-radius: 5px; padding: 6px 8px; font-family: "DM Mono", "JetBrains Mono", monospace;
}
.ocean-legend .leg-title {
    color: #d7e0e9; font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; margin-bottom: 4px;
}
.ocean-legend .leg-bar { height: 8px; border-radius: 2px; border: 1px solid #1c2530; }
.ocean-legend .leg-ends {
    display: flex; justify-content: space-between; margin-top: 2px;
    color: #7d8b99; font-size: 8px; letter-spacing: 0.04em;
}
.ocean-legend .leg-note {
    color: #5c6b78; font-size: 7.5px; line-height: 1.35; margin-top: 4px;
    letter-spacing: 0.02em;
}
/* ---------- unified cursor readout (HoverPanel) — shared ocean layer engine ---------- */
.ocean-hover {
  position: absolute; z-index: 1200; pointer-events: none;
  min-width: 128px; max-width: 250px; padding: 6px 9px;
  background: linear-gradient(180deg, rgba(14,20,25,0.96), rgba(11,14,17,0.96));
  border: 1px solid #1c2530; border-left: 2px solid #2dd4bf;
  border-radius: 5px; box-shadow: 0 6px 22px rgba(0,0,0,0.45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  font-family: "DM Mono", "JetBrains Mono", ui-monospace, monospace; font-size: 10px; line-height: 1.5; color: #d7e0e9;
}
.ocean-hover .oh-sec { display: flex; flex-direction: column; gap: 1px; padding: 3px 0; }
.ocean-hover .oh-sec + .oh-sec { border-top: 1px solid rgba(28,37,48,0.85); }
.ocean-hover .oh-k { font-size: 8.5px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 1px; }
.ocean-hover .oh-v { color: #d7e0e9; font-weight: 600; white-space: nowrap; }
.ocean-hover .oh-tag { display: inline-block; min-width: 48px; margin-right: 6px; font-style: normal; font-size: 8.5px; font-weight: 700; letter-spacing: 0.1em; }

/* ---------- universal location switcher ---------- */
.location-display { display: inline-flex; align-items: center; gap: 6px; }
.location-display .location-pin { color: #2dd4bf; flex: 0 0 auto; }
.location-select {
  appearance: none; -webkit-appearance: none;
  background: #10161c url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='%237d8b99'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 8px center;
  color: #d7e0e9; font-family: "DM Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid #1c2530; border-radius: 5px;
  padding: 5px 26px 5px 9px; cursor: pointer; max-width: 220px;
}
.location-select:hover { border-color: #2dd4bf; }
.location-select:focus { outline: none; border-color: #2dd4bf; box-shadow: 0 0 0 2px rgba(45,212,191,0.2); }
.location-select option { background: #10161c; color: #d7e0e9; }

.buoy-partial {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #fbbf24; border: 1px solid rgba(251,191,36,0.4); border-radius: 3px; padding: 1px 4px; margin-left: 4px;
}
.buoy-empty { color: #7d8b99; font-size: 12px; padding: 12px; text-align: center; }

/* ---------- location switcher: custom hi-tech dropdown ---------- */
.location-switcher { position: relative; }
.loc-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: #10161c; border: 1px solid #1c2530; border-radius: 6px;
  color: #d7e0e9; font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  padding: 6px 11px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.loc-btn:hover, .location-switcher.open .loc-btn { border-color: #2dd4bf; box-shadow: 0 0 0 2px rgba(45,212,191,0.15); }
.loc-btn .location-pin { color: #2dd4bf; flex: 0 0 auto; }
.loc-btn-label { white-space: nowrap; }
.loc-btn-label em { color: #7d8b99; font-style: normal; font-size: 10px; font-weight: 700; margin-left: 6px; letter-spacing: 0.1em; }
.loc-caret { color: #7d8b99; transition: transform .15s; flex: 0 0 auto; }
.location-switcher.open .loc-caret { transform: rotate(180deg); }

.loc-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 4000;
  width: 300px; max-height: 62vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(14,20,25,0.98), rgba(11,14,17,0.98));
  border: 1px solid #1c2530; border-radius: 8px; box-shadow: 0 12px 34px rgba(0,0,0,0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow: hidden;
}
.loc-search-wrap { display: flex; align-items: center; gap: 7px; padding: 9px 11px; border-bottom: 1px solid #1c2530; color: #5c6b78; }
.loc-search { flex: 1; background: transparent; border: none; outline: none; color: #d7e0e9; font-family: var(--font-mono); font-size: 12px; }
.loc-search::placeholder { color: #5c6b78; }
.loc-list { overflow-y: auto; padding: 4px 0; }
.loc-group-title { padding: 9px 12px 4px; font-size: 8.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: #2dd4bf; opacity: 0.72; }
.loc-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 7px 12px; cursor: pointer; border-left: 2px solid transparent;
  transition: background .1s, border-color .1s;
}
.loc-row:hover { background: rgba(45,212,191,0.09); border-left-color: #2dd4bf; }
.loc-row.active { background: rgba(45,212,191,0.05); border-left-color: rgba(45,212,191,0.6); }
.loc-row.active .loc-city { color: #2dd4bf; }
.loc-city { color: #d7e0e9; font-size: 13px; font-weight: 600; }
.loc-row:hover .loc-city { color: #eafffb; }
.loc-state {
  color: #7d8b99; font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
  border: 1px solid #1c2530; border-radius: 3px; padding: 1px 5px; flex: 0 0 auto;
}
.loc-row:hover .loc-state { color: #2dd4bf; border-color: rgba(45,212,191,0.4); }

/* map ping when hovering a dropdown row + lit nearest-4 buoys */
.loc-preview-ring { animation: loc-ping 1.3s ease-in-out infinite; }
@keyframes loc-ping { 0%,100%{ stroke-opacity:0.95; } 50%{ stroke-opacity:0.25; } }
.buoy-marker.buoy-lit { filter: drop-shadow(0 0 6px rgba(45,212,191,0.7)); }
.buoy-marker.buoy-flash::after {
  content:''; position:absolute; left:50%; top:50%; width:16px; height:16px;
  border:2px solid #2dd4bf; border-radius:50%; transform:translate(-50%,-50%);
  animation: buoy-flash 0.85s ease-out 2; pointer-events:none;
}
@keyframes buoy-flash { 0%{ opacity:0.9; transform:translate(-50%,-50%) scale(0.4);} 100%{ opacity:0; transform:translate(-50%,-50%) scale(3.2);} }

/* ---------- Ocean View: Real Time (cam) | Future (5-day outlook) ---------- */
.ocean-view-section { display: flex; flex-direction: column; overflow: hidden; }
.ovs-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #1c2530; }
.ovs-tabs { display: inline-flex; background: #0b0e11; border: 1px solid #1c2530; border-radius: 6px; padding: 2px; gap: 2px; }
.ovs-tab {
  background: transparent; border: none; color: #7d8b99; cursor: pointer;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 13px; border-radius: 4px; transition: background .15s, color .15s;
}
.ovs-tab.active { background: #2dd4bf; color: #08110f; }
.ovs-tab:not(.active):hover { color: #2dd4bf; }
.ovs-sub { font-size: 9px; letter-spacing: 0.08em; color: #7d8b99; transition: opacity .2s; text-transform: uppercase; }
.ovs-sub .buoycam-timestamp { color: #5c6b78; margin-left: 6px; }

.ovs-track { display: flex; width: 200%; transition: transform .35s cubic-bezier(.4,0,.2,1); }
.ocean-view-section.show-future .ovs-track { transform: translateX(-50%); }
.ovs-pane { width: 50%; flex: 0 0 50%; }

.ext-forecast { padding: 4px 10px 10px; }
.ext-head, .ext-row { display: grid; grid-template-columns: 1.05fr 1.5fr 0.85fr 0.75fr 1.4fr; gap: 8px; align-items: center; }
.ext-head { padding: 7px 6px 6px; font-size: 8px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #5c6b78; border-bottom: 1px solid #1c2530; }
.ext-row { padding: 9px 6px; border-bottom: 1px solid rgba(28,37,48,0.6); }
.ext-row:last-child { border-bottom: none; }
.ext-day { display: flex; flex-direction: column; line-height: 1.2; }
.ext-day b { color: #d7e0e9; font-size: 12px; font-weight: 700; }
.ext-day span { color: #5c6b78; font-size: 9px; }
.ext-cell { color: #2dd4bf; font-size: 12px; font-weight: 600; }
.ext-cell em { color: #7d8b99; font-style: normal; font-size: 9px; font-weight: 600; }
.ext-tide { display: flex; flex-direction: column; gap: 1px; }
.ext-tide .ext-hi { color: #2dd4bf; font-size: 10px; }
.ext-tide .ext-lo { color: #a78bfa; font-size: 10px; }
.ext-empty { color: #7d8b99; text-align: center; padding: 26px 10px; font-size: 12px; }

/* hidden attribute must beat the flex display */
.loc-panel[hidden] { display: none !important; }

/* buoy marker: themed sea-height chip + card<->marker hover highlight */
.buoy-wv-label {
  position: absolute; left: 50%; transform: translateX(-50%);
  background: rgba(14,20,25,0.94); color: #2dd4bf;
  font-family: "DM Mono", "JetBrains Mono", ui-monospace, monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
  padding: 2px 6px; border-radius: 4px; white-space: nowrap; line-height: 1;
  border: 1px solid rgba(45,212,191,0.35); box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.buoy-wv-label em { color: #7d8b99; font-style: normal; font-size: 8px; font-weight: 600; margin-left: 2px; }
/* NB: never set transform on .buoy-marker — Leaflet uses it to position the icon */
.buoy-marker.buoy-hover-lit { filter: drop-shadow(0 0 12px rgba(45,212,191,1)) brightness(1.2); z-index: 1200 !important; }
.buoy-card.buoy-card-active { border-color: #2dd4bf !important; box-shadow: 0 0 0 1px rgba(45,212,191,0.4), 0 0 18px rgba(45,212,191,0.12) !important; }

/* ---------- Real Time pane: cards + camera stacked ---------- */
#pane-realtime .buoy-cards { margin-bottom: 10px; }

/* ---------- Windy-style hourly meteogram ---------- */
.meteogram { padding: 2px 0 6px; }
.mg-scroll { overflow-x: auto; overflow-y: hidden; }
.mg-scroll::-webkit-scrollbar { height: 7px; }
.mg-scroll::-webkit-scrollbar-thumb { background: #1c2530; border-radius: 4px; }
.mg-table { display: flex; flex-direction: column; min-width: 100%; }
.mg-row { display: flex; align-items: stretch; }
.mg-rlabel {
  position: sticky; left: 0; z-index: 3; flex: 0 0 46px;
  background: #0e1419; border-right: 1px solid #1c2530;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 8px; font-size: 8px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #7d8b99;
}
.mg-rlabel em { color: #5c6b78; font-style: normal; font-size: 7px; }
.mg-rtrack { display: flex; }
.mg-cell { flex: 0 0 46px; width: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

.mg-timerow { border-bottom: 1px solid #1c2530; }
.mg-timerow .mg-cell { padding: 5px 0 4px; }
.mg-timerow b { display: block; color: #d7e0e9; font-size: 10px; font-weight: 700; }
.mg-timerow span { color: #7d8b99; font-size: 9px; }

.mg-windrow .mg-cell { gap: 2px; padding: 6px 0; }
.mg-arrow { font-size: 14px; line-height: 1; display: inline-block; color: #2dd4bf; }
.mg-arrow.na { color: #5c6b78; }
.mg-windrow b { font-size: 11px; font-weight: 700; }

.mg-waverow .mg-cell { justify-content: flex-end; height: 62px; gap: 3px; padding-bottom: 3px; }
.mg-barwrap { flex: 1; display: flex; align-items: flex-end; }
.mg-bar { width: 8px; border-radius: 2px 2px 0 0; background: linear-gradient(to top, rgba(45,212,191,0.25), #2dd4bf); box-shadow: 0 0 5px rgba(45,212,191,0.4); }
.mg-waverow b { color: #2dd4bf; font-size: 10px; font-weight: 700; }

.mg-perrow { border-top: 1px solid rgba(28,37,48,0.6); }
.mg-perrow .mg-cell { padding: 5px 0; color: #a78bfa; font-size: 10px; font-weight: 600; }

.mg-tiderow { border-top: 1px solid rgba(28,37,48,0.6); }
.mg-tiderow .mg-rtrack { position: relative; height: 34px; }
.mg-tide-svg { display: block; }
.mg-tide-na { color: #5c6b78; font-size: 10px; padding: 9px 8px; }

/* animate the ocean-view height as panes swap */
.ovs-track { transition: transform .35s cubic-bezier(.4,0,.2,1), height .25s ease; }

/* ============================================================
   HI-TECH SHARP-EDGE PASS (CAIMEO-style) + Ocean-View fit
   Loaded last, so these win. Colors kept; edges sharpened,
   chrome flattened, and the Real Time block made to fit.
   ============================================================ */

/* --- sharper corners across the board --- */
.map-container, .buoy-card, .buoycam-section, .ocean-view-section,
.buoycam-container, .buoycam-panorama, .condition-card, .chart-panel,
.timeline-controls, .location-display, .time-display, .beta-banner,
.beta-features-btn, .btn-tropical, .ocean-link, .buoycam-btn,
.tide-overlay, .moon-overlay, .loadingOverlay, #loadingOverlay {
  border-radius: 2px !important;
}

/* --- flat: kill heavy shadows + glassy blur for a crisp console look --- */
.map-container, .buoy-card, .buoycam-section, .buoycam-container,
.condition-card, .chart-panel, .timeline-controls, .buoy-cards {
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* --- hairline borders (theme edge, not the old heavy cyan) --- */
.buoy-card { border: 1px solid var(--border-color) !important; background: var(--background-medium) !important; }
.buoy-card:hover, .buoy-card.buoy-card-active { border-color: var(--accent-teal) !important; }
.map-container { border: 1px solid var(--border-color) !important; background: #0b0e11 !important; }
.condition-card, .chart-panel, .timeline-controls { border: 1px solid var(--border-color) !important; }

/* --- Ocean-View block: fit inside the fixed-height layout & swing cleanly --- */
.map-container { flex: 2 !important; }                    /* smaller map -> room below */
.ocean-view-section {
  flex: 1 1 auto !important; min-height: 0;
  border: 1px solid var(--border-color); background: var(--background-medium); overflow: hidden;
}
.ovs-track { flex: 1 1 auto; height: auto !important; align-items: stretch; }
.ovs-pane { overflow-y: auto; overflow-x: hidden; }
.ovs-pane::-webkit-scrollbar { width: 6px; }
.ovs-pane::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
#pane-realtime { display: flex; flex-direction: column; padding: 8px; }
#pane-realtime .buoy-cards { flex: 0 0 auto; margin: 0 0 8px 0 !important; padding: 0 !important; overflow: visible !important; }
#pane-realtime .buoycam-container { flex: 1 1 auto; height: auto !important; min-height: 90px; border: 1px solid var(--border-color); }
/* bottom-align so the NDBC timestamp burned into the image bottom stays visible */
.buoycam-panorama { width: 100% !important; height: 100% !important; max-height: none !important; object-fit: cover; object-position: center bottom; }

/* ---------- MapLibre GL attribution: dark, compact, unobtrusive ---------- */
.maplibregl-ctrl-attrib {
  background: rgba(14,20,25,0.55) !important; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-radius: 5px !important; font-family: var(--font-mono, monospace) !important; font-size: 8px !important;
  line-height: 15px !important; padding: 0 6px !important; color: #5c6b78 !important;
}
.maplibregl-ctrl-attrib a { color: #7d8b99 !important; }
.maplibregl-ctrl-attrib-button { background-color: rgba(14,20,25,0.55) !important; border-radius: 50% !important; filter: invert(0.62); }
.maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) { background: rgba(14,20,25,0.55) !important; }
:root[data-theme="light"] .maplibregl-ctrl-attrib { background: rgba(255,255,255,0.78) !important; color: #55636f !important; }
:root[data-theme="light"] .maplibregl-ctrl-attrib a { color: #0d9488 !important; }
:root[data-theme="light"] .maplibregl-ctrl-attrib-button { filter: none; }
/* zoom control: MapLibre ships a white control — wrong on the dark map. Dark by
   default (dark is the default theme), light only under data-theme="light". */
.maplibregl-ctrl-group { background: rgba(14,20,25,0.92) !important; border: 1px solid var(--border-color) !important; box-shadow: 0 2px 10px rgba(0,0,0,0.4) !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--border-color) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(0.82) !important; }   /* dark glyphs -> light */
.maplibregl-ctrl-group button:hover { background: rgba(45,212,191,0.14) !important; }
:root[data-theme="light"] .maplibregl-ctrl-group { background: rgba(255,255,255,0.95) !important; border-color: #dde4ec !important; box-shadow: 0 2px 10px rgba(16,33,44,0.12) !important; }
:root[data-theme="light"] .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: none !important; }
:root[data-theme="light"] .maplibregl-ctrl-group button:hover { background: rgba(13,148,136,0.1) !important; }

/* --- compact buoy cards so 4 + camera fit --- */
.buoy-card { min-height: 0 !important; padding: 7px 9px !important; }
.buoy-card .buoy-header { margin-bottom: 3px; }
.buoy-card .buoy-reading { margin: 1px 0 !important; }
.buoy-value { border-radius: 2px !important; }

/* --- header chips: crisp rectangles --- */
.condition-card { padding: 0.55rem 0.5rem; }

/* ============================================================
   Meteogram vertical-fill + right-panel/header cohesion pass
   ============================================================ */

/* meteogram grows to fill the Future pane (bars scale to height) */
#pane-future { display: flex; padding: 8px; min-height: 0; }
.meteogram { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0; }
.mg-scroll { flex: 1 1 auto; min-height: 0; overflow-x: auto; overflow-y: hidden; }
.mg-table { display: flex; flex-direction: column; height: 100%; min-width: 100%; }
.mg-row { flex: 0 0 auto; }
.mg-waverow { flex: 1 1 auto; min-height: 46px; }
.mg-waverow .mg-cell { height: auto; justify-content: flex-end; padding-bottom: 3px; gap: 3px; }
.mg-barwrap { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.mg-bar { width: 10px; min-height: 3px; }
.mg-tiderow .mg-rtrack { height: 52px; }
.mg-tide-svg { height: 52px; }

/* --- right panel + header: sharp, flat, aligned --- */
.right-panel { gap: 0.55rem; }
.condition-card,
.condition-card.active,
.condition-card:hover {
  background: var(--background-medium) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 2px !important;
  box-shadow: none !important;
}
.condition-card:hover { border-color: var(--accent-teal) !important; }
.chart-panel {
  background: var(--background-medium) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 2px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
.timeline-controls {
  background: var(--background-medium) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 2px !important;
  box-shadow: none !important;
}
/* header controls: uniform boxes, aligned baseline */
.header-controls { display: flex; align-items: stretch; gap: 0.5rem; }
.location-display, .time-display, .ocean-link, .btn-tropical {
  background: var(--background-medium) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 2px !important;
  box-shadow: none !important;
  display: flex; align-items: center;
}
.ocean-link:hover { border-color: var(--accent-teal) !important; }

/* meteogram breathing room (bars capped at ~68% in JS) */
.mg-timerow .mg-cell { padding: 8px 0 6px; }
.mg-windrow .mg-cell { padding: 9px 0; gap: 3px; }
.mg-arrow { font-size: 15px; }
.mg-perrow .mg-cell { padding: 8px 0; }
.mg-waverow { min-height: 70px; }

/* ============================================================
   Header refinement — one uniform, compact control row
   ============================================================ */
.header-controls { align-items: stretch !important; gap: 0.5rem !important; }
.header-controls > * { min-height: 46px; }

/* FULL MAP: compact bordered chip, centered */
.ocean-link {
  display: inline-flex !important; align-items: center; justify-content: center;
  padding: 0 16px !important; font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  color: var(--accent-teal) !important; text-decoration: none; white-space: nowrap;
}

/* location switcher fills the row height, button centered */
.location-switcher { display: flex !important; align-items: stretch; }
.location-switcher .loc-btn { height: 100%; padding: 0 12px !important; }

/* time display: mono, flat, tight columns */
.time-display {
  gap: 0.85rem !important; padding: 4px 13px !important; align-items: center;
  background: var(--background-medium) !important;
}
.local-time, .utc-time { gap: 1px !important; }
.time-label { font-size: 7.5px !important; letter-spacing: 0.16em !important; color: var(--text-muted) !important; }
.time-value {
  font-family: var(--font-mono) !important; font-size: 13px !important; font-weight: 600 !important;
  color: var(--text-primary) !important; text-shadow: none !important; letter-spacing: 0.03em !important;
}
.time-date { font-size: 8px !important; color: var(--text-muted) !important; letter-spacing: 0.06em; }

/* ============================================================
   Map is the central focus — it grows to fill; the Real Time /
   Future block is compact enrichment with a fixed height.
   ============================================================ */
.map-container { flex: 1 1 auto !important; min-height: 260px; }
.ocean-view-section { flex: 0 0 auto !important; height: 244px !important; }
/* camera becomes a clean strip filling whatever the cards leave */
#pane-realtime .buoycam-container { min-height: 74px; }

/* compact buoy cards so the camera strip fits under the big map */
.buoy-card { padding: 6px 9px !important; }
.buoy-card .buoy-header { margin-bottom: 3px !important; }
.buoy-card .buoy-header h4 { font-size: 9px !important; line-height: 1.15; }
.buoy-card .buoy-distance { font-size: 8px !important; }
.buoy-card .buoy-reading { margin: 0 !important; padding: 1px 0 !important; }
.buoy-card .buoy-label { font-size: 8px !important; }
.buoy-card .buoy-value { font-size: 11px !important; line-height: 1.15; }
.buoy-card .buoy-value span { font-size: 8px !important; }
.buoy-card .buoy-status { margin-top: 3px !important; padding-top: 3px !important; font-size: 8px !important; border-top: 1px solid var(--border-color); }

/* ============================================================
   Ambient backdrop — faint drifting topo contours + depth blobs
   behind everything; panels go slightly translucent to reveal it.
   ============================================================ */
.app-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.app-container { position: relative; z-index: 1; }
.bg-topo {
  position: absolute; inset: -8%; width: 116%; height: 116%;
  opacity: 0.05; animation: bgTopoDrift 90s ease-in-out infinite alternate;
}
.bg-blob { position: absolute; border-radius: 50%; filter: blur(95px); opacity: 0.08; }
.bg-b1 { width: 520px; height: 520px; background: #2dd4bf; top: -8%; left: -6%; animation: bgFloat1 36s ease-in-out infinite; }
.bg-b2 { width: 460px; height: 460px; background: #6366f1; bottom: -10%; right: -4%; animation: bgFloat2 44s ease-in-out infinite; }
.bg-b3 { width: 400px; height: 400px; background: #38bdf8; top: 42%; left: 55%; animation: bgFloat3 52s ease-in-out infinite; }
@keyframes bgTopoDrift { from { transform: translate(0,0) scale(1); } to { transform: translate(-2%,1.6%) scale(1.05); } }
@keyframes bgFloat1 { 0%,100%{ transform: translate(0,0);} 50%{ transform: translate(44px,30px);} }
@keyframes bgFloat2 { 0%,100%{ transform: translate(0,0);} 50%{ transform: translate(-52px,-26px);} }
@keyframes bgFloat3 { 0%,100%{ transform: translate(0,0);} 50%{ transform: translate(-32px,42px);} }
@media (prefers-reduced-motion: reduce) { .bg-topo, .bg-blob { animation: none !important; } }

/* let the backdrop show: transparent shells + slightly translucent panels */
.main-content, .left-panel, .right-panel, .header, .beta-banner { background: transparent !important; }
.buoy-card, .condition-card, .chart-panel, .timeline-controls,
.ocean-view-section, .location-display, .time-display,
.location-switcher .loc-btn, .ocean-link, .btn-tropical, .beta-features-btn {
  background: rgba(14, 20, 25, 0.72) !important;
}

/* inline buoy-card readings so the card is compact (fits under the big map) */
.buoy-card .buoy-data { display: flex !important; flex-direction: column; gap: 0 !important; }
.buoy-card .buoy-reading {
  display: flex !important; flex-direction: row !important; justify-content: space-between !important;
  align-items: baseline; margin: 0 !important; padding: 1.5px 0 !important; line-height: 1.25;
}

/* finer topo lines need a hair more presence */
.bg-topo { opacity: 0.07 !important; }

/* animated wave-mesh canvas (draws its own faint alpha) */
.bg-canvas { position: absolute; inset: 0; }

/* pano happy-place: fixed strip so it always shows under the cards + big map */
.ocean-view-section { height: 262px !important; }
#pane-realtime .buoycam-container { flex: 0 0 84px !important; height: 84px !important; min-height: 0 !important; }

/* robust pano fit: compact header, section sized to header+cards+camera, track fills w/o overflow */
.ovs-header { padding: 5px 12px !important; }
.ocean-view-section { height: 276px !important; }
.ovs-track { min-height: 0 !important; }
.ovs-pane { min-height: 0; }

.ocean-view-section { height: 288px !important; }

/* meteogram must fit the Future pane exactly — swell row absorbs the slack so
   the tide row never overflows/clips under the scrollbar */
.mg-waverow { min-height: 0 !important; }
.mg-timerow .mg-cell { padding: 5px 0 4px !important; }
.mg-windrow .mg-cell { padding: 6px 0 !important; }
.mg-perrow .mg-cell { padding: 5px 0 !important; }
.mg-tiderow .mg-rtrack { height: 44px !important; }
.mg-tide-svg { height: 44px !important; }
.mg-scroll { padding-bottom: 2px; }

/* ============================================================
   Beta Features Roadmap panel — match the sharp hi-tech theme
   ============================================================ */
.beta-features-content {
  background: linear-gradient(180deg, rgba(14,20,25,0.98), rgba(11,14,17,0.98)) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 2px !important;
  box-shadow: 0 16px 40px rgba(0,0,0,0.55) !important;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono) !important;
}
.beta-features-content::-webkit-scrollbar { width: 7px; }
.beta-features-content::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.features-header { border-bottom: 1px solid var(--border-color); }
.features-header h4 {
  color: var(--accent-teal) !important; font-family: var(--font-mono) !important;
  font-size: 12px !important; font-weight: 700 !important; letter-spacing: 0.16em !important;
  text-transform: uppercase; text-shadow: none !important; margin: 0;
}
.features-header p { color: var(--text-secondary) !important; font-size: 10.5px !important; letter-spacing: 0.02em; }

.feature-item {
  background: rgba(20,28,36,0.5) !important;
  border: 1px solid var(--border-color) !important;
  border-left: 2px solid var(--border-color) !important;
  border-radius: 2px !important;
  box-shadow: none !important; transition: border-color .15s, background .15s;
}
.feature-item:hover { background: rgba(45,212,191,0.06) !important; }
.feature-item.live { border-left-color: var(--accent-teal) !important; }
.feature-item.coming-soon { border-left-color: var(--accent-amber) !important; }
.feature-item.future { border-left-color: var(--accent-violet) !important; }
.feature-icon { filter: grayscale(0.1); }
.feature-name {
  color: var(--text-primary) !important; font-family: var(--font-mono) !important;
  font-size: 12px !important; font-weight: 700 !important; letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.feature-description { color: var(--text-secondary) !important; font-size: 10.5px !important; line-height: 1.5 !important; letter-spacing: 0.01em; }

.feature-status {
  font-family: var(--font-mono) !important; font-size: 8px !important; font-weight: 700 !important;
  letter-spacing: 0.14em !important; text-transform: uppercase;
  padding: 2px 6px !important; border-radius: 2px !important; border: 1px solid transparent;
  background: transparent !important;
}
.feature-item.live .feature-status { color: #08110f !important; background: var(--accent-teal) !important; }
.feature-item.coming-soon .feature-status { color: var(--accent-amber) !important; border-color: rgba(251,191,36,0.4) !important; }
.feature-item.future .feature-status { color: var(--accent-violet) !important; border-color: rgba(167,139,250,0.4) !important; }

.features-footer { border-top: 1px solid var(--border-color); }
.suggest-feature-link {
  color: var(--accent-teal) !important; font-family: var(--font-mono) !important;
  font-size: 11px !important; letter-spacing: 0.04em; text-decoration: none;
  border: 1px solid var(--border-color); border-radius: 2px; padding: 6px 10px; display: inline-block;
}
.suggest-feature-link:hover { border-color: var(--accent-teal) !important; }
.attribution-text, .attribution-text a { color: var(--text-muted) !important; font-size: 9px !important; }

/* the header toggle button already themed; ensure the open-state caret/border read right */
.beta-features-btn[aria-expanded="true"] { border-color: var(--accent-teal) !important; color: var(--accent-teal) !important; }

/* subtle hi-tech technical grid on the ambient backdrop (canvas adds glow+nodes) */
.app-bg {
  background-color: var(--background-dark);
  background-image:
    linear-gradient(rgba(45,212,191,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45,212,191,0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  background-position: -1px -1px;
}

/* ---------- wind-chart model-comparison chips (GFS/NBM · ECMWF · AI·AIFS) ---------- */
.chart-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.model-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.model-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 1px solid var(--border-color); border-radius: 2px;
  color: var(--text-muted); font-family: var(--font-mono); font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 7px; cursor: pointer;
  transition: opacity .12s, border-color .12s, color .12s; opacity: 0.45;
}
.model-chip .mc-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--c); flex: 0 0 auto; }
.model-chip.on { opacity: 1; border-color: var(--c); color: var(--text-primary); }
.model-chip:hover { opacity: 0.85; }
.model-chip.ai.on { box-shadow: inset 0 0 0 1px var(--c); }

/* finer "etched in glass" model chips — no boxes; thin letter-spaced text + a tiny glowing dot */
.model-chips { gap: 12px !important; flex-wrap: nowrap !important; align-items: center; }
.model-chip {
  background: transparent !important; border: none !important; box-shadow: none !important;
  padding: 0 !important; gap: 5px !important;
  font-weight: 400 !important; font-size: 8px !important; letter-spacing: 0.16em !important;
  color: var(--text-muted) !important; opacity: 0.5; white-space: nowrap;
}
.model-chip .mc-dot { width: 5px !important; height: 5px !important; border-radius: 50% !important; opacity: 0.4; box-shadow: none !important; }
.model-chip.on { opacity: 1; color: #cbdae6 !important; text-shadow: 0 0 6px rgba(203,218,230,0.25); }
.model-chip.on .mc-dot { opacity: 1; box-shadow: 0 0 5px var(--c) !important; }
.model-chip.ai.on { box-shadow: none !important; }
.model-chip:hover { opacity: 0.82; }

/* chips on their own row under the title so they never cut off */
.chart-header { flex-direction: column !important; align-items: flex-start !important; gap: 4px !important; }
.model-chips { gap: 12px !important; }
.model-chip { font-size: 7.5px !important; letter-spacing: 0.12em !important; }

body, button, input, select, textarea { font-synthesis: none; }

/* elegant display face for the big headline; data/labels stay DM Mono */
:root { --font-display: "Space Grotesk", "DM Mono", ui-monospace, monospace; }
.brand-name { font-family: var(--font-display) !important; font-weight: 600 !important; letter-spacing: 0.06em !important; }

/* timeline row: shrink the slider + wrap so the date label and AUTOPLAY button
   never overlap when the right panel narrows (was a fixed non-wrapping flex row
   with a 200px-min slider that squeezed the nowrap date under the button) */
.timeline-controls { flex-wrap: wrap; row-gap: 0.4rem; column-gap: 0.6rem; }
.timeline-slider-container { min-width: 0 !important; flex: 1 1 150px !important; }
.current-time { margin-left: auto; white-space: nowrap; }
.autoplay-btn { margin-left: 0 !important; flex: 0 0 auto; white-space: nowrap; padding: 0.4rem 0.7rem; }

/* directionality sub-line under a stat value (wind/swell): compass arrow + cardinal,
   kept subordinate to the value so the reading stays the hero */
.condition-dir {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  margin-top: 1px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--text-secondary);
  line-height: 1;
}
.condition-dir .dir-arrow { display: inline-block; font-size: 12px; line-height: 1; color: var(--accent-teal); }
.condition-dir .dir-card { letter-spacing: 0.1em; }

/* ============================================================
   LIGHT THEME  —  <html data-theme="light">
   Chrome goes light via variable overrides; the DATA panels
   (Chart.js charts + meteogram) stay dark so their bright
   teal/amber/violet series remain high-contrast — a deliberate
   "instrument panel" look. Dark is the default (no attribute).
   ============================================================ */
:root[data-theme="light"] {
  --primary-color: #0d9488;
  --primary-glow: rgba(13,148,136,0.14);
  --secondary-color: #b45309;
  --background-dark: #eef1f6;
  --background-medium: #ffffff;
  --background-light: #f3f6f9;
  --text-primary: #16212c;
  --text-secondary: #55636f;
  --text-muted: #8794a1;
  --border-color: #dde4ec;
  --border-light: #e7edf3;
  --accent-teal: #0d9488;
  --accent-amber: #b45309;
  --accent-violet: #7c3aed;
  --accent-pink: #db2777;
  --shadow-lg: 0 8px 24px rgba(20,40,60,0.10);
  --shadow-xl: 0 10px 30px rgba(20,40,60,0.12);
  color-scheme: light;
}
:root[data-theme="light"] body { background: var(--background-dark); }

/* softer ambient in light mode */
:root[data-theme="light"] .bg-blob { opacity: 0.045; }
:root[data-theme="light"] .bg-canvas { opacity: 0.4; }
:root[data-theme="light"] .app-bg {
  background-image:
    linear-gradient(rgba(13,148,136,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13,148,136,0.06) 1px, transparent 1px);
}

/* data panels stay dark so bright chart/meteogram colors keep contrast — but
   as FROSTED dark glass (translucent + blur + light edge) so they read as
   etched glass over the light theme instead of harsh solid rectangles */
:root[data-theme="light"] .chart-panel,
:root[data-theme="light"] .meteogram {
  background: rgba(13, 19, 25, 0.74) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  -webkit-backdrop-filter: blur(11px) !important; backdrop-filter: blur(11px) !important;
  box-shadow: 0 4px 20px rgba(20, 40, 60, 0.10), inset 0 1px 0 rgba(255,255,255,0.05) !important;
  color: #d7e0e9;
}
/* the Real Time / Future toggle track: frosted glass to match */
:root[data-theme="light"] .ovs-tabs {
  background: rgba(13, 19, 25, 0.72) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  -webkit-backdrop-filter: blur(8px) !important; backdrop-filter: blur(8px) !important;
}
:root[data-theme="light"] .chart-panel h3 { color: #c3ced9 !important; }
:root[data-theme="light"] .meteogram .mg-rlabel,
:root[data-theme="light"] .meteogram .mg-cell { color: #d7e0e9; }

/* ---------- theme toggle button ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; padding: 0 10px;
  background: var(--background-medium); border: 1px solid var(--border-color);
  border-radius: 2px; color: var(--text-secondary); cursor: pointer;
  transition: color .12s, border-color .12s;
}
.theme-toggle:hover { border-color: var(--accent-teal); color: var(--accent-teal); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .ic-moon { display: none; }
.theme-toggle .ic-sun { display: block; }
:root[data-theme="light"] .theme-toggle .ic-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ic-moon { display: block; }

/* light-mode "glass": invert the translucent-DARK panels to translucent-LIGHT
   (chart panels stay dark — handled above for the instrument look) */
:root[data-theme="light"] .buoy-card,
:root[data-theme="light"] .condition-card,
:root[data-theme="light"] .timeline-controls,
:root[data-theme="light"] .ocean-view-section,
:root[data-theme="light"] .location-display,
:root[data-theme="light"] .time-display,
:root[data-theme="light"] .location-switcher .loc-btn,
:root[data-theme="light"] .ocean-link,
:root[data-theme="light"] .btn-tropical,
:root[data-theme="light"] .beta-features-btn,
:root[data-theme="light"] .theme-toggle {
  background: rgba(255, 255, 255, 0.7) !important;
  border-color: var(--border-color) !important;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
/* text hard-coded light for the dark theme -> dark ink on the light glass */
:root[data-theme="light"] .loc-btn-label { color: var(--text-primary) !important; }
:root[data-theme="light"] .loc-btn-label em { color: var(--text-muted) !important; }

/* ============================================================
   LIGHT MODE — remaining dark surfaces -> frosted LIGHT glass
   (dropdowns, map chips, beta panel, buoycam, tab track) so the
   whole UI is cohesive, not black boxes on a light theme.
   ============================================================ */
:root[data-theme="light"] .map-chip,
:root[data-theme="light"] .layers-dd,
:root[data-theme="light"] .loc-panel,
:root[data-theme="light"] .beta-features-content,
:root[data-theme="light"] .ovs-tabs,
:root[data-theme="light"] #pane-realtime .buoycam-container {
  background: rgba(255, 255, 255, 0.86) !important;
  border-color: var(--border-color) !important;
  -webkit-backdrop-filter: blur(10px) !important; backdrop-filter: blur(10px) !important;
  box-shadow: 0 10px 30px rgba(20,40,60,0.12) !important;
}
/* location dropdown internals */
:root[data-theme="light"] .loc-search,
:root[data-theme="light"] .loc-city { color: var(--text-primary) !important; }
:root[data-theme="light"] .loc-search-wrap { border-bottom-color: var(--border-color) !important; color: var(--text-muted) !important; }
:root[data-theme="light"] .loc-state { color: var(--text-secondary) !important; border-color: var(--border-color) !important; }
:root[data-theme="light"] .loc-row:hover .loc-city,
:root[data-theme="light"] .loc-group-title { color: var(--accent-teal) !important; }
:root[data-theme="light"] .loc-row:hover { background: rgba(13,148,136,0.10) !important; }
/* beta panel internals inherit vars; make its scrollbars/edges light */
:root[data-theme="light"] .features-header { border-bottom-color: var(--border-color) !important; }

/* ============================================================
   LIGHT MODE v2 — real frosted glass (lower white opacity + strong
   blur) on the cards/chrome, matching frosted DARK glass on the data
   panels, + every dashboard map overlay lightened.
   ============================================================ */
:root[data-theme="light"] .buoy-card,
:root[data-theme="light"] .condition-card,
:root[data-theme="light"] .timeline-controls,
:root[data-theme="light"] .location-display,
:root[data-theme="light"] .time-display,
:root[data-theme="light"] .location-switcher .loc-btn,
:root[data-theme="light"] .ocean-link,
:root[data-theme="light"] .btn-tropical,
:root[data-theme="light"] .beta-features-btn,
:root[data-theme="light"] .theme-toggle,
:root[data-theme="light"] .map-chip,
:root[data-theme="light"] .layers-dd,
:root[data-theme="light"] .loc-panel,
:root[data-theme="light"] .beta-features-content {
  background: rgba(255,255,255,0.5) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2) !important;
  backdrop-filter: blur(16px) saturate(1.2) !important;
  border-color: rgba(255,255,255,0.55) !important;
}
:root[data-theme="light"] .ocean-view-section { background: rgba(255,255,255,0.4) !important; -webkit-backdrop-filter: blur(14px) !important; backdrop-filter: blur(14px) !important; }
/* data panels: frosted DARK glass, more translucent so they read as glass too */
:root[data-theme="light"] .chart-panel,
:root[data-theme="light"] .meteogram {
  background: rgba(13,19,25,0.62) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.1) !important;
  backdrop-filter: blur(14px) saturate(1.1) !important;
}

/* ---- dashboard light-map overlays ---- */
:root[data-theme="light"] #layerToast { background: rgba(255,255,255,0.9) !important; color: #55636f !important; border-color: #dde4ec !important; }
:root[data-theme="light"] .buoy-wv-label { background: rgba(255,255,255,0.92) !important; color: #16212c !important; border-color: #dde4ec !important; }
:root[data-theme="light"] .surf-spot-tip { background: rgba(255,255,255,0.94) !important; color: #16212c !important; border-color: #dde4ec !important; }
:root[data-theme="light"] .ocean-hover {
  --ink: #16212c; --ink-2: #55636f; --ink-3: #8a97a4;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(244,247,250,0.96)) !important;
  border-color: #dde4ec !important; border-left-color: #0d9488 !important; color: #16212c !important;
}
:root[data-theme="light"] .ocean-hover .oh-sec + .oh-sec { border-top-color: rgba(20,40,60,0.12) !important; }
/* light mode: the values are hardcoded light (#d7e0e9) and the section titles
   carry an inline light accent — both wash out on the white panel. Force dark. */
:root[data-theme="light"] .ocean-hover .oh-v { color: #16212c !important; }
:root[data-theme="light"] .ocean-hover .oh-k { color: #0f766e !important; }
:root[data-theme="light"] .ocean-legend .leg-item { background: rgba(255,255,255,0.92) !important; border-color: #dde4ec !important; }
:root[data-theme="light"] .ocean-legend .leg-title { color: #16212c !important; }
:root[data-theme="light"] .leaflet-control-zoom a { background: rgba(255,255,255,0.92) !important; color: #55636f !important; border-color: #dde4ec !important; }
:root[data-theme="light"] .leaflet-control-attribution { background: rgba(255,255,255,0.8) !important; color: #55636f !important; }
:root[data-theme="light"] .leaflet-popup-content-wrapper,
:root[data-theme="light"] .leaflet-popup-tip { background: #ffffff !important; color: #16212c !important; border-color: #dde4ec !important; }
:root[data-theme="light"] .leaflet-tooltip { background: #ffffff !important; color: #16212c !important; border-color: #dde4ec !important; }

/* light mode: kill the inner .chart-container dark fill (was #0f1419, doubling
   the darkness) and lighten the data-panel glass so it reads as glass, not a
   heavy black box. h3 stays light on the (still translucent-dark) glass. */
:root[data-theme="light"] .chart-container { background: transparent !important; }
:root[data-theme="light"] .chart-panel,
:root[data-theme="light"] .meteogram {
  background: rgba(15,22,30,0.42) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.15) !important;
  backdrop-filter: blur(16px) saturate(1.15) !important;
  border-color: rgba(255,255,255,0.14) !important;
}

/* ============================================================
   FULL LIGHT data panels — white frosted glass + dark ink.
   Chart LINES are darkened by the bwfLightLines Chart.js plugin;
   the meteogram's own colors are darkened here.
   ============================================================ */
:root[data-theme="light"] .chart-panel,
:root[data-theme="light"] .meteogram {
  background: rgba(255,255,255,0.5) !important;
  border-color: rgba(255,255,255,0.6) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2) !important;
  backdrop-filter: blur(16px) saturate(1.2) !important;
  color: #16212c !important;
}
:root[data-theme="light"] .chart-container { background: transparent !important; }
:root[data-theme="light"] .chart-panel h3 { color: #16212c !important; }

/* meteogram text + data darkened for the light glass */
:root[data-theme="light"] .meteogram .mg-timerow b { color: #16212c !important; }
:root[data-theme="light"] .meteogram .mg-timerow span,
:root[data-theme="light"] .meteogram .mg-rlabel,
:root[data-theme="light"] .meteogram .mg-rlabel em { color: #55636f !important; }
:root[data-theme="light"] .meteogram .mg-cell { color: #16212c !important; }
:root[data-theme="light"] .meteogram .mg-arrow { color: #0d9488 !important; }
:root[data-theme="light"] .meteogram .mg-windrow b { color: #0d9488 !important; }
:root[data-theme="light"] .meteogram .mg-waverow b { color: #0d9488 !important; }
:root[data-theme="light"] .meteogram .mg-perrow .mg-cell { color: #7c3aed !important; }
:root[data-theme="light"] .meteogram .mg-bar {
  background: linear-gradient(to top, rgba(13,148,136,0.35), #0d9488) !important;
  box-shadow: 0 0 5px rgba(13,148,136,0.35) !important;
}
:root[data-theme="light"] .meteogram .mg-tide-svg polyline { stroke: #0369a1 !important; }

/* meteogram sticky left label gutter -> light in light mode */
:root[data-theme="light"] .meteogram .mg-rlabel {
  background: rgba(255,255,255,0.72) !important;
  border-right-color: #dde4ec !important;
}

/* charts render low / bottom-clipped at short panel heights: the .chart-container
   padding + a 300px canvas cap stole vertical room. Give the canvas the full
   container height so Chart.js can fit the plot + axes centered. */
/* padding:0 so the canvas isn't inset; min-height:0 so the container shrinks to
   fit its panel at low desktop resolutions (a 200px min-height was overflowing
   the squeezed ~111px panel and clipping the chart). */
.chart-container { padding: 0 !important; display: block; min-height: 0 !important; }
/* let Chart.js size the canvas (responsive + maintainAspectRatio:false fills the
   container). Only remove the old 300px cap; do NOT force height — forcing it
   fights Chart.js and clips the plot when the panel is short. */
.chart-container canvas { max-height: none !important; }
/* drop the old cyan neon glow on the charts in light mode (wrong on white glass) */
:root[data-theme="light"] .chart-container canvas,
:root[data-theme="light"] .chart-panel:hover .chart-container canvas { filter: none !important; }

/* ============================================================
   Short-height desktops (low-res / small laptops): the fixed
   no-scroll two-pane can't fit the 2x2 charts, so let the page
   SCROLL and give the charts a usable height instead of clipping.
   ============================================================ */
@media (min-width: 1024px) and (max-height: 800px) {
  html, body { height: auto !important; overflow-y: auto !important; }
  .app-container { height: auto !important; min-height: 100vh; }
  .main-content { height: auto !important; overflow: visible !important; }
  .left-panel, .right-panel { height: auto !important; overflow: visible !important; }
  .app-container:not(.fullscreen-mode) .right-panel { overflow: visible !important; height: auto !important; }
  .map-container { height: 56vh !important; min-height: 320px; }
  .charts-container { grid-template-rows: auto auto !important; height: auto !important; }
  .chart-panel { min-height: 200px; }
  .chart-container { min-height: 160px !important; }
}

/* ============================================================
   Responsive navbar/header — scales with the viewport (clamp = no JS)
   so it doesn't jam when the window is smaller than full-screen.
   Full-size look is preserved at ~1980px (clamp max = current size).
   ============================================================ */
.brand-name { font-size: clamp(15px, 1.9vw, 32px) !important; }
.tagline { font-size: clamp(9px, 1.05vw, 17px) !important; letter-spacing: clamp(0.14em, 0.5vw, 0.44em) !important; }
.header { padding-top: clamp(6px, 1vh, 18px) !important; padding-bottom: clamp(6px, 1vh, 18px) !important; }

/* compact chrome on smaller / shorter windows to free vertical space */
@media (max-width: 1500px), (max-height: 900px) {
  .beta-banner { padding: 3px 12px !important; }
  .beta-text { font-size: 10px !important; }
  .time-value { font-size: 13px !important; }
  .header-controls { gap: 0.4rem !important; }
  .ocean-link, .loc-btn { padding: 0 9px !important; }
}
/* very short viewports: drop the non-essential header bits entirely */
@media (max-height: 720px) {
  .beta-banner { display: none !important; }
  .tagline { display: none !important; }
}
