* { box-sizing: border-box; }
:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #142c39;
  background: #eef3f5;
}
body { margin: 0; }
main { max-width: 1000px; margin: 0 auto; padding: 52px 24px; }
header { margin-bottom: 28px; }
h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -1.5px; margin: 8px 0 10px; }
h2 { font-size: 19px; margin: 0; }
p { color: #536b77; line-height: 1.5; margin: 12px 0; }
.eyebrow { font-size: 11px; letter-spacing: 1.8px; font-weight: 750; color: #3c6474; }
.connection { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.badge { background: #dee7eb; color: #425864; font-size: 13px; padding: 8px 12px; border-radius: 100px; }
.badge.online { background: #d8f0e6; color: #106148; }
.badge.offline { background: #f8e3df; color: #903c2f; }
#freshness { font-size: 13px; color: #536b77; }
.cards { display: grid; grid-template-columns: 1fr 1.1fr; gap: 18px; }
.card { border: 1px solid #dce5e9; background: white; padding: 30px; border-radius: 18px; min-height: 260px; }
.reading { font-size: 76px; font-weight: 650; letter-spacing: -4px; margin: 14px 0 0; font-variant-numeric: tabular-nums; }
.unit { font-size: 25px; letter-spacing: 0; margin-left: 8px; color: #617b88; }
.relay { font-size: 54px; font-weight: 650; letter-spacing: -2px; margin: 16px 0 24px; }
.relay.on { color: #08785a; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #126b69;
  background: #126b69;
  color: white;
  border-radius: 8px;
  padding: 11px 17px;
}
button.secondary { background: transparent; color: #234958; border-color: #cbd9df; }
button:hover { filter: brightness(.94); }
button:focus-visible { outline: 3px solid #6cb4e5; outline-offset: 3px; }
button:disabled { opacity: .45; cursor: default; }
#feedback { font-size: 13px; min-height: 20px; }
.messages { margin-top: 30px; }
.section-title { display: flex; justify-content: space-between; gap: 15px; align-items: center; }
#messages { background: white; border: 1px solid #dce5e9; border-radius: 12px; max-height: 360px; overflow: auto; padding: 0 18px; }
.event { padding: 14px 0; border-bottom: 1px solid #e8eff2; }
.event:last-child { border: 0; }
.event small { color: #5c7380; display: block; }
.event pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; margin: 8px 0 0; color: #254856; }
#error { background: #f8e3df; color: #903c2f; padding: 14px; border-radius: 8px; }
footer { margin-top: 25px; color: #617b88; font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 650px) {
  main { padding: 30px 16px; }
  .cards { grid-template-columns: 1fr; }
  .card { padding: 24px; min-height: auto; }
  .reading { font-size: 64px; }
  .section-title { align-items: flex-start; }
}

.login { max-width: 520px; }
.login label { display: block; margin: 14px 0 6px; }
.login input { width: 100%; padding: 12px; font: inherit; border: 1px solid #bacbd3; border-radius: 6px; }
.login button { margin-top: 22px; width: 100%; }
