/* ping.report portal — design system.
   Grounded in the logo: a deep-teal brand, a cyan→blue "signal" wave, and an
   ECG heartbeat that beats when healthy and flatlines when a service is down.
   No build step and the CSP blocks web fonts, so type is system-ui for UI and
   ui-monospace as a deliberate instrument-readout voice for telemetry. */

:root {
  /* Brand constants — identical in both themes; they come from the logo. */
  --brand-deep-1: #0f2027;
  --brand-deep-2: #203a43;
  --brand-deep-3: #2c5364;
  --brand-cyan: #36d1dc;
  --brand-blue: #5b86e5;
  --vital: #2ee6a6;

  /* Light theme (default). */
  --bg: #eaeff3;
  --panel: #ffffff;
  --panel-2: #f2f5f8;
  --panel-3: #e9eef2;
  --border: #dbe2e8;
  --border-strong: #c6d0d8;
  --text: #14212b;
  --text-2: #38505f;
  --muted: #64757f;
  --faint: #93a3ad;

  --accent: #0e8ba3;
  --accent-hover: #0b7488;
  --accent-fg: #ffffff;
  --accent-soft: #e0f3f6;

  --pass: #0f8a5f;
  --pass-soft: #e2f5ec;
  --fail: #dc2f4f;
  --fail-soft: #fce7ea;
  --fail-strong: #c31d3d;
  --warn: #b06f13;
  --warn-soft: #fbf0da;
  --unknown: #6b7a85;
  --unknown-soft: #e9edf1;

  /* Sidebar is always the dark brand, in both themes. */
  --side-text: #dbeaf1;
  --side-muted: #83a6b6;
  --side-hover: rgba(255, 255, 255, 0.07);
  --side-active: rgba(54, 209, 220, 0.16);
  --side-border: rgba(255, 255, 255, 0.09);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(16, 32, 45, 0.05), 0 2px 8px rgba(16, 32, 45, 0.05);
  --shadow-lg: 0 8px 30px rgba(16, 32, 45, 0.12);
  --sidebar-w: 246px;
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1116;
    --panel: #131b22;
    --panel-2: #182029;
    --panel-3: #1e2833;
    --border: #26323d;
    --border-strong: #33424f;
    --text: #e8eff4;
    --text-2: #b4c4cf;
    --muted: #8a9aa6;
    --faint: #62727d;

    --accent: #3ac6d8;
    --accent-hover: #5bd6e6;
    --accent-fg: #06181d;
    --accent-soft: #10333b;

    --pass: #35d69a;
    --pass-soft: #102b21;
    --fail: #ff5f7c;
    --fail-soft: #331319;
    --fail-strong: #ff829a;
    --warn: #ffcf6b;
    --warn-soft: #2e2410;
    --unknown: #8496a2;
    --unknown-soft: #1d2732;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 34px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

::selection {
  background: color-mix(in srgb, var(--brand-cyan) 34%, transparent);
}

/* ---------------------------------------------------------------- app shell */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(170deg, var(--brand-deep-1), var(--brand-deep-2) 55%, var(--brand-deep-3));
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--side-border);
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 18px 14px;
}
.sidebar-brand .mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}
.sidebar-brand .name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.sidebar-brand .name .dot {
  color: var(--brand-cyan);
}
.sidebar-brand .name .tld {
  color: var(--brand-cyan);
}


.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px 16px;
  scrollbar-width: thin;
}
.nav-group {
  margin-top: 16px;
}
.nav-group:first-child {
  margin-top: 4px;
}
.nav-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--side-muted);
  padding: 0 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--side-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: background 0.14s;
}
.nav-item:hover {
  background: var(--side-hover);
  text-decoration: none;
}
.nav-item.active {
  background: var(--side-active);
  color: #fff;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--brand-cyan), var(--brand-blue));
}
.nav-item .ico {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  line-height: 1;
  font-size: 14px;
  opacity: 0.9;
  color: var(--brand-cyan);
}
.nav-item .count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--side-text);
}
.nav-item .count.bad {
  background: var(--fail);
  color: #fff;
}
.nav-sub {
  display: flex;
  flex-direction: column;
  margin: 2px 0 2px 20px;
  padding-left: 8px;
  border-left: 1px solid var(--side-border);
}
.nav-sub .nav-item {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--side-muted);
}
.nav-sub .nav-item:hover,
.nav-sub .nav-item.active {
  color: #fff;
  background: var(--side-hover);
}
.nav-sub .nav-item.active::before {
  display: none;
}

.sidebar-foot {
  border-top: 1px solid var(--side-border);
  padding: 12px 14px;
}
.side-org {
  margin-bottom: 8px;
}
.side-org select {
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--side-border);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font: inherit;
  font-size: 13px;
}
.side-org .single {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  padding: 2px 2px 4px;
}
.side-org .eyebrow {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--side-muted);
  margin-bottom: 3px;
}
.side-user {
  display: flex;
  align-items: center;
  gap: 9px;
}
.side-user .avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-cyan), var(--brand-blue));
  color: var(--brand-deep-1);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.side-user .who {
  min-width: 0;
  flex: 1;
}
.side-user .who .n {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--side-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-user .who .signout {
  font-size: 11.5px;
  color: var(--side-muted);
  cursor: pointer;
}
.side-user .who .signout:hover {
  color: var(--brand-cyan);
  text-decoration: underline;
}

/* Main column. */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Mobile-only top bar with the drawer toggle. */
.mobilebar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(120deg, var(--brand-deep-1), var(--brand-deep-3));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}
.mobilebar .name {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.mobilebar .name .dot,
.mobilebar .name .tld {
  color: var(--brand-cyan);
}
.hamburger {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
}
.scrim {
  display: none;
}

.content {
  padding: 26px 30px 72px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

/* ------------------------------------------------------------- page headers */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head .titles {
  min-width: 0;
}
h1 {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.lede {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 5px;
}
.subtle {
  color: var(--muted);
  font-size: 13px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}
.backlink:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Section sub-navigation (Organization / Admin tabs). */
.subnav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.subnav a {
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.subnav a:hover {
  color: var(--text);
  text-decoration: none;
}
.subnav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* --------------------------------------------------------------- utilities */

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.between {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
}
.mono {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.truncate {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
.btn:hover {
  background: var(--panel-2);
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn.danger {
  color: var(--fail);
  border-color: color-mix(in srgb, var(--fail) 42%, var(--border));
}
.btn.danger:hover {
  background: var(--fail-soft);
}
.btn.small {
  padding: 5px 10px;
  font-size: 12.5px;
  border-radius: 7px;
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
}
.btn.ghost:hover {
  background: var(--panel-2);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn:focus-visible,
a:focus-visible,
.nav-item:focus-visible,
.probe-card:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.card.flush {
  padding: 0;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-body {
  padding: 20px;
}

/* -------------------------------------------------------------- badges/pills */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}
.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge.passing {
  color: var(--pass);
  background: var(--pass-soft);
}
.badge.failing {
  color: var(--fail);
  background: var(--fail-soft);
}
.badge.unknown {
  color: var(--unknown);
  background: var(--unknown-soft);
}
.badge.warn {
  color: var(--warn);
  background: var(--warn-soft);
}
.badge.plain {
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  text-transform: none;
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill.shared,
.pill.accent {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--accent);
}
.pill.type {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
  font-size: 10.5px;
  color: var(--text-2);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--pass);
}
.live .beat {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pass);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--pass) 60%, transparent);
  animation: beat 1.8s ease-out infinite;
}
.live.paused {
  color: var(--muted);
}
.live.paused .beat {
  background: var(--muted);
  animation: none;
}
@keyframes beat {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--pass) 55%, transparent);
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ----------------------------------------------------------- heartbeat/pulse */

/* The ECG signature is a <canvas>: a continuous scrolling monitor whose write
   head draws beats while healthy and a flat line while failing, with a fading
   tail (see the Pulse component). The tone class only supplies the stroke
   colour, which the component reads back via getComputedStyle. Width is fluid;
   each caller sets the height (.brand-tile, .health-hb, .gate-hb, .loading .hb,
   .empty .flat). */
.pulse {
  display: block;
  width: 100%;
  height: 30px;
  color: var(--brand-cyan);
}
/* The brand mark tile: deep-teal ground + radar glow, with the live ECG canvas
   filling it — the logo itself beats. Sized by the existing .mark rules. */
.brand-tile {
  display: block;
  border-radius: 26%;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, var(--brand-deep-1), var(--brand-deep-2) 55%, var(--brand-deep-3));
}
.brand-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(54, 209, 220, 0.2), transparent 62%);
}
.brand-tile .pulse {
  position: relative;
  height: 100%;
}
.pulse.brand {
  color: var(--brand-cyan);
}
.pulse.up {
  color: var(--pass);
}
.pulse.down {
  color: var(--fail);
}
.pulse.idle {
  color: var(--unknown);
}

/* At-a-glance pass/fail history: a compact strip of coloured ticks. */
.spark {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
}
.spark .t {
  width: 4px;
  border-radius: 2px;
  background: var(--unknown);
  opacity: 0.5;
}
.spark .t.pass {
  background: var(--pass);
  opacity: 0.85;
}
.spark .t.fail {
  background: var(--fail);
  opacity: 1;
}

.dots {
  display: inline-flex;
  gap: 3px;
  flex-wrap: wrap;
}
.dots .d {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--unknown);
}
.dots .d.pass {
  background: var(--pass);
}
.dots .d.fail {
  background: var(--fail);
}

/* ------------------------------------------------------------- health hero */

.health {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0;
  background: linear-gradient(150deg, var(--brand-deep-1), var(--brand-deep-2) 60%, var(--brand-deep-3));
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: var(--shadow-lg);
  color: #eaf6fb;
}
.health-lead {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.health-verdict {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 11px;
}
.health-verdict .glyph {
  font-size: 24px;
}
.health-verdict.ok {
  color: #bff6df;
}
.health-verdict.bad {
  color: #ffc2cd;
}
.health-hb {
  height: 46px;
  margin: 2px 0;
}
.health-meta {
  font-size: 13px;
  color: var(--side-muted);
}
.health-meta strong {
  color: #dbeaf1;
}
.health-stats {
  padding: 22px 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--side-border);
  border-left: 1px solid var(--side-border);
}
.hstat {
  background: linear-gradient(150deg, var(--brand-deep-2), var(--brand-deep-3));
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hstat .n {
  font-size: 30px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.hstat .l {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--side-muted);
}
.hstat.bad .n {
  color: #ff8199;
}
.hstat.bad {
  cursor: pointer;
}
.hstat.good .n {
  color: var(--vital);
}
.hstat.idle .n {
  color: #cfe0e8;
}

/* --------------------------------------------------------- probe/entity cards */

.card-list {
  display: grid;
  gap: 12px;
}
.probe-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.05s;
}
.probe-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.probe-card:active {
  transform: translateY(1px);
}
.probe-card.s-failing {
  border-left-color: var(--fail);
  background: linear-gradient(90deg, var(--fail-soft), var(--panel) 42%);
}
.probe-card.s-passing {
  border-left-color: var(--pass);
}
.probe-card.s-unknown {
  border-left-color: var(--unknown);
}
.probe-card.disabled {
  opacity: 0.62;
  border-left-color: var(--border-strong);
}
.probe-card .status-ico {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
}
.status-ico.s-failing {
  background: var(--fail-soft);
  color: var(--fail);
}
.status-ico.s-passing {
  background: var(--pass-soft);
  color: var(--pass);
}
.status-ico.s-unknown {
  background: var(--unknown-soft);
  color: var(--unknown);
}
.probe-card .body {
  min-width: 0;
}
.probe-card .title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.probe-card .title .nm {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.probe-card .sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  min-width: 0;
}
.probe-card .sub .tgt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.probe-card .aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  text-align: right;
}
.probe-card .aside .when {
  font-size: 12px;
  color: var(--muted);
}
.probe-card .fail-why {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--fail-soft);
  color: var(--fail-strong);
  font-size: 12.5px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  overflow: hidden;
}
.probe-card .fail-why .mono {
  color: inherit;
  overflow-wrap: anywhere;
}

/* Generic sub-detail dot separator. */
.sep {
  color: var(--border-strong);
}

/* ----------------------------------------------------------------- KPIs */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.kpi {
  background: var(--panel);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi .k {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.kpi .v {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.kpi .v.good {
  color: var(--pass);
}
.kpi .v.bad {
  color: var(--fail);
}

/* Definition list — for detail metadata, replacing single-row cramming. */
.deflist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 20px;
}
.deflist .df {
  min-width: 0;
}
.deflist .df .dk {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 3px;
}
.deflist .df .dv {
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* -------------------------------------------------------------- forms */

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}
input[type="text"],
input[type="number"],
input[type="url"],
input[type="email"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
textarea {
  min-height: 72px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: var(--ring);
  border-color: var(--accent);
}
.field {
  margin-bottom: 15px;
}
.field .hint {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 5px;
}
.field.check {
  display: flex;
  align-items: center;
  gap: 9px;
}
.field.check label {
  margin: 0;
  font-weight: 500;
}
.field.check input {
  width: auto;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.repeat-row {
  display: grid;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.repeat-row.cond {
  grid-template-columns: 1.4fr 1fr 1.2fr auto;
}
.repeat-row.notif {
  grid-template-columns: 1fr 2fr auto;
}
.repeat-row.kv {
  grid-template-columns: 1fr 1fr auto;
}
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* --------------------------------------------------------------- notices */

.notice {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.notice.error {
  background: var(--fail-soft);
  color: var(--fail-strong);
  border: 1px solid color-mix(in srgb, var(--fail) 30%, transparent);
}
.notice.ok {
  background: var(--pass-soft);
  color: var(--pass);
  border: 1px solid color-mix(in srgb, var(--pass) 28%, transparent);
}
.notice.info {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}

/* Empty & loading — the heartbeat carries these too. */
.empty {
  text-align: center;
  padding: 44px 24px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.empty .flat {
  width: 180px;
  max-width: 60%;
  height: 40px;
  margin: 0 auto 14px;
  color: var(--unknown);
}
.empty .t {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
  color: var(--muted);
}
.loading .hb {
  width: 160px;
  height: 40px;
  color: var(--brand-cyan);
}

/* --------------------------------------------------------- condition lines */

.cond-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  align-items: baseline;
}
.cond-line:last-child {
  border-bottom: none;
}
.cond-ok {
  color: var(--pass);
  font-weight: 700;
}
.cond-bad {
  color: var(--fail);
  font-weight: 700;
}
.cond-line > :last-child {
  min-width: 0;
}
.cond-line .mono {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-panel {
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 8px;
  border: 1px solid var(--border);
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px 18px;
  font-size: 13px;
}
.metrics-grid .m {
  min-width: 0;
}
.metrics-grid .m .mk {
  color: var(--muted);
}
.metrics-grid .mono {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.valuebox {
  display: block;
  max-width: 100%;
  max-height: 150px;
  overflow: auto;
  margin: 5px 0 0;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.txt-passing {
  color: var(--pass);
}
.txt-failing {
  color: var(--fail);
}
.txt-unknown {
  color: var(--unknown);
}

/* --------------------------------------------------------- history rows */

.hist-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.hist-controls .dt {
  width: auto;
  padding: 6px 9px;
  font-size: 13px;
}
.hist-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  border-top: 1px solid var(--border);
}

/* Result rows rendered as a structured list, not a table. */
.rlist {
  display: flex;
  flex-direction: column;
}
.rrow {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.rrow:hover {
  background: var(--panel-2);
}
.rrow.open {
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
}
.rrow .rstatus {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.rrow .rwhen {
  font-size: 13px;
  font-weight: 600;
}
.rrow .rwhen .ago {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}
.rrow .rdur {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.rrow .rprober {
  color: var(--muted);
  font-size: 12.5px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rrow .chev {
  color: var(--faint);
  font-size: 11px;
}
.rdetail {
  padding: 4px 20px 16px;
  border-bottom: 1px solid var(--border);
}

/* Segmented control. */
.seg {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.seg-btn {
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-left: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.seg-btn:first-child {
  border-left: none;
}
.seg-btn:hover {
  background: var(--panel-2);
  color: var(--text);
}
.seg-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
}
.seg-btn.active.fail {
  background: var(--fail);
}
.seg-btn.active.pass {
  background: var(--pass);
}

/* --------------------------------------------------------- charts (SVG) */

.chart-card {
  padding-bottom: 14px;
}
.chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.chart-legend {
  display: inline-flex;
  gap: 14px;
  font-size: 12px;
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chart-legend .lg {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.chart-legend .lg.pass {
  background: var(--pass);
}
.chart-legend .lg.fail {
  background: var(--fail);
}
.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}
.chart-axis {
  fill: var(--muted);
  font-size: 11px;
}
.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0.9;
}
.chart-failline {
  stroke: var(--fail);
  stroke-width: 1;
  opacity: 0.4;
}
.chart-pt {
  cursor: pointer;
  stroke: var(--panel);
  stroke-width: 1;
}
.chart-pt.pass {
  fill: var(--pass);
}
.chart-pt.fail {
  fill: var(--fail);
}
.chart-pt-hover {
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}
.chart-pt-hover.pass {
  stroke: var(--pass);
}
.chart-pt-hover.fail {
  stroke: var(--fail);
}
.chart-tip-bg {
  fill: var(--text);
  opacity: 0.94;
  pointer-events: none;
}
.chart-tip-t {
  fill: var(--panel);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}
.chart-tip-sub {
  fill: var(--panel);
  font-size: 11px;
  opacity: 0.82;
  pointer-events: none;
}

/* Custom select (replaces native <select> so menus are themeable). */
.sel {
  position: relative;
  font: inherit;
  outline: none;
  width: 100%;
}
.sel:focus-visible {
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}
.sel-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}
.sel-value:hover,
.sel.open .sel-value {
  border-color: var(--accent);
}
.sel-value.placeholder {
  color: var(--muted);
}
.sel-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sel-chev {
  color: var(--muted);
  font-size: 11px;
  flex: 0 0 auto;
  transition: transform 0.15s;
}
.sel.open .sel-chev {
  transform: rotate(180deg);
}
.sel-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 100%;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  max-height: 264px;
  overflow-y: auto;
}
/* .sel.up opens the menu above the control — for selects near the viewport
   bottom (e.g. the sidebar org switcher) so the list isn't clipped off-screen. */
.sel.up .sel-menu {
  top: auto;
  bottom: calc(100% + 4px);
}
.sel-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.sel-opt:hover {
  background: var(--panel-2);
}
.sel-opt.sel {
  color: var(--accent);
  font-weight: 600;
}
.sel-check {
  color: var(--accent);
  flex: 0 0 auto;
}
/* Dark variant — the sidebar org switcher sits on the deep-teal ground. */
.sel.dark .sel-value {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--side-border);
  color: #fff;
}
.sel.dark .sel-chev {
  color: var(--side-muted);
}
.sel.dark .sel-value:hover,
.sel.dark.open .sel-value {
  border-color: var(--brand-cyan);
}
.sel.dark .sel-menu {
  background: #16303a;
  border-color: var(--side-border);
}
.sel.dark .sel-opt {
  color: var(--side-text);
}
.sel.dark .sel-opt:hover {
  background: rgba(255, 255, 255, 0.08);
}
.sel.dark .sel-opt.sel,
.sel.dark .sel-check {
  color: var(--brand-cyan);
}

/* Friendlier duration chart: soft area fill, emphasized latest point, and a
   status ribbon (per-bucket pass/fail band) for at-a-glance "when was it down". */
.chart-area {
  stroke: none;
  fill: var(--accent);
  opacity: 0.1;
}
.chart-last {
  fill: var(--accent);
  stroke: var(--panel);
  stroke-width: 2;
}
.rib {
  shape-rendering: crispEdges;
  cursor: default;
}
.rib.pass {
  fill: var(--pass);
  opacity: 0.85;
}
.rib.fail {
  fill: var(--fail);
}
.rib.nodata {
  fill: var(--border-strong);
  opacity: 0.5;
}

/* Prober capability chips — types and labels styled distinctly so they don't
   read as one undifferentiated pill soup. */
.chipset {
  display: flex;
  gap: 8px 12px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-top: 10px;
}
.chipset .cs-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 0 0 auto;
  min-width: 48px;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.chip-type {
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.kv-chip {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11.5px;
  max-width: 100%;
}
.kv-chip .k {
  background: var(--panel-2);
  color: var(--muted);
  padding: 2px 7px;
  white-space: nowrap;
}
.kv-chip .v {
  color: var(--text);
  padding: 2px 8px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Team filter — pill toggles instead of a bare dropdown. */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filter-bar .fb-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.filter-chips {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fchip {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.fchip:hover {
  background: var(--panel-2);
  color: var(--text);
}
.fchip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

/* Zoom chip shown on the history bar when a chart bucket is drilled into. */
.zoom-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}
.zoom-chip button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  padding: 0;
}

/* ------------------------------------------------------------- sign-in */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--brand-cyan) 12%, var(--bg)), var(--bg));
}
.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px 28px;
  text-align: center;
}
.gate-card .mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
}
.gate-card h1 {
  justify-content: center;
  font-size: 24px;
  margin-bottom: 4px;
}
.gate-card h1 .dot,
.gate-card h1 .tld {
  color: var(--accent);
}
.gate-hb {
  height: 30px;
  margin: 14px 0 6px;
  color: var(--brand-cyan);
}
.gate-card .muted {
  color: var(--muted);
  font-size: 14px;
}
.gate-providers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}
.gate-providers .btn {
  padding: 11px;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }
  .shell.drawer-open .sidebar {
    transform: translateX(0);
  }
  .mobilebar {
    display: flex;
  }
  .shell.drawer-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(6, 15, 20, 0.5);
    z-index: 35;
  }
  .content {
    padding: 20px 18px 60px;
  }
  .health {
    grid-template-columns: 1fr;
  }
  .health-stats {
    border-left: none;
    border-top: 1px solid var(--side-border);
  }
}

@media (max-width: 620px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
  .repeat-row.cond,
  .repeat-row.notif,
  .repeat-row.kv {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 21px;
  }
  .content {
    padding: 18px 14px 56px;
  }
  .probe-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 12px;
  }
  /* Under the body, as a tidy right-aligned footer row — not wrapped to the
     bottom-left. Spark + last-run stay on one line against the card's edge. */
  .probe-card .aside {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
  }
  .probe-card .aside .when {
    font-size: 12px;
  }
  .rrow {
    grid-template-columns: 1fr auto;
    grid-auto-rows: auto;
    gap: 4px 12px;
  }
  .rrow .rwhen {
    grid-column: 1;
  }
  .rrow .rstatus {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .rrow .rdur {
    grid-column: 1;
  }
  .rrow .rprober {
    grid-column: 2;
    justify-self: end;
  }
  .rrow .chev {
    display: none;
  }
  .health-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* The Pulse canvas checks this query itself and renders a static trace. */
  .live .beat {
    animation: none;
  }
  .sidebar {
    transition: none;
  }
}
