/* Relay Pulse — status page styles
   Layout: masthead, overview, sticky controls, content (card grid or list), errors, footer.
   Theme: follows the OS unless the visitor picks light or dark (stored locally). */

:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --surface-3: #eef2f5;
  --ink: #0e1620;
  --ink-2: #3d4b57;
  --muted: #6c7c89;
  --line: #e2e9ee;
  --line-strong: #cfd9e1;
  --accent: #2c5ee0;
  --accent-ink: #1d47b8;
  --accent-soft: #e9efff;
  --good: #0d9560;
  --good-soft: #e0f5ea;
  --warn: #b47a06;
  --warn-soft: #fdf2d6;
  --bad: #c93c36;
  --bad-soft: #fce7e5;
  --none: #cbd6de;
  --none-soft: #f0f4f7;
  /* Amber for latency text needs a darker shade than --warn to clear AA
     contrast on white; the pill/badge colours above stay unchanged. */
  --lat-warn: #a06a00;
  --bar-good: #4bb98c;
  --bar-warn: #e0a52e;
  --bar-bad: #d9534c;
  --bar-none: #dbe4ea;
  --glow: rgba(44, 94, 224, 0.07);
  --shadow-sm: 0 1px 2px rgba(14, 22, 32, 0.05);
  --shadow-md: 0 1px 2px rgba(14, 22, 32, 0.04), 0 14px 32px -18px rgba(14, 22, 32, 0.28);
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1016;
    --surface: #111923;
    --surface-2: #151f2a;
    --surface-3: #1b2733;
    --ink: #e9f0f6;
    --ink-2: #b5c3cf;
    --muted: #8496a5;
    --line: #202c38;
    --line-strong: #2d3b49;
    --accent: #7ea2ff;
    --accent-ink: #a9c1ff;
    --accent-soft: #17233d;
    --good: #38cf92;
    --good-soft: #0e2e24;
    --warn: #e9b53f;
    --warn-soft: #33280d;
    --bad: #f4736b;
    --bad-soft: #3a1917;
    --none: #2b3a47;
    --none-soft: #16212c;
    --lat-warn: #e9b53f;
    --bar-good: #2fa87c;
    --bar-warn: #cf9b32;
    --bar-bad: #dd5f58;
    --bar-none: #2a3946;
    --glow: rgba(126, 162, 255, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -22px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a1016;
  --surface: #111923;
  --surface-2: #151f2a;
  --surface-3: #1b2733;
  --ink: #e9f0f6;
  --ink-2: #b5c3cf;
  --muted: #8496a5;
  --line: #202c38;
  --line-strong: #2d3b49;
  --accent: #7ea2ff;
  --accent-ink: #a9c1ff;
  --accent-soft: #17233d;
  --good: #38cf92;
  --good-soft: #0e2e24;
  --warn: #e9b53f;
  --warn-soft: #33280d;
  --bad: #f4736b;
  --bad-soft: #3a1917;
  --none: #2b3a47;
  --none-soft: #16212c;
  --lat-warn: #e9b53f;
  --bar-good: #2fa87c;
  --bar-warn: #cf9b32;
  --bar-bad: #dd5f58;
  --bar-none: #2a3946;
  --glow: rgba(126, 162, 255, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -22px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 460px at 50% -160px, var(--glow), transparent 72%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

button,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: none;
  fill: none;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #3d70f2, #2144c4);
  box-shadow:
    0 7px 18px -8px rgba(44, 94, 224, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-mark .icon {
  width: 24px;
  height: 24px;
}

.brand-text h1 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.15;
}

.brand-text p {
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Segmented control ---------- */

.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}

.seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.seg button:hover {
  color: var(--ink);
}

.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(14, 22, 32, 0.09), 0 0 0 1px var(--line);
}

.seg button .icon {
  width: 15px;
  height: 15px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

.icon-btn.is-busy .icon {
  animation: spin 0.9s linear infinite;
}

/* ---------- Overview ---------- */

.overview {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.overview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(560px 200px at 100% 0%, var(--accent-soft), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.overview > * {
  position: relative;
  z-index: 1;
}

.ov-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  flex: 1 1 420px;
}

.ov-status {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.ov-icon {
  width: 50px;
  height: 50px;
  flex: none;
  border-radius: 16px;
  display: grid;
  place-items: center;
}

.ov-icon .icon {
  width: 24px;
  height: 24px;
}

.overview[data-state="good"] .ov-icon {
  background: var(--good-soft);
  color: var(--good);
}

.overview[data-state="warn"] .ov-icon {
  background: var(--warn-soft);
  color: var(--warn);
}

.overview[data-state="bad"] .ov-icon {
  background: var(--bad-soft);
  color: var(--bad);
}

.overview[data-state="nodata"] .ov-icon {
  background: var(--surface-3);
  color: var(--muted);
}

.ov-copy h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1.2;
}

.ov-copy p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}

.ov-copy p .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.ov-meter {
  display: flex;
  gap: 4px;
  width: 100%;
  max-width: 440px;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
}

.ov-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.ov-meter span[data-s="good"] { background: var(--bar-good); }
.ov-meter span[data-s="warn"] { background: var(--bar-warn); }
.ov-meter span[data-s="bad"] { background: var(--bar-bad); }
.ov-meter span[data-s="nodata"] { background: var(--bar-none); }

.ov-stats {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}

.stat {
  min-width: 88px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stat b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
}

.stat span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.stat[data-s="good"] b { color: var(--good); }
.stat[data-s="warn"] b { color: var(--warn); }
.stat[data-s="bad"] b { color: var(--bad); }
.stat[data-s="good"] span::before { background: var(--good); }
.stat[data-s="warn"] span::before { background: var(--warn); }
.stat[data-s="bad"] span::before { background: var(--bad); }
.stat[data-zero="true"] b { color: var(--muted); }

/* ---------- Notice ---------- */

.notices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--warn) 34%, var(--line));
  background: var(--warn-soft);
  color: var(--ink);
  font-size: 12.8px;
  line-height: 1.5;
}

.notice[data-kind="error"] {
  border-color: color-mix(in srgb, var(--bad) 34%, var(--line));
  background: var(--bad-soft);
}

.notice .icon {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--warn);
}

.notice[data-kind="error"] .icon {
  color: var(--bad);
}

/* ---------- Controls ---------- */

.controls {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 10px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.controls-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.controls-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  flex-wrap: wrap;
}

.chips {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  color: var(--accent-ink);
}

.pdot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--dot, var(--muted));
}

.chip-issue .chip-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--bad);
}

.chip-issue[aria-pressed="true"] {
  background: var(--bad-soft);
  border-color: color-mix(in srgb, var(--bad) 38%, transparent);
  color: var(--bad);
}

.chip-badge {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bad) 14%, transparent);
  color: var(--bad);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
}

.search {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 190px;
  max-width: 280px;
  min-width: 165px;
  height: 34px;
  padding: 0 9px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search .search-icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}

.search input::placeholder {
  color: var(--muted);
}

.search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-clear {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.search-clear:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.search-clear .icon {
  width: 13px;
  height: 13px;
}

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrap select {
  height: 34px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.select-wrap select:hover {
  border-color: var(--line-strong);
}

.select-chev {
  position: absolute;
  right: 9px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
}

.text-btn {
  border: 0;
  background: transparent;
  padding: 5px 2px;
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}

.text-btn:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sub-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.result-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Content ---------- */

.content.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  align-items: stretch;
  align-content: start;
}

.content.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- Card grid ---------- */

.mcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.mcard:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.mcard[data-state="bad"] {
  border-color: color-mix(in srgb, var(--bad) 30%, var(--line));
  box-shadow: inset 3px 0 0 var(--bad), var(--shadow-sm);
}

.mcard[data-state="warn"] {
  border-color: color-mix(in srgb, var(--warn) 28%, var(--line));
  box-shadow: inset 3px 0 0 var(--warn), var(--shadow-sm);
}

.mcard[data-state="bad"]:hover {
  box-shadow: inset 3px 0 0 var(--bad), var(--shadow-md);
}

.mcard[data-state="warn"]:hover {
  box-shadow: inset 3px 0 0 var(--warn), var(--shadow-md);
}

.mcard-toggle {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}

.mtop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}

.mtitle {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

.mcard-name {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.012em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.mcard-name.mono {
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: -0.01em;
}

.mmetric {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.mvalue {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.mvalue b {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.mvalue span {
  font-size: 14px;
  color: var(--muted);
}

.mcard[data-state="bad"] .mvalue b { color: var(--bad); }
.mcard[data-state="warn"] .mvalue b { color: var(--warn); }
.mcard[data-state="nodata"] .mvalue b { color: var(--muted); }

.mlat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-bottom: 2px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.mlat .icon {
  width: 12px;
  height: 12px;
}

/* Latency severity: its own scale (>=5s slow, >=10s bad), independent of
   availability state, so a fast-but-flaky channel still shows a red rate
   while its latency stays neutral. */
.mlat[data-lat="warn"],
.glat[data-lat="warn"] {
  color: var(--lat-warn);
  font-weight: 600;
}

.mlat[data-lat="bad"],
.glat[data-lat="bad"] {
  color: var(--bad);
  font-weight: 600;
}

/* Colour the value, not a filled pill: the state badge beside it already has a
   filled background, and two filled shapes read as competing statuses. */
.mlat[data-lat="warn"] .icon,
.mlat[data-lat="bad"] .icon {
  color: inherit;
  opacity: 1;
}

.mlat[data-lat="ok"] .icon {
  opacity: 0.7;
}

.mcap {
  margin-top: -4px;
  font-size: 11.5px;
  color: var(--muted);
}

.mcard .strip {
  margin-top: 2px;
}

.strip-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: -6px;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.mfoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.mexpand {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent-ink);
  font-weight: 600;
}

.mexpand .icon {
  width: 13px;
  height: 13px;
  transition: transform 0.18s ease;
}

.mcard[data-open] .mexpand .icon {
  transform: rotate(180deg);
}

.mkids {
  display: none;
  flex-direction: column;
  margin-top: 2px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mcard[data-open] .mkids {
  display: flex;
}

.mfoot-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.mcover {
  padding-left: 8px;
  border-left: 1px solid var(--line-strong);
}

.mkid {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
}

.mkid + .mkid {
  border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.kdot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--none);
}

.kdot[data-s="good"] { background: var(--good); }
.kdot[data-s="warn"] { background: var(--warn); }
.kdot[data-s="bad"] { background: var(--bad); }
.kdot[data-s="nodata"] { background: var(--none); }

.kname {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.kav {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kav.is-muted {
  color: var(--muted);
}

/* ---------- List layout ---------- */

.row-grid {
  display: grid;
  grid-template-columns: minmax(170px, 1.35fr) 96px minmax(140px, 2.2fr) 86px 74px;
  gap: 14px;
  align-items: center;
}

.gcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.gcard:hover {
  border-color: var(--line-strong);
}

.gcard[data-state="bad"] {
  border-color: color-mix(in srgb, var(--bad) 26%, var(--line));
  box-shadow: inset 3px 0 0 var(--bad), var(--shadow-sm);
}

.gcard[data-state="warn"] {
  border-color: color-mix(in srgb, var(--warn) 24%, var(--line));
  box-shadow: inset 3px 0 0 var(--warn), var(--shadow-sm);
}

.gcard > .ghead-row {
  padding: 13px 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  transition: background 0.15s ease;
  cursor: pointer;
}

.gcard > .ghead-row:hover {
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
}

.gcard[data-open] > .ghead-row {
  border-bottom: 1px solid var(--line);
}

.ghead {
  min-width: 0;
}

.gtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gtoggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}

.gtoggle .chev {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--muted);
  transition: transform 0.18s ease;
}

.gcard[data-open] .gtoggle .chev {
  transform: rotate(90deg);
}

.gtitle-text {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.012em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.gtitle-text.mono {
  font-family: var(--mono);
  font-size: 13.5px;
}

.gmeta {
  margin-top: 2px;
  padding-left: 22px;
  font-size: 11.5px;
  color: var(--muted);
}

.gbody {
  display: none;
}

.gcard[data-open] .gbody {
  display: block;
}

.gbody .row-grid {
  padding: 9px 16px;
}

.gbody .row-grid + .row-grid {
  border-top: 1px solid var(--line);
}

.gbody .row-grid.cols {
  padding-block: 7px;
  background: var(--surface-2);
  border-top: 0;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.gbody .row-grid.cols .num {
  font-size: 11px;
  color: var(--muted);
}

.cname {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 22px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.cname::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  width: 9px;
  height: 1px;
  background: var(--line-strong);
}

.gbody-note {
  padding: 9px 16px 10px 38px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- Shared tags, pills, numbers, strips ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag .pdot {
  width: 5px;
  height: 5px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

.pill .g {
  font-size: 8.5px;
  line-height: 1;
}

.pill[data-s="good"] { background: var(--good-soft); color: var(--good); }
.pill[data-s="warn"] { background: var(--warn-soft); color: var(--warn); }
.pill[data-s="bad"] { background: var(--bad-soft); color: var(--bad); }
.pill[data-s="nodata"] { background: var(--surface-3); color: var(--muted); }

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}

.num b {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.num small {
  margin-left: 1px;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--muted);
}

.num.is-muted,
.num.is-muted b {
  color: var(--muted);
}

.strip {
  display: flex;
  align-items: stretch;
  gap: 2.5px;
  height: 26px;
  min-width: 0;
}

.strip.lg {
  height: 32px;
}

.bar {
  flex: 1 1 0;
  min-width: 2px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--bar-none);
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.12s ease;
}

.bar[data-s="good"] { background: var(--bar-good); }
.bar[data-s="warn"] { background: var(--bar-warn); }
.bar[data-s="bad"] { background: var(--bar-bad); }
.bar[data-s="nodata"] { background: var(--bar-none); }

.bar:hover,
.bar:focus-visible {
  filter: brightness(1.12);
  transform: scaleY(1.14);
  outline: none;
  box-shadow: 0 0 0 1px var(--ink);
}

.strip-empty {
  display: grid;
  place-items: center;
  flex: 1;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10.5px;
}

/* ---------- Errors panel ---------- */

.panel {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.014em;
}

.panel-head p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.panel-head > span {
  font-size: 12px;
  color: var(--muted);
}

.errgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 30px;
}

.errcol {
  min-width: 0;
}

.errcol h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 650;
}

.errcol h3 b {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.errcol > p {
  margin: 2px 0 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.erow {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(40px, 1fr) 62px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.ename {
  font-size: 12.8px;
  overflow-wrap: anywhere;
}

.owner {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.ebar {
  height: 7px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}

.ebar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.errcol.ignored .ename {
  color: var(--muted);
}

.errcol.ignored .ebar i {
  background: repeating-linear-gradient(45deg, var(--muted) 0 2px, transparent 2px 5px);
}

.errcol.ignored .num {
  color: var(--muted);
}

.err-empty {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Footer ---------- */

.page-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 3px;
}

.legend i[data-s="good"] { background: var(--bar-good); }
.legend i[data-s="warn"] { background: var(--bar-warn); }
.legend i[data-s="bad"] { background: var(--bar-bad); }
.legend i[data-s="nodata"] { background: var(--bar-none); }

.foot-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}

.foot-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

/* ---------- Empty / error states ---------- */

.state-panel {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 46px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.state-panel .sp-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 2px;
  border-radius: 13px;
  background: var(--surface-3);
  color: var(--muted);
}

.state-panel .sp-icon .icon {
  width: 21px;
  height: 21px;
}

.state-panel h3 {
  font-size: 15px;
  font-weight: 650;
}

.state-panel p {
  max-width: 380px;
  font-size: 12.5px;
  color: var(--muted);
}

.state-panel .btn {
  margin-top: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
}

.state-panel .btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

/* ---------- Tooltip ---------- */

#tip {
  position: fixed;
  z-index: 60;
  width: max-content;
  max-width: 280px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 12px 34px -8px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(3px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

#tip.on {
  opacity: 1;
  transform: none;
}

#tip .tt {
  margin-bottom: 2px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

#tip .tr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: color-mix(in srgb, var(--bg) 72%, var(--ink));
}

#tip .tr b {
  color: var(--bg);
  font-family: var(--mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#tip .tr.note {
  display: block;
  margin-top: 3px;
  color: color-mix(in srgb, var(--bg) 66%, var(--ink));
}

/* The tooltip is inverted (ink background, page-coloured text), so pull the
   severity colour toward the text colour to keep contrast in both themes. */
#tip .tr[data-lat="warn"] b {
  color: color-mix(in srgb, var(--warn) 72%, var(--bg));
}

#tip .tr[data-lat="bad"] b {
  color: color-mix(in srgb, var(--bad) 72%, var(--bg));
}

/* ---------- Skeletons ---------- */

.sk-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 188px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.sk-line {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
}

.sk-line.lg {
  height: 26px;
}

.sk-block {
  display: block;
  height: 32px;
  margin-top: 4px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
}

.w30 { width: 30%; }
.w35 { width: 35%; }
.w40 { width: 40%; }
.w45 { width: 45%; }
.w50 { width: 50%; }
.w55 { width: 55%; }
.w60 { width: 60%; }
.w65 { width: 65%; }
.w70 { width: 70%; }
.w80 { width: 80%; }

.overview-loading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.overview-loading .sk-line {
  height: 14px;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.noscript {
  max-width: 640px;
  margin: 40px auto;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
  text-align: center;
  font-size: 13px;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .row-grid {
    grid-template-columns: minmax(150px, 1.2fr) 90px minmax(120px, 1.9fr) 80px 68px;
    gap: 10px;
  }
}

@media (max-width: 820px) {
  .page {
    padding: 20px 16px 44px;
  }

  .content.grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .controls {
    position: static;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding: 2px 0 0;
  }

  .row-grid,
  .gbody .row-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
  }

  .ghead {
    grid-column: 1;
    grid-row: 1;
  }

  .gstate {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .gstrip {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .gav {
    grid-column: 1;
    grid-row: 3;
    text-align: left;
  }

  .glat {
    grid-column: 2;
    grid-row: 3;
    text-align: right;
  }

  .gbody .row-grid.cols {
    display: none;
  }

  .gcard > .ghead-row,
  .gbody .row-grid {
    padding: 12px 14px;
  }

  .strip {
    height: 22px;
  }

  .overview {
    padding: 17px;
  }

  .ov-main {
    flex-basis: 100%;
  }

  .ov-stats {
    width: 100%;
  }

  .stat {
    flex: 1;
  }

  .panel {
    padding: 16px;
  }

  .errgrid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
}

@media (max-width: 560px) {
  .brand-text h1 {
    font-size: 20px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .masthead-actions {
    width: 100%;
    justify-content: space-between;
  }

  .content.grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .search {
    order: 5;
    max-width: none;
    flex-basis: 100%;
  }

  .select-wrap {
    order: 6;
  }

  .controls-main .seg {
    flex: 0 0 auto;
  }

  .controls-sub {
    align-items: flex-start;
  }

  .sub-meta {
    width: 100%;
    margin-left: 0;
  }

  .mvalue b {
    font-size: 29px;
  }

  .erow {
    grid-template-columns: minmax(0, 1fr) 62px;
    gap: 5px 10px;
  }

  .erow .ebar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .erow .num {
    grid-column: 2;
    grid-row: 1;
  }

  .page-foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .mcard:hover {
    transform: none;
  }
}
/* ---------- active probes ----------
 * Card design follows the reference status page: 16px radius, soft shadow,
 * two metric tiles, a large tabular availability headline, and an inset
 * hourly timeline. Scoped under .probes so the traffic sections keep their
 * existing look. */

.probes {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.probes[hidden] { display: none; }

/* header: section title on the left, counts and freshness on the right */

.probes-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 20px;
  flex-wrap: wrap;
}

.probes .section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-left: 12px;
  border-left: 3px solid var(--good);
}

.probes .section-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.014em;
}

.probes .section-head > span {
  font-size: 13px;
  color: var(--muted);
}

.probes-tools {
  display: flex;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
  font-size: 13px;
}

.probes-counts {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}

.probes-total {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.probes-total b {
  color: var(--ink);
  font-weight: 700;
}

.probes-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.probes-count b {
  font-weight: 700;
  font-size: 13.5px;
}

.probes-count em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}

.probes-count.good b { color: var(--good); }
.probes-count.warn b { color: var(--warn); }
.probes-count.bad b { color: var(--bad); }

.probes-count .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.probes-count .dot[data-s="good"] { background: var(--good); }
.probes-count .dot[data-s="warn"] { background: var(--warn); }
.probes-count .dot[data-s="bad"] { background: var(--bad); }

.probes-fresh {
  color: var(--muted-2, var(--muted));
  font-size: 12.5px;
  white-space: nowrap;
}

/* legend */

.probes-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.probes-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.probes-legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: none;
}

.probes-legend i[data-s="good"] { background: var(--bar-good); }
.probes-legend i[data-s="warn"] { background: var(--bar-warn); }
.probes-legend i[data-s="bad"] { background: var(--bar-bad); }
.probes-legend i[data-s="nodata"] { background: var(--bar-none); }

/* groups of cards */

.probebody {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.probe-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.probe-group-tag {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.probe-group .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  align-items: start;
  gap: 16px;
}

/* card shell */

.probes .card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 18px 18px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
}

.probes .card.probe-card.bad { border-color: color-mix(in srgb, var(--bad) 34%, var(--line)); }
.probes .card.probe-card.warn { border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }

.probes .card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.probes .vendor-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.probes .vendor-icon[data-provider="anthropic"] { background: #fdf0e9; color: #b5582f; }
.probes .vendor-icon[data-provider="gemini"] { background: #eaf1ff; color: #2f6bd8; }
.probes .vendor-icon[data-provider="grok"] { background: var(--surface-3); color: var(--ink-2); }
.probes .vendor-icon[data-provider="deepseek"] { background: #e8efff; color: #2a52cc; }

:root[data-theme="dark"] .probes .vendor-icon[data-provider="anthropic"] { background: #33211a; color: #e8a884; }
:root[data-theme="dark"] .probes .vendor-icon[data-provider="gemini"] { background: #18243a; color: #8fb4ff; }
:root[data-theme="dark"] .probes .vendor-icon[data-provider="deepseek"] { background: #18233f; color: #8ea6ff; }

.probes .vendor-initial {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.probes .card-title {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-width: 0;
}

.probes .card-title h3 {
  margin: 0;
  max-width: 100%;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.probes .model-chip {
  max-width: 100%;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* status tag */

.probes .status-tag {
  flex: none;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.probes .status-tag.small {
  padding: 1px 8px;
  font-size: 11px;
}

.probes .status-tag.good { background: var(--good-soft); color: var(--good); }
.probes .status-tag.warn { background: var(--warn-soft); color: var(--warn); }
.probes .status-tag.bad { background: var(--bad-soft); color: var(--bad); }
.probes .status-tag.nodata { background: var(--surface-3); color: var(--muted); }

/* alert row for partial failures */

.probes .card-alert {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--bad);
  font-size: 12.5px;
  font-weight: 600;
}

.probes .card-alert.warn { background: var(--warn-soft); color: var(--warn); }

/* metric tiles */

.probes .card-middle { display: grid; }

.probes .tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.probes .tile {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.probes .tile > span {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.probes .tile-time {
  display: flex;
  align-items: baseline;
  column-gap: 4px;
  flex-wrap: wrap;
}

.probes .tile-time strong {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.probes .tile-time i {
  font-style: normal;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.probes .tile.frt-slow {
  border-color: color-mix(in srgb, var(--bar-warn) 45%, var(--line));
  background: var(--warn-soft);
}

.probes .tile.frt-slow .tile-time strong,
.probes .tile.frt-slow .tile-time i { color: var(--warn); }

.probes .tile.frt-very_slow {
  border-color: color-mix(in srgb, var(--bad) 45%, var(--line));
  background: var(--bad-soft);
}

.probes .tile.frt-very_slow .tile-time strong,
.probes .tile.frt-very_slow .tile-time i { color: var(--bad); }

/* headline availability + timeline */

.probes .card-bottom { display: grid; gap: 10px; }

.probes .uptime-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.probes .uptime-row > span {
  font-size: 12.5px;
  color: var(--muted);
}

.probes .uptime-row strong {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.probes .uptime-row strong.good { color: var(--good); }
.probes .uptime-row strong.warn { color: var(--warn); }
.probes .uptime-row strong.bad { color: var(--bad); }
.probes .uptime-row strong.none { color: var(--muted); }

.probes .recent { display: grid; gap: 8px; }

.probes .recent-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.probes .recent-label em {
  font-style: normal;
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.probes .timeline.card {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.probes .timeline-bars {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 20px;
}

.probes .timeline-bars .bar {
  flex: 1 1 0;
  min-width: 1px;
  border-radius: 2px;
  background: var(--bar-none);
}

.probes .timeline-bars .bar.band-good { background: var(--bar-good); }
.probes .timeline-bars .bar.band-warn { background: var(--bar-warn); }
.probes .timeline-bars .bar.band-bad { background: var(--bar-bad); }
.probes .timeline-bars .bar.band-nodata { background: var(--bar-none); }

.probes .timeline-bars .bar.idle { opacity: 0.55; }

.probes .timeline-bars:hover .bar { opacity: 0.45; }
.probes .timeline-bars .bar:hover { opacity: 1; }
.probes .timeline-bars .bar:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.probes .recent-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

/* per-model rows */

.probes .probe-models {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.probes .probe-model {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12.5px;
  min-width: 0;
}

.probes .probe-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.probes .probe-dot[data-s="good"] { background: var(--bar-good); }
.probes .probe-dot[data-s="warn"] { background: var(--bar-warn); }
.probes .probe-dot[data-s="bad"] { background: var(--bar-bad); }
.probes .probe-dot[data-s="nodata"] { background: var(--bar-none); }

.probes .probe-model-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.probes .probe-model-lat {
  flex: none;
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.probes .probe-model-fails {
  flex: none;
  font-size: 11px;
  color: var(--warn);
  white-space: nowrap;
}

.probes .probe-model-msg {
  margin: 0 0 6px 15px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .probes .card-grid { grid-template-columns: 1fr; }
  .probes .card { padding: 16px 14px 14px; }
  .probes .card-head { grid-template-columns: auto minmax(0, 1fr); }
  .probes .card-head > .status-tag { grid-column: 2; justify-self: start; }
  .probes .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .probes .tile { padding: 10px; }
  .probes .tile-time strong { font-size: 17px; }
  .probes .uptime-row strong { font-size: 26px; }
}

/* ---------- top-level tabs ----------
 * Two views share one page: live probe results and the traffic-based
 * availability monitor. Tabs keep either one a click away instead of stacking
 * them into a page that needs a long scroll. */

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  width: max-content;
  max-width: 100%;
}

.tabs button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.tabs button:hover {
  color: var(--ink-2);
}

.tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.tabs button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.tab-meta {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tabs button[aria-selected="true"] .tab-meta {
  background: var(--surface-3);
}

/* An unread problem in the other tab shows on its badge, so switching away
   does not hide an outage. */
.tabs button[data-attention="yes"] .tab-meta {
  background: var(--bad-soft);
  color: var(--bad);
}

/* Panes: only the selected one is displayed. */
.probes[hidden],
.pane[hidden] {
  display: none !important;
}

@media (max-width: 560px) {
  .tabs { width: 100%; }
  .tabs button { flex: 1 1 0; justify-content: center; padding: 9px 8px; }
  .tabs button { flex-wrap: wrap; row-gap: 3px; }
}
