@import url('https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700&display=swap');

:root {
    --bg: #fff;
    --text: #000;
    --panel-border: #444;
    --panel-bg: rgba(0,0,0,0.1);
}

td.nowrap { white-space: nowrap; }

#title {
    font-size: 35px;
    font-weight: 400;
    font-family: 'Roboto Condensed';
    color: black;
}

#logo {
    position: absolute;
    top: 15px;
    left: 20px;
}

#stats { color: black; }

#capture {
    position: relative;
    display: inline-flex;
    flex-wrap: wrap;
}

#container, .highcharts-legend-item {
    font-family: 'Roboto Condensed', sans-serif;
}

/* Controls */
#controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 1.2em;
    align-items: center;
    padding: 20px;
    background: rgba(0,0,0,0.1);
    border-bottom: 1px solid #ddd;
}

select, input[type='month'], input[type='number'] {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: none;
    font-size: 1rem;
    font-family: 'Roboto Condensed', sans-serif;
}

.view-toggle {
    display: flex;
    background: #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.view-toggle label {
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.view-toggle input { display: none; }

.view-toggle input:checked + span {
    background: #0078d7;
    color: white;
}

.view-toggle span {
    display: block;
    padding: 0.4rem 1rem;
}

button {
    padding: 0.4rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    background: #0078d7;
    color: white;
    border: none;
    border-radius: 6px;
    font-family: 'Roboto Condensed', sans-serif;
}
button:hover { background: #005a9e; }

.water-year-toggle {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Table Styling */
@media print {
    .climate-table-wrapper { overflow: visible !important; }
    .climate-table {
        transform: scale(0.90);
        transform-origin: top left;
    }
}

.climate-table-wrapper {
    /* overflow-x: auto; */
    width: 960px;
}

.climate-table {
    width: 100%;
    font-size: 11pt;
    margin-top: 990px;
    border-collapse: collapse;
    font-family: 'Roboto Condensed', sans-serif;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.climate-table th {
    padding: 5px;
    text-align: center;
    font-weight: 700;
    border: 1px solid #000;
}

.climate-table td {
    padding: 5px;
    border: 1px solid #000;
    text-align: center;
}

.observed { font-weight: 700; }
.month-high { color: #f0f; font-weight: 700; }
.month-low { color: #08f; font-weight: 700; }

.hc-icon-high { color: #f0f; font-size: 0.85em; position: absolute; }
.hc-icon-low { color: #08f; font-size: 0.85em; position: absolute; }
.hc-icon-highmin { color: #f0f; font-size: 0.78em; position: absolute; }
.hc-icon-lowmax { color: #08f; font-size: 0.78em; position: absolute; }

.positive { color: rgba(255, 0, 255, 1); }
.negative { color: rgba(0, 136, 255, 1); }
.positive-pcpn { color: rgba(0, 255, 200, 1); }
.negative-pcpn { color: rgba(255, 0, 255, 1); }

.rechi-cell { background-color: rgba(255, 0, 0, 0.2) !important; }
.reclo-cell { background-color: rgba(0, 0, 255, 0.2) !important; }
.normal-cell { background-color: rgba(0, 0, 0, 0.1) !important; }
.precip-cell { background-color: rgba(0, 255, 0, 0.2) !important; }
.snow-cell { background-color: rgba(0, 100, 255, 0.2) !important; }
.depth-cell { background-color: rgba(160, 0, 255, 0.2) !important; }

.stat-value {
    display: inline-block;
    font-size: 30px;
    font-weight: bold;
    margin-bottom: 15px;
    font-family: 'Roboto Condensed', sans-serif;
}

.stat-departure {
    display: inline-block;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: bold;
    text-shadow: none;
}

/* Yearly view specific */
.wrap { width: 960px; margin: 0 auto; padding-top: 20px; padding-bottom: 50px; font-family: 'Roboto Condensed'; }
.wrap h2 { margin: 0 0 12px; font-size: 24px; font-weight: 700; text-align: center; }
.hc { width: 960px; margin-bottom: 40px; }
#yearlyTempChart { height: 600px; }
.envChart { height: 300px; }

/* Yearly/Monthly Summary Table */
.yearly-summary { width: 960px; margin: 10px auto 0; }
.yearly-summary h3 {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin: 20px 0 8px;
    text-align: left;
    background: rgba(0,0,0,0.05);
    padding: 6px 10px;
    border-left: 4px solid #0078d7;
}
.yearly-summary table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.yearly-summary th {
    padding: 6px 4px;
    text-align: center;
    font-weight: 700;
    border: 1px solid #000;
    white-space: nowrap;
    line-height: 1.2;
    background: rgba(0,0,0,0.05);
}
.yearly-summary td {
    padding: 5px 4px;
    text-align: center;
    border: 1px solid #000;
    white-space: nowrap;
}
.yearly-summary .month-label { text-align: left; font-weight: 700; background: rgba(0,0,0,0.06); }
.yearly-summary .annual-row td { font-weight: 700; background: rgba(0,0,0,0.10); border-top: 2px solid #000; }
.yearly-summary .dep-pos { color: #f0f; font-weight: 700; }
.yearly-summary .dep-neg { color: #08f; font-weight: 700; }
.yearly-summary .dep-pos-p { color: #00aa00; font-weight: 700; }
.yearly-summary .dep-neg-p { color: #aa5100; font-weight: 700; }
.yearly-summary .hdr-temp { background: rgba(255,0,0,0.12); }
.yearly-summary .hdr-precip { background: rgba(0,200,0,0.12); }
.yearly-summary .hdr-snow { background: rgba(0,100,255,0.12); }
.yearly-summary .hdr-extreme { background: rgba(200,0,200,0.12); }
.yearly-summary .sub-hdr { font-size: 13px; font-weight: 400; }

/* Frequency distribution tables - equal columns */
.yearly-summary .freq-table { table-layout: fixed; }
.yearly-summary .freq-table th,
.yearly-summary .freq-table td { overflow: hidden; }

/* Records log table */
.yearly-summary .rec-type-hi { background: rgba(255,0,0,0.15); font-weight: 700; }
.yearly-summary .rec-type-lo { background: rgba(0,80,255,0.15); font-weight: 700; }
.yearly-summary .rec-type-himin { background: rgba(255,0,0,0.10); }
.yearly-summary .rec-type-lomax { background: rgba(0,80,255,0.10); }
.yearly-summary .rec-type-pcpn { background: rgba(0,200,0,0.12); font-weight: 700; }
.yearly-summary .rec-type-snow { background: rgba(0,100,255,0.12); font-weight: 700; }
.yearly-summary .rec-type-snowd { background: rgba(0,60,180,0.12); font-weight: 700; }
.yearly-summary .no-records { padding: 12px; text-align: center; color: #666; font-style: italic; }

/* Temperature frequency table */
.yearly-summary .freq-table td.count { font-weight: 700; }
.yearly-summary .freq-table td.zero { color: #ccc; }
.yearly-summary .freq-table .bin-hot { background: rgba(255,0,0,0.08); }
.yearly-summary .freq-table .bin-warm { background: rgba(255,160,0,0.08); }
.yearly-summary .freq-table .bin-cool { background: rgba(0,120,255,0.08); }
.yearly-summary .freq-table .bin-cold { background: rgba(0,0,200,0.12); }

/* Streaks & milestones */
.yearly-summary .streaks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}
.yearly-summary .streak-section h4 {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    padding: 4px 8px;
    background: rgba(0,0,0,0.08);
    border-left: 4px solid #0078d7;
}
.yearly-summary .streak-table { width: 100%; }
.yearly-summary .streak-table td { text-align: left; padding: 3px 6px; border: none; border-bottom: 1px solid #ddd; }
.yearly-summary .streak-table td:last-child { text-align: right; font-weight: 700; }
.yearly-summary .streak-table tr:last-child td { border-bottom: none; }

#loading {
    text-align: center;
    display: none;
    padding: 20px;
    font-size: 1.5em;
    color: #0078d7;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: bold;
}

.highcharts-tooltip span {
    font-family: 'Roboto Condensed', sans-serif;
}

/* Modern monthly climate summary cards */
.period-summary-dashboard {
    width: 960px;
    margin: 0 auto;
    font-family: 'Roboto Condensed', sans-serif;
}

.summary-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 18px 0 8px;
}

.summary-hero-card {
    border: 1px solid rgba(0,0,0,0.18);
    border-radius: 12px;
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(0,0,0,0.035), rgba(0,0,0,0.01));
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.summary-hero-card.temp { border-left: 6px solid #0078d7; }
.summary-hero-card.precip { border-left: 6px solid #00aa66; }
.summary-hero-card.snow { border-left: 6px solid #3c78ff; }

.hero-kicker {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    color: #444;
    letter-spacing: 0.03em;
}

.hero-value {
    font-size: 42px;
    line-height: 1;
    font-weight: 700;
    margin-top: 6px;
}

.hero-subtitle {
    font-size: 15px;
    color: #555;
    margin: 4px 0 10px;
}

.summary-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 8px 0 18px;
}

.summary-card {
    border: 1px solid rgba(0,0,0,0.16);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    box-shadow: 0 1px 5px rgba(0,0,0,0.07);
    min-height: 132px;
}

.summary-card.temp { border-top: 4px solid #0078d7; }
.summary-card.precip { border-top: 4px solid #00aa66; }
.summary-card.snow { border-top: 4px solid #3c78ff; }

.metric-name { font-size: 15px; font-weight: 700; color: #333; }
.metric-main { font-size: 30px; font-weight: 700; line-height: 1.1; margin: 5px 0; }

.metric-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    font-size: 13px;
    color: #555;
}

.metric-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.dep-pill,
.rank-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.dep-warm { background: rgba(255,0,0,0.12); color: #b00000; }
.dep-cool { background: rgba(0,120,255,0.14); color: #0056b3; }
.dep-wet { background: rgba(0,170,80,0.14); color: #007a3d; }
.dep-dry { background: rgba(170,90,0,0.16); color: #8a4600; }
.dep-neutral { background: rgba(0,0,0,0.08); color: #333; }
.rank-high { background: rgba(255,0,255,0.12); color: #9b009b; }
.rank-low { background: rgba(0,120,255,0.14); color: #0056b3; }
.rank-tied { background: rgba(0,0,0,0.08); color: #333; }
.rank-neutral { background: rgba(0,0,0,0.06); color: #555; }

.metric-records {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0,0,0,0.10);
    font-size: 12px;
    line-height: 1.25;
}

.record-hi { color: #f0f; font-weight: 700; }
.record-lo { color: #08f; font-weight: 700; }
.muted { color: #666; }

@media print {
    .summary-hero-grid,
    .summary-card-grid { break-inside: avoid; }
    .summary-card { box-shadow: none; }
}

#stats {
    display: none !important;
}

#container,
#precipContainer,
#snowContainer,
#depthContainer {
    left: 0 !important;
    width: 960px !important;
}

.period-summary-dashboard {
    width: 960px;
    margin: 0 auto;
    font-family: 'Roboto Condensed', sans-serif;
}

.summary-hero-grid {
    gap: 0;
    margin: 18px 0 12px;
    border: 1px solid #000;
    border-bottom: none;
}

.summary-hero-card {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    padding: 10px 12px;
    min-height: 94px;
}

.summary-hero-card + .summary-hero-card {
    border-left: 1px solid #000 !important;
}

.summary-hero-card.temp {
    background: linear-gradient(90deg, rgba(0,120,215,0.10), rgba(255,255,255,1)) !important;
}

.summary-hero-card.precip {
    background: linear-gradient(90deg, rgba(0,170,85,0.10), rgba(255,255,255,1)) !important;
}

.hero-kicker {
    font-size: 14px;
    font-weight: 700;
    color: #000;
    letter-spacing: 0;
}

.hero-value {
    font-size: 36px;
    margin-top: 3px;
}

.hero-subtitle {
    font-size: 14px;
    margin: 2px 0 6px;
}

.summary-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 0 0 18px;
    border-top: 1px solid #000;
    border-left: 1px solid #000;
}

.summary-card {
    border: none !important;
    border-right: 1px solid #000 !important;
    border-bottom: 1px solid #000 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff;
    min-height: 118px;
    padding: 8px 10px;
}

.summary-card.temp {
    background: linear-gradient(180deg, rgba(0,120,215,0.06), #fff 36px);
}

.summary-card.precip {
    background: linear-gradient(180deg, rgba(0,170,85,0.07), #fff 36px);
}

.summary-card.snow {
    background: linear-gradient(180deg, rgba(60,120,255,0.08), #fff 36px);
}

.metric-name {
    color: #000;
    font-size: 15px;
}

.metric-main {
    font-size: 28px;
    margin: 4px 0;
}

.metric-meta {
    font-size: 13px;
}

.dep-pill,
.rank-pill {
    border-radius: 0;
    border: 1px solid rgba(0,0,0,0.25);
    padding: 2px 6px;
}

.metric-records {
    border-top: 1px solid #ddd;
}

@media print {
    #container,
    #precipContainer,
    #snowContainer,
    #depthContainer {
        width: 960px !important;
    }
}


.notable-wrap {
    width: 960px;
    margin: 18px auto 12px;
    font-family: 'Roboto Condensed', sans-serif;
}

.notable-wrap h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    border-left: 4px solid #f0f;
}

.notable-pill,
.notable-row-pill {
    display: inline-block;
    background: rgba(255,0,255,0.14);
    color: #9b009b;
    border: 1px solid rgba(155,0,155,0.35);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.notable-table {
    width: 100%;
    border-collapse: collapse;
    border-left: 1px solid #000;
    border-top: 1px solid #000;
    margin: 0 0 18px;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 15px;
}

.notable-table td {
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    padding: 7px 8px;
    vertical-align: middle;
    text-align: left !important;
    white-space: normal !important;
}

.notable-table .notable-kind {
    width: 92px;
    text-align: center;
    background: rgba(0,0,0,0.03);
}

.notable-text {
    font-weight: 700;
}

.notable-detail {
    color: #555;
    font-size: 13px;
    white-space: nowrap;
}

.metric-records .record-line + .record-line {
    margin-top: 2px;
}

.metric-records .years-list {
    color: #666;
}

.count-context {
    color: #555;
    font-size: 12px;
    margin-top: 3px;
}

.rank-pill:empty,
.dep-pill:empty {
    display: none;
}