:root {
    color-scheme: light;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #17181b;
    background: #fff;
    font-synthesis: none;
    font-variant-numeric: tabular-nums;
    --brand: #006bd6;
    --primary: #0b59d5;
    --navy: #062554;
    --muted: #596879;
    --line: #dde4eb;
    --soft: #f4f7f9;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; }
body { margin: 0; font-size: 1rem; line-height: 1.5; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--primary); text-underline-offset: .22em; }
button, .button, input { transition: background-color 160ms ease, border-color 160ms ease; }
:focus-visible { outline: 3px solid #0090ff; outline-offset: 4px; }
::selection { color: #fff; background: #194386; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
.icon { width: 1.35rem; height: 1.35rem; flex-shrink: 0; vertical-align: middle; }
.brand { display: inline-flex; gap: .65rem; align-items: center; color: var(--navy); font-size: 1.125rem; font-weight: 750; text-decoration: none; letter-spacing: -.025em; }
.brand > .icon { color: var(--brand); width: 1.8rem; height: 1.8rem; }
.skip-link { position: fixed; top: -8rem; left: 1rem; z-index: 10; background: #fff; padding: .75rem 1rem; }
.skip-link:focus { top: 1rem; }
.auth-layout { min-height: 100dvh; display: grid; grid-template-columns: minmax(22rem, 44%) 1fr; }
.auth-intro { display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem 3.5rem; background: var(--navy); color: #fff; }
.brand-light, .brand-light > .icon { color: #fff; }
.intro-content { max-width: 29rem; margin: 4rem 0; }
.intro-content h1 { font-size: 2.75rem; letter-spacing: -.035em; line-height: 1.16; margin-bottom: 1.5rem; }
.intro-content > p { color: #c5d9f2; max-width: 26rem; font-size: 1.0625rem; line-height: 1.7; }
.intro-features { list-style: none; padding: 0; margin: 2.75rem 0 0; }
.intro-features li { display: flex; align-items: center; gap: .9rem; padding: 1rem 0; border-bottom: 1px solid #28466f; color: #e3efff; }
.intro-features .icon { color: #7fc7ff; }
.intro-footer { color: #b5ccea; font-size: .875rem; }
.auth-main { display: flex; justify-content: center; align-items: center; padding: 3rem 2rem; }
.auth-form-wrap { width: 100%; max-width: 25rem; }
.auth-form-wrap h2 { color: var(--navy); font-size: 1.875rem; letter-spacing: -.03em; }
.form-intro { margin: .65rem 0 2rem; color: var(--muted); }
.auth-form fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
.field { margin-bottom: 1.4rem; }
.field label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .5rem; }
.field input { width: 100%; min-height: 3.125rem; padding: .75rem .875rem; color: #17181b; background: #fff; border: 1px solid #aebbc9; border-radius: 6px; caret-color: var(--primary); }
.field input::placeholder { color: #687585; }
.field input:hover { border-color: #718397; }
.field input:focus { border-color: var(--brand); }
.field-help { color: var(--muted); font-size: .875rem; margin-top: .5rem; }
.password-input { position: relative; }
.password-input input { padding-right: 3.5rem; }
.password-toggle { position: absolute; right: .25rem; top: .25rem; width: 2.625rem; height: 2.625rem; background: transparent; border: 0; color: var(--muted); border-radius: 4px; }
.password-toggle:hover { background: var(--soft); color: var(--primary); }
[hidden] { display: none !important; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .55rem; padding: .7rem 1rem; min-height: 2.875rem; border: 1px solid transparent; border-radius: 6px; font-size: .875rem; font-weight: 600; text-decoration: none; }
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: #194386; }
.primary:active { background: var(--navy); }
.full-width { width: 100%; margin-top: .2rem; min-height: 3.125rem; }
.secondary { color: #194386; border-color: var(--line); background: #fff; }
.secondary:hover { background: #edf4ff; border-color: #b1c8e8; }
button:disabled, fieldset:disabled { cursor: default; opacity: .65; }
.first-access { margin-top: 1.5rem; font-size: .875rem; color: var(--muted); }
.first-access a { margin-left: .25rem; font-weight: 600; }
.auth-link { display: inline-block; margin-top: 1.25rem; font-size: .875rem; }
.notice { border: 1px solid #e0c68d; border-radius: 6px; background: #fffaed; color: #6b4610; padding: .9rem 1rem; font-size: .875rem; margin-bottom: 1.5rem; }
.dashboard-layout { min-height: 100dvh; display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); }
.sidebar { padding: 2rem 1.25rem 1.5rem; border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; }
.sidebar > .brand { padding: 0 .35rem; }
.sidebar nav { display: grid; gap: .5rem; margin-top: 3.25rem; }
.nav-link { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; color: #506176; text-decoration: none; font-size: .875rem; font-weight: 550; border-radius: 6px; }
.nav-link:hover { background: var(--soft); }
.nav-link.active { color: var(--primary); background: #edf4ff; font-weight: 650; }
.account { margin-top: auto; padding: 2rem .5rem 0; overflow-wrap: anywhere; }
.account-label { display: block; color: var(--muted); font-size: .8125rem; }
.account-email { display: block; font-size: .875rem; margin-top: .35rem; }
.logout { display: inline-flex; gap: .6rem; align-items: center; margin-top: 1.25rem; padding: .5rem 0; min-height: 2.75rem; background: transparent; border: 0; color: var(--muted); font-size: .875rem; }
.logout:hover { color: var(--primary); }
.dashboard-main { background: var(--soft); padding: 3rem 3.5rem 1.5rem; min-width: 0; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.page-header h1 { font-size: 1.875rem; letter-spacing: -.03em; color: var(--navy); }
.page-header p { margin-top: .5rem; color: var(--muted); }
.station-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.station-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.5rem 1.75rem; border-bottom: 1px solid var(--line); }
.station-heading h2 { font-size: 1.125rem; color: var(--navy); }
.station-heading p { color: var(--muted); font-size: .875rem; margin-top: .35rem; }
.status { display: inline-flex; align-items: center; gap: .5rem; font-size: .8125rem; padding: .35rem .75rem; border-radius: 26px; white-space: nowrap; }
.status::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }
.recent { color: #176046; background: #edf8f2; }
.inactive { color: #725019; background: #fff7e8; }
.measurements { margin: 0; padding: 1.75rem 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.measurement { padding: 0 1.75rem; }
.measurement + .measurement { border-left: 1px solid var(--line); }
.measurement dt { display: flex; align-items: center; gap: .6rem; color: #506176; font-size: .875rem; }
.measurement dt .icon { color: var(--brand); }
.measurement dd { margin: 1rem 0 .5rem; font-size: 2rem; font-weight: 650; letter-spacing: -.03em; color: var(--navy); line-height: 1.3; }
.measurement .unit { font-size: 1.25rem; font-weight: 500; }
.measurement .state-value { font-size: 1.5rem; min-height: 2.6rem; display: flex; align-items: center; }
.measurement-detail { font-size: .8125rem; color: var(--muted); }
.station-footer { border-top: 1px solid var(--line); padding: 1rem 1.75rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem; color: var(--muted); font-size: .8125rem; }
.station-footer > span:first-child { display: flex; align-items: center; gap: .5rem; }
.station-footer .icon { width: 1rem; height: 1rem; }
.connection-note { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 0; color: var(--muted); font-size: .875rem; max-width: 65ch; }
.connection-note .icon { color: #6e7f94; margin-top: .1rem; }
.history-section { margin-top: 2.25rem; }
.section-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: .75rem; margin-bottom: 1rem; }
.section-heading h2 { font-size: 1.125rem; color: var(--navy); }
.section-heading span { font-size: .8125rem; color: var(--muted); }
.empty-history { padding: 2.75rem 1.5rem; border: 1px dashed #bac9d9; border-radius: 12px; text-align: center; }
.empty-history > .icon { width: 1.75rem; height: 1.75rem; color: #607f9f; margin-bottom: .75rem; }
.empty-history h3 { font-size: 1rem; font-weight: 600; color: #364d69; }
.empty-history p { color: var(--muted); font-size: .875rem; margin-top: .5rem; }
.table-scroll { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; scrollbar-color: #a0b5cd #f4f7f9; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; white-space: nowrap; text-align: left; }
th { color: #506176; font-weight: 550; background: #f9fbfd; }
th, td { padding: .95rem 1.25rem; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbff; }
.dashboard-footer { margin-top: 2rem; display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; color: var(--muted); font-size: .8125rem; }
@media (min-width: 1600px) { .dashboard-main { padding-left: 5rem; padding-right: 5rem; } }
@media (max-width: 1100px) {
    .dashboard-layout { grid-template-columns: 13.5rem minmax(0,1fr); }
    .dashboard-main { padding: 2rem 1.75rem; }
    .measurement, .station-heading, .station-footer { padding-left: 1.25rem; padding-right: 1.25rem; }
    .auth-intro { padding-left: 2rem; padding-right: 2rem; }
}
@media (max-width: 800px) {
    .dashboard-layout { grid-template-columns: minmax(0,1fr); }
    .sidebar { padding: 1rem 1.25rem; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .75rem; }
    .sidebar nav { grid-column: 1 / -1; display: flex; margin: .25rem 0 0; }
    .nav-link { padding: .65rem .85rem; }
    .account { grid-row: 1; grid-column: 2; padding: 0; }
    .account-label, .account-email { display: none; }
    .logout { margin: 0; padding: .5rem; }
    .dashboard-main { padding: 1.75rem 1.25rem; }
    .auth-layout { grid-template-columns: 1fr; }
    .auth-intro { padding: 1.25rem 1.5rem; }
    .intro-content, .intro-footer { display: none; }
    .auth-main { align-items: flex-start; padding: 3rem 1.5rem; }
    .auth-form-wrap { max-width: 27rem; }
}
@media (max-width: 580px) {
    .brand { font-size: 1rem; }
    .page-header { align-items: flex-start; }
    .page-header h1 { font-size: 1.5rem; }
    .page-header p { font-size: .875rem; max-width: 22ch; }
    .page-header .button { padding: .65rem .75rem; }
    .station-heading { align-items: flex-start; flex-direction: column; padding: 1.25rem; }
    .measurements { grid-template-columns: 1fr; padding: 0; }
    .measurement { padding: 1.25rem; display: grid; grid-template-columns: 1fr auto; column-gap: .75rem; align-items: center; }
    .measurement + .measurement { border-left: 0; border-top: 1px solid var(--line); }
    .measurement dd { grid-column: 2; grid-row: 1 / 3; margin: 0; font-size: 1.5rem; }
    .measurement .state-value { font-size: 1.25rem; }
    .measurement-detail { margin-top: .35rem; font-size: .75rem; max-width: 25ch; }
    .station-footer > span:first-child { align-items: flex-start; }
    .station-footer > span:first-child .icon { margin-top: .15rem; }
    .empty-history { padding: 2rem 1rem; }
    .empty-history p { max-width: 30ch; margin: .65rem auto 0; }
    .logout { font-size: .8125rem; }
    .sidebar { padding-left: 1rem; padding-right: 1rem; }
    .nav-link { font-size: .8125rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

.station-panel + .station-panel { margin-top: 1.5rem; }
.station-heading h2 a { color: var(--navy); text-decoration: none; }
.station-heading h2 a:hover { color: var(--primary); text-decoration: underline; }
.settings-section { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem 1.75rem; margin-top: 1.75rem; }
.settings-section h2 { color: var(--navy); font-size: 1.125rem; margin-bottom: .75rem; }
.settings-section > p { color: var(--muted); font-size: .875rem; max-width: 70ch; }
.settings-section form { margin-top: 1rem; }
.settings-section .field { max-width: 38rem; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem 1.5rem; align-items: end; }
.form-grid .field { margin-bottom: 0; }
.form-grid > .button { justify-self: start; }
.check { display: flex; gap: .75rem; align-items: center; font-size: .875rem; margin: 1rem 0; min-height: 2.75rem; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--primary); flex-shrink: 0; }
.settings-section .field-help { margin-bottom: 1rem; }
select, textarea { font: inherit; border: 1px solid #aebbc9; border-radius: 6px; width: 100%; padding: .75rem; background: #fff; color: #17181b; min-height: 3rem; }
textarea { resize: vertical; overflow-wrap: anywhere; font-family: "Consolas", monospace; font-size: .875rem; }
select { appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23596879' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; }
.filter-form { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.filter-form select { width: auto; min-width: 12rem; }
.inline-form { display: inline-block; margin: 0 .5rem 0 0; }
.text-button { font: inherit; color: var(--primary); background: transparent; border: 0; min-height: 2.75rem; text-decoration: underline; text-underline-offset: .2em; padding: .35rem .25rem; }
.text-button:hover { color: var(--navy); }
.success { color: #175839; background: #edf8f2; border-color: #bdd9c9; }
.verify-notice { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.notification { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; display: flex; gap: 1.5rem; justify-content: space-between; margin-bottom: .75rem; }
.notification.unread { background: #f0f6ff; border-color: #b8d3f7; }
.notification h2 { font-size: 1rem; color: var(--navy); }
.notification p { margin-top: .5rem; color: var(--muted); font-size: .875rem; max-width: 65ch; }
.notification-meta { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.plain-list { margin: 1rem 0 1.5rem; }
.plain-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.plain-list dt { color: var(--muted); }
.plain-list dd { margin: 0; }
.session-list { list-style: none; padding: 0; }
.session-list li { display: flex; gap: 1rem; justify-content: space-between; padding: .75rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; font-size: .875rem; }
.session-list small { color: var(--muted); min-width: 9rem; text-align: right; }
.secret-value { font-family: "Consolas", monospace; background: var(--soft); padding: 1rem; margin: 1rem 0; overflow-wrap: anywhere; }
.recovery-codes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; margin-top: 1rem; overflow-wrap: anywhere; }
.credential code { overflow-wrap: anywhere; }
.history-section > h2 { font-size: 1.125rem; color: var(--navy); margin-bottom: 1rem; }
@media (max-width: 800px) {
    .sidebar nav { flex-wrap: wrap; gap: .25rem; }
    .nav-link { font-size: .8125rem; }
    .notification { flex-direction: column; gap: .75rem; }
}
@media (max-width: 580px) {
    .settings-section { padding: 1.25rem; }
    .form-grid { grid-template-columns: minmax(0,1fr); }
    .filter-form { align-items: stretch; }
    .filter-form select { width: 100%; }
    .session-list li { flex-direction: column; gap: .25rem; }
    .session-list small { text-align: left; }
    .plain-list > div { flex-direction: column; gap: .35rem; }
}

.settings-section + .station-panel { margin-top: 1.5rem; }
.nav-link { min-height: 2.75rem; }
.temperature-chart { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin: 0 0 1.5rem; padding: 1rem; }
.temperature-chart figcaption { font-size: .875rem; color: var(--muted); margin-bottom: .75rem; }
.temperature-chart svg { display: block; width: 100%; height: auto; min-height: 10rem; }
.chart-grid { stroke: #dde4eb; stroke-width: 1; }
.chart-line { stroke: #006bd6; stroke-width: 2.5; fill: none; }
.chart-dot { fill: #006bd6; }
.chart-label { fill: #596879; font-size: 12px; font-family: inherit; }
