:root {
    --th-bg: #eef4f8;
    --th-ink: #102a43;
    --th-muted: #6b7c8d;
    --th-brand: #1d5aa6;
    --th-brand-2: #0b78b8;
    --th-hot: #e4570c;
    --th-ok: #2f9e62;
    --th-bad: #c44949;
    --th-card: #ffffff;
    --th-line: #dce6ee;
    --th-soft: #f4f7fb;
    --th-shadow: 0 10px 28px rgba(16, 42, 67, .07);
    --th-room: #2f9e6b;
    --th-fridge: #2563eb;
    --th-freezer: #e0a13a;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
    margin: 0;
    background: var(--th-bg);
    color: var(--th-ink);
    font: 16px/1.55 "Segoe UI", Helvetica, Arial, sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--th-brand); }
.th-wrap { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; }
.th-top {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    border-bottom: 1px solid var(--th-line);
    box-shadow: 0 8px 26px rgba(17, 56, 84, .06);
}
.th-nav {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 64px;
    flex-wrap: wrap;
    padding: .45rem 0;
}
.th-brand { display: flex; align-items: center; text-decoration: none; }
.th-brand img { height: 42px; width: auto; }
.th-links { display: flex; gap: .9rem; flex-wrap: wrap; margin-left: auto; }
.th-links a {
    color: var(--th-ink);
    text-decoration: none;
    font-weight: 700;
    font-size: .95rem;
}
.th-links a.on, .th-links a:hover { color: var(--th-brand); }
.th-nav-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-shrink: 0;
}
.th-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--th-line);
    background: #fff;
    color: var(--th-ink);
    text-decoration: none;
    flex-shrink: 0;
}
.th-icon-btn svg { width: 22px; height: 22px; display: block; }
.th-icon-btn:hover, .th-icon-btn.on {
    color: var(--th-brand);
    border-color: var(--th-brand);
}
.th-logout { margin: 0; }
.th-logout button, .btn, .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 44px;
    padding: .65rem 1.05rem;
    border-radius: 10px;
    border: 0;
    background: linear-gradient(90deg, var(--th-brand), var(--th-brand-2));
    color: #fff;
    font-weight: 800;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.th-logout button, .btn-ghost {
    background: var(--th-card);
    color: var(--th-ink);
    border: 1px solid var(--th-line);
}
.th-logout button svg { width: 18px; height: 18px; display: block; }
.btn-danger { background: var(--th-bad); color: #fff; }
.th-main { padding: 1.4rem 0 3rem; min-height: 70vh; }
.th-who { color: var(--th-muted); font-size: .9rem; margin: 0 0 1rem; }
.th-flash {
    margin: 0 0 1rem;
    padding: .8rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--th-line);
    background: var(--th-soft);
}
.th-flash.ok { border-color: #9dccae; background: #eef8f1; }
.th-flash.err { border-color: #e2b0b0; background: #fdf2f2; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 .4rem; letter-spacing: -.02em; color: var(--th-ink); }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; color: var(--th-ink); }
.lead { color: var(--th-muted); margin: 0 0 1.2rem; max-width: 38rem; }
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.card, .panel, .mon {
    background: var(--th-card);
    border: 1px solid #e8eef3;
    border-radius: 18px;
    box-shadow: var(--th-shadow);
    padding: 1.35rem 1.4rem 1.4rem;
}
.card-link { color: inherit; text-decoration: none; display: block; }
.card-link:hover { border-color: var(--th-brand); }
.temp {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.03em;
    margin: .35rem 0 .2rem;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border-radius: 99px;
    padding: .28rem .75rem;
    font-size: .8rem;
    font-weight: 800;
    background: var(--th-soft);
    white-space: nowrap;
}
.pill.live { background: #e8f8ee; color: var(--th-ok); }
.pill.live::before,
.pill.dead::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    display: block;
}
.pill.dead { background: #fdeeee; color: var(--th-bad); }
.muted { color: var(--th-muted); }
.row-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-top: .75rem; }
.field span { font-size: .92rem; font-weight: 700; }
input, select, textarea {
    width: 100%;
    min-height: 44px;
    padding: .65rem .75rem;
    border: 1px solid var(--th-line);
    border-radius: 10px;
    background: var(--th-card);
    color: var(--th-ink);
    font: inherit;
    font-size: 16px;
}
.spark { width: 100%; height: 88px; display: block; background: var(--th-soft); border-radius: 10px; }
.alert-row {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    align-items: flex-start;
    padding: .85rem 0;
    border-top: 1px solid var(--th-line);
}
.alert-row:first-child { border-top: 0; padding-top: 0; }
.th-foot {
    background: #06121a;
    color: #b9c6d4;
    padding: 1.2rem 0 1.4rem;
    font-size: .9rem;
}
.th-foot a { color: #d7e5f3; }
.login-card {
    max-width: 400px;
    margin: 2.2rem auto;
    padding: 1.7rem 1.6rem 1.55rem;
}
.login-card h1 { margin-bottom: .25rem; }
.login-card .lead {
    margin: 0 0 1.15rem;
    max-width: none;
}
.login-forgot {
    margin: .45rem 0 1rem;
    text-align: right;
    font-size: .9rem;
}
.login-forgot a { color: var(--th-brand); font-weight: 700; text-decoration: none; }
.login-forgot a:hover { text-decoration: underline; }
.login-submit { width: 100%; min-height: 48px; font-size: 1.05rem; }
.login-foot {
    margin: 1.15rem 0 0;
    text-align: center;
    color: var(--th-muted);
    font-size: .92rem;
}
.login-foot a { font-weight: 700; }
.login-card-mac { max-width: 440px; }
.mac-boxes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .15rem;
}
.mac-boxes span {
    color: var(--th-muted);
    font-weight: 800;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.mac-octet {
    width: 2.55rem;
    min-width: 0;
    flex: 1 1 2.4rem;
    min-height: 48px;
    text-align: center;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .45rem .1rem;
}
.mac-hint {
    margin: .2rem 0 0;
    font-size: .82rem;
    font-weight: 600;
    color: var(--th-muted);
}
.mac-readout {
    margin: 0 0 1rem;
    padding: .7rem .8rem;
    text-align: center;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--th-ink);
    background: var(--th-soft);
    border: 1px solid var(--th-line);
    border-radius: 12px;
}
.login-agree {
    flex-direction: row;
    align-items: flex-start;
    gap: .55rem;
    margin-top: 1rem;
    margin-bottom: .85rem;
}
.login-agree input { width: auto; min-height: 0; margin-top: .2rem; }
.login-agree span { font-weight: 600; color: #31465a; }
.linkish {
    border: 0;
    background: none;
    padding: 0;
    color: var(--th-brand);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}
.linkish:hover { text-decoration: underline; }
.hero-temp { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.meta { display: flex; gap: .6rem; flex-wrap: wrap; margin: .5rem 0 0; }
.empty { text-align: center; padding: 2.2rem 1rem; }
.house-bar {
    display: flex;
    gap: .75rem;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 0 0 1rem;
    padding: .85rem 1rem;
}
.house-bar-main {
    display: flex;
    gap: .6rem;
    align-items: end;
    flex-wrap: wrap;
    flex: 1 1 220px;
}
.house-bar .field { margin: 0; min-width: 220px; flex: 1 1 220px; }
.house-name {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: .65rem .75rem;
    border: 1px solid var(--th-line);
    border-radius: 10px;
    background: var(--th-soft);
    font-weight: 700;
}
.house-bar-add { margin-left: auto; flex: 0 0 auto; }
.hp { position: absolute; left: -9999px; }

.device-tabs {
    display: flex;
    gap: .45rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
}
.device-tab {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: .35rem .9rem;
    border-radius: 999px;
    border: 1px solid var(--th-line);
    background: #fff;
    color: var(--th-ink);
    text-decoration: none;
    font-weight: 700;
    font-size: .9rem;
}
.device-tab.on {
    background: var(--th-brand);
    border-color: var(--th-brand);
    color: #fff;
}

.mon { margin: 0 0 1rem; }
.mon-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.15rem;
}
.mon-title {
    font-size: clamp(1.45rem, 2.6vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -.03em;
    margin: 0;
    color: var(--th-ink);
    line-height: 1.2;
}
.mon-sub {
    color: var(--th-muted);
    font-size: .92rem;
    margin: .3rem 0 0;
}
.mon-status { flex-shrink: 0; }
.mon-head-actions {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-shrink: 0;
}
.btn-alerts,
.btn-name {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 52px;
    padding: .7rem 1.4rem;
    border-radius: 12px;
    border: 0;
    background: var(--th-brand);
    color: #fff;
    font: inherit;
    font-weight: 800;
    font-size: 1.08rem;
    letter-spacing: -.01em;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(29, 90, 166, .22);
}
.btn-name {
    background: #fff;
    color: var(--th-ink);
    border: 1px solid var(--th-line);
    box-shadow: none;
}
.btn-alerts:hover,
.btn-name:hover { filter: brightness(1.06); }
.btn-alerts-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: #fff;
    color: var(--th-brand);
    font-size: .82rem;
    font-weight: 800;
}
body.th-modal-lock { overflow: hidden; }
.th-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(16, 42, 67, .48);
}
.th-modal.is-open { display: flex; }
.th-modal[hidden] { display: none !important; }
.th-modal-card {
    width: min(540px, 100%);
    max-height: min(88vh, 760px);
    overflow: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(16, 42, 67, .22);
    padding: 1.25rem 1.3rem 1.35rem;
}
.th-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    margin: 0 0 .35rem;
}
.th-modal-head h2 { margin: 0; font-size: 1.35rem; }
.th-modal-sub { margin: 1.1rem 0 0; font-size: 1.05rem; }
.th-modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: var(--th-soft);
    color: var(--th-ink);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}
.alert-when-row {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, .9fr);
    gap: .75rem;
    align-items: end;
}
.alert-when-row .field { margin-top: .75rem; }
.alert-when-row.is-offline { grid-template-columns: 1fr; }
#thAlertTempField[hidden],
#thAlertProbeField[hidden] { display: none !important; }
.alert-for {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-top: 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--th-ink);
}
.alert-for input {
    width: 5.75rem;
    flex: 0 0 5.75rem;
    text-align: center;
}
.alert-board .hist-title { margin-bottom: .35rem; }
.alert-board .alert-row:first-of-type { border-top: 0; padding-top: .35rem; }
.alert-row-actions {
    margin-top: 0;
    align-items: center;
}
.alert-row-actions form { margin: 0; }

.tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
}
.sync-bar { margin-top: 1.05rem; }
.sync-bar-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .75rem;
    margin: 0 0 .4rem;
}
.sync-bar-title {
    font-weight: 800;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--th-muted);
}
.sync-bar-eta {
    font-weight: 700;
    font-size: .92rem;
    color: var(--th-ink);
}
.sync-bar-track {
    height: 10px;
    border-radius: 99px;
    background: #e3edf4;
    overflow: hidden;
}
.sync-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--th-brand), var(--th-brand-2));
    transition: width .25s linear;
}
.sync-bar.is-due .sync-bar-fill {
    background: linear-gradient(90deg, #2f9e62, #4ecf8a);
    animation: th-sync-pulse 1.2s ease-in-out infinite;
}
.sync-bar.is-offline .sync-bar-fill {
    background: #c44949;
    animation: none;
}
@keyframes th-sync-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .55; }
}
.protect { margin-top: .7rem; }
.protect-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .45rem;
}
.protect-chip {
    background: #f3faf6;
    border: 1px solid #cfe6d6;
    border-radius: 10px;
    padding: .4rem .7rem .42rem;
}
.protect-chip.is-check {
    background: #fdf6f0;
    border-color: #f0d2bc;
}
.protect-chip.is-offline,
.protect-chip.is-wait {
    background: var(--th-soft);
    border-color: var(--th-line);
}
.protect-chip.is-offline .protect-chip-value { color: var(--th-bad); }
.protect-chip-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .55rem;
}
.protect-chip-kicker {
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--th-ok);
}
.protect-chip.is-check .protect-chip-kicker { color: var(--th-hot); }
.protect-chip.is-offline .protect-chip-kicker,
.protect-chip.is-wait .protect-chip-kicker { color: var(--th-muted); }
.protect-chip-value {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -.02em;
    line-height: 1.15;
    color: var(--th-ink);
}
.protect-chip-hint {
    margin: .08rem 0 0;
    font-size: .78rem;
    color: var(--th-muted);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.protect-watch {
    margin: .45rem 0 0;
    color: #31465a;
    font-size: .9rem;
    line-height: 1.4;
}
.protect-watch.is-gap {
    padding: .45rem .7rem;
    background: #fdf6f0;
    border: 1px solid #f0d2bc;
    border-radius: 10px;
}
.protect-watch button {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
    color: var(--th-brand);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.tile {
    background: var(--th-soft);
    border-radius: 14px;
    padding: 1.15rem .75rem 1.05rem;
    text-align: center;
}
.tile-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto .6rem;
    display: block;
}
.tile-label {
    color: #7a8b9a;
    font-size: .82rem;
    font-weight: 600;
}
.tile-temp {
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--th-ink);
    margin: .4rem 0 .3rem;
    line-height: 1;
}
.tile-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .28rem;
    font-size: .85rem;
    font-weight: 700;
}
.tile-status.ok { color: var(--th-ok); }
.tile-status.bad { color: var(--th-bad); }
.tile-status.na { color: var(--th-muted); font-weight: 600; }
.tile-status.ok .tick,
.tile-status.bad .tick {
    width: 14px;
    height: 14px;
    display: inline-block;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M13.2 4.3 6.5 11 2.8 7.3l1.2-1.2 2.5 2.5 5.5-5.5z'/></svg>") center / contain no-repeat;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M13.2 4.3 6.5 11 2.8 7.3l1.2-1.2 2.5 2.5 5.5-5.5z'/></svg>") center / contain no-repeat;
}

.hist-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0 0 .7rem;
}
.hist-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -.02em;
}
.ranges {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}
.range {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: .3rem .85rem;
    border-radius: 10px;
    border: 1px solid var(--th-line);
    background: #fff;
    color: var(--th-ink);
    text-decoration: none;
    font-weight: 700;
    font-size: .85rem;
}
.range.on {
    background: var(--th-brand);
    border-color: var(--th-brand);
    color: #fff;
}
svg.hist {
    width: 100%;
    height: 220px;
    display: block;
}
.hist-empty {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--th-muted);
    background: linear-gradient(#fff, #fafcfd);
    border-radius: 12px;
}
.hist-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
    gap: 1rem;
    align-items: start;
}
.hist-main { min-width: 0; }
.health-stack {
    position: sticky;
    top: 80px;
    display: grid;
    gap: .75rem;
}
.health-now,
.health-card {
    background: #f3faf6;
    border: 1px solid #cfe6d6;
    border-radius: 16px;
    padding: 1.05rem 1.15rem 1.15rem;
    box-shadow: 0 8px 20px rgba(16, 42, 67, .04);
}
.health-now.is-check,
.health-card.is-check {
    background: #fdf6f0;
    border-color: #f0d2bc;
}
.health-now.is-offline,
.health-now.is-wait,
.health-card.is-offline,
.health-card.is-wait {
    background: #f4f7fb;
    border-color: #dce6ee;
}
.health-kicker {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--th-ok);
    margin: 0 0 .2rem;
}
.health-now.is-check .health-kicker,
.health-card.is-check .health-kicker { color: var(--th-hot); }
.health-now.is-offline .health-kicker,
.health-now.is-wait .health-kicker,
.health-card.is-offline .health-kicker,
.health-card.is-wait .health-kicker { color: var(--th-muted); }
.health-now h3,
.health-card h3 {
    margin: 0 0 .5rem;
    font-size: 1.28rem;
    line-height: 1.25;
    letter-spacing: -.02em;
}
.health-card p {
    margin: 0 0 .7rem;
    color: #31465a;
    font-size: .95rem;
    line-height: 1.55;
}
.health-card p:last-child { margin-bottom: 0; }
.health-now-lede {
    margin: 0;
    color: #31465a;
    font-size: .95rem;
    line-height: 1.5;
}
.hist-lanes { display: grid; gap: .85rem; }
.hist-lane {
    background: #fbfcfd;
    border: 1px solid #e8eef3;
    border-radius: 14px;
    padding: .7rem .7rem .45rem;
}
.hist-lane-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin: 0 .15rem .35rem;
}
.hist-lane-name {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 800;
    letter-spacing: -.01em;
}
.hist-lane-name i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.hist-lane-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .9rem;
    color: var(--th-muted);
    font-size: .85rem;
}
.hist-lane-stats strong { color: var(--th-ink); font-weight: 800; }
.hist-lane-stats .ok { color: var(--th-ok); }
.hist-lane-stats .bad { color: var(--th-bad); }
.hist-lane-plot {
    position: relative;
    cursor: crosshair;
}
.hist-svg {
    width: 100%;
    height: 148px;
    display: block;
}
.hist-svg text {
    fill: #7a8b9a;
    font-size: 11px;
    font-family: "Segoe UI", Helvetica, Arial, sans-serif;
}
.hist-band { fill: rgba(47, 158, 107, .10); }
.hist-cross-x { stroke: #102a43; stroke-opacity: .28; stroke-width: 1; }
.hist-lane-empty {
    position: absolute;
    inset: 18px 48px 28px 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--th-muted);
    font-size: .9rem;
    pointer-events: none;
}
.hist-tip {
    position: absolute;
    top: 8px;
    z-index: 2;
    background: #102a43;
    color: #fff;
    border-radius: 10px;
    padding: .4rem .65rem;
    font-size: .82rem;
    line-height: 1.25;
    pointer-events: none;
    box-shadow: 0 8px 18px rgba(16, 42, 67, .22);
    white-space: nowrap;
}
.hist-tip strong { display: block; font-size: .95rem; }
.hist-tip span { color: #c5d3de; }
.legend {
    display: flex;
    gap: .85rem 1.1rem;
    flex-wrap: wrap;
    align-items: center;
    margin: .85rem 0 0;
    color: var(--th-muted);
    font-size: .85rem;
}
.legend i {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: .35rem;
    vertical-align: middle;
}
.lg-room { background: var(--th-room); }
.lg-fridge { background: var(--th-fridge); }
.lg-freezer { background: var(--th-freezer); }
@media (max-width: 900px) {
    .hist-split { grid-template-columns: 1fr; }
    .health-stack { position: static; }
    .protect-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
    .th-links { margin-left: 0; width: 100%; order: 3; }
    .th-nav-actions { margin-left: auto; }
    .th-logout button { width: 44px; padding: 0; }
    .th-logout button span { display: none; }
    .grid { grid-template-columns: 1fr; }
    .alert-row { flex-direction: column; }
    .row-actions .btn, .row-actions .btn-ghost, .row-actions button { width: 100%; }
    .alert-row-actions { width: 100%; }
    .alert-row-actions form { width: 100%; }
    .tiles { grid-template-columns: 1fr; }
    .tile-logo { width: 64px; height: 64px; }
    .protect-row { grid-template-columns: 1fr 1fr; }
    .protect-chip-hint { display: none; }
    .mon-head { flex-direction: column; }
    .mon-head-actions { width: 100%; flex-wrap: wrap; }
    .btn-alerts, .btn-name { flex: 1 1 calc(50% - .3rem); }
    .house-bar-add { width: 100%; margin-left: 0; }
    .ranges { width: 100%; }
    .range { flex: 1 1 calc(50% - .4rem); }
    svg.hist { height: 170px; }
    .hist-svg { height: 132px; }
    .hist-lane-stats { width: 100%; }
    .alert-when-row { grid-template-columns: 1fr 1fr; }
    #thAlertTempField { grid-column: 1 / -1; }
}
