:root {
  color-scheme: light;
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --raised: #F8FAFC;
  --ink: #12233A;
  --text: #2A3848;
  --muted: #5F6C7B;
  --line: #E2E7ED;
  --field: #C4CDD8;
  --track: #E3E8EE;
  --ok: #1F9D55;
  --warn: #C98500;
  --bad: #D2382C;
  --maint: #2A78D6;
  --idle: #9AA6B4;
  --nodata: #DDE3EA;
  --s1: #2A78D6;
  --s2: #EB6834;
  --mark: #FFF7DC;
  --accent: #12233A;
  --on-accent: #FFFFFF;
  --scroll: #C3CDD9;
  --scroll-hover: #8C99A8;
  --shadow: 0 1px 2px rgba(18, 35, 58, .05), 0 6px 20px rgba(18, 35, 58, .06);
  --bar: #12233A;
  --bar-ink: #FFFFFF;
  --bar-muted: #C9D3DE;
  --bar-line: rgba(255, 255, 255, .22);
  --bar-hover: rgba(255, 255, 255, .08);
  /* each page sets these on its body: the public page reads larger and narrower */
  --size: 15px;
  --wrap: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0B121B;
    --surface: #121C28;
    --raised: #172331;
    --ink: #EEF3F8;
    --text: #D2DBE5;
    --muted: #93A1B2;
    --line: #223144;
    --field: #33465C;
    --track: #223144;
    --ok: #34B56C;
    --warn: #E5AA1F;
    --bad: #EE5A4E;
    --maint: #4C93E6;
    --idle: #5B6B7E;
    --nodata: #253447;
    --s1: #3987E5;
    --s2: #E5733F;
    --mark: #2A2514;
    --accent: #EEF3F8;
    --on-accent: #0B121B;
    --scroll: #33465C;
    --scroll-hover: #4D6380;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-hover); }
/* the bar stays put and only the page under it scrolls, so the scrollbar never runs behind the bar */
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); color: var(--text); font: var(--size)/1.5 "IBM Plex Sans", "Segoe UI", sans-serif; }
.page { flex: 1; min-height: 0; overflow-y: auto; }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.25; font-weight: 600; }
ol, ul { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--maint); outline-offset: 2px; }
.mono, code { font-family: "IBM Plex Mono", Consolas, monospace; font-weight: 500; font-variant-numeric: tabular-nums; }
code { font-size: 0.84em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

.bar { flex: none; position: relative; z-index: 20; background: var(--bar); box-shadow: 0 4px 16px rgba(0, 0, 0, .12); }
.bar .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand svg { height: 22px; display: block; }
.area { color: var(--bar-ink); font-weight: 500; padding-left: 14px; border-left: 1px solid var(--bar-line); margin-right: auto; }
.me { color: var(--bar-muted); font-size: 0.9rem; }
.ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--bar-line); background: none; color: var(--bar-ink); cursor: pointer; text-decoration: none; font-size: 0.9rem; font-weight: 500; white-space: nowrap; }
.ghost:hover { background: var(--bar-hover); }
.ghost[aria-current="page"] { background: var(--bar-hover); border-color: var(--bar-muted); }

.card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.head h1 { font-size: 1.4rem; }
.sec { display: flex; align-items: baseline; gap: 10px; font-size: 1rem; margin-bottom: 10px; }
.sec small { font-size: 0.84rem; font-weight: 400; color: var(--muted); }
.empty { padding: 18px; color: var(--muted); }

.live { display: inline-flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--muted); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.live.stale::before { background: var(--warn); }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.maint { background: var(--maint); }
.dot.idle { background: var(--idle); }
.pill { display: inline-block; padding: 2px 9px; font-size: 0.76rem; font-weight: 600; white-space: nowrap; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pill.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.pill.maint { color: var(--maint); background: color-mix(in srgb, var(--maint) 12%, transparent); }
.pill.tag, .pill.idle { color: var(--muted); background: var(--raised); border: 1px solid var(--line); font-weight: 500; }
.meter { width: 64px; height: 6px; background: var(--track); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--s1); transform-origin: left; }
.meter.warn i { background: var(--warn); }
.meter.bad i { background: var(--bad); }
.s1 { background: var(--s1); }
.s2 { background: var(--s2); }

/* slides open by animating its one row from 0fr to 1fr, so the content needs no fixed height */
.drawer { display: grid; grid-template-rows: 0fr; }
.drawer.on { grid-template-rows: 1fr; }
.drawer > div { min-height: 0; overflow: hidden; }

/* motion only for people who haven't asked for less */
@media (prefers-reduced-motion: no-preference) {
  .live::before { animation: ping 2s infinite; }
  .live.stale::before { animation: none; }
  .dot, .pill { transition: background-color .3s, color .3s; }
  .dot.bad { animation: alarm 1.4s infinite; }
  .drawer { transition: grid-template-rows .3s cubic-bezier(.2, .7, .3, 1); }
}
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes alarm { 50% { opacity: .35; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 640px) {
  .area, .me, .long { display: none; }
  .brand { margin-right: auto; }
}
/* last, so anything toggled with hidden actually hides; pages that give toggled things a display repeat it */
[hidden] { display: none; }
