* { box-sizing: border-box; }
body { margin: 0; background: #dbe8f6; color: #17263a; font: 16px/1.5 'Segoe UI', Tahoma, Arial, sans-serif; }
.site-shell { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.site-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 25px 0; border-bottom: 1px solid #dae2ec; }
.site-brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: inline-flex; justify-content: center; align-items: center; background: #dcecff; color: #245b94; width: 50px; height: 50px; border-radius: 15px; font-size: 27px; }
.site-name { display: block; font-size: 24px; font-weight: 750; letter-spacing: -.4px; }
.site-subtitle { display: block; font-size: 12px; color: #64748b; }
.site-nav { display: flex; gap: 20px; align-items: center; font-size: 14px; }
.site-nav a { color: #1a538b; text-decoration: none; font-weight: 600; }
.site-nav a:hover, .site-nav a:focus { text-decoration: underline; }
.nav-future { color: #7f8b98; }
.main-content { padding: 35px 0 45px; }
h1 { margin: 0; font-size: 29px; letter-spacing: -.5px; }
h2 { margin: 0 0 16px; font-size: 21px; }
.muted { margin: 6px 0 0; color: #607286; }
.intro { margin-bottom: 22px; }
.current-layout { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.3fr); gap: 18px; }
.temperature-card { background: #183f6c; color: white; padding: 28px; border-radius: 17px; min-height: 225px; }
.temperature-card .card-label { color: #d4e7f9; }
.temperature-value { font-size: 65px; line-height: 1.25; font-weight: 650; letter-spacing: -2px; margin: 17px 0 5px; }
.temperature-caption { color: #d4e7f9; font-size: 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.metric-card, .daily-card { background: white; border: 1px solid #e2e8f0; border-radius: 15px; padding: 21px; box-shadow: 0 2px 8px rgba(30, 55, 85, .035); }
.card-label { display: block; font-size: 13px; color: #607286; }
.metric-card strong, .daily-card strong { display: block; margin-top: 7px; font-size: 25px; font-weight: 650; }
.metric-note { display: block; color: #607286; font-size: 13px; margin-top: 3px; }
.daily-section { margin-top: 32px; }
.daily-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; }
.daily-card { padding: 17px; }
.daily-card strong { font-size: 23px; }
.message-error { padding: 16px 20px; background: #fff5f3; border: 1px solid #d99a8f; border-radius: 12px; color: #8b2d21; }
.site-footer { padding: 23px 0 35px; border-top: 1px solid #dae2ec; color: #6f7d8c; font-size: 13px; }
@media (max-width: 900px) { .daily-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 680px) { .site-header { display: block; } .site-nav { margin-top: 18px; } .current-layout { grid-template-columns: 1fr; } .daily-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .temperature-value { font-size: 54px; } }
@media (max-width: 380px) { .metric-grid, .daily-grid { grid-template-columns: 1fr; } }



/* Weather History - Recorded Observations */


/* Recorded Observations */

table.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    font-size: 17px;
}

.history-table th {
    background: #c5d9ef;
    padding: 14px 16px;
    text-align: right;
    white-space: nowrap;
    border-bottom: 2px solid #92b2d5;
}

.history-table td {
    padding: 10px 16px;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid #d8e3ef;
}

.history-table th:first-child,
.history-table td:first-child {
    text-align: left;
}

.history-table tr:nth-child(even) td {
    background: #edf4fc;
}

.history-table tr:hover td {
    background: #dceafa;
}


/* On This Date: history comparison across available years */
.on-this-date-section { margin-top: 32px; }
.on-this-date-section .muted { margin: 6px 0 16px; }
.on-this-date-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
@media (max-width: 760px) {
    .on-this-date-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
    .on-this-date-grid { grid-template-columns: 1fr; }
}



/* =====================================================
   Historical comparison section
   ===================================================== */

.on-this-date-section {
    margin-top: 40px;
    margin-bottom: 34px;
}

.on-this-date-section h2 {
    margin-bottom: 14px;
    font-size: 32px;
    color: #17263a;
}

.on-this-date-section h3 {
    font-size: 22px;
    margin: 24px 0 14px;
    color: #17263a;
}

.on-this-date-section .muted {
    margin: 8px 0 16px;
    font-size: 18px;
    color: #5f7287;
    line-height: 1.5;
}

/* Summary cards at top of historical section */

.on-this-date-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.on-this-date-grid .daily-card {
    min-width: 0;
    padding: 18px 20px;
}

.on-this-date-grid .daily-card strong {
    display: block;
    font-size: 26px;
    margin-top: 6px;
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}

/* Higher highs in red-ish */
.on-this-date-grid .daily-card:nth-child(1) strong,
.on-this-date-grid .daily-card:nth-child(3) strong {
    color: #c93b32;
}

/* Lower lows in blue-ish */
.on-this-date-grid .daily-card:nth-child(2) strong,
.on-this-date-grid .daily-card:nth-child(4) strong {
    color: #245cc4;
}

/* =====================================================
   Historical averages table
   ===================================================== */

.historical-average-table {
    width: 100%;
    margin-top: 14px;
    background: #ffffff;
/*    border-collapse: separate; */
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    border: 1px solid #b8cade;
    border-radius: 10px;
    overflow: hidden;
}

.historical-average-table thead th {
    background: #bcd0e6;
    color: #17263a;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    padding: 14px 16px;
    border-bottom: 2px solid #96b2ce;
    font-size: 17px;
    font-weight: 700;
}

.historical-average-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid #d5e2ef;
    text-align: right;
    white-space: nowrap;
}

.historical-average-table tbody tr:nth-child(even) td {
    background: #edf4fc;
}

.historical-average-table tbody tr:nth-child(odd) td {
    background: #ffffff;
}

.historical-average-table tbody tr:hover td {
    background: #e2edf9;
}

.historical-average-table tbody td:first-child {
    text-align: left;
    font-weight: 700;
    color: #17263a;
}

/* Footer row */
.historical-average-table tfoot th,
.historical-average-table tfoot td {
    background: #c5d9ef;
    color: #17263a;
    font-weight: 700;
    border-top: 2px solid #8facc9;
    border-bottom: 2px solid #91b3d7;
    padding: 14px 16px;
    font-size: 18px;
}

.historical-average-table tfoot th {
    text-align: left;
}

/* =====================================================
   Color all HIGH / MAX columns red-ish
   Col 2 = Selected Day Max
   Col 4 = Through Day Avg Max
   Col 6 = Full Month Avg Max
   ===================================================== */

.historical-average-table tbody td:nth-child(2),
.historical-average-table tbody td:nth-child(4),
.historical-average-table tbody td:nth-child(6),
.historical-average-table tfoot td:nth-child(2),
.historical-average-table tfoot td:nth-child(4),
.historical-average-table tfoot td:nth-child(6) {
    color: #c93b32;
    font-weight: 700;
}

/* =====================================================
   Color all LOW / MIN columns blue-ish
   Col 3 = Selected Day Min
   Col 5 = Through Day Avg Min
   Col 7 = Full Month Avg Min
   ===================================================== */

.historical-average-table tbody td:nth-child(3),
.historical-average-table tbody td:nth-child(5),
.historical-average-table tbody td:nth-child(7),
.historical-average-table tfoot td:nth-child(3),
.historical-average-table tfoot td:nth-child(5),
.historical-average-table tfoot td:nth-child(7) {
    color: #245cc4;
    font-weight: 700;
}

.history-note {
    font-size: 15px;
    color: #5f7287;
    margin-top: 12px;
    line-height: 1.5;
}



/* Align historical column headings with numeric values */

.historical-average-table thead tr:nth-child(2) th {
    text-align: right;
    padding-right: 16px;
}

/* Keep the grouped headings centered */

.historical-average-table thead tr:first-child th {
    text-align: center;
}

/* Keep Date left-justified */

.historical-average-table thead tr:first-child th:first-child {
    text-align: left;
}




/* AQI: colored values on both dashboard pages */

.aqi-value {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 8px;
    font-weight: 700;
    line-height: 1.4;
    min-width: 65px;
    text-align: center;
}

/* AQI color-coded observation table cells */

.history-table td.aqi-cell {
    font-weight: 700;
    text-align: center;
}

/* Good: 0-50 */

.aqi-good,
.history-table td.aqi-cell.aqi-good {
    background: #c7efc4 !important;
    color: #183d1a !important;
}

/* Moderate: 51-100 */

.aqi-moderate,
.history-table td.aqi-cell.aqi-moderate {
    background: #fff2a6 !important;
    color: #554500 !important;
}

/* Unhealthy for Sensitive Groups: 101-150 */

.aqi-sensitive,
.history-table td.aqi-cell.aqi-sensitive {
    background: #ffd19a !important;
    color: #653300 !important;
}

/* Unhealthy: 151-200 */

.aqi-unhealthy,
.history-table td.aqi-cell.aqi-unhealthy {
    background: #f5a2a2 !important;
    color: #5d1111 !important;
}

/* Very Unhealthy: 201-300 */

.aqi-very-unhealthy,
.history-table td.aqi-cell.aqi-very-unhealthy {
    background: #b897d8 !important;
    color: #30164f !important;
}

/* Hazardous: 301+ */

.aqi-hazardous,
.history-table td.aqi-cell.aqi-hazardous {
    background: #854052 !important;
    color: #ffffff !important;
}

/* Missing AQI value */

.aqi-unknown,
.history-table td.aqi-cell.aqi-unknown {
    background: #e5e7eb !important;
    color: #374151 !important;
}

/* Small-screen adjustments */

@media (max-width: 900px) {
    .on-this-date-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 500px) {
    .on-this-date-grid {
        grid-template-columns: 1fr;
    }
}



/* Larger, easier-to-use weather history date controls */

.history-picker {
    margin: 22px 0 32px;
}

.history-picker > span,
.history-picker > label {
    display: block;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 9px;
}

.history-date-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.history-date-input {
    width: 190px;
    height: 46px;
    padding: 9px 13px;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 18px;
    border: 1px solid #a8bfd9;
    border-radius: 8px;
    background: #ffffff;
    color: #17263a;
}

.history-date-row input[type="submit"] {
    min-height: 46px;
    padding: 9px 18px;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 17px;
    font-weight: 600;
    border: 1px solid #a8bfd9;
    border-radius: 8px;
    background: #ffffff;
    color: #17263a;
    cursor: pointer;
}

.history-date-row input[type="submit"]:hover {
    background: #d5e4f5;
}

.history-calendar {
    display: inline-block;
    margin-top: 16px;
    padding: 12px;
    border: 1px solid #c2d5e8;
    border-radius: 10px;
    background: #ffffff;
}

/* Larger calendar day cells */

.history-calendar table {
    font-size: 16px;
}

.history-calendar td,
.history-calendar th {
    padding: 7px;
}

.history-calendar a {
    font-size: 16px;
}



/* New historical record highs and lows */

.historical-average-table .new-record-high {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    background: #fbe0dc;
    color: #a92520;
    font-weight: 800;
    border: 1px solid #eaa9a2;
}

.historical-average-table .new-record-low {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    background: #dce9ff;
    color: #174caa;
    font-weight: 800;
    border: 1px solid #a3c3ef;
}


/* Historical year range selection */

.year-filter {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px 20px;
    margin: 18px 0 24px;
    background: #edf4fc;
    border: 1px solid #b8cade;
    border-radius: 10px;
}

.year-filter label {
    display: block;
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #17263a;
}

.year-input {
    width: 125px;
    height: 46px;
    padding: 8px 12px;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 19px;
    color: #17263a;
    background: #ffffff;
    border: 1px solid #a8bfd9;
    border-radius: 8px;
}

.year-button {
    height: 46px;
    padding: 8px 20px;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    background: #1c416d;
    border: 1px solid #1c416d;
    border-radius: 8px;
    cursor: pointer;
}

.year-button:hover {
    background: #2c5a8e;
}

.year-input:focus,
.year-button:focus {
    outline: 2px solid #4b86c5;
    outline-offset: 2px;
}



/* Boss-approved high temperature colors */

/* Normal high temperature columns */
.historical-average-table tbody td:nth-child(2),
.historical-average-table tbody td:nth-child(4),
.historical-average-table tbody td:nth-child(6),
.historical-average-table tfoot td:nth-child(2),
.historical-average-table tfoot td:nth-child(4),
.historical-average-table tfoot td:nth-child(6) {
    color: #d52738;
}

/* Record-breaking high temperature */
.historical-average-table .new-record-high {
    background: #fceced;
    color: #b81d27;
    border: 1px solid #f1a8ad;
}

/* Historical high summary cards */
.on-this-date-grid .daily-card:nth-child(1) strong,
.on-this-date-grid .daily-card:nth-child(3) strong {
    color: #d52738;
}

