/* Global Vars */
:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --border-color: #30363d;
    --lactate-color: #fca5a5;
    /* Red-300 for Lactate Threshold/Impact */
    --vo2-color: #93c5fd;
    /* Blue-300 for VO2 Max */
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    /* Keep viewport width stable when vertical scrollbars appear/disappear. */
    scrollbar-gutter: stable both-edges;
}

/* Custom Scrollbar (Slim & Dark) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

body {
    background-color: #0d1117;
    /* Static "Premium Void" Background */
    background-image:
        radial-gradient(circle at 50% 0%, rgba(88, 166, 255, 0.08) 0%, transparent 70%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.03) 0%, transparent 50%);
    /* Very subtle color hint */
    background-attachment: fixed;

    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-bottom: 20px;
}

#view-weather.main-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Removed @keyframes gradientMesh */

.container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    box-sizing: border-box;
}

.container-narrow {
    max-width: 650px;
}

.settings-inline-btn {
    margin-left: auto;
    margin-right: 8px;
    opacity: 0.6;
    padding: 6px;
}

.location-group.push-right {
    margin-left: auto;
}

.input-section-flat {
    background: transparent;
    border: none;
    padding: 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Keep climate header actions (including tooltip) usable while climate data loads. */
#tab-climate .header {
    position: relative;
    z-index: 10;
}

h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 12px rgba(88, 166, 255, 0.3);
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Tabs */
.tab-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--card-bg);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex: 1;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--accent-color);
    color: #fff;
}

.tab-content {
    display: none;
    animation: fadeEffect 0.2s;
    width: 100%;
    position: relative;
    padding-bottom: 80px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* Input Group */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.input-row {
    display: flex;
    gap: 12px;
}

:focus-visible {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* Results Structure */
.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-row:last-child {
    border-bottom: none;
}

.data-label-group {
    display: flex;
    /* flex-direction: column; */
    align-items: center;
    gap: 8px;
}

.data-label {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.data-value-group {
    text-align: right;
}

.data-value {
    font-family: 'Var', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.data-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* VDOT Banner */
.vdot-box {
    background: linear-gradient(135deg, #1f6feb 0%, #238636 100%);
    border-radius: 12px;
    padding: 2px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(31, 111, 235, 0.2);
    cursor: pointer;
}

.vdot-box>.vdot-header {
    background: var(--bg-color);
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vdot-details-panel {
    display: none;
    background: var(--bg-color);
    border-radius: 0 0 10px 10px;
    padding: 0 20px;
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

.vdot-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
}

.vdot-hint {
    font-size: 0.7em;
    opacity: 0.7;
    font-weight: 400;
}

.vdot-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.vdot-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.vdot-sub-gap {
    margin-top: 2px;
}

.vdot-highlight {
    color: #e6edf3;
}

.vdot-bold {
    font-weight: 700;
}

.vdot-threshold-range-enabled {
    cursor: pointer;
    text-decoration: none;
}

.vdot-right {
    text-align: right;
}


/* VDOT Gauge */
.vdot-gauge {
    position: relative;
    width: 100px;
    height: 55px;
    margin-top: -12px;
}

.vdot-gauge-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.vdot-gauge-track {
    display: none;
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 6;
    stroke-linecap: round;
}

.vdot-gauge-arc {
    display: none;
    fill: none;
    stroke: var(--accent-color);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        stroke 0.5s ease;
    filter: drop-shadow(0 0 4px var(--accent-color));
}

.vdot-gauge-value {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.vdot-gauge-label {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    opacity: 0.8;
    transition: color 0.5s ease;
}

/* Location Group */
.location-group {
    position: relative;
    margin-right: 8px;
}

#tab-current #btn-copy-cond {
    margin-left: auto;
    margin-right: 6px;
}

#tab-calculator #copy-btn {
    margin-right: 6px;
}

/* Copy Button */
.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    opacity: 0.4;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
    color: var(--text-primary);
}

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

/* Weather Impact Styles */
.weather-impact-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 6px;
}

.impact-low {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.impact-med {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.impact-high {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

/* Table Wrapper - for scroll and rounded corners */
.table-wrapper {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

/* Forecast Table */
.forecast-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: var(--card-bg);
}

.forecast-table th {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

/* Sticky Header logic */
.forecast-table thead th {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 5;
}

.forecast-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.forecast-table tr:last-child td {
    border-bottom: none;
}

.impact-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    min-width: 40px;
}

.impact-badge--compact {
    color: #000;
    font-weight: 600;
    font-size: 0.75em;
    background: var(--impact-bg, #4ade80);
}

.forecast-row-selected,
.climate-row-selected {
    background: var(--card-bg);
    font-weight: 700;
}

.forecast-time-cell {
    padding: 6px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.forecast-dayline {
    font-size: 0.75em;
    display: flex;
    align-items: center;
    gap: 1px;
}

.forecast-timeline {
    font-size: 1em;
    color: var(--text-primary);
    font-weight: 500;
}

.forecast-cell-center {
    text-align: center;
}

.forecast-rain-main {
    font-weight: 500;
}

.forecast-rain-prob {
    font-size: 0.75em;
    color: var(--cell-prob-color, var(--text-secondary));
}

.forecast-wind-unit {
    font-size: 0.7em;
    color: var(--text-secondary);
}

.forecast-wind-dir-wrap {
    font-size: 0.7em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.forecast-wind-arrow {
    display: inline-block;
    transform: rotate(var(--wind-dir-deg, 0deg));
    font-size: 0.8em;
    margin-left: 2px;
}

.forecast-pace-line {
    font-family: 'Courier New', monospace;
    font-size: 1em;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 2px;
}

.climate-time-cell {
    padding: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.climate-date-line {
    font-size: 0.75em;
}

.climate-time-line {
    font-size: 1em;
    color: var(--text-primary);
    font-weight: 500;
}

.climate-wind-unit {
    font-size: 0.7em;
    color: var(--text-secondary);
}

/* Custom Scrollbar for x-overflow */
::-webkit-scrollbar {
    height: 6px;
    width: 6px;
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* 16-Day Grid Styles */
.forecast-grid {
    /* No grid definition here, purely container */
    padding-bottom: 10px;
}

.forecast-tooltip {
    position: fixed;
    /* Fixed to viewport */
    background: rgba(22, 27, 34, 0.9);
    /* Glass */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    pointer-events: auto;
    /* Allow clicks on links inside */
    z-index: 10000;
    /* Ensure on top */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    width: 160px;
    display: none;
    /* Hidden by default */
    opacity: 0;
    transition: opacity 0.1s ease-in-out;
}

.tooltip-header {
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    border-bottom: 1px solid #374151;
    padding-bottom: 4px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.tooltip-label {
    color: #9ca3af;
}

.tooltip-val {
    font-weight: 600;
}

/* Legend items */
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    border-radius: 4px;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legend-item--interactive {
    cursor: pointer;
    transition: all 0.2s;
    opacity: var(--legend-opacity, 1);
}

.legend-color--dynamic {
    background-color: var(--legend-color, transparent);
    border: var(--legend-border, 1px solid transparent);
    box-shadow: var(--legend-shadow, none);
}

.legend-sub {
    font-size: 0.75em;
    opacity: 0.7;
}

.legend-share {
    margin-left: 4px;
    font-size: 0.7em;
    color: var(--text-secondary);
    opacity: var(--legend-share-opacity, 0.55);
    font-variant-numeric: tabular-nums;
}

.legend-item--climate {
    align-items: flex-start;
}

.legend-climate-text {
    display: flex;
    flex-direction: column;
    line-height: 1.12;
}

.legend-item--climate .legend-share {
    margin-left: 0;
    margin-top: 2px;
}

.heatmap-svg {
    width: 100%;
    height: auto;
    display: block;
}

.heatmap-cell {
    cursor: pointer;
    transition: fill-opacity 0.2s;
}

.heatmap-day-label {
    fill: var(--text-primary);
    font-size: 9px;
    font-weight: 600;
}

.heatmap-day-label-date {
    font-size: 7px;
    font-weight: 400;
    fill: var(--text-secondary);
    opacity: 0.72;
}

.heatmap-day-label--now {
    fill: #f8fbff;
    font-weight: 700;
}

.heatmap-hour-label {
    fill: var(--text-secondary);
    opacity: 0.85;
}

.heatmap-hour-label--now {
    fill: #dbeafe;
    opacity: 1;
    font-weight: 700;
}

.heatmap-cell--now {
    filter: drop-shadow(0 0 5px rgba(191, 219, 254, 0.42));
}

.heatmap-now-ring {
    pointer-events: none;
    fill: none;
    stroke: rgba(219, 234, 254, 0.95);
    stroke-width: 1.3;
    vector-effect: non-scaling-stroke;
    animation: heatmapNowPulse 1.75s ease-in-out infinite;
}

.heatmap-now-ring--small {
    stroke-width: 1.05;
}

.heatmap-now-dot {
    pointer-events: none;
    fill: #f8fbff;
    opacity: 0.95;
}

@keyframes heatmapNowPulse {
    0% {
        stroke-opacity: 0.45;
    }

    50% {
        stroke-opacity: 1;
    }

    100% {
        stroke-opacity: 0.45;
    }
}

.heatmap-empty {
    width: 100%;
    min-height: 150px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
}

/* Insight Banner */
.insight-banner {
    background: linear-gradient(90deg, rgba(22, 27, 34, 0.8) 0%, rgba(30, 41, 59, 0.8) 100%);
    border: 1px solid #30363d;
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.insight-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.insight-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    display: block;
}

.insight-impact {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    /* background: rgba(0,0,0,0.2); */
}

/* Selector inside banner */
.insight-selector {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 2px;
}

.insight-btn {
    padding: 2px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-secondary);
}

.insight-btn.active {
    background: var(--accent-color);
    color: white;
}

/* --- TAGS --- */
.tag {
    display: inline-block;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 6px;
    letter-spacing: 0.5px;
}

/* HMP = Blue */
.tag-hmp {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* 15KP = Yellow/Orange */
.tag-15kp {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* 30KP = Green */
.tag-30kp {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* EZ = Purple */
.tag-ez {
    background: rgba(163, 113, 247, 0.15);
    color: #a371f7;
    border: 1px solid rgba(163, 113, 247, 0.3);
}

/* 10KP = Red */
.tag-10kp {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}



/* Split Badge Aesthetic (Premium Polish) */
.split-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(22, 27, 34, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 2px 0;
    overflow: hidden;
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.split-badge:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.2);
}

.sb-time {
    padding: 3px 10px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    font-size: 0.8rem;
    opacity: 0.9;
}

.sb-sep {
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
}

.sb-tag {
    padding: 3px 10px;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* Dynamic Glows using :has() */
/* 10KP (Red) */
.split-badge:has(.tag-10kp-text) {
    border-left: 2px solid rgba(248, 113, 113, 0.5);
}

.split-badge:has(.tag-10kp-text):hover {
    border-color: rgba(248, 113, 113, 0.4);
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.1);
}

.tag-10kp-text {
    color: #f87171;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}

/* 15KP (Yellow) */
.split-badge:has(.tag-15kp-text) {
    border-left: 2px solid rgba(251, 191, 36, 0.5);
}

.split-badge:has(.tag-15kp-text):hover {
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.1);
}

.tag-15kp-text {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

/* HMP (Blue) */
.split-badge:has(.tag-hmp-text) {
    border-left: 2px solid rgba(96, 165, 250, 0.5);
}

.split-badge:has(.tag-hmp-text):hover {
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.1);
}

.tag-hmp-text {
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

/* 30KP (Green) */
.split-badge:has(.tag-30kp-text) {
    border-left: 2px solid rgba(52, 211, 153, 0.5);
}

.split-badge:has(.tag-30kp-text):hover {
    border-color: rgba(52, 211, 153, 0.4);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.1);
}

.tag-30kp-text {
    color: #34d399;
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}

/* EZ (Purple) */
.split-badge:has(.tag-ez-text) {
    border-left: 2px solid rgba(167, 139, 250, 0.5);
}

.split-badge:has(.tag-ez-text):hover {
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.1);
}

.tag-ez-text {
    color: #a371f7;
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.3);
}





.tag-btn {
    background: rgba(22, 27, 34, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Match split-badge border */
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    /* Match split-badge radius */
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.tag-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.05);
    /* Subtle lightening */
    color: var(--text-primary);
}

/* Specific Colors (Matching Split Badge Text) */
.tag-btn.tag-10kp:not(.active) {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.2);
}

.tag-btn.tag-10kp:not(.active):hover {
    border-color: rgba(248, 113, 113, 0.5);
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.1);
}

.tag-btn.tag-15kp:not(.active) {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.2);
}

.tag-btn.tag-15kp:not(.active):hover {
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.1);
}

.tag-btn.tag-hmp:not(.active) {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.2);
}

.tag-btn.tag-hmp:not(.active):hover {
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.1);
}

.tag-btn.tag-30kp:not(.active) {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.2);
}

.tag-btn.tag-30kp:not(.active):hover {
    border-color: rgba(52, 211, 153, 0.5);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.1);
}

.tag-btn.tag-ez:not(.active) {
    color: #a371f7;
    border-color: rgba(167, 139, 250, 0.2);
}

.tag-btn.tag-ez:not(.active):hover {
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.1);
}

/* Active State - Subtle yet Clear */
.tag-btn.active {
    color: #fff;
    transform: translateY(0);
    /* Remove text shadow for cleaner look */
}

.tag-btn.active.tag-10kp {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.6);
    color: #f87171;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}

.tag-btn.active.tag-15kp {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.6);
    color: #fbbf24;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.tag-btn.active.tag-hmp {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.6);
    color: #60a5fa;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

.tag-btn.active.tag-30kp {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.6);
    color: #34d399;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.tag-btn.active.tag-ez {
    background: rgba(163, 113, 247, 0.15);
    border: 1px solid rgba(163, 113, 247, 0.6);
    color: #a371f7;
    box-shadow: 0 0 12px rgba(163, 113, 247, 0.15);
}






/* Modern Input Styles */
.modern-input-card {
    background: linear-gradient(145deg, rgba(22, 27, 34, 0.6), rgba(22, 27, 34, 0.3));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
}

.modern-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    /* Editorial Typography */
    color: var(--accent-color);
    margin-bottom: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-row-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr 1fr;
    gap: 16px;
    align-items: center;
}

.input-row-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
}

.floating-input-group {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Floating Label Transition */
.floating-input-group label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 600;
    transition: all 0.2s ease;
    transform-origin: left bottom;
}

.floating-input-group:focus-within label {
    color: var(--accent-color);
    transform: translateY(-2px);
    text-shadow: 0 0 8px rgba(88, 166, 255, 0.3);
}

.modern-input {
    width: 100%;
    padding: 12px 14px;
    background-color: rgba(13, 17, 23, 0.4);
    border: 1px solid rgba(88, 166, 255, 0.1);
    border-bottom: 2px solid rgba(88, 166, 255, 0.2);
    border-radius: 8px 8px 0 0;
    color: #fff;
    font-size: 0.95rem;
    font-family: 'Var', monospace;
    font-weight: 500;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 0 transparent;
}

/* Neon Focus State */
.modern-input:focus {
    background-color: rgba(13, 17, 23, 0.8);
    border-color: rgba(88, 166, 255, 0.2);
    border-bottom-color: var(--accent-color);
    box-shadow: 0 4px 12px -2px rgba(88, 166, 255, 0.2);
}

/* Select Styling Override */
select.modern-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* Hide Spin Buttons for Number Inputs */
.modern-input[type="number"]::-webkit-outer-spin-button,
.modern-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.modern-input[type="number"] {
    -moz-appearance: textfield;
}

/* Mobile Optimization */
@media (max-width: 600px) {

    /* Mobile Input Grid */
    /* Mobile Input Grid */
    .input-row-grid {
        grid-template-columns: 1fr 1fr;
    }

    .input-row-grid.cols-3 {
        grid-template-columns: 1fr 1fr;
        /* Stack to 2 cols on mobile? Or 1? */
        /* Let's try 1fr for very small, but 3 cols fit on most phones if padding small. */
        /* Actually better to let them flow. */
        grid-template-columns: 1fr;
        /* Stack vertically on small screens */
    }

    .input-row-grid.cols-4 {
        grid-template-columns: 1fr 1fr;
    }

    .input-row-grid.cols-2.impact-grid {
        grid-template-columns: 1fr 1fr;
        /* Keep side-by-side for impacts unless very small */
    }

    /* Compact Tabs */
    .tab-nav {
        gap: 4px;
        padding: 4px;
        display: flex;
    }

    .tab-btn {
        flex: 1;
        /* Distribute space evenly */
        padding: 8px 2px;
        font-size: 0.8rem;
        text-align: center;
        justify-content: center;
    }

    /* Compact Table */
    .forecast-table th,
    .forecast-table td {
        padding: 6px 2px;
        font-size: 0.7rem;
        /* Smaller text */
    }

    .forecast-table th {
        white-space: normal;
        /* Allow headers to wrap */
        line-height: 1.1;
    }

    /* Tighter Tag Buttons */
    .tag-btn {
        padding: 4px 6px;
        font-size: 0.65rem;
    }

    #pace-tag-container-16 {
        gap: 4px;
    }

    /* Compact Cells */
    .forecast-table td .impact-badge {
        font-size: 0.7em;
        padding: 2px 4px;
    }
}

/* VDOT Expanded Table */
.vdot-details-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.vdot-details-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.vdot-details-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.vdot-details-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.vdot-details-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.vdot-details-table .time-val {
    font-family: 'Var', monospace;
    font-weight: 600;
    color: #fff;
}

.vdot-details-table .pace-val {
    font-family: 'Var', monospace;
    color: var(--text-secondary);
    font-size: 0.8em;
}

/* --- Location UI --- */
/* --- Location UI --- */
.location-btn {
    background: transparent;
    /* Changed from rgba */
    border: none;
    /* Changed from 1px solid */
    color: var(--text-secondary);
    padding: 2px 4px;
    /* Reduced padding */
    border-radius: 6px;
    /* Changed from 20px to 6px (Square) */
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    text-decoration: none;
    height: auto;
    min-height: 32px;
}

.loc-text-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    text-align: left;
}

.elevation-display {
    font-size: 0.65rem;
    opacity: 0.7;
    font-weight: 400;
}

.location-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    /* Subtle square hover */
    color: var(--text-primary);
    /* Removed border-color override since border is none */
}

.location-btn:focus {
    outline: none;
    box-shadow: none;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.modal-backdrop.open {
    display: flex;
    opacity: 1;
}


.modal-content {
    background: linear-gradient(145deg, rgba(22, 27, 34, 0.95), rgba(13, 17, 23, 0.95));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(10px);
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

.modal-input {
    width: 100%;
    padding: 14px 16px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.2s;
}

.modal-input:focus {
    border-color: var(--accent-color);
    background-color: rgba(0, 0, 0, 0.5);
    outline: none;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.location-list,
#loc-results,
.loc-results {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.location-item,
.loc-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    word-break: break-word;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: background 0.15s, border-color 0.15s, transform 0.15s, color 0.15s;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
}

.location-item:hover,
.loc-item:hover {
    background: rgba(88, 166, 255, 0.12);
    border-color: rgba(88, 166, 255, 0.25);
    color: #fff;
    transform: translateX(2px);
}

.location-item.active,
.loc-item.active {
    background: rgba(88, 166, 255, 0.15);
    border-left: 3px solid #58a6ff;
    padding-left: 9px;
}

.location-sub,
.loc-sub {
    color: var(--text-secondary);
    font-size: 0.8em;
    margin-left: 6px;
    font-weight: 500;
}

.loc-section-header {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 10px 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-search-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.modern-button {
    background: linear-gradient(135deg, var(--accent-color) 0%, #1f6feb 100%);
    border: none;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.25);
}

.modern-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.4);
}

.modern-button:active {
    transform: translateY(0);
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 42px 12px 40px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: white;
    font-size: 16px;
}

.search-input:focus {
    border-color: var(--accent-color);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #8b949e;
    pointer-events: none;
}

.search-gps-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(88, 166, 255, 0.35);
    border-radius: 7px;
    background: rgba(88, 166, 255, 0.12);
    color: #bfdbfe;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.search-gps-btn:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: rgba(88, 166, 255, 0.55);
    color: #e0ecff;
}

.search-gps-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.search-gps-btn.is-loading svg {
    animation: gpsPulseSpin 0.95s linear infinite;
}

@keyframes gpsPulseSpin {
    from {
        transform: scale(0.92) rotate(0deg);
        opacity: 0.72;
    }

    to {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

/* Legacy aliases above already cover loc-results/loc-item/loc-sub */

#loc-modal .modal-content {
    width: min(96vw, 980px);
    max-width: 980px;
    max-height: min(88vh, 900px);
    padding: 14px 16px 16px;
    gap: 10px;
    overflow-y: auto;
}

#loc-modal .modal-header-row {
    margin-bottom: 2px;
}

#loc-modal .modal-title {
    line-height: 1.1;
}

.loc-modal-split {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.loc-search-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 10px;
}

.loc-map-panel {
    position: relative;
    border: 1px solid rgba(88, 166, 255, 0.22);
    border-radius: 10px;
    background: rgba(13, 17, 23, 0.72);
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.loc-map-toggle {
    display: none;
    position: absolute;
    top: auto;
    bottom: 14px;
    right: 16px;
    z-index: 4;
    border: 1px solid rgba(88, 166, 255, 0.35);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #c7dbff;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 5px 10px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.loc-map-toggle:hover {
    background: rgba(30, 64, 175, 0.28);
    border-color: rgba(96, 165, 250, 0.68);
    color: #e4eeff;
}

.loc-map-canvas {
    width: 100%;
    height: clamp(420px, 58vh, 560px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    background: radial-gradient(circle at 30% 30%, rgba(56, 189, 248, 0.13), rgba(15, 23, 42, 0.9));
}

.loc-selection-card {
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    background: rgba(13, 17, 23, 0.62);
    padding: 10px;
    display: grid;
    gap: 5px;
}

.loc-selection-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.98fr);
    grid-template-areas:
        "name name"
        "details metrics";
    column-gap: 12px;
    row-gap: 4px;
    align-items: end;
}

.loc-selection-details {
    grid-area: details;
    display: grid;
    gap: 4px;
    align-self: end;
}

.loc-selection-name {
    grid-area: name;
    font-size: clamp(1.22rem, 1.95vw, 1.62rem);
    color: #e2e8f0;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

.loc-selection-sub,
.loc-selection-altitude,
.loc-selection-coords {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.loc-selection-metrics {
    grid-area: metrics;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: min(236px, 100%);
    justify-content: flex-end;
    margin-left: auto;
    margin-top: 0;
    padding-bottom: 1px;
    padding-left: 0;
    border-left: 0;
    align-self: end;
}

.loc-metric-inline {
    display: grid;
    grid-template-columns: max-content max-content;
    align-items: baseline;
    gap: 6px;
    justify-content: end;
    width: 100%;
    margin-left: 0;
    min-width: 0;
    border-bottom: none;
    padding-bottom: 0;
    white-space: normal;
}

.loc-metric-inline-label {
    font-size: 0.71rem;
    letter-spacing: 0.015em;
    text-transform: none;
    color: var(--text-secondary);
    font-weight: 510;
    line-height: 1.1;
    white-space: nowrap;
    text-align: right;
    justify-self: end;
}

.loc-metric-inline-value {
    --metric-color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 610;
    color: color-mix(in srgb, var(--metric-color) 72%, #cbd5e1);
    line-height: 1.1;
    min-width: 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    text-align: right;
    justify-self: end;
}

.loc-confirm-btn {
    width: 100%;
    margin-top: 6px;
    justify-content: center;
}

.loc-confirm-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#loc-modal .loc-search-panel #loc-results {
    margin-top: 0;
}

@media (min-width: 861px) {
    #loc-modal .modal-content {
        width: min(96vw, 890px);
        max-width: 890px;
    }

    .loc-modal-split {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
        align-items: start;
        column-gap: 12px;
    }

    #loc-modal .loc-search-panel #loc-results {
        max-height: 320px;
    }
}

@media (max-width: 860px) {
    #loc-modal {
        align-items: flex-end;
        justify-content: center;
        padding: 0;
    }

    #loc-modal .modal-content {
        width: min(100vw, 680px);
        max-width: 680px;
        min-height: min(72dvh, 760px);
        max-height: min(92dvh, 920px);
        margin: 0;
        padding: 10px 10px 12px;
        border-radius: 16px 16px 0 0;
        overflow: hidden;
        gap: 8px;
    }

    #loc-modal .modal-header-row {
        position: sticky;
        top: 0;
        z-index: 3;
        margin-bottom: 0;
        padding: 2px 2px 0;
        background: linear-gradient(180deg, rgba(26, 34, 48, 0.98), rgba(26, 34, 48, 0.82));
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .loc-selection-main {
        grid-template-columns: minmax(0, 1fr) minmax(160px, 0.86fr);
        grid-template-areas:
            "name name"
            "details metrics";
        column-gap: 10px;
        row-gap: 4px;
        align-items: start;
    }

    .loc-selection-details {
        align-self: start;
    }

    .loc-selection-metrics {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        width: min(214px, 100%);
        justify-content: initial;
        margin-left: auto;
        margin-top: 0;
        padding-bottom: 0;
        padding-left: 0;
        border-left: 0;
        align-self: start;
    }

    .loc-modal-split {
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-height: 0;
        overflow: hidden;
    }

    .loc-search-panel {
        order: 1;
        min-height: 0;
        gap: 8px;
    }

    .loc-map-panel {
        order: 2;
        display: flex !important;
        padding: 8px;
        border-radius: 10px;
    }

    .loc-map-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .loc-map-canvas {
        height: 132px;
        transition: height 0.18s ease;
    }

    #loc-modal.loc-map-expanded .loc-map-canvas {
        height: 260px;
    }

    #loc-modal .loc-search-panel #loc-results {
        margin-top: 0;
        flex: 1 1 auto;
        min-height: 130px;
        max-height: none;
        overflow-y: auto;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .loc-selection-card {
        gap: 4px;
    }

    .loc-confirm-btn {
        position: sticky;
        bottom: 0;
        z-index: 2;
        margin-top: 4px;
    }
}

/* Block-level loading skeletons (replaces fullscreen overlays) */
.block-skeleton {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    min-height: var(--skeleton-min-height, 120px);
    --skeleton-icon-size: clamp(56px, 18vw, 88px);
    --skeleton-visual-pad: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.block-skeleton>*:not(.block-skeleton-visual) {
    opacity: 0 !important;
    transition: opacity 0.15s ease;
}

.block-skeleton-visual {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--skeleton-visual-pad);
    pointer-events: none;
}

.weather-skeleton-svg {
    width: var(--skeleton-icon-size);
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.block-skeleton::before,
.block-skeleton::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.block-skeleton::before {
    inset: 0;
    background:
        linear-gradient(100deg,
            transparent 0%,
            rgba(255, 255, 255, 0.08) 42%,
            rgba(255, 255, 255, 0.16) 50%,
            rgba(255, 255, 255, 0.08) 58%,
            transparent 100%);
    transform: translateX(-100%);
    animation: blockSkeletonSweep 1.2s linear infinite;
    z-index: 2;
}

.block-skeleton::after {
    inset: 12px;
    border-radius: 10px;
    background:
        repeating-linear-gradient(180deg,
            rgba(255, 255, 255, 0.08) 0 10px,
            transparent 10px 24px);
    opacity: 0.7;
    z-index: 1;
}

.block-skeleton-grid {
    --skeleton-min-height: 360px;
    --skeleton-icon-size: clamp(62px, 20vw, 92px);
}

.block-skeleton-chart {
    --skeleton-min-height: 180px;
    --skeleton-icon-size: clamp(54px, 16vw, 78px);
}

.block-skeleton-heatmap {
    --skeleton-min-height: 150px;
    --skeleton-icon-size: clamp(56px, 16vw, 82px);
}

.block-skeleton-list {
    --skeleton-min-height: 180px;
    --skeleton-icon-size: clamp(52px, 15vw, 76px);
}

.block-skeleton-strip {
    --skeleton-min-height: 44px;
    --skeleton-icon-size: 28px;
    --skeleton-visual-pad: 4px;
}

.block-skeleton-table {
    --skeleton-min-height: 300px;
    --skeleton-icon-size: clamp(58px, 16vw, 84px);
}

@keyframes blockSkeletonSweep {
    to {
        transform: translateX(100%);
    }
}

/* Utilities */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.start-center {
    display: flex;
    align-items: center;
}

.gap-2 {
    gap: 8px;
}

.gap-4 {
    gap: 16px;
}

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.relative {
    position: relative;
}

.chart-box {
    width: 100%;
    height: 180px;
    position: relative;
}

.h3-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Icon Animations */
.icon-spin {
    animation: iconSpin 10s linear infinite;
    transform-origin: center;
}

.icon-float {
    animation: iconFloat 3s ease-in-out infinite;
}

.icon-pulse {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

@keyframes iconPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.text-sec-xs {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.gps-btn {
    width: 100%;
    padding: 10px;
    background: rgba(46, 160, 67, 0.1);
    border: 1px solid rgba(46, 160, 67, 0.3);
    color: #3fb950;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.gps-btn:hover {
    background: rgba(46, 160, 67, 0.2);
}

/* Rich Tooltip Styles */
.info-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    color: var(--text-secondary);
    margin-left: 6px;
    vertical-align: middle;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.info-icon:hover {
    opacity: 1;
    color: var(--accent-color);
}

.tooltip-content {
    visibility: hidden;
    width: 260px;
    background-color: #161b22;
    color: #c9d1d9;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    /* Top positioning */
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    font-size: 0.8rem;
    line-height: 1.4;
    font-weight: 400;
    pointer-events: none;
    text-transform: none;
}

/* Triangle Arrow */
.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--border-color) transparent transparent transparent;
}

.info-icon:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.tooltip-content a,
.tooltip-content a:visited,
.forecast-tooltip a,
.forecast-tooltip a:visited {
    color: #60a5fa !important;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
}

.tooltip-content a:hover {
    border-bottom-color: var(--accent-color);
}

/* Clickable Popover Trigger */
.popover-trigger {
    cursor: pointer;
    border-bottom: 1px dashed var(--text-secondary);
    transition: color 0.2s, border-color 0.2s;
}

.popover-trigger:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.icon-btn:active {
    transform: scale(0.98);
}

.input-row-grid.cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.input-row-grid.cols-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

@media (max-width: 600px) {
    .input-row-grid.cols-3 {
        grid-template-columns: 1fr;
    }

    .input-row-grid.cols-4 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Impact Box Styling */
.tag-btn.toggler.active {
    background: rgba(255, 255, 255, 0.9);
    color: #161b22;
    /* Dark text for contrast */
    border-color: rgba(255, 255, 255, 0.9);
    opacity: 1;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.tag-btn.toggler:not(.active) {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
}

/* Impact Box Styling */
.impact-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.2s ease;
    min-height: 40px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    position: relative;
}

.impact-box.header {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-bottom: 2px;
}

/* Force equal width for impact grid (flex-based) */
.impact-grid>.impact-box {
    flex: 1 1 0;
    min-width: 0;
}

/* Interactive Impact Cards */
.clickable-card {
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: all 0.2s ease;
}

.clickable-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

.clickable-card:active {
    transform: scale(0.98);
}

.clickable-card.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
}

@media (hover: hover) and (pointer: fine) {
    .pace-hover-value {
        cursor: pointer;
        transition: text-shadow 0.15s ease;
    }

    .pace-hover-value:hover {
        text-shadow: 0 0 10px rgba(88, 166, 255, 0.35);
    }
}

/* Fix Pace Card Overflow on Mobile */
.data-row {
    flex-wrap: nowrap;
    gap: 10px;
}

.data-label-group {
    flex: 0 0 auto;
}

.data-value-group {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    /* Ensure it doesn't exceed parent */
    overflow-x: auto;
    overflow-y: hidden;
    /* Scroll if too wide */
    -webkit-overflow-scrolling: touch;
}

.pace-columns-wrap {
    display: flex;
    width: 100%;
    justify-content: flex-end;
}

.pace-columns-track {
    display: grid;
    grid-template-columns: repeat(var(--pace-col-count, 1), minmax(0, 1fr));
    column-gap: 6px;
    align-items: flex-start;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.pace-columns-track.cols-1 {
    width: auto;
    grid-template-columns: auto;
}

.pace-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 58px;
    position: relative;
    padding: 0 3px;
}

.pace-column--with-separator::before {
    content: "";
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.pace-col-label {
    font-size: 0.64em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.62;
    margin-bottom: 2px;
}

.pace-col-label--base {
    opacity: 0.42;
}

.pace-distance-value {
    font-size: 0.78em;
    opacity: 0.82;
    margin-top: 2px;
}

.pace-hover-value {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.pace-hover-value:focus,
.pace-hover-value:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* On very small screens, stack them */
@media (max-width: 400px) {
    .data-value-group {
        width: auto;
        text-align: right;
    }

    /* Keep right alignment in compact screens as requested. */
    .data-value>div,
    .pace-columns-wrap--single {
        justify-content: flex-end !important;
    }

    .pace-columns-wrap--multi {
        justify-content: flex-end !important;
    }
}

@media (max-width: 860px) {
    .pace-columns-wrap--multi {
        justify-content: flex-end;
        overflow: visible;
    }

    .pace-columns-wrap--multi .pace-columns-track {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        grid-template-columns: repeat(var(--pace-col-count, 1), minmax(0, 1fr));
        column-gap: 6px;
    }

    .pace-carousel {
        width: 100%;
    }

    .pace-carousel-track {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .pace-carousel-track::-webkit-scrollbar {
        display: none;
    }

    .pace-carousel-slide {
        flex: 0 0 100%;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        min-width: 0;
    }

    .pace-carousel-slide .pace-columns-wrap {
        justify-content: flex-end;
    }

    .pace-carousel-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-top: 8px;
    }

    .pace-carousel-dot {
        width: 6px;
        height: 6px;
        border-radius: 999px;
        border: 0;
        background: rgba(255, 255, 255, 0.28);
        padding: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .pace-carousel-dot.is-active {
        width: 14px;
        background: rgba(88, 166, 255, 0.86);
    }

    .pace-carousel-dot:focus,
    .pace-carousel-dot:focus-visible {
        outline: none;
        box-shadow: none;
    }
}

@media (min-width: 861px) {
    .data-value-group {
        overflow-x: hidden;
    }

    .pace-columns-track {
        column-gap: 4px;
    }

    .pace-columns-track.cols-4 .pace-column {
        min-width: 46px;
        padding: 0 1px;
    }

    .pace-columns-track.cols-5 .pace-column {
        min-width: 38px;
        padding: 0 1px;
    }

    .pace-columns-track.cols-4 .pace-hover-value,
    .pace-columns-track.cols-5 .pace-hover-value {
        font-size: 0.83em !important;
        letter-spacing: -0.01em;
    }

    .pace-columns-track.cols-4 .pace-distance-value,
    .pace-columns-track.cols-5 .pace-distance-value {
        font-size: 0.62em;
    }

    .pace-columns-track.cols-4 .pace-col-label,
    .pace-columns-track.cols-5 .pace-col-label {
        font-size: 0.5em;
    }
}

/* Reduce font size on mobile to prevent clipping */
@media (max-width: 600px) {
    .data-value {
        font-size: 0.95rem;
        /* Reduced from 1.1rem */
    }

    /* Even smaller for very narrow screens */
    @media (max-width: 370px) {
        .data-value {
            font-size: 0.85rem;
        }
    }
}

/* Further reduce font size and letter spacing for mobile */
@media (max-width: 600px) {
    .data-value {
        font-size: 0.85rem !important;
        /* Aggressive reduction */
        letter-spacing: -0.5px;
        /* Compact text */
    }
}

@media (max-width: 370px) {
    .data-value {
        font-size: 0.75rem !important;
        /* Tiny for small phones */
    }
}

/* GitHub Footer */
.github-footer {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    margin-bottom: 20px;
    padding-bottom: env(safe-area-inset-bottom);
}

.github-link {
    color: var(--text-primary);
    opacity: 0.3;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.github-link:hover {
    opacity: 0.8;
}

/* Radio Button Styling */
.settings-unit-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.settings-radio-pill {
    flex: 1;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.settings-radio-pill input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.settings-radio-pill span {
    display: block;
    text-align: center;
    padding: 9px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.radio-label input:checked+span {
    color: var(--accent-color);
    font-weight: 700;
}

.radio-label:has(input:checked) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(88, 166, 255, 0.45);
}

/* Premium Modal Styling (Shared) */
.premium-modal {
    max-width: 340px;
    padding: 24px;
    background: linear-gradient(145deg, #161b22, #0d1117);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.settings-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 6px;
}

.settings-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 36px 10px 12px;
    font-size: 0.95rem;
    color: #fff;
    transition: all 0.2s ease;
    -moz-appearance: textfield;
    appearance: textfield;
}

.settings-input::-webkit-inner-spin-button,
.settings-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.settings-input:focus {
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

select.settings-input {
    padding-right: 12px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.unit-suffix {
    position: absolute;
    right: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    pointer-events: none;
}

.settings-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.settings-label svg {
    opacity: 0.6;
}

.settings-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-helper {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.4;
}

/* Robust Fix for Mobile Input Alignment */
.input-row-grid .floating-input-group {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.input-row-grid .floating-input-group input {
    margin-top: auto !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pace-card,
.result-card,
.weather-card,
.impact-box {
    animation: fadeInUp 0.4s ease-out forwards;
}

/* Stagger Animations */
.result-card:nth-child(1) {
    animation-delay: 0.05s;
}

.result-card:nth-child(2) {
    animation-delay: 0.1s;
}

.result-card:nth-child(3) {
    animation-delay: 0.15s;
}


/* Weather Map Styles */
.weather-map-card .map-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 0 4px;
}

.map-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

.map-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    border: 2px solid #1f2937;
}

/* MapLibre Dark Override */
.maplibregl-map {
    background: #111 !important;
    font-family: var(--font-main) !important;
}

.loc-map-panel .maplibregl-ctrl-top-right {
    top: 10px;
    right: 10px;
}

.loc-map-panel .maplibregl-ctrl-group {
    border-radius: 12px !important;
    overflow: hidden;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.88), rgba(30, 41, 59, 0.78)) !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    box-shadow: 0 8px 22px rgba(2, 8, 23, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(8px);
}

.loc-map-panel .maplibregl-ctrl-group button {
    width: 36px;
    height: 36px;
    background: transparent !important;
    border: 0 !important;
    color: #dbeafe !important;
    transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.loc-map-panel .maplibregl-ctrl-group button+button {
    border-top: 1px solid rgba(148, 163, 184, 0.2) !important;
}

.loc-map-panel .maplibregl-ctrl-group button .maplibregl-ctrl-icon {
    filter: brightness(0) invert(1) opacity(0.88);
    transition: filter 0.14s ease;
}

.loc-map-panel .maplibregl-ctrl-group button:hover {
    background: rgba(96, 165, 250, 0.22) !important;
    color: #ffffff !important;
}

.loc-map-panel .maplibregl-ctrl-group button:hover .maplibregl-ctrl-icon {
    filter: brightness(0) invert(1) opacity(1);
}

.loc-map-panel .maplibregl-ctrl-group button:active {
    transform: scale(0.96);
}

.loc-map-panel .maplibregl-ctrl-group button:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.9);
    outline-offset: -2px;
}

.maplibregl-ctrl-attrib {
    background: rgba(3, 7, 18, 0.58) !important;
    color: #9ca3af !important;
    backdrop-filter: blur(4px);
}

.maplibregl-ctrl-attrib a {
    color: #93c5fd !important;
}

/* Utility: Gradient Text */
.text-gradient-primary {
    background: linear-gradient(135deg, #fff 30%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.1));
}

/* Animated Gradient Border for Cards */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* Refined Card Border (Static & Subtle) */
.card-glow-border {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    /* Base border */
    background-clip: padding-box;
    /* Ensure border doesn't overlap bg */
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-glow-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 13px;
    /* Slightly larger than card */
    padding: 1px;
    /* Static Gradient: Accent top-left to transparent bottom-right */
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.4), rgba(255, 255, 255, 0.05) 40%, transparent);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
    opacity: 0.6;
}

.card-glow-border:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3), 0 0 15px rgba(88, 166, 255, 0.1);
}

.card-glow-border:hover::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.6), rgba(88, 166, 255, 0.1) 50%, transparent);
}

@keyframes spinBorder {
    to {
        --angle: 360deg;
    }
}

/* Utility: Shimmer Loading Skeleton */
.skeleton-shimmer {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Utility: Pulsing Status Indicator */
.status-pulse {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.status-pulse::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #10b981;
    /* Emerald-500 */
    border-radius: 50%;
    margin-left: 8px;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* --- BATCH 2 AESTHETIC IMPROVEMENTS --- */

/* 1. Glassmorphism Tooltips */
.forecast-tooltip {
    position: fixed;
    background: rgba(22, 27, 34, 0.85);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 9999;
    display: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.2s, transform 0.2s;
}

.tooltip-header {
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--accent-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

/* 3. Fading Divider Utility */
.divider-fade {
    height: 1px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 100%);
    border: none;
    margin: 16px 0;
}

/* 4. Modern Table Styling (Zebra + Highlight) */
.forecast-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
    font-size: 0.85rem;
}

.forecast-table th {
    text-align: left;
    padding: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: color 0.2s;
}

.forecast-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    vertical-align: middle;
}

/* Zebra Striping (Subtle) */
.forecast-table tr:nth-child(even) td {
    background-color: rgba(255, 255, 255, 0.015);
}

/* Row Highlight */
.forecast-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.04);
}

/* 5. Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    background-color: rgba(255, 255, 255, 0.3);
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.tag-btn,
.tab-btn,
.btn,
.insight-btn {
    overflow: hidden;
    /* Contain ripple */
    position: relative;
    /* For absolute ripple */
}

/* 6. Elegant Toast Notification */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: rgba(22, 27, 34, 0.9);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    justify-content: center;

    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Weather Icons in Table */
.weather-icon-sm {
    width: 16px;
    height: 16px;
    fill: currentColor;
    vertical-align: middle;
    margin-right: 2px;
    opacity: 0.8;
}

/* Drops & Menus */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    width: 240px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

.dropdown-header {
    padding: 8px 12px;
    font-size: 0.7em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.5px;
}

.dropdown-item {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item .sub {
    font-size: 0.75em;
    color: var(--text-secondary);
}

.dropdown-item-search {
    color: var(--accent-color);
    font-weight: 500;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.star-active svg {
    fill: #eab308;
    /* Yellow-500 */
    stroke: #eab308;
}

/* Floating Action Button (Refresh) */
.fab-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
    /* Only show on Conditions tab by default, toggled via JS */
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.fab-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.fab-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.fab-btn:hover {
    background: var(--accent-light);
    /* fallback if accent-light not defined, brightness filter ok */
    filter: brightness(1.1);
}

.fab-spin svg {
    animation: spin 1s linear infinite;
}

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

@media (max-width: 600px) {
    .fab-btn {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }
}

/* Hide FAB on Desktop */
@media (min-width: 601px) {
    .fab-btn {
        display: none !important;
    }
}

/* Monthly Averages Row */
.monthly-row:last-child {
    border-bottom: none !important;
}

.monthly-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

:root {
    --input-bg: #21262d;
}

/* Toggle Button (Segmented Control) */
.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    color: var(--text-primary);
}

.toggle-btn.active {
    background: var(--card-bg);
    /* Use card bg to "lift" it from input-bg container */
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

/* ========================================
   Monthly Averages Enhancements
   ======================================== */

/* Animation for monthly rows - stagger entrance */
@keyframes monthlyRowSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}




/* Smooth transitions */
.monthly-row {
    transition: background 0.2s ease, transform 0.2s ease;
}

.monthly-row:hover {
    transform: translateX(2px);
    background: rgba(255, 255, 255, 0.03) !important;
}

/* ===== Phase 3: Extracted Inline Styles ===== */

.forecast-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.chart-toggle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.chart-toggle-header:focus,
.chart-toggle-header:focus-visible {
    outline: none;
    box-shadow: none;
}

.chart-toggle-icon {
    transition: transform 0.2s;
    color: var(--text-secondary);
}

.chart-wrapper {
    margin-top: 20px;
    transition: all 0.3s ease-out;
    overflow: hidden;
}

.chart-placeholder {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding-top: 60px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
    font-size: 0.75rem;
}

.flex-center {
    display: flex;
    align-items: center;
}

.location-search-btn {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2px 8px 2px 4px;
}

.location-search-icon {
    padding: 6px;
    color: var(--text-secondary);
}

.location-name-btn {
    background: transparent;
    border: none;
    margin: 0;
    padding-left: 4px;
}

.location-subtitle {
    font-size: 0.7em;
    opacity: 0.6;
}

.fav-star-btn {
    cursor: pointer;
    opacity: 0.5;
    margin-left: 4px;
    display: inline-flex;
    vertical-align: middle;
}

.dropdown-menu-right {
    display: none;
    right: 0;
    left: auto;
}

.heatmap-legend {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    align-items: center;
    flex-wrap: wrap;
}

.table-heading-no-margin {
    margin-bottom: 0;
}

.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.legend-dot {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-dot-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot-line {
    width: 8px;
    height: 2px;
}

.text-left {
    text-align: left;
}

.location-chevron {
    margin-left: 6px;
    opacity: 0.5;
}

/* ===== Phase 6: Aesthetic Refresh ===== */

:root {
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-md: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.375rem;
    --fs-2xl: 1.8rem;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --radius-md: 12px;
    --radius-lg: 14px;
    --dur-fast: 130ms;
    --dur-mid: 220ms;
    --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
    --surface-elev-1: linear-gradient(165deg, rgba(31, 40, 53, 0.56), rgba(22, 27, 34, 0.88));
    --surface-elev-2: linear-gradient(170deg, rgba(35, 45, 60, 0.72), rgba(18, 24, 33, 0.92));
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.26);

    --state-ideal: #4ade80;
    --state-good: #facc15;
    --state-fair: #fb923c;
    --state-warning: #f87171;
    --state-severe: #c084fc;
    --state-ideal-bg: rgba(74, 222, 128, 0.16);
    --state-good-bg: rgba(250, 204, 21, 0.16);
    --state-fair-bg: rgba(251, 146, 60, 0.16);
    --state-warning-bg: rgba(248, 113, 113, 0.16);
    --state-severe-bg: rgba(192, 132, 252, 0.18);
}

body {
    font-size: var(--fs-md);
    line-height: 1.5;
    letter-spacing: 0.01em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

h1 {
    font-size: var(--fs-2xl);
    font-weight: 760;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.subtitle {
    font-size: var(--fs-sm);
    letter-spacing: 0.01em;
}

.tab-btn {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
}

.modern-label,
.card-title,
.table-wrapper .forecast-table th {
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.09em;
}

.data-label,
.h3-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
}

.data-value,
.forecast-pace-line,
.impact-badge--compact,
.vdot-gauge-value,
.forecast-timeline,
.climate-time-line {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

.card,
.modern-input-card,
.forecast-card,
.table-wrapper,
.modal-content,
.location-search-btn {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--surface-elev-1);
    box-shadow: var(--shadow-soft);
}

.forecast-card,
.modern-input-card,
.card {
    position: relative;
    overflow: hidden;
}

.forecast-card::after,
.modern-input-card::after,
.card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, rgba(88, 166, 255, 0.06), transparent 35%);
    pointer-events: none;
}

.card-title,
.h3-title,
#tab-climate .forecast-card>h3 {
    position: relative;
    padding-left: 12px;
}

.card-title::before,
.h3-title::before,
#tab-climate .forecast-card>h3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.15em;
    bottom: 0.15em;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent-color), rgba(88, 166, 255, 0.25));
}

.vdot-box {
    background: linear-gradient(145deg, #2a3444 0%, #1b2432 58%, #17212f 100%);
    border: 1px solid rgba(88, 166, 255, 0.18);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 26px rgba(5, 10, 18, 0.48);
    cursor: default;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--dur-mid) var(--ease-standard),
        box-shadow var(--dur-mid) var(--ease-standard),
        border-color var(--dur-mid) var(--ease-standard);
}

.vdot-box.vdot-expanded {
    background: linear-gradient(135deg, #1f6feb 0%, #238636 100%);
    border-color: rgba(88, 166, 255, 0.28);
    box-shadow: 0 12px 30px rgba(31, 111, 235, 0.26);
}

.vdot-box>.vdot-header {
    border-radius: calc(var(--radius-lg) - 2px);
    background: var(--surface-elev-2);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.forecast-table thead th {
    background: rgba(17, 23, 32, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.forecast-table tbody tr {
    transition: background-color var(--dur-fast) var(--ease-standard);
}

.forecast-table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.05);
}

.impact-low {
    background: var(--state-ideal-bg);
    color: var(--state-ideal);
}

.impact-med {
    background: var(--state-good-bg);
    color: var(--state-good);
}

.impact-high {
    background: var(--state-warning-bg);
    color: var(--state-warning);
}

.impact-badge--compact {
    border: 1px solid transparent;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.impact-badge--ideal {
    border-color: rgba(74, 222, 128, 0.5);
}

.impact-badge--good {
    border-color: rgba(250, 204, 21, 0.5);
}

.impact-badge--fair {
    border-color: rgba(251, 146, 60, 0.5);
}

.impact-badge--warning {
    border-color: rgba(248, 113, 113, 0.5);
}

.impact-badge--severe {
    border-color: rgba(192, 132, 252, 0.55);
}

.legend-state-ideal {
    color: var(--state-ideal);
}

.legend-state-good {
    color: var(--state-good);
}

.legend-state-fair {
    color: var(--state-fair);
}

.legend-state-warning {
    color: var(--state-warning);
}

.legend-state-severe {
    color: var(--state-severe);
}

.legend-state-ideal .legend-sub,
.legend-state-good .legend-sub,
.legend-state-fair .legend-sub,
.legend-state-warning .legend-sub,
.legend-state-severe .legend-sub {
    color: var(--text-secondary);
}

.tab-btn,
.tag-btn,
.modern-button,
.copy-btn,
.icon-btn,
.clickable-card,
.legend-item--interactive,
.location-btn,
.location-item,
.loc-item,
.dropdown-item,
.chart-toggle-header {
    transition:
        transform var(--dur-fast) var(--ease-standard),
        box-shadow var(--dur-mid) var(--ease-standard),
        border-color var(--dur-mid) var(--ease-standard),
        background-color var(--dur-mid) var(--ease-standard),
        color var(--dur-mid) var(--ease-standard),
        opacity var(--dur-mid) var(--ease-standard);
}

.tab-btn:hover,
.tag-btn:hover,
.modern-button:hover,
.copy-btn:hover,
.icon-btn:hover,
.clickable-card:hover,
.legend-item--interactive:hover,
.location-item:hover,
.loc-item:hover,
.dropdown-item:hover {
    transform: translateY(-1px);
}

.tab-btn:active,
.tag-btn:active,
.modern-button:active,
.icon-btn:active,
.clickable-card:active {
    transform: translateY(0) scale(0.985);
}

.tab-btn:focus-visible,
.tag-btn:focus-visible,
.modern-button:focus-visible,
.icon-btn:focus-visible,
.location-btn:focus-visible,
.copy-btn:focus-visible,
.clickable-card:focus-visible {
    outline: 2px solid rgba(88, 166, 255, 0.9);
    outline-offset: 2px;
}

.impact-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
}

@media (max-width: 760px) {
    .container {
        padding: 14px 12px;
    }

    .tab-nav {
        position: sticky;
        top: 6px;
        z-index: 30;
        background: rgba(22, 27, 34, 0.9);
        backdrop-filter: blur(8px);
    }

    .table-wrapper {
        max-height: min(58vh, 440px);
        overflow-y: auto;
        overflow-x: hidden;
    }

    .forecast-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
        font-size: 0.74rem;
    }

    .forecast-table th,
    .forecast-table td {
        padding: 7px 4px;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Climate table: avoid oversized first column (inline width:35%) and rebalance all columns. */
    #tab-climate .forecast-table th:nth-child(1),
    #tab-climate .forecast-table td:nth-child(1) {
        width: 24% !important;
    }

    #tab-climate .forecast-table th:nth-child(2),
    #tab-climate .forecast-table td:nth-child(2),
    #tab-climate .forecast-table th:nth-child(3),
    #tab-climate .forecast-table td:nth-child(3),
    #tab-climate .forecast-table th:nth-child(4),
    #tab-climate .forecast-table td:nth-child(4),
    #tab-climate .forecast-table th:nth-child(5),
    #tab-climate .forecast-table td:nth-child(5) {
        width: 14%;
    }

    #tab-climate .forecast-table th:nth-child(6),
    #tab-climate .forecast-table td:nth-child(6) {
        width: 20%;
    }

    #tab-climate .forecast-table th:not(:first-child),
    #tab-climate .forecast-table td:not(:first-child) {
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }

    .forecast-time-cell,
    .climate-time-cell {
        white-space: normal;
    }

    .forecast-dayline {
        flex-wrap: wrap;
        font-size: 0.68em;
        line-height: 1.15;
    }

    .forecast-timeline,
    .climate-time-line {
        font-size: 0.9em;
    }

    .forecast-rain-main,
    .forecast-rain-prob,
    .forecast-wind-dir-wrap,
    .forecast-wind-unit,
    .climate-wind-unit {
        font-size: 0.65em;
    }

    .impact-badge--compact {
        font-size: 0.64em;
        padding: 2px 5px;
        min-width: 0;
    }

    .chart-legend {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    h1 {
        font-size: 1.5rem;
    }

    .tab-btn {
        font-size: var(--fs-xs);
        padding: 8px 4px;
    }

    .impact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .forecast-table {
        font-size: 0.68rem;
    }

    .forecast-table th,
    .forecast-table td {
        padding: 6px 3px;
    }

    #tab-climate .forecast-table th:nth-child(1),
    #tab-climate .forecast-table td:nth-child(1) {
        width: 25% !important;
    }

    #tab-climate .forecast-table th:nth-child(2),
    #tab-climate .forecast-table td:nth-child(2),
    #tab-climate .forecast-table th:nth-child(3),
    #tab-climate .forecast-table td:nth-child(3),
    #tab-climate .forecast-table th:nth-child(4),
    #tab-climate .forecast-table td:nth-child(4),
    #tab-climate .forecast-table th:nth-child(5),
    #tab-climate .forecast-table td:nth-child(5) {
        width: 13.5%;
    }

    #tab-climate .forecast-table th:nth-child(6),
    #tab-climate .forecast-table td:nth-child(6) {
        width: 21%;
    }
}

@media (max-width: 380px) {
    .impact-grid {
        grid-template-columns: 1fr !important;
    }

    .forecast-table {
        font-size: 0.64rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ===== Micro Polish Pass ===== */

:root {
    --radius-md: 12px;
    --radius-lg: 12px;
}

.card,
.modern-input-card,
.forecast-card,
.table-wrapper,
.vdot-box,
.vdot-box>.vdot-header {
    border-radius: var(--radius-lg);
}

.card,
.modern-input-card,
.forecast-card,
.table-wrapper,
.modal-content,
.location-search-btn {
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
}

.card:hover,
.modern-input-card:hover,
.forecast-card:hover,
.table-wrapper:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.card,
.modern-input-card,
.forecast-card,
.table-wrapper,
.vdot-box {
    margin-bottom: 16px;
}

.card-title,
.h3-title,
#tab-climate .forecast-card>h3 {
    padding-left: 10px;
}

.card-title::before,
.h3-title::before,
#tab-climate .forecast-card>h3::before {
    width: 2px;
    top: 0.24em;
    bottom: 0.24em;
    opacity: 0.92;
}

.table-wrapper .forecast-table th,
.forecast-table th {
    letter-spacing: 0.03em;
}

.impact-badge--compact {
    padding: 1px 6px;
    border-radius: 999px;
}

.forecast-tooltip {
    line-height: 1.45;
}

.tooltip-header {
    font-weight: 600;
}

.tab-btn {
    transition:
        background-color 110ms cubic-bezier(0.28, 0.72, 0.4, 1),
        color 110ms cubic-bezier(0.28, 0.72, 0.4, 1),
        box-shadow 110ms cubic-bezier(0.28, 0.72, 0.4, 1),
        transform 110ms cubic-bezier(0.28, 0.72, 0.4, 1);
}

.tab-btn.active {
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.24);
}

@media (max-width: 760px) {

    .subtitle,
    .data-sub,
    .legend-sub,
    .location-subtitle,
    .forecast-dayline,
    .climate-date-line,
    .text-sec-xs {
        color: rgba(201, 209, 217, 0.72);
        opacity: 1;
    }

    .impact-badge--compact {
        padding: 1px 6px;
    }
}

@media (max-width: 520px) {

    .table-wrapper .forecast-table th,
    .forecast-table th {
        letter-spacing: 0.02em;
    }
}

/* ===== Phase: Essential Aesthetic Overhaul ===== */

:root {
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --font-display: 'Sora', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --font-mono-ui: 'JetBrains Mono', 'Var', 'Courier New', monospace;
    --space-1: 6px;
    --space-2: 10px;
    --space-3: 14px;
    --space-4: 18px;
    --space-5: 24px;
    --motion-fast: 120ms;
    --motion-mid: 220ms;
    --motion-slow: 360ms;
    --motion-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
    --motion-spring: cubic-bezier(0.16, 1, 0.3, 1);

    --risk-ideal: #4ade80;
    --risk-good: #facc15;
    --risk-fair: #fb923c;
    --risk-warning: #f87171;
    --risk-severe: #c084fc;
    --risk-ideal-surface: rgba(74, 222, 128, 0.17);
    --risk-good-surface: rgba(250, 204, 21, 0.17);
    --risk-fair-surface: rgba(251, 146, 60, 0.17);
    --risk-warning-surface: rgba(248, 113, 113, 0.17);
    --risk-severe-surface: rgba(192, 132, 252, 0.2);
}

body {
    font-family: var(--font-body);
}

h1,
h2,
h3,
.card-title,
.h3-title,
.modal-title {
    font-family: var(--font-display);
}

h1 {
    font-weight: 780;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.subtitle {
    font-size: 0.88rem;
    letter-spacing: 0.01em;
}

.table-wrapper .forecast-table th,
.forecast-table th,
.vdot-label,
.modern-label,
.settings-section-label {
    letter-spacing: 0.055em;
}

.data-value,
.vdot-val,
.vdot-gauge-value,
.forecast-pace-line,
.impact-badge,
.impact-badge--compact {
    font-family: var(--font-mono-ui);
}

/* Data cockpit panels */
.card,
.modern-input-card,
.forecast-card,
.table-wrapper,
.insight-banner,
.modal-content {
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(88, 166, 255, 0.12), transparent 48%),
        linear-gradient(165deg, rgba(21, 28, 38, 0.95), rgba(14, 20, 29, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.085);
    box-shadow:
        0 14px 38px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(6px);
    position: relative;
    overflow: hidden;
}

.card::before,
.modern-input-card::before,
.forecast-card::before,
.table-wrapper::before,
.insight-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.06), transparent 22%),
        repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 255, 255, 0.012) 18px 19px);
    opacity: 0.7;
}

.card>*,
.modern-input-card>*,
.forecast-card>*,
.table-wrapper>*,
.insight-banner>* {
    position: relative;
    z-index: 1;
}

.card-title,
.h3-title,
#tab-climate .forecast-card>h3 {
    margin-bottom: 14px;
}

.card-title::before,
.h3-title::before,
#tab-climate .forecast-card>h3::before {
    background: linear-gradient(180deg, #7dd3fc, #3b82f6);
}

.insight-banner {
    border-left: 3px solid var(--accent-color);
}

/* Semantic risk palette across widgets */
.impact-badge--ideal,
.legend-state-ideal {
    color: var(--risk-ideal);
}

.impact-badge--good,
.legend-state-good {
    color: var(--risk-good);
}

.impact-badge--fair,
.legend-state-fair {
    color: var(--risk-fair);
}

.impact-badge--warning,
.legend-state-warning {
    color: var(--risk-warning);
}

.impact-badge--severe,
.legend-state-severe {
    color: var(--risk-severe);
}

.impact-badge--ideal {
    background: var(--risk-ideal-surface);
    border-color: rgba(74, 222, 128, 0.48);
}

.impact-badge--good {
    background: var(--risk-good-surface);
    border-color: rgba(250, 204, 21, 0.48);
}

.impact-badge--fair {
    background: var(--risk-fair-surface);
    border-color: rgba(251, 146, 60, 0.5);
}

.impact-badge--warning {
    background: var(--risk-warning-surface);
    border-color: rgba(248, 113, 113, 0.5);
}

.impact-badge--severe {
    background: var(--risk-severe-surface);
    border-color: rgba(192, 132, 252, 0.54);
}

.legend-color--dynamic {
    border-radius: 999px;
    width: 12px;
    height: 12px;
}

.legend-item {
    padding: 4px 8px;
    border-radius: 8px;
}

/* Premium mobile-first layout */
@media (max-width: 860px) {
    .container {
        max-width: 100%;
        padding: 14px 10px;
    }

    .tab-nav {
        position: sticky;
        top: 6px;
        z-index: 60;
        gap: 6px;
        padding: 6px;
        border-radius: 14px;
        background: rgba(15, 22, 32, 0.86);
        backdrop-filter: blur(12px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
    }

    .tab-btn {
        border-radius: 10px;
        min-height: 38px;
    }

    #tab-current .header,
    #tab-forecast16 .header,
    #tab-climate .header {
        flex-wrap: wrap;
        row-gap: 8px;
        align-items: flex-start;
    }

    #tab-current .location-group,
    #tab-forecast16 .location-group,
    #tab-climate .location-group {
        margin-left: 0;
    }

    .forecast-card,
    .modern-input-card,
    .card,
    .table-wrapper {
        margin-bottom: 14px;
    }
}

@media (max-width: 600px) {
    .forecast-table {
        font-size: 0.7rem;
    }

    .forecast-table th,
    .forecast-table td {
        padding: 6px 3px;
    }

    .impact-badge--compact {
        font-size: 0.62em;
    }
}

/* Motion system */
@keyframes panelRiseIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.996);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes subtlePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(88, 166, 255, 0.18);
    }

    70% {
        box-shadow: 0 0 0 7px rgba(88, 166, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(88, 166, 255, 0);
    }
}

.card,
.modern-input-card,
.forecast-card,
.insight-banner {
    animation: panelRiseIn var(--motion-slow) var(--motion-spring) both;
}

/* Keep Climate tab width visually stable while content/skeleton swaps. */
#tab-climate .forecast-card,
#tab-climate .table-wrapper {
    animation: none !important;
    transform: none !important;
}

.tab-btn,
.tag-btn,
.modern-button,
.icon-btn,
.legend-item--interactive,
.location-btn,
.dropdown-item,
.clickable-card {
    transition:
        transform var(--motion-fast) var(--motion-ease),
        box-shadow var(--motion-mid) var(--motion-ease),
        background-color var(--motion-mid) var(--motion-ease),
        color var(--motion-mid) var(--motion-ease),
        border-color var(--motion-mid) var(--motion-ease);
}

.tab-btn.active,
.modern-button:hover {
    animation: subtlePulse 1.6s ease-out;
}

@media (prefers-reduced-motion: reduce) {

    .card,
    .modern-input-card,
    .forecast-card,
    .insight-banner,
    .tab-btn.active,
    .modern-button:hover {
        animation: none !important;
    }
}

/* ===== Glassmorphism Refinement + Table Scroll Fix ===== */
:root {
    --glass-panel-bg:
        linear-gradient(138deg, rgba(28, 40, 56, 0.58), rgba(16, 24, 36, 0.5));
    --glass-panel-bg-strong:
        linear-gradient(145deg, rgba(24, 35, 50, 0.8), rgba(13, 20, 31, 0.72));
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-border-soft: rgba(255, 255, 255, 0.11);
    --glass-shadow:
        0 16px 38px rgba(5, 10, 20, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --glass-blur: 16px;
}

.tab-nav,
.card,
.modern-input-card,
.forecast-card,
.table-wrapper,
.location-search-btn,
.modal-content {
    background: var(--glass-panel-bg);
    border: 1px solid var(--glass-border-soft);
    box-shadow: var(--glass-shadow);
    backdrop-filter: saturate(145%) blur(var(--glass-blur));
    -webkit-backdrop-filter: saturate(145%) blur(var(--glass-blur));
}

.tab-nav,
.location-search-btn,
.modal-content {
    background: var(--glass-panel-bg-strong);
    border-color: var(--glass-border);
}

.card::before,
.modern-input-card::before,
.forecast-card::before,
.table-wrapper::before,
.insight-banner::before {
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02) 28%, transparent 56%),
        repeating-linear-gradient(95deg, transparent 0 20px, rgba(255, 255, 255, 0.012) 20px 21px);
    opacity: 0.72;
}

.forecast-table thead th {
    background: rgba(13, 20, 31, 0.74);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.table-wrapper {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.42);
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.62);
}

/* ===== Minimalist Theme Pass ===== */
:root {
    --minimal-bg: #0f141b;
    --minimal-surface: #151c25;
    --minimal-surface-strong: #1a2230;
    --minimal-border: rgba(255, 255, 255, 0.09);
    --minimal-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

body {
    background-color: var(--minimal-bg);
    background-image: none;
}

h1,
h2,
h3,
.card-title,
.h3-title,
.modal-title,
.modern-label,
.settings-section-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    text-shadow: none;
}

h1 {
    font-weight: 700;
    letter-spacing: -0.015em;
}

.subtitle {
    color: rgba(201, 209, 217, 0.76);
}

.tab-nav,
.card,
.modern-input-card,
.forecast-card,
.table-wrapper,
.location-search-btn,
.modal-content,
.vdot-box,
.vdot-box>.vdot-header {
    background: var(--minimal-surface);
    border: 1px solid var(--minimal-border);
    border-radius: 10px;
    box-shadow: var(--minimal-shadow);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.tab-nav,
.location-search-btn,
.modal-content,
.vdot-box>.vdot-header {
    background: var(--minimal-surface-strong);
}

.card::before,
.card::after,
.modern-input-card::before,
.modern-input-card::after,
.forecast-card::before,
.forecast-card::after,
.table-wrapper::before,
.table-wrapper::after,
.insight-banner::before,
.insight-banner::after {
    content: none;
}

.card-title,
.h3-title,
#tab-climate .forecast-card>h3 {
    padding-left: 0;
}

.card-title::before,
.h3-title::before,
#tab-climate .forecast-card>h3::before {
    display: none;
}

.forecast-table thead th {
    background: #18202a;
    border-bottom: 1px solid var(--minimal-border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.forecast-table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.025);
}

.table-wrapper {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.45);
}

.tab-btn,
.tag-btn,
.modern-button,
.icon-btn,
.legend-item--interactive,
.location-btn,
.dropdown-item,
.clickable-card {
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
    transform: none !important;
}

.tab-btn.active,
.modern-button:hover,
.card,
.modern-input-card,
.forecast-card,
.insight-banner {
    animation: none !important;
}

.tab-btn.active {
    box-shadow: none;
    background: rgba(88, 166, 255, 0.15);
    border: 1px solid rgba(88, 166, 255, 0.25);
}

/* Mobile tooltip fallback: bottom sheet */
.forecast-tooltip-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: 9998;
    opacity: 0;
    display: none;
    transition: opacity 140ms ease;
}

.forecast-tooltip-backdrop.active {
    opacity: 1;
}

.forecast-tooltip--sheet {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(60vh, 520px);
    overflow-y: auto;
    border-radius: 12px;
    padding: 12px 14px 14px;
    pointer-events: auto !important;
    z-index: 10000;
}

.tooltip-content-body {
    font-size: 0.86em;
    opacity: 0.94;
    line-height: 1.5;
    padding-right: 28px;
}

/* ===== Phase 4: Semantic UI Classes ===== */
.info-tooltip-trigger {
    cursor: pointer;
    opacity: 0.56;
    display: inline-flex;
    vertical-align: middle;
    color: var(--text-secondary);
    transition: opacity 120ms ease, color 120ms ease;
}

.info-tooltip-trigger:hover {
    opacity: 0.95;
    color: var(--text-primary);
}

.info-tooltip-trigger--inline {
    margin-left: 4px;
}

.info-tooltip-trigger--card-corner {
    position: absolute;
    top: 4px;
    right: 4px;
    margin-left: 0;
}

.tooltip-row--divider {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #374151;
}

.tooltip-val--temp {
    color: #fff;
}

.tooltip-val--dew {
    color: #60a5fa;
}

.tooltip-val--rain {
    color: #60a5fa;
}

.tooltip-val--prob {
    color: #93c5fd;
}

.tooltip-val--wind {
    color: #c084fc;
}

.tooltip-val--dir {
    color: #e9d5ff;
}

.tooltip-val--impact {
    color: var(--tooltip-impact-color, var(--accent-color));
}

.forecast-tooltip--training-model {
    width: auto;
    min-width: 360px;
    max-width: min(92vw, 520px);
}

.forecast-tooltip--sheet.forecast-tooltip--training-model {
    min-width: 0 !important;
    max-width: none !important;
}

.threshold-tooltip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
    line-height: 1.35;
}

.threshold-tooltip-table th,
.threshold-tooltip-table td {
    padding: 2px 4px;
    white-space: nowrap;
}

.threshold-tooltip-table thead th {
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.64rem;
    font-weight: 600;
    text-align: right;
}

.threshold-tooltip-table thead th:first-child,
.threshold-tooltip-table tbody th {
    text-align: left;
}

.threshold-tooltip-table tbody th {
    color: #e5e7eb;
    font-weight: 600;
    padding-right: 8px;
}

.threshold-tooltip-table tbody td {
    text-align: right;
    color: #dbe2f0;
    font-weight: 600;
}

.threshold-tooltip-table tbody td:last-child {
    color: #94a3b8;
}

.forecast-table td.forecast-cell-color {
    color: var(--cell-fg, var(--text-primary));
}

.impact-status-card {
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    padding-left: 12px;
}

.impact-status-copy {
    line-height: 1.32;
}

.impact-note-line {
    line-height: 1.32;
}

.impact-note-line--spaced {
    margin-bottom: 4px;
}

.impact-note-value {
    color: var(--impact-note-color, var(--text-primary));
}

.impact-note-value--headwind {
    color: #f87171;
}

.impact-note-value--tailwind {
    color: #22c55e;
}

.chart-svg {
    cursor: crosshair;
}

.chart-grid-line,
.chart-axis-label {
    pointer-events: none;
}

.chart-interact-layer {
    cursor: crosshair;
    pointer-events: all;
}

@media (max-width: 860px) {
    .tab-nav {
        z-index: 2500;
    }

    #tab-climate .header {
        z-index: 1;
    }
}

.location-group--dropdown-open {
    z-index: 3200;
}

.location-group--dropdown-open .dropdown-menu {
    z-index: 3201;
    background: #161b22;
    opacity: 1;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.header--dropdown-open {
    z-index: 3200 !important;
}

/* Compact collapsed forecast charts */
.chart-toggle-header .h3-title,
.chart-toggle-header .table-heading-no-margin {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.chart-wrapper {
    margin-top: 12px;
}

.forecast-card.chart-card-collapsed {
    padding-top: 12px;
    padding-bottom: 12px;
}

/* ===== Phase 1+3 Consolidation Layer ===== */
.tab-btn[aria-selected="true"] {
    background: rgba(88, 166, 255, 0.15);
    border: 1px solid rgba(88, 166, 255, 0.25);
    color: #fff;
}

.tab-btn[aria-selected="false"] {
    color: var(--text-secondary);
}

.impact-grid--controls {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.impact-grid--controls .impact-box {
    color: var(--text-secondary);
}

.card-spaced-top {
    margin-top: 16px;
}

.loading-state {
    text-align: center;
    color: var(--text-secondary);
}

.loading-state--card {
    padding: 40px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    margin: auto;
    display: block;
}

.loading-state-label {
    margin-top: 12px;
    font-size: 0.9em;
}

.scroll-x-auto {
    overflow-x: auto;
}

.insight-title {
    margin-right: 8px;
}

.insight-right {
    text-align: right;
}

.pace-mode-row {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.pace-mode-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: 8px;
}

.pace-mode-tags {
    display: flex;
    gap: 8px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chart-legend-item--temp {
    color: #f87171;
}

.chart-legend-item--dew,
.chart-legend-item--rain {
    color: #60a5fa;
}

.chart-legend-item--prob {
    color: #93c5fd;
}

.chart-legend-item--wind {
    color: #c084fc;
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
}

.chart-legend-dot--temp {
    background: #f87171;
}

.chart-legend-dot--dew,
.chart-legend-dot--rain {
    background: #60a5fa;
}

.chart-legend-line {
    width: 8px;
    height: 2px;
    display: inline-block;
}

.chart-legend-line--prob {
    background: #93c5fd;
}

.chart-legend-line--wind {
    background: #c084fc;
}

.th-sort {
    cursor: pointer;
}

.th-sort-center {
    text-align: center;
}

.th-sort-rain {
    min-width: 60px;
}

.th-sort-wind {
    min-width: 70px;
}

.th-sort-time {
    width: 35%;
}

.table-loading-cell {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    opacity: 0.9;
}

.table-loading-cell::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg,
            transparent 0%,
            rgba(255, 255, 255, 0.08) 45%,
            rgba(255, 255, 255, 0.18) 50%,
            rgba(255, 255, 255, 0.08) 55%,
            transparent 100%);
    transform: translateX(-100%);
    animation: tableLoadingSweep 1.15s linear infinite;
    pointer-events: none;
}

.table-loading-cell::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.35);
    border-top-color: rgba(219, 234, 254, 0.95);
    animation: tableLoadingSpin 0.9s linear infinite;
    vertical-align: middle;
}

@keyframes tableLoadingSweep {
    to {
        transform: translateX(100%);
    }
}

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

.climate-overflow-card {
    overflow-x: auto;
}

.climate-heatmap-shell {
    position: relative;
}

.climate-heatmap-grid {
    display: grid;
    gap: 1px;
    grid-template-columns: 40px repeat(53, 1fr);
}

.section-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-title--compact {
    margin: 0;
}

.monthly-averages-wrapper {
    margin-top: 15px;
    transition: all 0.3s ease-out;
    overflow: hidden;
}

.section-row {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.section-row-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 12px;
}

.filter-pill {
    font-size: 0.65rem;
    background: var(--accent-color);
    color: #fff;
    padding: 1px 4px;
    border-radius: 2px;
}

.link-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: underline;
}

.link-button--small {
    font-size: 0.75rem;
}

.climate-thead {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 10;
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-gps-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    font-weight: 500;
}

.modal-or {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 5px 0;
}

/* Keep header subtitles aligned consistently with the left title edge. */
#tab-calculator .header-left .subtitle,
#tab-climate .header-left .subtitle {
    justify-content: flex-start;
    text-align: left;
    padding-left: 3px;
}

.settings-grid-two {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.settings-col {
    flex: 1;
    min-width: 0;
}

.settings-block {
    margin-bottom: 16px;
}

.settings-save-btn {
    width: 100%;
    margin-top: 12px;
    justify-content: center;
    padding: 12px;
    font-weight: 600;
}

.info-tooltip-trigger:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
    opacity: 1;
}

@media (max-width: 600px) {
    .settings-grid-two {
        flex-direction: column;
        gap: 10px;
    }

    .pace-mode-row {
        flex-wrap: wrap;
        row-gap: 8px;
    }
}

/* Settings modal: same visual language as Select Location, but wider for form content */
#settings-modal .settings-modal-content {
    width: min(94vw, 540px);
    max-width: 540px;
    max-height: none;
    overflow: visible;
    padding: 24px;
    gap: 12px;
}

#settings-modal .settings-modal-header {
    margin-bottom: 8px;
}

#settings-modal .settings-section-label {
    margin-top: 4px;
    margin-bottom: 8px;
}

#settings-modal .settings-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    column-gap: 10px;
    row-gap: 8px;
    margin-bottom: 8px;
}

#settings-modal .settings-block {
    margin-bottom: 8px;
}

#settings-modal .settings-save-btn {
    margin-top: 10px;
    min-height: 42px;
}

@media (max-width: 600px) {
    #settings-modal .settings-modal-content {
        width: calc(100vw - 14px);
        padding: 12px;
    }

    #settings-modal .settings-grid-two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 8px;
        row-gap: 6px;
    }

    #settings-modal .settings-input-wrapper {
        margin-top: 4px;
    }

    #settings-modal .settings-input {
        padding: 8px 28px 8px 9px;
        font-size: 0.84rem;
    }

    #settings-modal .settings-label {
        font-size: 0.72rem;
        gap: 3px;
        line-height: 1.15;
    }

    #settings-modal .settings-label svg {
        width: 12px;
        height: 12px;
    }

    #settings-modal .info-tooltip-trigger--inline svg {
        width: 10px;
        height: 10px;
    }

    #settings-modal .unit-suffix {
        font-size: 0.72rem;
        right: 8px;
    }

    #settings-modal .settings-section-label {
        margin-top: 2px;
        margin-bottom: 6px;
        font-size: 0.62rem;
    }

    #settings-modal .settings-save-btn {
        margin-top: 8px;
        padding: 10px;
    }
}
