@font-face {
  font-family: "Prichal Sans";
  src: url("/static/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Prichal Sans";
  src: url("/static/fonts/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Prichal Sans";
  src: url("/static/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Prichal Mono";
  src: url("/static/fonts/jetbrains-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07111f;
  --bg-raise: #0c1a2e;
  --surface: #12243d;
  --surface-2: #183050;
  --line: #2d4d73;
  --ink: #f2f7fd;
  --muted: #c5d4e8;
  --faint: #9fb4ce;
  --accent: #8fd4ff;
  --accent-2: #1a4fbf;
  --accent-deep: #123f9c;
  --focus: #b9e6ff;
  --online: #b8ffe8;
  --online-bg: #0e3d3a;
  --offline: #ffd0b0;
  --offline-bg: #4a2c1c;
  --unknown: #d7e2f2;
  --unknown-bg: #243650;
  --stale: #ffe6ad;
  --stale-bg: #3f3416;
  --unparsable: #ffc9c9;
  --danger: #ffb4bc;
  --danger-bg: #4a2030;
  --danger-solid: #8e2438;
  --shadow: 0 18px 40px rgba(2, 8, 18, 0.35);
  --sans: "Prichal Sans", "Noto Sans", "Liberation Sans", "DejaVu Sans", sans-serif;
  --mono: "Prichal Mono", "JetBrains Mono", "Noto Sans Mono", "DejaVu Sans Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, #14345c, transparent 55%),
    radial-gradient(700px 380px at 100% 0%, #0d2748, transparent 50%),
    var(--bg);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  font-feature-settings: "kern" 1, "liga" 1;
}
img { display: block; }
a { color: var(--accent); text-underline-offset: 0.16em; }
a:hover { color: #d7f1ff; }
h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}
h1 { font-size: 2.15rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.28rem; margin: 0 0 0.65rem; }
p { margin: 0 0 0.85rem; }
.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 5;
  border-radius: 8px;
}
.skip:focus { top: 12px; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}
.shell-solo { grid-template-columns: minmax(0, 1fr); }
.side {
  background: #06101c;
  color: #e7f0fb;
  padding: 28px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid #16304e;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.brand strong {
  display: block;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.brand small { color: var(--muted); font-weight: 400; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  color: #e7f0fb;
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 500;
}
.nav a:hover { background: rgba(143, 212, 255, 0.08); color: white; }
.nav a[aria-current="page"] {
  background: #123056;
  box-shadow: inset 3px 0 0 var(--accent);
  color: white;
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.side-foot a { color: var(--accent); font-weight: 500; }
.linkish {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  padding: 8px 0;
  cursor: pointer;
  text-align: left;
  min-height: 44px;
}
.linkish:hover { color: white; }
.main { padding: 32px 36px 28px; max-width: 1120px; }
.foot { color: var(--faint); font-size: 0.86rem; margin-top: 36px; line-height: 1.45; }
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.lede { color: var(--muted); max-width: 64ch; }
.muted, .hint { color: var(--muted); }
.hint { display: block; font-weight: 400; margin-top: 6px; line-height: 1.45; }
.error { display: block; color: #ffc4cb; margin-top: 6px; font-weight: 500; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}
.btn.primary { background: var(--accent-2); color: #f7fbff; }
.btn.primary:hover { background: #2457c5; color: white; }
.btn.ghost { background: transparent; border-color: #3d628c; color: var(--ink); }
.btn.ghost:hover { background: #163456; color: white; }
.btn.danger { background: var(--danger-solid); color: #fff7f8; }
.btn.danger:hover { background: #d24b62; color: white; }
.btn:disabled, button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.wide { width: 100%; }
.btn + .btn, .btn + a.btn, a.btn + .btn { margin-left: 8px; }

.flash, .alert, .callout {
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.45;
}
.flash { background: #12365c; color: #e5f3ff; border: 1px solid #2d6296; }
.alert { background: var(--danger-bg); color: #ffd5db; border: 1px solid #8a3d52; }
.callout { background: #102844; border-left: 3px solid var(--accent); color: var(--ink); }
.callout.warn { background: #3a2a18; border-left-color: #f0b56a; color: #ffe7c8; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 0;
  margin: 0 0 16px;
  list-style: none;
  color: var(--muted);
}
.legend li { display: flex; gap: 8px; align-items: center; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.card, .panel, .empty, .login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.card {
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 230px;
}
.card h2 { margin: 0; font-size: 1.4rem; }
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { color: var(--accent); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.more { margin-top: auto; font-weight: 600; }
.chip { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.3;
}
.pill i {
  width: 8px;
  height: 8px;
  background: currentColor;
  display: block;
  flex: none;
}
.pill.online i { border-radius: 50%; }
.pill.offline i { border-radius: 1px; transform: rotate(45deg); }
.pill.unknown i, .pill.unparsable i { border-radius: 1px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.pill.stale i { border-radius: 1px; }
.pill.online { color: var(--online); background: var(--online-bg); }
.pill.offline { color: var(--offline); background: var(--offline-bg); }
.pill.unknown, .pill.unparsable { color: var(--unknown); background: var(--unknown-bg); }
.pill.stale { color: var(--stale); background: var(--stale-bg); }
.metrics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 0; }
.metrics div { margin: 0; min-width: 0; }
.metrics dt { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.metrics dd {
  margin: 0;
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.metrics small { color: var(--faint); display: block; margin-top: 2px; line-height: 1.35; }
.panel, .empty { padding: 18px; margin: 0 0 16px; }
.empty h2 { margin-top: 0; }
.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; }
.facts { margin: 0 0 12px; }
.facts div {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.facts dt { color: var(--muted); font-weight: 500; }
.facts dd { margin: 0; }
.break, .facts dd {
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.narrow { max-width: 720px; }
.step { margin: 8px 0 18px; }
.step h2 span {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent-deep);
  color: #f4f9ff;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0 0 12px;
  padding: 8px 12px 12px;
}
legend { padding: 0 6px; color: var(--muted); }
.choice { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; min-height: 44px; }
.choice input { margin-top: 6px; accent-color: var(--accent-2); }
.field { margin: 0 0 14px; }
label { font-weight: 600; }
input, select, textarea {
  width: 100%;
  margin-top: 6px;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid #3d628c;
  background: #0b182b;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
  line-height: 1.4;
}
input:hover, select:hover, textarea:hover { border-color: #6ea0d4; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
textarea { min-height: 96px; resize: vertical; }
::placeholder { color: #9fb4ce; opacity: 1; }
details { margin: 8px 0 16px; }
summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
}
summary:hover { color: var(--accent); }
.after, .events, .caveats, .sources { padding-left: 1.2rem; }
.events { list-style: none; padding-left: 0; }
.events li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.events time {
  display: block;
  color: var(--faint);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
.danger-zone {
  border: 1px solid #8a3d52;
  background: #2a1520;
  border-radius: 18px;
  padding: 16px;
  margin-top: 8px;
}
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-size: 0.86rem; font-weight: 600; }
td { font-variant-numeric: tabular-nums; }
tr:hover td { background: rgba(143, 212, 255, 0.04); }
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background:
    radial-gradient(800px 360px at 12% 0%, #1a4b86, transparent 58%),
    radial-gradient(700px 320px at 100% 10%, #0e2c52, transparent 55%),
    var(--bg);
}
.login-wrap { width: min(460px, 100%); }
.login-card { padding: 32px 28px 26px; }
.login-card h1 { font-size: 2.6rem; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: static;
    height: auto;
    padding: 16px;
    gap: 12px;
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 0 10px; }
  .side-foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 0;
  }
  .main { padding: 20px 16px 32px; }
  .page-head, .split, .facts div { display: block; }
  h1 { font-size: 1.85rem; }
  .page-head .btn, .page-head .pill { margin-top: 12px; }
  .btn + .btn, .btn + a.btn, a.btn + .btn { margin-left: 0; margin-top: 8px; }
  .danger-zone .btn { display: flex; }
  .legend { flex-direction: column; align-items: flex-start; }
  .metrics dd { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}
