:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: #f4f7fb;
  color: #14243c;
  --muted: #52637b;
  --border: #dce4ef;
  --blue: #2055c5;
  --accent: #2157cc;
}
* { box-sizing: border-box; }
body { margin: 0; }
.topbar { background: white; border-bottom: 1px solid var(--border); }
.topbar-inner, main { width: min(1140px, calc(100% - 64px)); margin: auto; }
.topbar-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; font-size: 18px; white-space: nowrap; }
.brand strong { color: var(--blue); font-weight: inherit; }
.brand-mark { background: var(--blue); width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 2px; }
.brand-mark i { width: 2px; height: 9px; border-radius: 4px; background: white; }
.brand-mark i:nth-child(even) { height: 14px; }
.brand-mark i:nth-child(3) { height: 20px; }
.local-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.local-label span { width: 7px; height: 7px; background: #087a67; border-radius: 50%; flex: none; }
main { padding: 39px 0 21px; }
.heading, .card-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.heading { margin-bottom: 25px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(30px, 4.5vw, 43px); letter-spacing: -.042em; line-height: 1.13; font-weight: 760; }
.heading p { color: var(--muted); font-size: 15px; line-height: 1.5; margin-top: 9px; }
button { font: inherit; cursor: pointer; min-height: 44px; border-radius: 9px; font-weight: 700; }
button:focus-visible, input:focus-visible { outline: 3px solid #88aafd; outline-offset: 3px; }
.measure { background: var(--blue); border: 1px solid var(--blue); color: white; padding: 0 18px; display: flex; align-items: center; justify-content: center; gap: 9px; flex-shrink: 0; }
.measure:hover { background: #173f99; }
.measure[data-active="true"] { color: #a2293d; background: #fff; border-color: #eac6cd; }
.measure[data-active="true"]:hover { background: #fff2f4; }
.button-symbol { display: block; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.measure[data-active="true"] .button-symbol { border-radius: 2px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(255px, 320px); gap: 19px; align-items: start; }
.measurements { display: grid; gap: 19px; min-width: 0; }
.card { background: white; border: 1px solid var(--border); border-radius: 17px; padding: 22px 24px; box-shadow: 0 2px 4px #14243c06; }
h2 { font-size: 17px; line-height: 1.35; letter-spacing: -.012em; }
h3 { font-size: 13px; margin-bottom: 4px; }
.status { --status-bg: #ecf0f6; --status-text: #465a75; display: flex; align-items: center; gap: 7px; border-radius: 30px; background: var(--status-bg); color: var(--status-text); padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.status span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status[data-tone="normal"] { --status-bg: #e8f6ef; --status-text: #176647; }
.status[data-tone="warning"] { --status-bg: #fff3dc; --status-text: #854600; }
.status[data-tone="alert"], .status[data-tone="error"] { --status-bg: #fff0f1; --status-text: #a2293d; }
.status[data-tone="recovery"], .status[data-tone="waiting"] { --status-bg: #eaf1ff; --status-text: #2352aa; }
.reading { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 18px; }
.reading output { font-size: clamp(43px, 8vw, 73px); line-height: 1; font-weight: 750; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.reading span { color: var(--muted); font-weight: 650; }
.meter { height: 10px; position: relative; border-radius: 9px; background: #e9eff8; }
.meter-fill { width: 0%; height: 100%; border-radius: inherit; background: #285bcd; transition: width .2s ease; }
.meter-fill[data-tone="warning"] { background: #b66d14; }
.meter-fill[data-tone="alert"] { background: #bf4050; }
.meter-threshold { position: absolute; top: -3px; bottom: -3px; width: 2px; left: 70%; background: #a66426; }
.meter-labels, .chart-times { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.meter-labels { margin-top: 8px; }
.feedback { min-height: 21px; margin-top: 15px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.feedback[data-error="true"], .rules-feedback[data-error="true"] { color: #a2293d; }
.subtle { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.legend { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 11px; white-space: nowrap; }
.series-key, .threshold-key { display: inline-block; width: 13px; border-top: 2px solid var(--blue); }
.threshold-key { border-color: #a66426; border-top-style: dashed; margin-left: 6px; }
.plot { height: 190px; position: relative; margin-top: 17px; }
#chart { display: block; width: 100%; height: 100%; }
.plot-empty { position: absolute; inset: 0 4px 0 38px; display: grid; place-content: center; text-align: center; padding: 10px; color: var(--muted); font-size: 13px; pointer-events: none; }
.plot-empty[hidden] { display: none; }
.chart-times { padding: 0 3px 0 37px; }
.settings form { margin-top: 17px; }
label { display: block; font-size: 13px; font-weight: 650; margin-bottom: 6px; }
.input { display: flex; align-items: center; position: relative; margin-bottom: 13px; }
.input input { appearance: textfield; background: #f8faff; width: 100%; min-height: 42px; border: 1px solid var(--border); border-radius: 8px; padding: 7px 58px 7px 11px; font: inherit; font-size: 16px; font-weight: 650; color: inherit; }
.input input::-webkit-inner-spin-button { appearance: none; }
.input span { position: absolute; right: 11px; color: var(--muted); font-size: 12px; pointer-events: none; }
.apply { display: block; width: 100%; border: 1px solid #cbd9f4; color: #1846a5; background: #eef4ff; }
.apply:hover { background: #e1ecff; }
.rules-feedback { color: #176647; font-size: 12px; margin-top: 7px; }
.rules-feedback:empty { display: none; }
.note { margin-top: 19px; padding-top: 15px; border-top: 1px solid var(--border); }
.note p, footer { font-size: 12px; line-height: 1.6; color: var(--muted); }
footer { margin-top: 19px; }
@media (max-width: 740px) {
  .topbar-inner, main { width: calc(100% - 36px); }
  main { padding-top: 26px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .heading { align-items: start; flex-direction: column; gap: 15px; margin-bottom: 18px; }
  .measure { width: 100%; }
  .card { padding: 17px; }
  .layout, .measurements { gap: 13px; }
}
@media (max-width: 360px) {
  .card-heading { gap: 8px; }
  .history .card-heading { align-items: start; flex-direction: column; }
  .local-label { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .meter-fill { transition: none; } }
[hidden] { display: none !important; }
.room-panel { margin-bottom: 19px; }
.room-panel .apply { width: auto; padding: 0 12px; white-space: nowrap; }
.room-panel label { margin-top: 12px; }
.room-panel input { width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; font-size: 16px; }
.layout.viewer { grid-template-columns: minmax(0, 1fr); }
.viewer .meter-threshold, .viewer .legend { display: none; }
