:root {
    color-scheme: light;
    --bg: #f7fbff;
    --ink: #102235;
    --muted: #66788d;
    --surface: rgba(255, 255, 255, .78);
    --surface-strong: rgba(255, 255, 255, .94);
    --line: rgba(16, 34, 53, .12);
    --brand: #2fb7b0;
    --brand-dark: #117d84;
    --coral: #ff8a5c;
    --yellow: #ffd166;
    --shadow: 0 24px 70px rgba(34, 67, 98, .15);
    --soft-shadow: 0 14px 35px rgba(34, 67, 98, .10);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background:
        radial-gradient(circle at 12% 8%, rgba(47, 183, 176, .12), transparent 30rem),
        radial-gradient(circle at 88% 18%, rgba(255, 138, 92, .09), transparent 26rem),
        linear-gradient(155deg, #f7fbff 0%, #eef7fa 52%, #f8fafb 100%);
}

button {
    font: inherit;
}

.shell {
    width: min(1440px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 54px);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: clamp(24px, 4vw, 52px);
}

.eyebrow {
    display: inline-flex;
    margin: 0 0 10px;
    padding: 8px 13px;
    border: 1px solid rgba(47, 183, 176, .22);
    border-radius: 999px;
    background: rgba(47, 183, 176, .12);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 64px);
    line-height: .96;
    letter-spacing: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-height: 48px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--soft-shadow);
    backdrop-filter: blur(20px);
    white-space: nowrap;
}

.status-pill span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--yellow);
    box-shadow: 0 0 0 5px rgba(255, 209, 102, .22);
}

.status-pill.is-online span {
    background: var(--brand);
    box-shadow: 0 0 0 5px rgba(47, 183, 176, .18);
}

.status-pill.is-offline span {
    background: var(--coral);
    box-shadow: 0 0 0 5px rgba(255, 138, 92, .18);
}

.overview {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) repeat(2, minmax(250px, .72fr));
    gap: clamp(16px, 2vw, 24px);
}

.hero-tile,
.metric-tile {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
}

.hero-tile {
    min-height: 390px;
    padding: clamp(26px, 4vw, 44px);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .58)),
        linear-gradient(135deg, rgba(47, 183, 176, .24), rgba(255, 138, 92, .18));
}

.tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.tile-head span {
    color: var(--brand-dark);
    font-weight: 800;
}

small {
    color: var(--muted);
}

.temperature-line {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: clamp(42px, 7vw, 82px) 0 34px;
}

.temperature-line strong {
    font-size: clamp(94px, 14vw, 178px);
    line-height: .78;
    letter-spacing: 0;
}

.temperature-line span {
    margin-top: .18em;
    color: var(--brand-dark);
    font-size: clamp(32px, 4vw, 52px);
    font-weight: 800;
}

.metric-tile {
    position: relative;
    min-height: 390px;
    padding: 30px;
    overflow: hidden;
}

.metric-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .16;
    background: linear-gradient(135deg, var(--brand), transparent 58%);
}

.metric-tile.accent-coral::before {
    background: linear-gradient(135deg, var(--coral), transparent 58%);
}

.metric-label {
    position: relative;
    color: var(--muted);
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-value {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 76px;
}

.metric-tile strong {
    font-size: clamp(54px, 6vw, 88px);
    line-height: .9;
}

.metric-value span {
    color: var(--muted);
    font-size: 23px;
    font-weight: 800;
}

.scale-block {
    position: absolute;
    left: 30px;
    right: 30px;
    bottom: 30px;
}

.hero-tile .scale-block {
    position: static;
    margin-top: 6px;
}

.scale-track {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #6fb6ff 0%, var(--brand) 42%, var(--yellow) 68%, var(--coral) 100%);
    box-shadow: inset 0 1px 2px rgba(16, 34, 53, .16);
}

.accent-blue .scale-track {
    background: linear-gradient(90deg, rgba(47, 183, 176, .38), var(--brand) 45%, var(--yellow) 72%, var(--coral));
}

.accent-coral .scale-track {
    background: linear-gradient(90deg, #6fb6ff, var(--brand) 48%, var(--yellow) 72%, var(--coral));
}

.scale-track i {
    position: absolute;
    top: 50%;
    left: var(--value, 50%);
    width: 4px;
    height: 26px;
    border-radius: 999px;
    background: var(--ink);
    box-shadow: 0 6px 18px rgba(16, 34, 53, .22);
    transform: translate(-50%, -50%);
    transition: left .45s ease;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 13px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 1120px) {
    .overview {
        grid-template-columns: 1fr 1fr;
    }

    .hero-tile {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .shell {
        padding: 20px;
    }

    .topbar,
    .tile-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .overview {
        grid-template-columns: 1fr;
    }

    .hero-tile,
    .metric-tile {
        min-height: 260px;
    }

    .metric-value {
        margin-top: 42px;
    }
}


.history-section {
    margin-top: clamp(54px, 7vw, 92px);
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.section-heading .eyebrow {
    margin-bottom: 14px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1;
}

.section-heading > p {
    max-width: 420px;
    margin: 0 0 4px;
    color: var(--muted);
    text-align: right;
}

.history-filters,
.chart-card,
.history-stats article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--soft-shadow);
    backdrop-filter: blur(20px);
}

.history-filters {
    display: grid;
    gap: 20px;
    padding: 22px;
}

.quick-ranges {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.quick-ranges button {
    min-height: 42px;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--muted);
    cursor: pointer;
    font-weight: 800;
}

.quick-ranges button:hover,
.quick-ranges button.is-active {
    border-color: rgba(47, 183, 176, .45);
    background: rgba(47, 183, 176, .13);
    color: var(--brand-dark);
}

.date-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr)) auto;
    align-items: end;
    gap: 14px;
}

.date-fields label {
    display: grid;
    gap: 7px;
}

.date-fields label span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.date-fields input {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-strong);
    color: var(--ink);
    font: inherit;
}

.date-fields input:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(47, 183, 176, .14);
}

.primary-button {
    min-height: 48px;
    padding: 10px 20px;
    border: 0;
    border-radius: 7px;
    background: var(--brand-dark);
    color: white;
    cursor: pointer;
    font-weight: 800;
}

.primary-button:hover {
    background: #0d6f75;
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 18px 0;
}

.history-stats article {
    display: grid;
    gap: 7px;
    min-height: 138px;
    padding: 22px;
}

.history-stats article > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.history-stats strong {
    align-self: end;
    font-size: clamp(25px, 3vw, 38px);
    line-height: 1;
}

.history-stats article:first-child {
    background:
        linear-gradient(135deg, rgba(255, 138, 92, .14), transparent 72%),
        var(--surface);
}

.chart-card {
    padding: clamp(18px, 3vw, 30px);
}

.chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.chart-head > div:first-child {
    display: grid;
    gap: 5px;
}

.chart-head strong {
    font-size: 18px;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.chart-legend i {
    width: 24px;
    height: 3px;
    border-radius: 99px;
    background: var(--brand-dark);
}

.chart-wrap {
    position: relative;
    height: clamp(310px, 40vw, 470px);
}

.chart-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: pan-y;
}

.chart-message {
    position: absolute;
    inset: 50% auto auto 50%;
    margin: 0;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
    transform: translate(-50%, -50%);
}

.chart-tooltip {
    position: absolute;
    z-index: 2;
    width: 170px;
    padding: 9px 11px;
    border: 1px solid rgba(16, 34, 53, .12);
    border-radius: 7px;
    background: rgba(16, 34, 53, .92);
    color: white;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    pointer-events: none;
    white-space: pre-line;
    box-shadow: var(--soft-shadow);
}

@media (max-width: 900px) {
    .history-stats {
        grid-template-columns: 1fr 1fr;
    }

    .date-fields {
        grid-template-columns: 1fr 1fr;
    }

    .primary-button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-heading > p {
        text-align: left;
    }

    .date-fields,
    .history-stats {
        grid-template-columns: 1fr;
    }

    .chart-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .chart-wrap {
        height: 320px;
    }
}

.chart-coming-soon {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    border-radius: 7px;
    background: rgba(247, 251, 255, .86);
    text-align: center;
}

.chart-coming-soon strong {
    font-size: clamp(24px, 4vw, 36px);
}

.chart-coming-soon span {
    max-width: 360px;
    color: var(--muted);
}
