:root {
  color-scheme: dark;
  --bg: #0c1522;
  --surface: #101e2e;
  --soft: #14253a;
  --border: #25384e;
  --text: #e6f1fb;
  --muted: #9eb2c7;
  --accent: #72e0c0;
  --warn: #f5ca81;
  --red: #f48e92;
  font: 14px/1.5 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--accent); overflow-wrap: anywhere; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px,3.5vw,42px); line-height: 1.08; letter-spacing: -.035em; }
h2 { font-size: 18px; letter-spacing: -.017em; }
h3 { font-size: 15px; }
p { max-width: 82ch; }
.subtle { color: var(--muted); }
.sidebar {
  width: 238px; padding: 24px 14px; background: #0f1b2a; border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 2;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 0 10px 23px; }
.brand strong { font-size: 21px; display: block; line-height: 1.05; letter-spacing: .04em; }
.brand small { color: var(--muted); }
.mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 8px;
  background: var(--accent); color: #092922; font-size: 22px; font-weight: 800; }
.sidebar nav { display: grid; gap: 3px; overflow: auto; }
nav button { text-align: left; border: 1px solid transparent; border-radius: 7px;
  background: none; color: var(--muted); padding: 10px 11px; font-weight: 600; }
nav button:hover, nav button[aria-current] { background: var(--soft); color: var(--text); }
nav button[aria-current] { border-color: var(--border); box-shadow: inset 3px 0 var(--accent); }
.side-foot { margin: auto 10px 0; padding-top: 13px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 5px; }
main { margin-left: 238px; min-height: 100vh; }
.top { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
  border-bottom: 1px solid var(--border); background: var(--surface); font-weight: 600; gap: 12px; }
.top > div { display: flex; align-items: center; gap: 12px; }
#content { padding: 28px; max-width: 1680px; margin-inline: auto; outline: 0; }
.heading { margin-bottom: 23px; display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.heading p { margin-top: 8px; color: var(--muted); }
.panel, .tile, .notice { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.panel { padding: 15px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-form { width: min(440px,100%); display: grid; gap: 14px; padding: 28px; }
.login-form label { display: grid; gap: 5px; }
.login-form button { justify-self: start; }
.panel h2, .panel h3 { margin-bottom: 9px; }
.notice { padding: 12px 14px; border-left: 3px solid var(--accent); }
.notice.hold { border-left-color: var(--warn); }
.notice p { margin-top: 3px; color: var(--muted); }
.status { font-size: 12px; font-weight: 700; color: var(--warn); }
.status.good { color: var(--accent); }
.grid, .tiles { display: grid; gap: 13px; }
.tiles { grid-template-columns: repeat(4,minmax(0,1fr)); }
.grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.tile { padding: 13px 15px; }
.tile small { color: var(--muted); font-weight: 600; }
.tile strong { display: block; font-size: clamp(20px,2vw,29px); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.stack { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; }
.flex { display: flex; flex-wrap: wrap; gap: 9px; align-items: end; }
.button, select, input, textarea { border: 1px solid var(--border); border-radius: 6px;
  background: var(--soft); color: var(--text); padding: 7px 10px; min-width: 0; }
.button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); color: #052d22; border-color: var(--accent); font-weight: 750; }
.button[disabled] { opacity: .55; cursor: wait; }
a.button { text-decoration: none; display: inline-block; }
label { display: grid; gap: 3px; color: var(--muted); font-size: 13px; }
label.check { display: flex; align-items: center; min-height: 36px; }
textarea { width: 100%; min-height: 92px; font-family: Consolas, monospace; }
details summary { cursor: pointer; color: var(--accent); }
details > div, details > form { margin-top: 10px; }
.table-shell { max-width: 100%; overflow: auto; max-height: 660px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--soft); color: #cddded; font-size: 12px; z-index: 1; }
td.wrap { white-space: normal; overflow-wrap: anywhere; }
th button, .link { color: inherit; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.link { color: var(--accent); text-decoration: underline; }
tbody tr:hover { background: #142539; }
canvas { width: 100%; height: 250px; display: block; }
#price-chart { height: 385px; }
.chart-empty { display: grid; place-items: center; min-height: 185px; text-align: center; color: var(--muted); padding: 16px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 10px; }
.metrics > div { border-top: 1px solid var(--border); padding-top: 7px; }
.metrics dt { color: var(--muted); font-size: 12px; }
.metrics dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.feed { padding: 2px 7px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); }
.feed.live { color: var(--accent); }
.feed.delayed, .feed.stale { color: var(--warn); }
.chart-options { margin-bottom: 8px; align-items: start; }
.chart-options fieldset { padding: 2px 8px; }
.chart-options .check { min-height: 27px; }
#interactive-chart { height: 405px; }
.chart-point { display: block; min-height: 32px; color: var(--muted); font-variant-numeric: tabular-nums; }
#monitor-table { min-width: 0; }
#monitor-table .table-shell { max-height: 480px; }
#monitor-table td:first-child, #monitor-table th:first-child { position: sticky; left: 0; background: var(--soft); }
#monitor-table th:first-child { z-index: 2; }
.error { color: var(--red); padding: 7px 0; }
.success { color: var(--accent); padding: 7px 0; }
fieldset { border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
@media (max-width: 880px) {
  .sidebar { position: static; width: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 13px; }
  .sidebar nav { display: flex; overflow: auto; }
  nav button { white-space: nowrap; }
  .brand { padding: 0 3px 10px; }
  .side-foot { display: none; }
  main { margin-left: 0; }
  #content { padding: 19px; }
  .top { padding: 0 19px; }
}
@media (max-width: 590px) {
  .tiles { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid { grid-template-columns: 1fr; }
  .top { font-size: 12px; }
  .top .subtle { display: none; }
  th, td { padding: 7px; }
}
