:root {
  color-scheme: light;
  --navy: #183153;
  --blue: #2274a5;
  --blue-soft: #e9f3fa;
  --red: #c73e3a;
  --red-soft: #fceceb;
  --green: #1f8a5b;
  --ink: #17212b;
  --muted: #647180;
  --line: #d8e0e7;
  --surface: #ffffff;
  --background: #f3f6f8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  line-height: 1.45;
}

button, input { font: inherit; }

button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(34, 116, 165, 0.35);
  outline-offset: 2px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem max(1rem, calc((100vw - 1080px) / 2));
  color: white;
  background: var(--navy);
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { margin-bottom: 0.25rem; font-size: 1.25rem; }

.eyebrow {
  margin-bottom: 0.1rem;
  color: #bcd2e4;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.layout {
  width: min(1080px, calc(100% - 2rem));
  margin: 1rem auto 3rem;
  display: grid;
  gap: 1rem;
}

.card {
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(24, 49, 83, 0.06);
}

.current-card, .section-heading, .button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.label, .muted, .hint { color: var(--muted); }
.label { margin-bottom: 0; font-size: 0.9rem; }
.muted, .hint { margin-bottom: 0; font-size: 0.9rem; }

.current-value {
  margin-bottom: 0;
  color: var(--navy);
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 750;
  letter-spacing: -0.05em;
  line-height: 1.05;
}

.status-block { display: flex; align-items: center; gap: 0.55rem; }
.status-dot { width: 0.75rem; height: 0.75rem; border-radius: 999px; background: #a6afb7; }
.status-dot.ok { background: var(--green); box-shadow: 0 0 0 5px rgba(31, 138, 91, 0.12); }
.status-dot.stale { background: #d68d19; box-shadow: 0 0 0 5px rgba(214, 141, 25, 0.12); }

.chart-wrap { height: 300px; margin-top: 1rem; }
#temperatureChart { display: block; width: 100%; height: 100%; }

.button {
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--blue);
  border-radius: 0.65rem;
  color: white;
  background: var(--blue);
  cursor: pointer;
  font-weight: 650;
}

.button:hover { filter: brightness(0.96); }
.button:disabled { cursor: not-allowed; filter: none; opacity: 0.5; }
.button.secondary { border-color: var(--line); color: var(--navy); background: white; }
.topbar .button.secondary { border-color: rgba(255,255,255,.35); color: white; background: transparent; }
.button.danger { border-color: #efcac8; color: var(--red); background: var(--red-soft); }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 13rem));
  gap: 1rem;
  margin: 1rem 0 0.5rem;
}

label { display: grid; gap: 0.35rem; color: var(--navy); font-weight: 650; }
input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #b9c5cf;
  border-radius: 0.55rem;
  color: var(--ink);
  background: white;
}

.button-row { justify-content: flex-start; margin-top: 1rem; flex-wrap: wrap; }
.pill { padding: 0.35rem 0.65rem; border-radius: 999px; color: var(--muted); background: #edf1f4; font-size: 0.85rem; }
.pill.ok { color: #146b45; background: #e4f5ed; }
.message { min-height: 1.45rem; margin: 0.75rem 0 0; color: var(--muted); }
.message.error, .error { color: var(--red); }

details { margin-top: 0.75rem; }
summary { cursor: pointer; color: var(--navy); font-weight: 650; }
details p { margin: 0.5rem 0 0; color: var(--muted); }

.table-wrap { max-height: 28rem; margin-top: 1rem; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.7rem; border-bottom: 1px solid var(--line); text-align: left; }
th { position: sticky; top: 0; background: var(--surface); color: var(--muted); font-size: 0.85rem; }
td:last-child { font-variant-numeric: tabular-nums; font-weight: 650; }

.privacy-note { padding: 0 0.5rem; color: var(--muted); font-size: 0.85rem; }
.privacy-note p { margin-bottom: 0; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(28rem, 100%); padding: 2rem; border: 1px solid var(--line); border-radius: 1rem; background: white; box-shadow: 0 12px 40px rgba(24,49,83,.1); }
.login-card h1 { margin-bottom: 0.5rem; color: var(--navy); }
.login-form { display: grid; gap: 0.8rem; margin-top: 1.25rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 650px) {
  .current-card, .section-heading { align-items: flex-start; }
  .current-card { flex-direction: column; }
  .settings-grid { grid-template-columns: 1fr; }
  .chart-wrap { height: 240px; }
  .button-row .button { flex: 1 1 9rem; }
  th, td { padding: 0.6rem 0.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
