:root {
  color-scheme: light;
  --paper: #f0f4f6;
  --panel: #fff;
  --ink: #172d3a;
  --muted: #536978;
  --line: #dce5eb;
  --accent: #09657e;
  --accent-light: #e6f4f7;
  --danger: #a33029;
  --danger-light: #fcece9;
  --warning: #824a06;
  --warning-light: #fcf1d9;
  --positive: #176345;
  --positive-light: #e8f4ec;
  font: 16px/1.48 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: var(--accent); text-underline-offset: .16em; }
a:hover { text-decoration-thickness: .14em; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #1c89ab; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.22; }
h1 { font-size: clamp(1.7rem, 3vw, 2.45rem); letter-spacing: -.025em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
.wrap { width: min(1120px, 100% - 3rem); margin-inline: auto; }
.topbar { background: #142c3a; color: #eef7fa; }
.topbar-inner { min-height: 66px; display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.brand { display: inline-flex; gap: .66rem; align-items: baseline; color: inherit; text-decoration: none; }
.brand b { font-size: 1.05rem; letter-spacing: .1em; }
.brand span { color: #bed6e0; }
.account { display: flex; align-items: center; gap: 1rem; }
.account a, .quiet { color: #e0edf2; font-size: .9rem; }
.quiet { border: 0; background: transparent; padding: .3rem 0; text-decoration: underline; text-underline-offset: .16em; }
.page { padding-block: 34px 50px; }
.page-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: end; gap: .75rem 1rem; margin-bottom: 1.3rem; }
.page-heading .muted { margin-top: .2rem; }
.trail { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; color: var(--muted); font-size: .9rem; margin: 0 0 .45rem; }
.muted { color: var(--muted); font-size: .9rem; }
.number { font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .47fr); gap: 1rem; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: clamp(15px, 3vw, 25px); min-width: 0; border-radius: 12px; }
.panel > h2 { margin-bottom: .85rem; }
.site-list { display: grid; gap: .75rem; max-width: 720px; margin-top: 1rem; }
.project { color: var(--ink); text-decoration: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.project h2 { margin-bottom: .25rem; }
.link-arrow { color: var(--accent); font-size: 1.3rem; }
.project:hover, .point-row:hover { background: #f7fbfc; }
.button { display: inline-block; border: 1px solid var(--line); background: var(--panel); color: var(--accent); font-weight: 600; border-radius: 7px; padding: .45rem .68rem; text-decoration: none; font-size: .9rem; }
.button:hover { background: var(--accent-light); }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: #08526a; }
.sign-in { max-width: 420px; margin: 48px auto 0; }
.sign-in h1 { font-size: 1.75rem; }
.form-stack { display: grid; gap: 1rem; margin-top: 1.2rem; }
.form-stack label { display: grid; gap: .28rem; }
.form-stack input { width: 100%; padding: .5rem .65rem; border: 1px solid #b5c5ce; border-radius: 6px; }
.form-stack .button { justify-self: start; }
.error { color: var(--danger); margin-top: .65rem; }
.point-row { display: grid; grid-template-columns: minmax(115px, 1fr) auto auto; gap: .6rem 1.1rem; align-items: center; padding: .85rem 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.point-row .muted { display: block; }
.point-data { text-align: end; }
.point-data small { color: var(--muted); font-size: .8rem; }
.badge { display: inline-block; width: fit-content; border-radius: 5px; padding: .13rem .38rem; font-size: .79rem; font-weight: 600; }
.ok { color: var(--positive); background: var(--positive-light); }
.late { color: var(--warning); background: var(--warning-light); }
.status-dot { display: inline-block; height: 8px; width: 8px; border-radius: 50%; background: var(--warning); flex: none; }
.status-dot.critical { background: var(--danger); }
.alarm-preview { display: flex; gap: .65rem; align-items: baseline; text-decoration: none; border-top: 1px solid var(--line); padding: .65rem 0; color: var(--ink); }
.alarm-preview .muted { margin-top: .17rem; }
.reading-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: .5rem; }
.reading { margin-top: .47rem; font-size: clamp(1.9rem, 5vw, 3.4rem); line-height: 1.14; letter-spacing: -.035em; font-weight: 680; }
.reading small { color: var(--muted); font-size: .43em; font-weight: 550; letter-spacing: 0; }
.chart-wrap { margin-top: 1rem; }
#measurement-chart { display: block; width: 100%; }
#measurement-chart text { fill: var(--muted); font-size: 11px; }
#measurement-chart .axis { stroke: var(--line); stroke-width: 1; }
#measurement-chart .data-line { stroke: var(--accent); stroke-width: 2; fill: none; }
#measurement-chart .data-dot { fill: var(--accent); stroke: var(--panel); stroke-width: 1; }
#measurement-chart .limit { stroke-width: 1; stroke-dasharray: 4 4; }
#measurement-chart .warning { stroke: var(--warning); }
#measurement-chart .critical { stroke: var(--danger); }
.chart-caption { display: flex; flex-wrap: wrap; gap: .35rem 1rem; color: var(--muted); font-size: .85rem; }
.chart-warning::before, .chart-critical::before { content: ''; display: inline-block; width: 15px; border-top: 1px dashed var(--warning); vertical-align: middle; margin-right: .4rem; }
.chart-critical::before { border-color: var(--danger); }
.rule-note { margin-top: .35rem; }
.alarm-box { border-top: 1px solid var(--line); padding: .65rem 0; }
.alarm-box > :is(p, form) { margin-top: .45rem; }
.history-title { margin-top: 1.15rem; }
.history { list-style: none; margin: .45rem 0 0; padding: 0; }
.history li { border-top: 1px solid var(--line); padding: .55rem 0; }
.measurements { border-top: 1px solid var(--line); margin-top: .9rem; padding-top: .65rem; }
.measurements summary { cursor: pointer; color: var(--accent); }
table { border-collapse: collapse; width: 100%; font-size: .89rem; margin-top: .6rem; }
th, td { padding: .38rem .25rem; border-bottom: 1px solid var(--line); text-align: start; }
th:last-child, td:last-child { text-align: end; }
@media (max-width: 680px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .wrap { width: calc(100% - 1.5rem); }
  .page { padding-top: 23px; }
  .point-row { column-gap: .55rem; }
}
@media (max-width: 380px) {
  .point-row { grid-template-columns: minmax(0, 1fr) auto; }
  .point-row > .badge { grid-column: 1; grid-row: 2; }
  .account { gap: .5rem; }
}
