@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/inter.woff2) format("woff2");
}
:root {
  color-scheme: dark;
  --ground: #0c201f;
  --bar: #081917;
  --panel: #132b29;
  --field: #0c211e;
  --line: #304d48;
  --edge: #44655d;
  --text: #f2f5e9;
  --muted: #b1c6bd;
  --accent: #c0ef92;
  --warn: #ffd198;
  --good: #a6e7be;
  --danger: #ffb5b5;
  font-family:
    Inter,
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  font-synthesis: none;
  font-size: 16px;
  line-height: 1.48;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.btn {
  appearance: none;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--edge);
  padding: 0.65rem 0.95rem;
  min-height: 44px;
  border-radius: 5px;
  font-weight: 630;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.25;
}
button:hover,
.btn:hover {
  background: #224438;
  border-color: var(--accent);
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button.primary,
.btn.primary {
  background: var(--accent);
  color: #10291b;
  border-color: var(--accent);
}
button.primary:hover,
.btn.primary:hover {
  background: #dcffc0;
}
button.outline {
  border-color: var(--accent);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.bar {
  background: var(--bar);
  border-bottom: 1px solid #28473d;
}
.bar-inner,
main:not(.setup) {
  max-width: 1450px;
  margin: auto;
  padding-left: clamp(18px, 3.6vw, 62px);
  padding-right: clamp(18px, 3.6vw, 62px);
}
.bar-inner {
  min-height: 75px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  font-size: clamp(20px, 1.9vw, 29px);
  line-height: 1.12;
  font-weight: 740;
  letter-spacing: -0.04em;
}
.brand img {
  width: 48px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 490;
  letter-spacing: 0.035em;
  margin-top: 3px;
}
nav {
  display: flex;
  align-self: stretch;
  gap: clamp(6px, 1.3vw, 22px);
}
nav a {
  padding: 0 0.2rem;
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 570;
  white-space: nowrap;
}
nav a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--text);
}
nav a:hover {
  color: var(--accent);
}
main:not(.setup) {
  padding-top: clamp(26px, 3.4vw, 52px);
  padding-bottom: 74px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(35px, 4vw, 60px);
  line-height: 1.04;
  font-weight: 705;
  letter-spacing: -0.052em;
}
h2 {
  font-size: clamp(21px, 2vw, 31px);
  line-height: 1.14;
  letter-spacing: -0.036em;
  font-weight: 670;
}
h3,
legend {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.012em;
}
p + p {
  margin-top: 0.55rem;
}
.subtitle {
  color: var(--muted);
  margin-top: 8px;
  font-size: clamp(16px, 1.5vw, 22px);
}
.pagehead {
  margin-bottom: clamp(22px, 2.5vw, 36px);
}
.muted,
small {
  color: var(--muted);
}
.subtle {
  color: var(--muted);
  font-size: 0.84rem;
}
.state {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dot {
  height: 9px;
  width: 9px;
  flex: none;
  display: inline-block;
  border-radius: 50%;
  background: #8da0af;
}
.dot.on {
  background: var(--good);
}
.dot.off {
  background: #a9c0b5;
}
.warn {
  color: var(--warn);
}
.danger {
  color: var(--danger);
}
.good {
  color: var(--good);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--edge);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 24px;
}
.metric {
  padding: clamp(15px, 1.75vw, 28px);
  min-width: 0;
}
.metric + .metric {
  border-left: 1px solid var(--line);
}
.metric h3 {
  color: var(--muted);
  font-size: clamp(0.82rem, 1.35vw, 1.15rem);
  font-weight: 600;
}
.reading {
  font-size: clamp(1.9rem, 3.3vw, 3.2rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.15;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.reading i {
  font-size: 0.55em;
  font-style: normal;
  font-weight: 560;
  letter-spacing: -0.02em;
}
.metric time {
  display: block;
  font-size: 0.82rem;
  margin-top: 6px;
}
.pair {
  display: grid;
  grid-template-columns: minmax(0, 1.43fr) minmax(0, 1fr);
  gap: 22px;
}
.panel {
  padding: clamp(17px, 1.9vw, 30px);
  border: 1px solid var(--edge);
  border-radius: 5px;
  min-width: 0;
}
.panel h2,
.panel h3 {
  margin-bottom: 15px;
}
.pair + .panel,
.panel + .panel,
.sectiongap {
  margin-top: 22px;
}
.pair > .panel {
  margin-top: 0;
}
.camera-empty {
  display: flex;
  flex-direction: column;
  gap: 13px;
  align-items: center;
  justify-content: center;
  min-height: 165px;
  color: var(--muted);
  text-align: center;
}
.camera-empty svg {
  width: 47px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}
.camera-frame {
  display: block;
  width: 100%;
  max-height: 410px;
  object-fit: contain;
  background: #030b12;
  border-radius: 3px;
}
.stack {
  display: grid;
  gap: 14px;
}
.stack.tight {
  gap: 9px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}
.split {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.log-actions {
  margin-top: 16px;
}
.log-actions button {
  width: 100%;
}
.statusline {
  margin-top: 12px;
  font-size: 0.86rem;
  color: var(--muted);
}
.noticebar {
  padding: 0.65rem 0.9rem;
  border-left: 3px solid var(--warn);
  background: #292c2c;
  color: #f8debe;
  margin: 12px 0;
}
.small-link {
  font-size: 0.9rem;
}
.metric-add {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: -10px 0 22px;
  color: var(--muted);
  font-size: 0.91rem;
}
.setup,
.login {
  max-width: 580px;
  margin: clamp(38px, 8vw, 110px) auto;
  padding: 26px;
}
.setup h1,
.login h1 {
  margin-bottom: 14px;
}
.setup form,
.login form {
  margin-top: 25px;
}
.word {
  color: var(--accent);
  font-weight: bold;
  margin-bottom: 18px;
}
.forms {
  max-width: 900px;
}
.forms .panel {
  margin-bottom: 18px;
}
label {
  font-weight: 560;
  font-size: 0.9rem;
  display: grid;
  gap: 5px;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
  display: grid;
  gap: 10px;
  min-width: 0;
}
legend {
  padding: 0 0.35rem;
}
input,
select,
textarea {
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 0.65rem 0.75rem;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  font-size: 1rem;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  accent-color: var(--accent);
}
label.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
}
.rule {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.list {
  display: grid;
}
.row {
  padding: 15px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.row:first-child {
  border-top: 0;
}
.row strong {
  display: block;
}
.row small {
  display: block;
  margin-top: 2px;
}
.row .mark {
  font-size: 0.8rem;
  color: var(--muted);
}
.flag {
  font-size: 0.76rem;
  font-weight: 650;
  color: var(--warn);
  display: inline-block;
  margin-right: 0.55rem;
}
.pager {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
}
.userrow {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.userrow .actions {
  margin-top: 6px;
}
details {
  margin-top: 12px;
}
summary {
  cursor: pointer;
  min-height: 40px;
  color: var(--accent);
  padding: 8px 0;
}
code,
.mono {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}
dialog {
  width: min(490px, calc(100% - 32px));
  max-height: 85dvh;
  padding: 24px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--edge);
  border-radius: 7px;
}
dialog::backdrop {
  background: #020910bb;
}
dialog h2 {
  margin-bottom: 12px;
}
dialog form {
  margin-top: 14px;
}
#notice {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  max-width: calc(100% - 28px);
  width: max-content;
  padding: 12px 19px;
  background: #234233;
  border: 1px solid var(--accent);
  border-radius: 6px;
  box-shadow: 0 4px 18px #0005;
}
#notice[hidden],
[hidden] {
  display: none !important;
}
.errorbox {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 8px 0;
}
time {
  font-variant-numeric: tabular-nums;
}
button.compact {
  min-height: 38px;
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
}
@media (max-width: 800px) {
  .bar-inner {
    display: block;
    padding-top: 12px;
  }
  .brand {
    font-size: 22px;
  }
  .brand img {
    width: 39px;
  }
  .brand small {
    font-size: 0.68rem;
  }
  nav {
    gap: 18px;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  nav a {
    font-size: 0.87rem;
    min-height: 45px;
  }
  .pair {
    gap: 14px;
  }
  .metrics {
    margin-bottom: 15px;
  }
  .metric {
    padding: 15px;
  }
  .panel {
    padding: 17px;
  }
  .pair + .panel,
  .sectiongap {
    margin-top: 15px;
  }
}
@media (max-width: 620px) {
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metric:nth-child(3) {
    border-left: 0;
  }
  .metric:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .pair {
    grid-template-columns: 1fr;
  }
  .camera-empty {
    min-height: 112px;
  }
  .row {
    flex-wrap: wrap;
  }
  .bar-inner,
  main:not(.setup) {
    padding-left: 18px;
    padding-right: 18px;
  }
  nav {
    gap: 14px;
  }
  .login,
  .setup {
    margin: 26px auto;
    padding: 20px;
  }
  .pagehead {
    margin-bottom: 20px;
  }
  .metrics .reading {
    margin-top: 4px;
  }
  .fields {
    grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  }
  .pair > .panel + .panel {
    margin: 0;
  }
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(22px, 2.5vw, 36px);
}
.dashboard-head .pagehead {
  margin: 0;
}
.quickstate {
  display: grid;
  gap: 5px;
  font-size: 0.95rem;
}
.quickstate .state {
  color: var(--muted);
  font-weight: 600;
}
.history {
  margin-top: 18px;
}
.history > summary {
  font-size: 1.1rem;
  font-weight: 650;
  min-height: 28px;
  padding: 0;
}
.history[open] > summary {
  margin-bottom: 16px;
}
.trend {
  width: 100%;
  height: 145px;
  margin-top: 12px;
  display: block;
}
.trend .guide {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.trend .line,
.trend .range {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.trend .range {
  stroke: var(--edge);
  stroke-width: 3;
}
.trend circle {
  fill: var(--accent);
}
.table-wrap {
  overflow: auto;
  max-height: 280px;
}
table {
  border-collapse: collapse;
  width: 100%;
}
td,
th {
  padding: 7px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 0.85rem;
}
th {
  color: var(--muted);
  position: sticky;
  top: 0;
  background: var(--ground);
}
@media (min-width: 801px) {
  .bar-inner,
  main:not(.setup) {
    max-width: 1590px;
  }
  .bar-inner {
    min-height: 73px;
  }
  .bar-inner nav a {
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
  }
  main:not(.setup) {
    padding-top: clamp(26px, 2.6vw, 44px);
  }
  .metric {
    padding: clamp(15px, 1.5vw, 23px);
  }
  .log-actions button {
    min-height: 50px;
  }
  .pair .camera-empty {
    min-height: 183px;
  }
}
@media (max-width: 620px) {
  .dashboard-head {
    display: grid;
    gap: 11px;
  }
  .quickstate {
    gap: 3px;
  }
  .trend {
    height: 110px;
  }
}

.metric {background:var(--panel)}
.metric-hint {display:block;font-size:.73rem;margin-top:8px}
.metrics {border-radius:10px}
.metric:first-child .reading {color:var(--accent)}
.station-foot {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
input,select,textarea {max-width:100%;min-width:0}
.panel {background:var(--panel);border-radius:10px}
.bar-inner,main:not(.setup) {max-width:1100px}
@media (max-width:620px) {
 .dashboard-head {margin-bottom:16px}
 .reading {font-size:2.3rem}
 .metric {padding:14px 12px}
 .metric time {font-size:.74rem}
 nav {max-width:100%}
 .bar-inner:has(nav:empty) {padding-bottom:12px}
}
.run-summary {padding:1rem 0;border-bottom:1px solid var(--line);font-size:.9rem}
.run-summary ul {padding-left:1.25rem}

.nav-short {display:none}
@media (max-width:620px) {
 .nav-full {display:none}
 .nav-short {display:inline}
 nav {justify-content:space-between;gap:4px}
 nav a {font-size:.77rem}
}
.dot.alarm {background:var(--warn)}
