/* ==========================================================================
   Howth Weather Station — shared design system
   Used by index.html, widgets.html, alerts.html, windy.html
   ========================================================================== */

/* ---- Design tokens ---- */
:root {
    color-scheme: dark;

    --color-bg: #14161a;
    --color-card: #1f2227;
    --color-card-hover: #262a30;
    --color-sidebar: #14161a;
    --color-border: rgba(255, 255, 255, 0.07);
    --color-text: #f4f6f8;
    --color-text-dim: #a2abb5;
    --color-text-faint: #6d7680;

    --color-accent: #4a90e2;
    --color-accent-soft: rgba(74, 144, 226, 0.16);

    --color-gauge-track: #383d44;
    --color-gauge-red: #ea4228;
    --color-gauge-yellow: #f5cd19;
    --color-gauge-green: #5be12c;
    --color-gauge-blue: #00bcd4;

    --status-yellow: #ffd700;
    --status-orange: #ff8c00;
    --status-red: #ff3b30;
    --status-green: #38b000;

    --sidebar-width: 280px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 14px 32px rgba(0, 0, 0, 0.4);
    --shadow-sidebar: 2px 0 20px rgba(0, 0, 0, 0.45);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);

    /* Liquid-glass surfaces (mobile bottom bar, settings sheet) */
    --color-glass: rgba(24, 26, 31, 0.68);
    --color-glass-border: rgba(255, 255, 255, 0.12);
    --color-glass-sheen: rgba(255, 255, 255, 0.14);
}

:root[data-theme="light"] {
    color-scheme: light;

    --color-bg: #f1f3f6;
    --color-card: #ffffff;
    --color-card-hover: #f7f8fa;
    --color-sidebar: #ffffff;
    --color-border: rgba(15, 23, 42, 0.08);
    --color-text: #1a1d21;
    --color-text-dim: #5b6470;
    --color-text-faint: #8a93a0;

    --color-gauge-track: #e3e6ea;

    --shadow-card: 0 3px 14px rgba(15, 23, 42, 0.07);
    --shadow-card-hover: 0 8px 24px rgba(15, 23, 42, 0.1);
    --shadow-sidebar: 2px 0 20px rgba(15, 23, 42, 0.06);

    --color-glass: rgba(255, 255, 255, 0.68);
    --color-glass-border: rgba(15, 23, 42, 0.08);
    --color-glass-sheen: rgba(255, 255, 255, 0.5);
}

/* ---- Accent color options ----
   Blue is the default (--color-accent set in :root above); these override
   it when a custom accent is picked from the settings sheet. Swatch hexes
   below (in .accent-swatch[data-accent]) must match these. */
:root[data-accent="red"]    { --color-accent: #ef4444; --color-accent-soft: rgba(239, 68, 68, 0.16); }
:root[data-accent="orange"] { --color-accent: #f97316; --color-accent-soft: rgba(249, 115, 22, 0.16); }
:root[data-accent="green"]  { --color-accent: #22c55e; --color-accent-soft: rgba(34, 197, 94, 0.16); }
:root[data-accent="purple"] { --color-accent: #a855f7; --color-accent-soft: rgba(168, 85, 247, 0.16); }
:root[data-accent="pink"]   { --color-accent: #ec4899; --color-accent-soft: rgba(236, 72, 153, 0.16); }

/* ---- Reset & base ---- */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

a { color: inherit; }

/* ---- App shell ---- */
#weather-app { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
#sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background-color: var(--color-sidebar);
    border-right: 1px solid var(--color-border);
    padding: 28px 0 20px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sidebar);
    z-index: 10;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo-container {
    width: 88px;
    height: 88px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--color-accent-soft);
    padding: 6px;
}

#station-header img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 50%;
}

#station-header h1 {
    font-size: 1.15em;
    font-weight: 600;
    text-align: center;
    margin: 0 0 6px;
    color: var(--color-text);
    letter-spacing: 0.2px;
}

.station-subtitle {
    display: block;
    text-align: center;
    font-size: 0.75em;
    color: var(--color-text-faint);
    margin-bottom: 26px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

nav ul {
    list-style: none;
    padding: 0 12px;
    margin: 0;
    width: 100%;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-item { margin: 4px 0; border-radius: var(--radius-sm); }
.settings-trigger-item { display: none; } /* mobile-only, see responsive section */

.nav-item a, .nav-item .nav-settings-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--color-text-dim) !important;
    text-decoration: none !important;
    font-size: 0.95em;
    font-weight: 500;
    font-family: inherit;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-item:not(.active-page) a:hover, .nav-item .nav-settings-btn:hover {
    background-color: var(--color-card-hover);
    color: var(--color-text) !important;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-flex;
}
.nav-icon svg { width: 100%; height: 100%; }

.active-page a {
    background-color: var(--color-accent);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.35);
}

#info-section { margin-top: auto; padding: 0 12px; }
#info-section a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    font-size: 0.9em;
    color: var(--color-text-faint);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
#info-section a:hover { background-color: var(--color-card-hover); color: var(--color-text-dim); }

#dark-mode-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px 4px;
    font-size: 0.9em;
    color: var(--color-text-dim);
}
#dark-mode-toggle label { cursor: pointer; }

/* Toggle switch */
.switch-container { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch-container input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background-color: var(--color-gauge-track);
    transition: 0.3s var(--ease);
    border-radius: 34px;
}
.slider:before {
    position: absolute; content: "";
    height: 18px; width: 18px; left: 3px; bottom: 3px;
    background-color: #ffffff;
    transition: 0.3s var(--ease);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
input:checked + .slider { background-color: var(--color-accent); }
input:checked + .slider:before { transform: translateX(20px); }

/* ---- Settings sheet (mobile) ---- */
.settings-overlay {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: flex-end; justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background-color 0.25s var(--ease);
}
.settings-overlay.open { background: rgba(0, 0, 0, 0.4); }
.settings-overlay[hidden] { display: none; }

.settings-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    padding: 10px 22px calc(24px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.3s var(--ease);
}
.settings-overlay.open .settings-sheet { transform: translateY(0); }

.settings-sheet-handle {
    width: 36px; height: 4px; border-radius: 4px;
    background: var(--color-gauge-track);
    margin: 6px auto 16px;
}

.settings-sheet h3 { margin: 0 0 16px; font-size: 1.1em; font-weight: 600; }

.settings-section { margin-bottom: 18px; }
.settings-label {
    display: block; font-size: 0.78em; text-transform: uppercase;
    letter-spacing: 0.6px; color: var(--color-text-faint); margin-bottom: 10px;
}

.segmented-control {
    display: flex; gap: 4px; position: relative;
    background: var(--color-bg); border-radius: 12px; padding: 4px;
}
.segmented-control button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 6px; border: none; border-radius: 9px;
    background: none; color: var(--color-text-dim);
    font-family: inherit; font-size: 0.78em; font-weight: 500;
    cursor: pointer; position: relative; z-index: 1;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.segmented-control button svg { width: 18px; height: 18px; }
.segmented-control button.active {
    background: var(--color-card); color: var(--color-accent);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* iOS-only: a genuine "Liquid Glass" selection lens that slides and springs
   between options, instead of the plain background-swap above. Detected via
   JS (see settings.js) rather than a media query, since there's no reliable
   CSS-only way to target "real iOS Safari" specifically. */
.segmented-glass {
    display: none;
    position: absolute; top: 4px; bottom: 4px; left: 4px; width: 0;
    border-radius: 9px;
    background: var(--color-glass);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--color-glass-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18), inset 0 1px 0 var(--color-glass-sheen);
    pointer-events: none;
    z-index: 0;
    /* A slight overshoot on the transform approximates the "settles into
       place" spring feel without a full physics/JS animation loop. */
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
html.is-ios .segmented-glass { display: block; }
.segmented-glass.no-anim { transition: none; }
html.is-ios .segmented-control button.active {
    background: none; box-shadow: none; /* the glass lens supplies the highlight instead */
}

.accent-swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.accent-swatch {
    width: 36px; height: 36px; border-radius: 50%;
    border: none; padding: 0; cursor: pointer;
    background: var(--swatch-color);
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s var(--ease);
}
.accent-swatch:active { transform: scale(0.92); }
.accent-swatch.active::after {
    content: '';
    position: absolute; inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--swatch-color);
}
.accent-swatch svg {
    width: 16px; height: 16px; color: #fff;
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    opacity: 0; transition: opacity 0.15s var(--ease);
}
.accent-swatch.active svg { opacity: 1; }

.settings-about-link {
    display: block; padding: 12px 0; font-size: 0.9em;
    color: var(--color-accent); text-decoration: none;
}
.settings-about-link:hover { text-decoration: underline; }

.settings-close {
    width: 100%; margin-top: 8px; padding: 12px;
    border: none; border-radius: 12px;
    background: var(--color-bg); color: var(--color-text);
    font-family: inherit; font-size: 0.95em; font-weight: 600;
    cursor: pointer;
}

/* ---- Main content ---- */
#dashboard-content {
    flex-grow: 1;
    padding: 32px 36px 40px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}

.page-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.live-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: var(--color-text-faint);
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--color-gauge-green);
    box-shadow: 0 0 0 0 rgba(91, 225, 44, 0.5);
    animation: pulse-dot 2s infinite;
}
.status-dot.error { background-color: var(--color-gauge-red); animation: none; }

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(91, 225, 44, 0.45); }
    70% { box-shadow: 0 0 0 7px rgba(91, 225, 44, 0); }
    100% { box-shadow: 0 0 0 0 rgba(91, 225, 44, 0); }
}

/* ---- Cards (shared) ---- */
.gauge-card {
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.gauge-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
    background-color: var(--color-card-hover);
}

/* ---- Weather tiles ---- */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    width: 100%;
}
.tile-grid.secondary { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* Rainfall + Moon Phase share a row and stretch to fill its full width,
   rather than sitting in the auto-fit grid where leftover columns at wide
   viewports leave dead space next to them. */
.tile-row-split { display: flex; gap: 20px; width: 100%; }
.tile-row-split .tile-rain { flex: 3; }
.tile-row-split .tile-moon { flex: 2; }
@media (max-width: 640px) {
    .tile-row-split { flex-direction: column; }
}

.weather-tile {
    align-items: flex-start;
    text-align: left;
    padding: 24px;
}
.weather-tile.wide { grid-column: span 2; }
@media (max-width: 640px) {
    .weather-tile.wide { grid-column: span 1; }
}

.weather-tile.secondary { padding: 18px 20px; }

.tile-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
    background: var(--tile-accent-soft, var(--color-accent-soft));
    color: var(--tile-accent, var(--color-accent));
    flex-shrink: 0;
}
.tile-icon svg { width: 22px; height: 22px; }
.tile-icon.tile-icon-fill { padding: 0; overflow: hidden; background: none; }

.weather-tile.secondary .tile-icon { width: 36px; height: 36px; margin-bottom: 10px; }
.weather-tile.secondary .tile-icon svg { width: 18px; height: 18px; }

.tile-label {
    font-size: 0.78em; text-transform: uppercase; letter-spacing: 1px;
    color: var(--color-text-faint); font-weight: 600;
}
.tile-value { font-size: 2.1em; font-weight: 700; margin-top: 4px; line-height: 1.15; }
.tile-value .tile-unit { font-size: 0.48em; font-weight: 500; opacity: 0.7; margin-left: 3px; }
.weather-tile.secondary .tile-value { font-size: 1.4em; }

.tile-sub { font-size: 0.85em; color: var(--color-text-dim); margin-top: 8px; }
.tile-sub strong { color: var(--color-text); }

.tile-bar { width: 100%; height: 6px; border-radius: 4px; background: var(--color-gauge-track); margin-top: 16px; overflow: hidden; }
.tile-bar-fill { height: 100%; width: 0; border-radius: 4px; background-repeat: no-repeat; transition: width 1.2s var(--ease); }
.tile-range { display: flex; justify-content: space-between; width: 100%; font-size: 0.72em; color: var(--color-text-faint); margin-top: 6px; }

.tile-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; width: 100%; }
.tile-chip { background: var(--color-bg); border-radius: 8px; padding: 8px 12px; font-size: 0.72em; color: var(--color-text-faint); text-align: left; flex: 1 1 80px; }
.tile-chip strong { display: block; color: var(--color-text); font-size: 1.15em; font-weight: 700; margin-bottom: 2px; }

/* Per-metric accent colors + gradient bar fills */
.tile-temp { --tile-accent: #ea4228; --tile-accent-soft: rgba(234, 66, 40, 0.15); }
.tile-temp .tile-bar-fill { background: linear-gradient(90deg, #00bcd4, #f5cd19, #ea4228); }

.tile-humidity { --tile-accent: #00bcd4; --tile-accent-soft: rgba(0, 188, 212, 0.15); }
.tile-humidity .tile-bar-fill { background: linear-gradient(90deg, #f5cd19, #5be12c, #00bcd4); }

.tile-wind { --tile-accent: #5be12c; --tile-accent-soft: rgba(91, 225, 44, 0.15); }
.tile-wind .tile-bar-fill { background: linear-gradient(90deg, #5be12c, #f5cd19, #ea4228); }

.tile-rain { --tile-accent: #4a90e2; --tile-accent-soft: rgba(74, 144, 226, 0.15); }
.tile-rain .tile-bar-fill { background: #00bcd4; }

.tile-pressure { --tile-accent: #a78bfa; --tile-accent-soft: rgba(167, 139, 250, 0.15); }
.tile-solar { --tile-accent: #ff9900; --tile-accent-soft: rgba(255, 153, 0, 0.15); }
.tile-moon { --tile-accent: #c7cdd6; --tile-accent-soft: rgba(199, 205, 214, 0.14); }

/* Wind tile: compass + readout side by side */
.wind-tile-body { display: flex; align-items: center; gap: 24px; width: 100%; margin-top: 12px; }
.wind-compass-large { width: 100px; height: 100px; flex-shrink: 0; color: var(--tile-accent); }
.wind-tile-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.wind-needle { color: var(--tile-accent); transform-origin: 50px 50px; transition: transform 0.8s var(--ease); }
@media (max-width: 520px) {
    .wind-tile-body { flex-direction: column; align-items: flex-start; gap: 16px; }
    .wind-compass-large { width: 84px; height: 84px; align-self: center; }
}

/* Moon icon (rendered by moon.js) */
.tile-icon.tile-moon-icon { background: none; }

/* ---- Trends ---- */
.trends-section { width: 100%; }
.trends-header {
    display: flex; align-items: baseline; justify-content: space-between;
    flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.trends-header h3 { margin: 0; font-size: 1.15em; font-weight: 600; }
.trends-link { font-size: 0.85em; color: var(--color-accent); text-decoration: none; }
.trends-link:hover { text-decoration: underline; }

.chart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.chart-card { align-items: stretch; padding: 20px; }
.chart-card h4 { margin: 0 0 12px; font-size: 0.95em; font-weight: 600; text-align: left; width: 100%; color: var(--color-text-dim); }
.chart-canvas-wrap { position: relative; height: 220px; width: 100%; }
.chart-empty { margin: 0; padding: 24px 0; text-align: center; color: var(--color-text-faint); font-size: 0.85em; }

/* ==========================================================================
   Widgets page
   ========================================================================== */
#widget-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; }
.widget-card { min-height: 340px; padding: 18px; align-items: stretch; }
.widget-card h3 { margin: 0 0 12px; font-size: 1.05em; font-weight: 600; text-align: left; width: 100%; }
#rain-viewer-widget { grid-column: 1 / -1; min-height: 620px; }
.widget-iframe-container { overflow: hidden; border-radius: var(--radius-sm); flex-grow: 1; background: var(--color-bg); }
.widget-iframe-container iframe { width: 100%; height: 100%; display: block; border: 0; }
/* Met Éireann's widget has a fixed, non-responsive internal size — stretching
   it to fill a tall flex container distorts/misscales it, so it gets a fixed
   iframe height and is centered in its card instead of stretched. */
.widget-iframe-container.contain-widget { display: flex; align-items: center; justify-content: center; }
.widget-iframe-container.contain-widget iframe { height: 420px; max-height: 100%; }

/* ==========================================================================
   Alerts page
   ========================================================================== */
#alerts-container { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.alert-card {
    border-left: 5px solid var(--status-green);
    align-items: stretch;
    padding: 20px 22px;
}
.alert-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; flex-wrap: wrap; }
.alert-level {
    font-weight: 700; padding: 4px 12px; border-radius: 20px;
    text-transform: uppercase; font-size: 0.78em; letter-spacing: 0.5px;
}
.alert-times { font-size: 0.82em; color: var(--color-text-faint); }
.alert-headline { font-size: 1.2em; font-weight: 600; margin-top: 10px; width: 100%; text-align: left; }
.alert-details { font-size: 0.9em; margin-top: 8px; line-height: 1.55; color: var(--color-text-dim); width: 100%; text-align: left; }
.alert-empty, .alert-loading, .alert-error {
    padding: 24px; color: var(--color-text-dim); text-align: center;
}
.alert-error { color: var(--color-gauge-red); }

/* ==========================================================================
   Windy page
   ========================================================================== */
#dashboard-content.windy-content { padding: 0; max-width: none; margin: 0; }
#windy-map-container { flex-grow: 1; width: 100%; height: 100%; min-height: 100vh; position: relative; }
#windy-map { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

/* ==========================================================================
   Forecast page
   ========================================================================== */
.forecast-hero { flex-direction: row; align-items: center; gap: 32px; padding: 32px; flex-wrap: wrap; }
.forecast-hero-icon { width: 64px; height: 64px; flex-shrink: 0; color: var(--color-accent); }
.forecast-hero-main { display: flex; flex-direction: column; align-items: flex-start; }
.forecast-hero-temp { font-size: 3em; font-weight: 700; line-height: 1; margin-top: 4px; }
.forecast-hero-desc { font-size: 1.05em; color: var(--color-text-dim); margin-top: 6px; }
.forecast-hero-range { font-size: 0.85em; color: var(--color-text-faint); margin-top: 6px; }
.forecast-hero-range strong { color: var(--color-text); }
.forecast-hero-stats { display: flex; gap: 28px; margin-left: auto; flex-wrap: wrap; }
.forecast-hero-stat .stat-label {
    display: block; font-size: 0.72em; text-transform: uppercase;
    letter-spacing: 0.6px; color: var(--color-text-faint);
}
.forecast-hero-stat .stat-value { display: block; font-size: 1.3em; font-weight: 700; margin-top: 4px; }

.forecast-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; width: 100%; }
.forecast-day-card { padding: 16px 8px; text-align: center; align-items: center; }
.forecast-day-card.today { border-color: var(--tile-accent, var(--color-accent)); background: var(--color-accent-soft); }
.forecast-day-name { font-size: 0.78em; font-weight: 600; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.4px; }
.forecast-day-icon { width: 32px; height: 32px; margin: 10px 0; color: var(--color-accent); }
.forecast-day-temps { font-size: 0.92em; white-space: nowrap; }
.forecast-day-temps .hi { font-weight: 700; }
.forecast-day-temps .lo { color: var(--color-text-faint); margin-left: 5px; }
.forecast-day-rain { font-size: 0.7em; color: var(--color-gauge-blue); margin-top: 8px; }

@media (max-width: 860px) {
    .forecast-days { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 600px) {
    .forecast-hero { flex-direction: column; align-items: flex-start; padding: 22px; }
    .forecast-hero-stats { margin-left: 0; gap: 20px; }
    .forecast-days { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
    .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    #weather-app { flex-direction: column; }

    /* Bottom tab bar: fixed, frosted "liquid glass" surface, floating a
       little clear of the screen edge (and the iPhone safe area) rather
       than fused flush to the bottom or top of the viewport. */
    #sidebar {
        width: auto;
        position: fixed;
        left: 12px; right: 12px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        top: auto;
        height: auto;
        border: 1px solid var(--color-glass-border);
        border-radius: 26px;
        background: var(--color-glass);
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
        padding: 6px 0;
        z-index: 100;
        overflow: hidden;
    }
    /* Specular sheen along the top edge — the glassy highlight */
    #sidebar::before {
        content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
        background: linear-gradient(90deg, transparent, var(--color-glass-sheen), transparent);
    }

    #station-header, .station-subtitle, #info-section, #dark-mode-toggle { display: none; }

    nav ul {
        display: flex; justify-content: space-between; padding: 0 2px;
        overflow-x: auto; flex-grow: 0;
    }
    .nav-item { margin: 0; flex-shrink: 0; border-radius: 0; }
    .nav-item a, .nav-item .nav-settings-btn {
        flex-direction: column; gap: 2px; padding: 6px 4px 4px;
        font-size: 0.6em; border-radius: 12px; white-space: nowrap;
    }
    .nav-icon { width: 20px; height: 20px; }
    .active-page a {
        background: none; box-shadow: none; color: var(--color-accent) !important;
    }
    .settings-trigger-item { display: block; }

    /* Room for the fixed, floating bottom bar so content isn't hidden behind it */
    #dashboard-content { padding: 18px; padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
    .tile-grid { grid-template-columns: 1fr; }

    #widget-grid { grid-template-columns: 1fr; }
    #rain-viewer-widget { min-height: 320px; }
    .widget-card { min-height: 300px; }
    .alert-header { flex-direction: column; align-items: flex-start; }
    /* #windy-map fills this container via position:absolute; inset:0, which
       sits flush with the padding-box edge regardless of padding — so the
       bottom bar's clearance has to come from shrinking the container's
       height, not padding it. */
    #windy-map-container { min-height: calc(100vh - 86px - env(safe-area-inset-bottom, 0px)); }
}
